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

--- Comment #6 from jbeulich at suse dot com ---
(In reply to Jakub Jelinek from comment #5)
> 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.

While for int8_t x = -1 or int8_t x = 255 I can see that the result is as
described, for uint8_t x = -1 or uint8_t x = 255 (or, as in the example, a
constant the was cast to an unsigned 8-bit type) why is it not (const int 255)?

Reply via email to