aboutsummaryrefslogtreecommitdiff
path: root/4.5.0
diff options
context:
space:
mode:
authorRyan Hill <rhill@gentoo.org>2010-06-20 06:25:20 +0000
committerRyan Hill <rhill@gentoo.org>2010-06-20 06:25:20 +0000
commitfdc2c66cd825515029904dc34df670825c252a4c (patch)
tree1e57ba9370168b7992b3e12a09fdd24a54bc6c2c /4.5.0
parentinitial 4.4.4 patchset based on last 4.4.3 patchset (diff)
downloadgcc-patches-fdc2c66cd825515029904dc34df670825c252a4c.tar.gz
gcc-patches-fdc2c66cd825515029904dc34df670825c252a4c.tar.bz2
gcc-patches-fdc2c66cd825515029904dc34df670825c252a4c.zip
Add upstream patch for bug #317513 (-march=native misdetects Core i? as atom).
Diffstat (limited to '4.5.0')
-rw-r--r--4.5.0/gentoo/30_all_gcc45-pr44046-core2-native.patch107
-rw-r--r--4.5.0/gentoo/README.history1
2 files changed, 108 insertions, 0 deletions
diff --git a/4.5.0/gentoo/30_all_gcc45-pr44046-core2-native.patch b/4.5.0/gentoo/30_all_gcc45-pr44046-core2-native.patch
new file mode 100644
index 0000000..a54ca56
--- /dev/null
+++ b/4.5.0/gentoo/30_all_gcc45-pr44046-core2-native.patch
@@ -0,0 +1,107 @@
+Core processors are misdetected as Atom by -march=native.
+
+http://bugs.gentoo.org/317513
+http://gcc.gnu.org/PR44046
+http://gcc.gnu.org/ml/gcc-patches/2010-05/msg00606.html
+
+Fixed upstream for 4.5.1.
+
+2010-05-09 H.J. Lu <hongjiu.lu@intel.com>
+
+ Backport from mainline
+ 2010-05-09 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR target/44046
+ * config/i386/driver-i386.c (host_detect_local_cpu): Properly
+ detect Atom, Core 2 and Core i7.
+
+
+--- a/gcc/config/i386/driver-i386.c
++++ b/gcc/config/i386/driver-i386.c
+@@ -538,34 +538,61 @@ const char *host_detect_local_cpu (int argc, const char **argv)
+ cpu = "pentium";
+ break;
+ case PROCESSOR_PENTIUMPRO:
+- if (model == 28)
+- cpu = "atom";
+- else if (model >= 28 && l2sizekb < 2048)
+- /* Assume it's a small core if there's less than 2MB cache */
+- cpu = "atom";
+- else if (has_longmode)
+- cpu = "core2";
+- else if (arch)
++ switch (model)
+ {
+- if (has_sse3)
+- /* It is Core Duo. */
+- cpu = "pentium-m";
+- else if (has_sse2)
+- /* It is Pentium M. */
+- cpu = "pentium-m";
+- else if (has_sse)
+- /* It is Pentium III. */
+- cpu = "pentium3";
+- else if (has_mmx)
+- /* It is Pentium II. */
+- cpu = "pentium2";
++ case 0x1c:
++ case 0x26:
++ /* Atom. */
++ cpu = "atom";
++ break;
++ case 0x1a:
++ case 0x1e:
++ case 0x1f:
++ case 0x2e:
++ /* FIXME: Optimize for Nehalem. */
++ cpu = "core2";
++ break;
++ case 0x25:
++ case 0x2f:
++ /* FIXME: Optimize for Westmere. */
++ cpu = "core2";
++ break;
++ case 0x17:
++ case 0x1d:
++ /* Penryn. FIXME: -mtune=core2 is slower than -mtune=generic */
++ cpu = "core2";
++ break;
++ case 0x0f:
++ /* Merom. FIXME: -mtune=core2 is slower than -mtune=generic */
++ cpu = "core2";
++ break;
++ default:
++ if (arch)
++ {
++ if (has_ssse3)
++ /* If it is an unknown CPU with SSSE3, assume Core 2. */
++ cpu = "core2";
++ else if (has_sse3)
++ /* It is Core Duo. */
++ cpu = "pentium-m";
++ else if (has_sse2)
++ /* It is Pentium M. */
++ cpu = "pentium-m";
++ else if (has_sse)
++ /* It is Pentium III. */
++ cpu = "pentium3";
++ else if (has_mmx)
++ /* It is Pentium II. */
++ cpu = "pentium2";
++ else
++ /* Default to Pentium Pro. */
++ cpu = "pentiumpro";
++ }
+ else
+- /* Default to Pentium Pro. */
+- cpu = "pentiumpro";
++ /* For -mtune, we default to -mtune=generic. */
++ cpu = "generic";
++ break;
+ }
+- else
+- /* For -mtune, we default to -mtune=generic. */
+- cpu = "generic";
+ break;
+ case PROCESSOR_PENTIUM4:
+ if (has_sse3)
diff --git a/4.5.0/gentoo/README.history b/4.5.0/gentoo/README.history
index 6d7ecae..12d8e7a 100644
--- a/4.5.0/gentoo/README.history
+++ b/4.5.0/gentoo/README.history
@@ -1,3 +1,4 @@
+ + 30_all_gcc45-pr44046-core2-native.patch
1.1 17.05.2010
+ 02_all_gcc45-pr42347.patch