GCC for xscale big-endian gives error: register specified for '__r1' isn't suitable for data type

Khem Raj kraj@mvista.com
Tue Mar 1 19:37:00 GMT 2005


I am using gcc 3.4.3 branch

Khem Raj wrote:

> 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



More information about the Gcc-help mailing list