Global register variable definition is removed as dead code

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

 



Hi,
Consider the following test case:
// gcc-4.6.1// option: -O1
register void  *ptr asm("rbx") ;
void testfn1(void* func){  ptr = func;  // removed as dead code  goto *ptr;}
When compiling with O1 option, 'ptr = func' definition is removed as dead code. But ref[1] says it should not be deleted even if it appears to be dead.
In dead code elimination (gcc/dce.c), the register definition is not checked for "global register variable".
Is gcc's behaviour is correct?
ref1: http://gcc.gnu.org/onlinedocs/gcc/Global-Reg-Vars.html
Thanks,Pitchumani.S

 		 	   		  



[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