public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/98829] New: Different results with -O3 and custom quiet NaN
@ 2021-01-25 22:32 gnu at nemanjaboric dot com
  2021-01-25 22:55 ` [Bug middle-end/98829] " pinskia at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: gnu at nemanjaboric dot com @ 2021-01-25 22:32 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98829

            Bug ID: 98829
           Summary: Different results with -O3 and custom quiet NaN
           Product: gcc
           Version: 10.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gnu at nemanjaboric dot com
  Target Milestone: ---

Created attachment 50047
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50047&action=edit
Example of the code giving different results

Hi, see the attached code which generates the different code with -O3 (compiled
with various GCC version). Two workarounds are commented in the code: to use
`std::isnan` and to copy the source object.

I couldn't find anything undefined that I'm doing here but I might be wrong.

-ffast-math _is not_ used. Just -O3 yields different result:
https://www.godbolt.org/z/nxPd8W

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

end of thread, other threads:[~2022-01-26 14:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-25 22:32 [Bug c++/98829] New: Different results with -O3 and custom quiet NaN gnu at nemanjaboric dot com
2021-01-25 22:55 ` [Bug middle-end/98829] " pinskia at gcc dot gnu.org
2021-01-25 22:59 ` gnu at nemanjaboric dot com
2021-01-25 23:18 ` gnu at nemanjaboric dot com
2021-01-26  8:20 ` rguenth at gcc dot gnu.org
2021-01-26 11:02 ` gnu at nemanjaboric dot com
2021-01-27 16:42 ` jakub at gcc dot gnu.org
2022-01-26 14:59 ` nemanjab at amazon 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).