[Bug inline-asm/85185] Wider-than-expected load for struct member used as operand of inline-asm with memory clobber at -Og

zev+gccbug at bewilderbeest dot net gcc-bugzilla@gcc.gnu.org
Wed Apr 4 04:01:00 GMT 2018


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85185

--- Comment #2 from Zev Weiss <zev+gccbug at bewilderbeest dot net> ---
I was wondering if I might be unwittingly violating some subtle rule like that;
are the details of this documented?  I don't see anything  obvious in section
6.45.2.5 ("Input Operands") of the GCC manual, but perhaps I'm missing
something or not looking in the right place.

Also, would the undefinedness you describe extend to the remaining 32 bits
above that as well?  (I'm a bit unclear on why/how 32-bit values would enter
the picture if the underlying variable is 16 bits and the hardware register is
64 -- is integer promotion applied to inline asm operands? If so, the selection
of %ax on x86-64 seems odd.)


More information about the Gcc-bugs mailing list