public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/31982]  New: Missed forw prop with indirect ref and addr. (and char types or sizeof(type) == 1)
@ 2007-05-17 23:28 pinskia at gcc dot gnu dot org
  2007-05-24 10:11 ` [Bug tree-optimization/31982] " rguenth at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-05-17 23:28 UTC (permalink / raw)
  To: gcc-bugs

This testcase should pass:
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-forwprop" }  */

/* We should be able to optimize this to b->t[i] = 1 during
   early optimizations.  */

struct a
{
  char t[10];
};

struct a *b;

void f(__SIZE_TYPE__ i)
{
  int *c = b->t;
  c[i] = 1;
}

/* { dg-final { scan-tree-dump "t\\\[i.*\\\] = 1;" "forwprop1" { xfail *-*-* }
} } */
/* { dg-final { scan-tree-dump "t\\\[i.*\\\] = 1;" "forwprop2" } } */
/* { dg-final { cleanup-tree-dump "forwprop?" } } */


---------

I found this while fixing up forwprop for the pointer plus branch.
forwprop is looking for a MULT_EXPR which does not exist in this case.


-- 
           Summary: Missed forw prop with indirect ref and addr. (and char
                    types or sizeof(type) == 1)
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: enhancement
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pinskia at gcc dot gnu dot org


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


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

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

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-17 23:28 [Bug tree-optimization/31982] New: Missed forw prop with indirect ref and addr. (and char types or sizeof(type) == 1) pinskia at gcc dot gnu dot org
2007-05-24 10:11 ` [Bug tree-optimization/31982] " rguenth at gcc dot gnu dot org
2007-05-24 10:22 ` rguenth at gcc dot gnu dot org
2007-05-25  9:08 ` rguenth at gcc dot gnu dot org
2007-05-25  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).