This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/23444] Volatile register access incorrectly optimized
- From: "oakad at yahoo dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Aug 2005 16:31:37 -0000
- Subject: [Bug rtl-optimization/23444] Volatile register access incorrectly optimized
- References: <20050817154313.23444.oakad@yahoo.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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