public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
[parent not found: <bug-21664-4@http.gcc.gnu.org/bugzilla/>]
* [Bug c/21664] New: array-of-empty-structure extension not properly defined
@ 2005-05-19 14:02 rguenth at gcc dot gnu dot org
  2005-05-19 19:55 ` [Bug c/21664] " gdr at integrable-solutions dot net
  2005-05-19 20:20 ` rguenth at gcc dot gnu dot org
  0 siblings, 2 replies; 5+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2005-05-19 14:02 UTC (permalink / raw)
  To: gcc-bugs

For

struct {} a[4]; int main() { return &a[2] - &a[1]; }

the C frontend emits

  return 0 /[ex] 0;

which will, at -O0 fault at runtime, at -O not due to RTL CSE.

Is this even well-defined?  Should the C-frontend rather emit

 return 0;

?  Of course this contradicts the C standard, but that does not
allow empty structures anyway.

-- 
           Summary: array-of-empty-structure extension not properly defined
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rguenth at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org


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


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

end of thread, other threads:[~2014-04-18 20:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-21664-10053@http.gcc.gnu.org/bugzilla/>
2005-10-25 19:47 ` [Bug c/21664] array-of-empty-structure extension not properly defined pinskia at gcc dot gnu dot org
     [not found] <bug-21664-4@http.gcc.gnu.org/bugzilla/>
2014-03-20  7:27 ` mpolacek at gcc dot gnu.org
2014-04-18 20:57 ` mpolacek at gcc dot gnu.org
2005-05-19 14:02 [Bug c/21664] New: " rguenth at gcc dot gnu dot org
2005-05-19 19:55 ` [Bug c/21664] " gdr at integrable-solutions dot net
2005-05-19 20:20 ` rguenth at gcc dot gnu dot 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).