Comment 2 for bug 1720993

Revision history for this message
Thomas Preud'homme (thomas-preudhomme) wrote :

You need to use the & constraint modifier on your output operand. Alternatively you could reorder the two instructions and keep the constraints as is, which would be the most efficient.

From the official GCC documentation [1]:

"Use the ‘&’ constraint modifier (see Modifiers) on all output operands that must not overlap an input. Otherwise, GCC may allocate the output operand in the same register as an unrelated input operand, on the assumption that the assembler code consumes its inputs before producing outputs. This assumption may be false if the assembler code actually consists of more than one instruction."

[1] https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html#OutputOperands

Best regards,

Thomas