From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2107 invoked by alias); 17 Jul 2012 07:32:52 -0000 Received: (qmail 2092 invoked by uid 22791); 17 Jul 2012 07:32:49 -0000 X-SWARE-Spam-Status: No, hits=-3.1 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_AV,TW_BJ,TW_CL,TW_CX,TW_DC,TW_FS,TW_GX,TW_LZ,TW_OV,TW_TB,TW_ZC X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 17 Jul 2012 07:32:37 +0000 From: "hakan at debian dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/53991] New: _mm_popcnt_u64 fails with -O3 -fgnu-tm Date: Tue, 17 Jul 2012 07:32:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: hakan at debian dot org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-07/txt/msg01280.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D53991 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=3D27807 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 int main(void) { int res =3D _mm_popcnt_u64(0); printf("Result res should be 0: %d\n", res); } With this command line and output: $ gcc -v -save-temps -march=3Dnative -O3 -fgnu-tm popcnt.c=20 Using built-in specs. COLLECT_GCC=3Dgcc COLLECT_LTO_WRAPPER=3D/usr/lib/gcc/x86_64-linux-gnu/4.7/lto-wrapper Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion=3D'Debian 4.7.1-2' --with-bugurl=3Dfile:///usr/share/doc/gcc-4.7/README.Bugs --enable-languages=3Dc,c++,go,fortran,objc,obj-c++ --prefix=3D/usr --program-suffix=3D-4.7 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=3D/usr/lib --without-included-gettext --enable-threads=3Dposix --with-gxx-include-dir=3D/usr/include/c++/4.7 --libdir=3D/usr/lib --enable-nls --with-sysroot=3D/ --enable-clocale=3Dgnu --enable-libstdcxx-debug --enable-libstdcxx-time=3Dyes --enable-gnu-unique-= object --enable-plugin --enable-objc-gc --with-arch-32=3Di586 --with-tune=3Dgeneric --enable-checking=3Drelease --build=3Dx86_64-linux-gnu --host=3Dx86_64-linu= x-gnu --target=3Dx86_64-linux-gnu Thread model: posix gcc version 4.7.1 (Debian 4.7.1-2)=20 COLLECT_GCC_OPTIONS=3D'-v' '-save-temps' '-march=3Dnative' '-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=3Dcorei7 -mcx16 -msahf -mno-m= ovbe -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=3D32 --param l1-cache-line-size=3D64 --param l2-cache-size=3D8192 -mtune=3Dcorei7 -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=3D'-v' '-save-temps' '-march=3Dnative' '-O3' '-fgnu-tm' '-pthread' /usr/lib/gcc/x86_64-linux-gnu/4.7/cc1 -fpreprocessed popcnt.i -march=3Dcor= ei7 -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=3D32 --param l1-cache-line-size=3D64 --param l2-cache-size=3D= 8192 -mtune=3Dcorei7 -quiet -dumpbase popcnt.c -auxbase popcnt -O3 -version -fgn= u-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=3D100 --param ggc-min-heapsize=3D131= 072 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=3D100 --param ggc-min-heapsize=3D131= 072 Compiler executable checksum: 9e08a85d4bf68460be9df04a431a25b0 popcnt.c: In function =E2=80=98main=E2=80=99: popcnt.c:5:5: warning: incompatible implicit declaration of built-in functi= on =E2=80=98printf=E2=80=99 [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: inlin= ing failed in call to always_inline =E2=80=98_mm_popcnt_u64=E2=80=99:=20 popcnt.c:4:29: error: called from here