dead code elimination in cp front end

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

 



Hello,

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 ??

int a,b;
int y,output;

class FSM
{
public : void op ()
{
 if (y==1)
    output=b;
else 
    output=a;
}
};    
    
int main()
{
  
FSM f;
a=50;
b=10;
y=1;
f.op();
return output;
}

thanks

Asma






[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