public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/19807] New: fold does not fold &a[4]-1
@ 2005-02-07 23:13 rguenth at gcc dot gnu dot org
  2005-02-07 23:15 ` [Bug middle-end/19807] " rguenth at gcc dot gnu dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2005-02-07 23:13 UTC (permalink / raw)
  To: gcc-bugs

PR19639 is pessimized by (?)

extern void link_error(void);
int main(void)
{
  int a[4];
  if (&a[2]-1 != &a[1])
    link_error();
  return 0;
}

where for C++ (!!) we do not fold the addition of ADDR_EXPR (ARRAY_REF (..))
 and INTEGER_CST into the ARRAY_REF offset.  For C the frontend avoids
passing ARRAY_REFs to fold.

-- 
           Summary: fold does not fold &a[4]-1
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: enhancement
          Priority: P2
         Component: middle-end
        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
OtherBugsDependingO 19639
             nThis:


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


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

end of thread, other threads:[~2005-05-11  9:08 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-07 23:13 [Bug middle-end/19807] New: fold does not fold &a[4]-1 rguenth at gcc dot gnu dot org
2005-02-07 23:15 ` [Bug middle-end/19807] " rguenth at gcc dot gnu dot org
2005-02-07 23:16 ` rguenth at gcc dot gnu dot org
2005-02-08  2:34 ` pinskia at gcc dot gnu dot org
2005-02-09 17:40 ` rguenth at gcc dot gnu dot org
2005-04-23 21:37 ` rguenth at gcc dot gnu dot org
2005-04-25 14:49 ` pinskia at gcc dot gnu dot org
2005-05-11  8:15 ` cvs-commit at gcc dot gnu dot org
2005-05-11  9:07 ` rguenth at gcc dot gnu dot org
2005-05-11  9:08 ` 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).