[Bug middle-end/66876] vrp: changing unsigned to signed comparison

mikpelinux at gmail dot com gcc-bugzilla@gcc.gnu.org
Wed Jul 15 09:58:00 GMT 2015


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

Mikael Pettersson <mikpelinux at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mikpelinux at gmail dot com

--- Comment #1 from Mikael Pettersson <mikpelinux at gmail dot com> ---
Compile with -fsanitize=undefined and you'll get

runtime error: signed integer overflow: 60667 * 65536 cannot be represented in
type 'int'

The "65536 * d[1]" sub-expression is evaluated as int*int->int, so it overflows
and then all bets are off.

Append a U to the 64K literal.



More information about the Gcc-bugs mailing list