Comment 6 for bug 803865

Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

Apparently GCC is unable to spill EBX around the assembly in case of PIC. Fixed code is

    int32 val_for_ebx= set & 0xFFFFFFFF; \
    int32 val_for_ecx= set >> 32; \
    int32 saved_ebx; \
    asm ("movl %%ebx, %3;" \
         "movl %4, %%ebx;" \
         LOCK_prefix "; cmpxchg8b %0;" \
         "setz %1;" \
         "movl %%edi, %%ebx" \
         : "+m" (*a), "=g" (ret), "+A" (*cmp), "=g" (saved_ebx) \
         : "g" (val_for_ebx), "c" (val_for_ecx) \
         : "flags")

Also relevant is http://lists.mysql.com/commits/113160