[Bug middle-end/95903] gcc 10: wrong code with -fwrapv

markus at oberhumer dot com gcc-bugzilla@gcc.gnu.org
Fri Jun 26 10:38:58 GMT 2020


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

--- Comment #6 from Markus F.X.J. Oberhumer <markus at oberhumer dot com> ---
Thanks for the quick fix!

And no need to be grumpy, I'm just trying to nail down those pesky edge
cases...

As for ILP32, here is another suspicious test case, now only using just a
little bit more than 2 GiB of memory: https://gcc.godbolt.org/z/mRf2kd

// arm64-linux-gcc -mabi=ilp32 -O2 -fwrapv -fwrapv-pointer

char get_byte(const char* ptr, int off)
{
    off += 2147483647;
    return ptr[off];
}


More information about the Gcc-bugs mailing list