Fix PR61657 (undefined behavior in loop-iv.c)
authorMarkus Trippelsdorf <markus@trippelsdorf.de>
Fri, 21 Aug 2015 16:44:30 +0000 (16:44 +0000)
committerMarkus Trippelsdorf <trippels@gcc.gnu.org>
Fri, 21 Aug 2015 16:44:30 +0000 (16:44 +0000)
commitf5dffc0ba1786e6af96fd31e9c04599b818aeedb
treedc8b58a037ecde64170bd90464b597621c8066a1
parentcf6a9610f2e86f6de12281cc47b2d5a5acba63e4
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.

From-SVN: r227075
gcc/ChangeLog
gcc/loop-iv.c