[tree-ssa] live analysis on local static functions

Andrew MacLeod amacleod@redhat.com
Tue Oct 14 17:33:00 GMT 2003


On Tue, 2003-10-14 at 12:52, Jan Hubicka wrote:
> > On Tue, 2003-10-14 at 12:10, Jan Hubicka wrote:
> > 
> > > so we miss the initializer.  I've tracked down the problem to fact that
> > > variable a does not have flag used set in it's annotation.  It has, when
> > > I disable the inlining.  It is marked in create_ssa_var_map by seeing
> > > VUSE attached to the return statement.  With inline enabled the set also
> > > has VUSE but it's operand is not VAR_DECL itself, but SSA_NAME
> > > 
> > 
> > 
> > I assume the useless stmt remover ought to check to see if there is a
> > static initializer in a BIND_EXPR before removing a DECL with an
> > initializer which is not marked used.    
> > 
> > Either that, or has_hidden_use() ought to be set on A.
> > 
> > Neither is true right now.
> > 
> > There are other choices too :-)
> 
> This is patch I use in my tree.  Would be OK to apply it?

Mine was a quick test to see if this was indeed the case. Neither allows
us to delete a static variable which is truly unused, which we'd like to
do I think. 

So it is incorrect in the language to initialize a at the top of the
program here?

ie, it spossible to execute code and return before we ever enter the
scope which initializes 'a'.  If so, promoting this to a functiojn level
static isn't going to help.

POssibly the best thing to do is when I see a VUSE or VDEF use of a
live-on-entry object, set the used flag on that core variable for the
object.

So when I see VUSE <a_1>, its got a default definition, so I would set
USED on 'a';

That possible makes more sense to me.

Andrew
 




More information about the Gcc mailing list