[Bug tree-optimization/39736] signed overflow in loop induction variable: missing warning and wrong code
mikpe at it dot uu dot se
gcc-bugzilla@gcc.gnu.org
Sun Apr 12 09:11:00 GMT 2009
------- Comment #2 from mikpe at it dot uu dot se 2009-04-12 09:11 -------
(In reply to comment #1)
> There is no undefined behavior here (increment of a short value converts
> to int, increments then converts back to short, none of which are
> undefined), so at least the wrong code issue would be the same as bug
> 35634.
It's not undefined, but the conversion from int back to short provokes
implementation-defined behaviour when the int value doesn't fit in a short.
That makes this test program not strictly conforming.
The lack of a compile-time warning is unfortunate, but I don't think this is a
case of wrong-code.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39736
More information about the Gcc-bugs
mailing list