https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85344
--- Comment #25 from Segher Boessenkool <segher at gcc dot gnu.org> --- The number is an integer constant. 32768 is 32768, not -32768. The value got that way (potentially, but not in this case even) because it was cast to un unsigned short. All of that is done way before RTL expand of course. Yes, the C standard does not require the usual promotions here, simply because GCC inline asm is a GCC extension, not standard C. Everything anywhere near similar does get the usual promotions, of course. Any (non-explicit) cast that changes value is so against the spirit of C, it doesn't even matter if it's against the letter!