We have a user that is getting illegal instruction errors while building xulrunner. /var/tmp/portage/net-libs/xulrunner-1.9.2.3-r1/work/mozilla-1.9.2/dist/bin/xpidl -m typelib -w -I. -I../../dist/idl -e _xpidlgen/nsIConsoleListener.xpt -d .deps/nsIConsoleListener.pp nsIConsoleListener.idl make[4]: *** [_xpidlgen/nsIConsoleListener.xpt] Illegal instruction It turns out that using -march=native with his Core i5 processor results in -march=atom being used, specifically: gcc version 4.5.0 (Gentoo 4.5.0 p1.0) COLLECT_GCC_OPTIONS= '-v' '-o' 'test' /usr/libexec/gcc/x86_64-pc-linux-gnu/4.5.0/cc1 -quiet -v test.c -D_FORTIFY_SOURCE=2 -march=atom -mcx16 -msahf -maes -mpclmul -mpopcnt -msse4.2 --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=3072 -mtune=core2 -quiet -dumpbase test.c -auxbase test -version -o /tmp/ccmAagyo.s I believe the issue is that this processor doesn't support mmovbe, which -march=atom enables (the error doesn't occur w/ -march=atom -mno-movbe). Am I right in guessing that it should instead be using -march=core2 + a bunch of -m flags? I will attach his /proc/cpuinfo. Let me know what other info you need. http://bugs.gentoo.org/317513
Created attachment 20610 [details] /proc/cpuinfo
From config/driver-i386.c [...] 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"; And from cpuid: cpu family : 6 model : 37 cache size : 3072 KB driver detects --param l2-cache-size=3072 and -march=atom ... WTF ? Can you please step through the driver with debugger and determine _exact_ values of model and l2sizekb in the above source? It is around line 540 in gcc/config/i386/driver-i386.c.
A patch is posted at http://gcc.gnu.org/ml/gcc-patches/2010-05/msg00606.html
Subject: Bug 44046 Author: hjl Date: Sun May 9 14:49:53 2010 New Revision: 159202 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=159202 Log: Properly detect Atom, Core 2 and Core i7. 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. Modified: trunk/gcc/ChangeLog trunk/gcc/config/i386/driver-i386.c
Subject: Bug 44046 Author: hjl Date: Sun May 9 14:53:00 2010 New Revision: 159203 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=159203 Log: Properly detect Atom, Core 2 and Core i7. 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. Modified: branches/gcc-4_5-branch/gcc/ChangeLog branches/gcc-4_5-branch/gcc/config/i386/driver-i386.c
Created attachment 20614 [details] gcc45-PR44046-core2.patch
sorry, wrong bugzilla. ;)
Fixed. No need to change gcc 4.4.
Apparently some KVM versions claim to be GenuineIntel family 6 model 6 with lm, but not ssse3, see https://bugzilla.redhat.com/show_bug.cgi?id=620562 Perhaps the has_longmode -> core2 test should be restored...
(In reply to comment #9) > Apparently some KVM versions claim to be GenuineIntel family 6 model 6 with lm, > but not ssse3, see > https://bugzilla.redhat.com/show_bug.cgi?id=620562 > Perhaps the has_longmode -> core2 test should be restored... > There are no such processors from Intel. If you look at SSE3 and LM, it sounds like Nocona. But it also has family 6 and model 6. It looks like Pentium-M. If we pass -march=core2, it will generate SSSE3, which isn't supported. The bug is in KVM. It should never make up fake Intel processors.
Maybe we can improve the unknown processor support: 1. For 32bit, use i686 + -mSSEx. 2. For 64bit, use x86_64 + -mSSEx.
This patch produced regression, described (and more) in Bug 45359