[Bug fortran/83235] IAND sometimes doesn't take bitwise-and of sign bit with -O2

paul.k.romano at gmail dot com gcc-bugzilla@gcc.gnu.org
Fri Dec 1 12:40:00 GMT 2017


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

--- Comment #3 from Paul Romano <paul.k.romano at gmail dot com> ---
Thank you both for your quick responses. I understand that the bit model for
negative numbers is undefined and that x*x overflows and is thus also
undefined. However, the second argument to IAND is well-defined: it's a bit
mask with only the most significant bit zeroed. I would have thought that this
would guarantee that the resulting number would have its most significant bit
zeroed, regardless of whatever was passed as the first argument to IAND. Is
there really no way to guarantee that?


More information about the Gcc-bugs mailing list