[tree-ssa] live analysis on local static functions
law@redhat.com
law@redhat.com
Tue Oct 14 17:40:00 GMT 2003
In message <20031014164618.GB11582@atrey.karlin.mff.cuni.cz>, Jan Hubicka write
s:
>> On Tue, 2003-10-14 at 12:10, Jan Hubicka wrote:
>>
>> > ;; Function q (q)
>> >
>> > q ()
>> > {
>> > char * <Ub244>;
>> >
>> > {
>> > <Ub244> = a;
>> > <Ub1d0>:;;
>> > };
>> > return <Ub244>;;
>> > }
>> >
>> > 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
>> >
>> The assignment seems to be killed by DCE, so it should not be related to
>> the used flag. We may be missing the use-def link between the use of
>> 'a' and its initialization. Could you add it as a test case and open a
>
>Should be there a link when the initialization happens outside the
>function?
>> bugzilla report?
>>
>> There should be a VDEF of 'a' in that initialization. What does
>> -fdump-tree-all-vops show?
>
>No VDEFs are emit for static initailizers.
>There is VUSE <a_1> but as I've explained earlier it points to SSA_NAME
>so we don't set tree-used flag on the original.
The set_is_used function does know how to dive inside the SSA_NAME to get
to the VAR_DECL. This can't be the reason for the failure.
void
set_is_used (tree t)
{
t = get_base_symbol (t);
var_ann (t)->used = 1;
}
Where get_base_symbol has the following:
do
{
...
switch (TREE_CODE (t))
{
case SSA_NAME:
t = SSA_NAME_VAR (t);
break;
...
} while ....
Jeff
More information about the Gcc
mailing list