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

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Actually I think only the warning for the three add case is wrong and here is
why:
adding two (unsigned) 8bit integers together will only give you a max a 9bit
integer.
so comparing b and (a+a) is fine

Adding three 8bit (unsigned) integers together will give a 10bit integer.

It just happens GCC can figure out the first case of adding two 8bit integers
will not change value for signed vs unsigned while adding the third add, for
the warning, gcc does not figure that out.

Reply via email to