public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/109344] New: feraiseexcept produces incorrect code when optimizations are enabled
@ 2023-03-30  7:49 albin at yahoo dot com
  2023-03-30 10:17 ` [Bug c++/109344] " xry111 at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: albin at yahoo dot com @ 2023-03-30  7:49 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 109344
           Summary: feraiseexcept produces incorrect code when
                    optimizations are enabled
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: albin at yahoo dot com
  Target Milestone: ---

At -O1, calls to feraiseexcept are inlined. But the inlined code produces
incorrect results.

See here, only the first function behaves as expected:
https://godbolt.org/z/ncc3cjoKh

The behavior persists across many versions.

(A side note, I don't understand how the first function works, in order to
produce a divbyzero exception it appears to divide 0 / 1, not 1 / 0, am I
reading the assembly wrong?)

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

end of thread, other threads:[~2023-03-30 12:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-30  7:49 [Bug c++/109344] New: feraiseexcept produces incorrect code when optimizations are enabled albin at yahoo dot com
2023-03-30 10:17 ` [Bug c++/109344] " xry111 at gcc dot gnu.org
2023-03-30 11:09 ` jakub at gcc dot gnu.org
2023-03-30 11:21 ` xry111 at gcc dot gnu.org
2023-03-30 12:18 ` albin at yahoo dot com
2023-03-30 12:23 ` xry111 at gcc dot gnu.org

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