RFR: 8324833: Signed integer overflows in ABS [v2]
Andrew Haley
aph at openjdk.org
Sat Feb 3 18:43:01 UTC 2024
On Fri, 2 Feb 2024 21:25:08 GMT, Dean Long <dlong at openjdk.org> wrote:
> > Yes, I think we care. I would try a build with `Wsigned-conversion` and look where we should sprinkle more `checked_cast`-s.
>
> Let me try your latest with -Wsigned-conversion turned on. If I remember correctly, checked_cast doesn't always work right when the "signed-ness" changes (signed --> unsigned or unsigned --> signed).
It should work. The checked_cast from signed --> unsigned can never overflow and is always well-defined, but the overflow behaviour in the other direction is implementation defined. Having said that, it's defined the same way on every compiler we use AFAIK
-------------
PR Comment: https://git.openjdk.org/jdk/pull/17617#issuecomment-1925425205
More information about the graal-dev
mailing list