https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83244
--- Comment #2 from Andrzej Lichnerowicz <unjello at gmail dot com> --- The resolution doesn't seem appropriate. GCC is creating invalid assembly, and user should not be held responsible for writing correct code, because why have any warnings and errors at all. OTOH, it is my mistake, sort of, because GCC when emitting code, not assembly (without -S option), actually warns about it: $ g++-7 gcc_imm8_bug.cpp -o gcc_imm8_bug. gcc_imm8_bug.cpp: Assembler messages: gcc_imm8_bug.cpp:12: Error: operand type mismatch for `int' only with -S option, it is silent. again, Clang warns in both cases.