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

Philipp <pkk at spth dot de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pkk at spth dot de

--- Comment #4 from Philipp <pkk at spth dot de> ---
I disagree about this bug for gcc.c-torture/execute/920711-1.c. I think there
was no bug here, and the "fix" actually introduced a problem, and should be
reverted:

I do not see signed integer overflow here:

f (0x80000000L)

Unless explicitly noted otherwise, all section numbers in the following refer
to the C2X standard draft N3047.

The 0x80000000L might be outside the range of long (i.e. on systems where long
has 32 bits). In that case, it will have type long long, as per the table in
section 6.4.4.1. Since the argument to f is of type long, it will get converted
to type long. That is not undefined, but implementation-defined according to
section 6.3.1.3.
By section 4.5 of the GCC manual
https://gcc.gnu.org/onlinedocs/gcc/Integers-implementation.html#Integers-implementation
the result of the conversion is -1.

Reply via email to