[tree-ssa] live analysis on local static functions
Jan Hubicka
jh@suse.cz
Tue Oct 14 19:13: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.
I would say that it is work for unit-at-a-time code. I would like to
rework this on mainline in a way so initializers are simply expanded and
unit-at-a-time takes care of the removal. There is not good reason to
have these two different so far down in the path.
After that change the static funtions would never appear in BIND_EXPR at
gimple level making this easier too.
I am not quite sure what to do in non-unit-at-a-time, whether it is OK
to keep them expanded even when they are unused or wehther these must be
elliminated....
Honza
>
> 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