[tree-ssa] variables being dragged out of their lexical scopes

Daniel Berlin dberlin@dberlin.org
Thu May 1 16:24:00 GMT 2003


>
>> I see two ways of handling this:
>>
>> 1- Never allow copy propagation in expressions of the form 'VAR = 
>> TEMP'
>>    (where 'VAR' is a program variable and 'TEMP' a compiler
>>    temporary).  This could work but I'm not sure if it would be a
>>    valid long term approach.
>
Why not just disallow it whenever TEMP's defining var (ie the var we 
are copying) is in a scope different than the current statement?

>
>>
>> 2- While building the flowgraph, emit a group-clobber instruction
>>    for all the variables that were declared inside a lexical
>>    scope.  The clobber instruction would be a new GIMPLE
>>    statement of the form CLOBBER_EXPR <var1, var2, ..., varN>.
>>    This would avoid any code movement that tries to take
>>    variables outside of their original scope (and it would also
>>    avoid having to generate all those temporaries in the
>>    gimplifier).
>
> Triple uggh.
> I *really* don't want code movement optimization to have to start 
> dealing with clobbers like that for regular variables.

I'll note that i'd *much* rather see extra temporaries (Isn't this what 
we used to do until the code to reuse temporaries went in recently? I 
swear we've discussed this problem before) than having CLOBBER.



More information about the Gcc mailing list