This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Bogus testcase?


for (i = ((unsigned) ~0 >> 1) - 3; i <= ((unsigned) ~0 >> 1) + 3; i++)

i <= ((unsigned)~0>>1) + 3

Seems like it overflows to me, or would cause "i" to have to
overflow to terminate the loop.

Yes, the two expression are respectively 0x7FFFFFFC and 0x80000002.


It ought to work with -fwrapv, though.

Paolo


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]