public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/53416] New: 4.7.0 Wrong code when optimising loop involving _rdrand32_step
@ 2012-05-19 17:15 marcel.kyas@fu-berlin.de
  2012-05-20 17:48 ` [Bug target/53416] " hjl.tools at gmail dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: marcel.kyas@fu-berlin.de @ 2012-05-19 17:15 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 53416
           Summary: 4.7.0 Wrong code when optimising loop involving
                    _rdrand32_step
    Classification: Unclassified
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: marcel.kyas@fu-berlin.de


Created attachment 27440
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27440
Reduced test case

The attached file prints different output depending whether it is compiled with
-O0, -O1 or -O2 on gcc-Version 4.7.0 20120507 (Red Hat 4.7.0-5) (GCC).

When the file is built with gcc -std=c99 -mrdrnd -O0 rngtest.i, it prints four
different random numbers. If it is built with gcc -std=c99 -mrdrnd -O1
rngtest.i, it prints the same number four times. If it is built with gcc
-std=c99 -mrdrnd -O2 rngtest.i, it prints the random number four times and
prints the random number as the result of the call to _rdrand32_step. The last
one is especially surprising, because _rdrand32_step should only return 0 or 1.


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

end of thread, other threads:[~2012-05-21 13:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-19 17:15 [Bug c/53416] New: 4.7.0 Wrong code when optimising loop involving _rdrand32_step marcel.kyas@fu-berlin.de
2012-05-20 17:48 ` [Bug target/53416] " hjl.tools at gmail dot com
2012-05-20 18:22 ` hjl.tools at gmail dot com
2012-05-21 12:41 ` hjl at gcc dot gnu.org
2012-05-21 13:07 ` hjl at gcc dot gnu.org
2012-05-21 13:09 ` hjl at gcc dot gnu.org
2012-05-21 13:10 ` hjl.tools 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).