On Sat, Sep 3, 2011 at 5:31 PM, Michael Matz <m...@suse.de> wrote:
> Hi,
>
> On Sat, 3 Sep 2011, Richard Guenther wrote:
>
>> >> As I feared the call to get_var_ann in set_is_used right now really
>> >> is still needed, privatizing it hence isn't that straight forward.
>> >
>> > After pondering I concluded that it's not necessary to call
>> > set_is_used for variables without var annotation.  Those won't be in
>> > referenced_vars (or local_decls) and therefore also won't be removed
>> > from those lists no matter how hard we try.
>> >
>> > Regstrapped on x86_64-linux (without Ada).  Okay for trunk?
>>
>> No.  We call mark_all_vars_used on trees contained in GIMPLE non-debug
>> statements.  All vars we can reach that way _have_ to be in the list of
>> referenced vars.
>
> Sometimes global variables (non-auto vars with context != cfun) can be
> missing from referenced_vars.  In the case where we hit bugs with this
> it's the non-local variables generated for profile counters.  I can add
> the respective add_referenced_var calls for that, but I'm not sure I see
> the point.  That of course comes back to our old discussion for what
> purposes referenced_vars actually is used.  I looked at all users and I
> think that the global counters missing from referenced_vars is harmless.
>
> OTOH it's a nice invariant that can actually be checked for (that all
> reachable vars whatsoever have to be in referenced_vars), so I'm going to
> do that.

Yes, until we get rid of referenced_vars (which we still should do at
some point...)
that's the best.  IIRC we have some verification code even, and wonder why it
doesn't trigger.

Richard.

>> That they are not is the bug. So - can you investigate
>> which var doesn't have an annotation an why it isn't in referenced vars?
>
>
> Ciao,
> Michael.

Reply via email to