Related to PR38207, SCCVN doesn't CSE the load of c->a in
/* { dg-do compile } */
/* { dg-options "-O -fdump-tree-fre" } */
struct a
{
union
{
int a;
int b;
};
union
{
int c;
int d;
};
int e;
};
int f(struct a *c)
{
int d;
c->e = 2;
d = c->a;
c->c = 1;
return c->a + d;
}
/* We should have CSEd the load from c->a. */
/* { dg-final { scan-tree-dump-times "c_.*\\\.a" 1 "fre" } } */
/* { dg-final { cleanup-tree-dump "fre" } } */
which is because it doesn't do expression hashtable lookups for intermediate
VUSEs it walks. Without proper caching this will probably be too expensive.
--
Summary: SCCVN doesn't do expression lookups during stmt walks
Product: gcc
Version: 4.4.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: enhancement
Priority: P3
Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: rguenth at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38230