This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/53991] New: _mm_popcnt_u64 fails with -O3 -fgnu-tm
- From: "hakan at debian dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 17 Jul 2012 07:32:35 +0000
- Subject: [Bug c/53991] New: _mm_popcnt_u64 fails with -O3 -fgnu-tm
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53991
Bug #: 53991
Summary: _mm_popcnt_u64 fails with -O3 -fgnu-tm
Classification: Unclassified
Product: gcc
Version: 4.7.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: hakan@debian.org
Created attachment 27807
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27807
preprocessed file that triggers the bug
Hi,
a call to _mm_popcnt_u64 fails to compile if -O3 and -fgnu-tm is enabled. If
either is disabled it works fine. It can be triggered by:
#include <smmintrin.h>
int main(void) {
int res = _mm_popcnt_u64(0);
printf("Result res should be 0: %d\n", res);
}
With this command line and output:
$ gcc -v -save-temps -march=native -O3 -fgnu-tm popcnt.c
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.7/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.7.1-2'
--with-bugurl=file:///usr/share/doc/gcc-4.7/README.Bugs
--enable-languages=c,c++,go,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-4.7 --enable-shared --enable-linker-build-id
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.7
--libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object
--enable-plugin --enable-objc-gc --with-arch-32=i586 --with-tune=generic
--enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu
--target=x86_64-linux-gnu
Thread model: posix
gcc version 4.7.1 (Debian 4.7.1-2)
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-march=native' '-O3' '-fgnu-tm'
'-pthread'
/usr/lib/gcc/x86_64-linux-gnu/4.7/cc1 -E -quiet -v -imultiarch
x86_64-linux-gnu -D_REENTRANT popcnt.c -march=corei7 -mcx16 -msahf -mno-movbe
-mno-aes -mno-pclmul -mpopcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop
-mno-bmi -mno-bmi2 -mno-tbm -mno-avx -mno-avx2 -msse4.2 -msse4.1 -mno-lzcnt
-mno-rdrnd -mno-f16c -mno-fsgsbase --param l1-cache-size=32 --param
l1-cache-line-size=64 --param l2-cache-size=8192 -mtune=corei7 -fgnu-tm -O3
-fpch-preprocess -o popcnt.i
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring nonexistent directory
"/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../x86_64-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/lib/gcc/x86_64-linux-gnu/4.7/include
/usr/local/include
/usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed
/usr/include/x86_64-linux-gnu
/usr/include
End of search list.
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-march=native' '-O3' '-fgnu-tm'
'-pthread'
/usr/lib/gcc/x86_64-linux-gnu/4.7/cc1 -fpreprocessed popcnt.i -march=corei7
-mcx16 -msahf -mno-movbe -mno-aes -mno-pclmul -mpopcnt -mno-abm -mno-lwp
-mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mno-avx -mno-avx2
-msse4.2 -msse4.1 -mno-lzcnt -mno-rdrnd -mno-f16c -mno-fsgsbase --param
l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=8192
-mtune=corei7 -quiet -dumpbase popcnt.c -auxbase popcnt -O3 -version -fgnu-tm
-o popcnt.s
GNU C (Debian 4.7.1-2) version 4.7.1 (x86_64-linux-gnu)
compiled by GNU C version 4.7.1, GMP version 5.0.5, MPFR version 3.1.0-p10,
MPC version 0.9
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU C (Debian 4.7.1-2) version 4.7.1 (x86_64-linux-gnu)
compiled by GNU C version 4.7.1, GMP version 5.0.5, MPFR version 3.1.0-p10,
MPC version 0.9
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 9e08a85d4bf68460be9df04a431a25b0
popcnt.c: In function âmainâ:
popcnt.c:5:5: warning: incompatible implicit declaration of built-in function
âprintfâ [enabled by default]
In file included from
/usr/lib/gcc/x86_64-linux-gnu/4.7/include/smmintrin.h:796:0,
from popcnt.c:1:
/usr/lib/gcc/x86_64-linux-gnu/4.7/include/popcntintrin.h:40:1: error: inlining
failed in call to always_inline â_mm_popcnt_u64â:
popcnt.c:4:29: error: called from here