public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/53991] New: _mm_popcnt_u64 fails with -O3 -fgnu-tm
@ 2012-07-17  7:32 hakan at debian dot org
  2013-05-16 17:18 ` [Bug tree-optimization/53991] " ubizjak at gmail dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: hakan at debian dot org @ 2012-07-17  7:32 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-08-01  9:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-17  7:32 [Bug c/53991] New: _mm_popcnt_u64 fails with -O3 -fgnu-tm hakan at debian dot org
2013-05-16 17:18 ` [Bug tree-optimization/53991] " ubizjak at gmail dot com
2013-05-20 12:33 ` hubicka at ucw dot cz
2013-05-20 13:05 ` jakub at gcc dot gnu.org
2013-05-21 14:08 ` torvald at gcc dot gnu.org
2014-08-01  9:46 ` andysem at mail dot ru

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).