[Bug c/124223] Cast (int32_t)0x80000000 causes the whole loop to be optimized away

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Feb 24 10:07:37 GMT 2026


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

--- Comment #8 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Why aren't you just doing arithmetic on the unsigned types?

        int32_t diff = values[i] - 0x80000000;


More information about the Gcc-bugs mailing list