Re: dead code elimination in cp front end

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 31/03/11 09:49, charfi asma wrote:
> I compiled this code with g++  -Os -fipa-cp -S
> I expected that in test.s "assign of a" will be removed since value of  "y" did 
> not change  and so "a" will not be used. Am I wrong ??

In general, this wouldn't be a good optimization.  "a" is globally
visible, so any code that runs when main() exits might inspect it.
There isn't any such code in this case, but, generally speaking,
assignments to global static memory have to be preserved.

Andrew.


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux