Message ID | 20100909121404.GA19675@kam.mff.cuni.cz |
---|---|
State | New |
Headers | show |
On Thu, 9 Sep 2010, Jan Hubicka wrote: > Hi, > the TREE_STATIC check in constructor folding disqualify quite many optimizations still and I don't > see any practical value in it. Doc says that the flag imply static storage being allocated for > constructor, but for folding readonly vars this is probalby irrelevant anyway. > > Bootstrapped/regtested x86_64-linux, OK? Ok. Thanks, Richard. > Honza > > * tree-ssa-ccp.c (fold_const_aggregate_ref): Do not require STATIC > flag on constructors. > Index: tree-ssa-ccp.c > =================================================================== > --- tree-ssa-ccp.c (revision 164002) > +++ tree-ssa-ccp.c (working copy) > @@ -1373,8 +1373,7 @@ fold_const_aggregate_ref (tree t) > > if (ctor == NULL_TREE > || (TREE_CODE (ctor) != CONSTRUCTOR > - && TREE_CODE (ctor) != STRING_CST) > - || !TREE_STATIC (ctor)) > + && TREE_CODE (ctor) != STRING_CST)) > return NULL_TREE; > > /* Get the index. If we have an SSA_NAME, try to resolve it > @@ -1459,8 +1459,7 @@ fold_const_aggregate_ref (tree t) > } > > if (ctor == NULL_TREE > - || TREE_CODE (ctor) != CONSTRUCTOR > - || !TREE_STATIC (ctor)) > + || TREE_CODE (ctor) != CONSTRUCTOR) > return NULL_TREE; > > field = TREE_OPERAND (t, 1); > @@ -1526,8 +1525,7 @@ fold_const_aggregate_ref (tree t) > > if (ctor == NULL_TREE > || (TREE_CODE (ctor) != CONSTRUCTOR > - && TREE_CODE (ctor) != STRING_CST) > - || !TREE_STATIC (ctor)) > + && TREE_CODE (ctor) != STRING_CST)) > return NULL_TREE; > > /* Get the byte offset. */ > >
Index: tree-ssa-ccp.c =================================================================== --- tree-ssa-ccp.c (revision 164002) +++ tree-ssa-ccp.c (working copy) @@ -1373,8 +1373,7 @@ fold_const_aggregate_ref (tree t) if (ctor == NULL_TREE || (TREE_CODE (ctor) != CONSTRUCTOR - && TREE_CODE (ctor) != STRING_CST) - || !TREE_STATIC (ctor)) + && TREE_CODE (ctor) != STRING_CST)) return NULL_TREE; /* Get the index. If we have an SSA_NAME, try to resolve it @@ -1459,8 +1459,7 @@ fold_const_aggregate_ref (tree t) } if (ctor == NULL_TREE - || TREE_CODE (ctor) != CONSTRUCTOR - || !TREE_STATIC (ctor)) + || TREE_CODE (ctor) != CONSTRUCTOR) return NULL_TREE; field = TREE_OPERAND (t, 1); @@ -1526,8 +1525,7 @@ fold_const_aggregate_ref (tree t) if (ctor == NULL_TREE || (TREE_CODE (ctor) != CONSTRUCTOR - && TREE_CODE (ctor) != STRING_CST) - || !TREE_STATIC (ctor)) + && TREE_CODE (ctor) != STRING_CST)) return NULL_TREE; /* Get the byte offset. */