https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108941
--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> --- (In reply to jbeulich from comment #4) > > In the assembly, if you have a spot which accepts 8-bit quantity, one > > shouldn't care if it is signed or unsigned. > > I firmly disagree: I assume you did look at the description of the gas > change. A negative value for SHL may (by some) be viewed as reasonable (and > as said in the submission, I could have been convinced to further relax > things, provided fair arguments), but a negative value for RCL firmly is > rubbish and hence should have been rejected years ago. GCC doesn't even have that information at all, at the RTL level it doesn't know if it was signed or unsigned. All it has is the constraint and operand for it, like (reg:QI 126) or (const_int -1). As I said earlier, constants are always sign-extended from their mode. One could e.g. have during expansion (set (reg:QI 126) (const_int -1)) and later on asm_operands with "ic" and (reg:QI 126). Same assignment for int8_t x = -1 or int8_t x = 255 or uint8_t x = -1 or uint8_t x = 255, at GIMPLE one can differentiate that based on types, at RTL one has just mode. So there really is nothing that can be changed on the GCC side even if we wanted to (and IMHO we don't, we want to preserve existing behavior).