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]

Re: [tree-ssa] Too conservative optimization with globalvariables??


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]