This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/66876] vrp: changing unsigned to signed comparison
- From: "mikpelinux at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 15 Jul 2015 09:58:01 +0000
- Subject: [Bug middle-end/66876] vrp: changing unsigned to signed comparison
- Auto-submitted: auto-generated
- References: <bug-66876-4 at http dot gcc dot gnu dot org/bugzilla/>
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.