[tree-ssa] Too conservative optimization with global variables??
Diego Novillo
dnovillo@redhat.com
Mon Jun 16 12:34:00 GMT 2003
On Mon, 2003-06-16 at 06:59, Steven Bosscher wrote:
> extern int c;
>
> fubar()
> {
> int T.1;
> int a;
> int b;
>
> c = 3;
> c = c * 2;
> }
>
> Why can't this just be folded to "c = 6;"?
>
Because we do not rename global nor local static variables anymore.
This is to avoid problems in the SSA->normal pass. If two versions of
the same global were live at the same time, we would need to have
copy-in/copy-out operations at entry/exit points to update the original
object.
Adding copy-in/copy-out ops are somewhere in the todo list, but it's not
a priority yet. Inserting those operations blindly seems expensive.
Diego.
More information about the Gcc
mailing list