This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
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?
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.
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.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |