Menu

#112 Assembler error on arm at -O0 (fastlock.h)

closed-fixed
nobody
core (125)
5
2006-10-23
2006-10-18
No

OpenSER (1.1.0, but probably applies to all versions)
fails to build on arm at -O0, spitting out an assembler
error:

$ gcc -c -fPIC -g -O0 -g tree234.i
/tmp/cco6vA7j.s: Assembler messages:
/tmp/cco6vA7j.s:172: Error: Rn must not overlap other
operands -- `swpb r3,r2,[r3]'

The code at fault is the inline assembly in fastlock.h:

asm volatile(
"# here \n\t"
"swpb %0, %1, [%2] \n\t"
"=r" (val)
"r"(1), "r" (lock) : "memory"
);

See the Debian bug report:
<http://bugs.debian.org/393858>

And the GCC PR:
<http://gcc.gnu.org/PR29329>

The problem in the GCC PR is not caused by this
problem, it's a bug in the optimizer on arm, but this
issue came up while investigating this PR.

Thanks,

JB.

Discussion

  • Julien BLACHE

    Julien BLACHE - 2006-10-22

    Logged In: YES
    user_id=27488

    Hi,

    The attached one-liner fixes the problem.

    JB.

     
  • Julien BLACHE

    Julien BLACHE - 2006-10-22

    inline asm constraint fix for fastlock.h on arm

     
  • Bogdan-Andrei Iancu

    • status: open --> closed-fixed
     
  • Bogdan-Andrei Iancu

    Logged In: YES
    user_id=1275325

    Hi Julien,

    thanks for the patch - I applied on cvs for both head and
    1.1.0 (last stable) versions.

    regards,
    bogdan

     

Log in to post a comment.

MongoDB Logo MongoDB