public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/58928] New: Different results from gcc when -mlzcnt is used
@ 2013-10-30 20:05 mikeb01 at gmail dot com
  2013-12-10  7:06 ` [Bug target/58928] " gnome3fans at gmail dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: mikeb01 at gmail dot com @ 2013-10-30 20:05 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58928

            Bug ID: 58928
           Summary: Different results from gcc when -mlzcnt is used
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mikeb01 at gmail dot com

Created attachment 31113
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31113&action=edit
Preprossed test.c code

I have the following code:

#include <stdint.h>
#include <stdio.h>
#include <x86intrin.h>

long long lzcnt(long long l)
{
    return __lzcnt64(l);
}

int main(int argc, char** argv)
{
    printf("%lld\n", lzcnt(atoll(argv[1])));
    return 0;
}

If I compile and run with and without the -mlzcnt flag I get different results:

$ gcc src/test.c -D__LZCNT__ -mlzcnt && ./a.out 2047
10

$ gcc src/test.c -D__LZCNT__ && ./a.out 2047
53

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.2/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla
--enable-bootstrap --enable-shared --enable-threads=posix
--enable-checking=release --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-gnu-unique-object
--enable-linker-build-id --with-linker-hash-style=gnu
--enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin
--enable-initfini-array --enable-java-awt=gtk --disable-dssi
--with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre
--enable-libgcj-multifile --enable-java-maintainer-mode
--with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib
--with-isl=/builddir/build/BUILD/gcc-4.8.2-20131017/obj-x86_64-redhat-linux/isl-install
--with-cloog=/builddir/build/BUILD/gcc-4.8.2-20131017/obj-x86_64-redhat-linux/cloog-install
--with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.8.2 20131017 (Red Hat 4.8.2-1) (GCC) 

File test.i attached.  It was the same for both compilations, so only one file
attached.


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

end of thread, other threads:[~2014-01-20 23:48 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-30 20:05 [Bug c/58928] New: Different results from gcc when -mlzcnt is used mikeb01 at gmail dot com
2013-12-10  7:06 ` [Bug target/58928] " gnome3fans at gmail dot com
2014-01-17  1:18 ` mikeb01 at gmail dot com
2014-01-17 10:31 ` jtaylor.debian at googlemail dot com
2014-01-17 11:16 ` jakub at gcc dot gnu.org
2014-01-19  0:44 ` mikeb01 at gmail dot com
2014-01-20 23:48 ` mikeb01 at gmail dot com
2014-01-20 23:48 ` mikeb01 at gmail dot com

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).