Here’s the response from the compiler engineer that I ask to look at this:
The extended asm fails because we have one less general purpose register
to work with when we compile with -fpic on 32-bit. Compiling with -fpic
on 32-bit removes %ebx from the pool of general purpose registers
because it uses %ebx for the PIC register. The 64-bit compilers do not
have this issue because the ABI provides a dedicated PIC register. We
will investigate this further to see if we can improve the register
usage of this asm statement.
Also the programmer is using a hard coded %ebx in their asm statement.
All hard coded registers in an asm statement must be included in the asm
statement’s clobber list. Otherwise, the asm statement may clobber a
value in a hard coded register that the compiler is using for something
else. For example, note the addition of “%ebx” in the clobber list below
(the last part of the asm statement):
: “+a” (*eax), “=m” (*ebx), “=&r”(sav_ebx),
“+c” (*ecx), “=&d” (*edx) ::
As a work around, the programmer can either compile without -fpic on 32-bit, or possibly use fewer registers in their asm statement.
I add a problem report (TPR#19078) to see if improvements can be done or better error detection can be give. In any case, the compiler shouldn’t give an ICE.