http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52695
--- Comment #7 from Ryan Hill <dirtyepic at gentoo dot org> --- (In reply to Jakub Jelinek from comment #5) > No idea what "brokeness" the above talks about, it works just fine for me in > C++, so IMHO it just should always include x86intrin.h, but certainly if > __MMX__ is defined, but no __SSE__, the above won't include in C++ any > header which would define __m64. For 4.8 it just directly includes x86intrin.h. http://gcc.gnu.org/ml/gcc-patches/2012-11/msg00467.html [1] However after patching 4.7.3 [2] we're seeing a different error on some systems. ---8<--- In file included from /var/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build/./gcc/include/x86intrin.h:27:0, from /var/tmp/portage/sys-devel/gcc-4.7.3-r1/work/gcc-4.7.3/libitm/config/x86/target.h:72, from /var/tmp/portage/sys-devel/gcc-4.7.3-r1/work/gcc-4.7.3/libitm/libitm_i.h:82, from /var/tmp/portage/sys-devel/gcc-4.7.3-r1/work/gcc-4.7.3/libitm/aatree.cc:28: /var/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build/./gcc/include/ia32intrin.h: In function ‘int __bsrd(int)’: /var/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build/./gcc/include/ia32intrin.h:41:35: error: ‘__builtin_ia32_bsrsi’ was not declared in this scope /var/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build/./gcc/include/ia32intrin.h: In function ‘long long unsigned int __rdpmc(int)’: /var/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build/./gcc/include/ia32intrin.h:89:35: error: ‘__builtin_ia32_rdpmc’ was not declared in this scope /var/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build/./gcc/include/ia32intrin.h: In function ‘long long unsigned int __rdtsc()’: /var/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build/./gcc/include/ia32intrin.h:97:32: error: ‘__builtin_ia32_rdtsc’ was not declared in this scope --->8--- Both the reporters have AMD K8 processors. They only hit the bug when using -march=native; -march=k8 is successful. $ echo "" | gcc -march=native -v -E - 2>&1 | grep cc1 /usr/libexec/gcc/x86_64-pc-linux-gnu/4.6.3/cc1 -E -quiet -v - -march=k8 -mno-cx16 -mno-sahf -mno-movbe -mno-aes -mno-pclmul -mno-popcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-tbm -mno-avx -mno-sse4.2 -mno-sse4.1 --param l1-cache-size=64 --param l1-cache-line-size=64 --param l2-cache-size=512 -mtune=k8 So it seems there's still a piece missing. [1] http://gcc.gnu.org/viewcvs/gcc?view=revision&revision=193369 [2] http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.3/gentoo/49_all_x86_pr52695_libitm-m64.patch?revision=1.1&view=markup