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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Sorry, in this case it isn't wrong (that is the passing of char/short case),
the __builtin_unreachable () says that negative values are undefined, therefore
the compiler can use both sign and zero extension interchangeably.
And the undefined signed overflow means when we have:
int i;
...
((unsigned long long) (i + 4)) * 4
we can compute it as
((unsigned long long) (i + 4)) * 4
or
((unsigned long long) i) * 4 + 16
because if i is in [INT_MAX - 3, INT_MAX] it is UB.

Reply via email to