This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/61657] Undefined behavior in loop-iv.c
- From: "trippels at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 21 Aug 2015 16:45:02 +0000
- Subject: [Bug rtl-optimization/61657] Undefined behavior in loop-iv.c
- Auto-submitted: auto-generated
- References: <bug-61657-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61657
--- Comment #10 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
Author: trippels
Date: Fri Aug 21 16:44:30 2015
New Revision: 227075
URL: https://gcc.gnu.org/viewcvs?rev=227075&root=gcc&view=rev
Log:
Fix PR61657 (undefined behavior in loop-iv.c)
bootstrap-ubsan shows:
loop-iv.c:2626:14: runtime error: signed integer overflow: 9223372036854775806
- -9223372036854775808 cannot be represented in type 'long int'
Fixed by moving the variables in question from signed to unsigned.
PR rtl-optimization/61657
* loop-iv.c (iv_number_of_iterations): Declare up and down as
unsigned. Remove superflous uint64_t cast.
Modified:
trunk/gcc/ChangeLog
trunk/gcc/loop-iv.c