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

--- Comment #3 from Kostas Sotiropoulos <kosotiro at yahoo dot gr> ---
(In reply to Andrew Pinski from comment #2)
> THis is not a bug, In C, "i += MACRO;" is equivant to:
> i = i + MACRO.
> And since you are using a type smaller than int, it is prompted to int.
> 
> NOTE there might be another bug associated with this one.

1)In order to remove the warning we should only do the following: i = (unsigned
char)(i + MACRO)?

2)Why if we want to cast like this: i += (unsigned char)MACRO, i on the right
side of expression is not also casted to unsigned char (I mean the second i of
expanded expression i = i + MACRO?

3)What do you mean with your NOTE can you please elaborate a bit more?

4) If we expand and cast the expression we will probably have not so optimized
produced code by the compiler, should we?

Thank you,
Kostas

Reply via email to