public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/98555] New: Functions optimized to zero length break function pointer inequality
@ 2021-01-06  3:39 bugdal at aerifal dot cx
  2021-01-06  9:09 ` [Bug middle-end/98555] " rguenth at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: bugdal at aerifal dot cx @ 2021-01-06  3:39 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 98555
           Summary: Functions optimized to zero length break function
                    pointer inequality
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bugdal at aerifal dot cx
  Target Milestone: ---

Given a function such as

void foo() { __builtin_unreachable(); }

or optimized to such due to unconditional undefined behavior when the function
is reached, GCC emits a zero-length function. This causes the address of foo to
be equal to the address of whatever function happens to follow foo, breaking
the language requirement that distinct functions' addresses compare not-equal.

As far as I can tell, all versions back to 4.x or earlier are affected.

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

end of thread, other threads:[~2021-03-16 21:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-06  3:39 [Bug middle-end/98555] New: Functions optimized to zero length break function pointer inequality bugdal at aerifal dot cx
2021-01-06  9:09 ` [Bug middle-end/98555] " rguenth at gcc dot gnu.org
2021-01-06 14:38 ` [Bug rtl-optimization/98555] " rlcamp.pdx at gmail dot com
2021-01-06 18:52 ` bugdal at aerifal dot cx
2021-01-10  4:40 ` vanyacpp at gmail dot com
2021-03-16 21:05 ` bugdal at aerifal dot cx

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