This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
GCC for xscale big-endian gives error: register specified for '__r1'isn't suitable for data type
- From: Khem Raj <kraj at mvista dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Tue, 01 Mar 2005 11:35:05 -0800
- Subject: GCC for xscale big-endian gives error: register specified for '__r1'isn't suitable for data type
- Organization: MontaVista Software Inc.
- Reply-to: kraj at mvista dot com
Hi
When compiling the following example with gcc with xscale big endian I
am getting following error.
test.c: In function `foo':
test.c:6: error: register specified for '__r1' isn't suitable for data type
test.c:6: error: register name given for non-register variable '__r1'
typedef unsigned long long u64;
int foo(unsigned long arg)
{
u64 ullval = 0;
const register typeof(*((u64 *)arg)) __r1 asm("r1") = (ullval << 9);
return 0;
}
But the same example compiles fine with xscale little endian gcc.
However if I use r0 instead of r1 then the program compiles fine on both
big and little endian.
Why is error happening and what is the right way to code the above
Thanks for your help
-Khem