This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/31981] New: Missed forw prop with indirect ref and addr.
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 May 2007 22:49:06 -0000
- Subject: [Bug tree-optimization/31981] New: Missed forw prop with indirect ref and addr.
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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
{
int 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.
--
Summary: Missed forw prop with indirect ref and addr.
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: normal
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=31981