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

Siarhei Siamashka <siarhei.siamashka at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |siarhei.siamashka at gmail
                   |                            |dot com

--- Comment #7 from Siarhei Siamashka <siarhei.siamashka at gmail dot com> 
2010-10-11 19:18:46 UTC ---
Looks like this or similar "Variables in Specified Registers" bug is also
reproducible on ARM with gcc 4.5.1

$ cat test.c

int f(int a)
{
  register int result asm("r0");
  asm (
    "add    r0, %[a], #123\n"
    : [result] "=&r" (result)
    : [a]      "r"   (a)
  );
  return result;
}

$ gcc -O2 -c test.c
$ objdump -d test.o

00000000 <f>:
   0:   e280007b        add     r0, r0, #123    ; 0x7b
   4:   e1a00003        mov     r0, r3
   8:   e12fff1e        bx      lr

Here the local variable 'result' gets assigned to register r3 instead of r0
causing all kind of problems.

Reply via email to