This is the mail archive of the gcc-bugs@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]

[Bug rtl-optimization/23444] Volatile register access incorrectly optimized


------- Additional Comments From oakad at yahoo dot com  2005-08-17 16:31 -------
Sorry, I misunderstood you. The function is a part of a large project (namely,   
u-boot-1.1.3).   
What about this:   
//--------------   
char str1[]="123456789";   
char str2[10];   
   
int   
main()   
{   
   register volatile char* cptr asm ("r29");  
   cptr=str1;  
   asm volatile ("or 29,29,29"); //optimization barrier, supposedly  
   memcpy(str2,cptr,10);  
   return (int)cptr; //just for fun  
}    
//----------- 
Compile with -ffixed-r29. 
  
  

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23444


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