--- Comment #5 from edwintorok at gmail dot com 2009-04-13 06:56 ---
(In reply to comment #4)
(In reply to comment #3)
But converting from short to int for the argument to printf should behave
as if
a short value was converted to int, i.e. the int value should be in range
--- Comment #6 from schwab at linux-m68k dot org 2009-04-13 07:53 ---
(In reply to comment #4)
But your test program does cause signed overflow
No, it doesn't. There is a conversion (from int to short) where the value is
not representable by the target type, but that is _not_
--- Comment #7 from rguenth at gcc dot gnu dot org 2009-04-13 08:19 ---
*** This bug has been marked as a duplicate of 35634 ***
--
rguenth at gcc dot gnu dot org changed:
What|Removed |Added
--- 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
--- Comment #3 from edwintorok at gmail dot com 2009-04-12 09:32 ---
(In reply to comment #2)
(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
--- Comment #4 from mikpe at it dot uu dot se 2009-04-12 21:33 ---
(In reply to comment #3)
(In reply to comment #2)
(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
--- Comment #1 from joseph at codesourcery dot com 2009-04-11 12:51 ---
Subject: Re: New: signed overflow in loop
induction variable: missing warning and wrong code
On Sat, 11 Apr 2009, edwintorok at gmail dot com wrote:
Testcase:
#include stdio.h
int
main ()
{
int