Fix PR tree-optimization/78598 - tree-ssa-loop-prefetch.c:835:16: runtime error:...
authorMarkus Trippelsdorf <markus@trippelsdorf.de>
Thu, 1 Dec 2016 14:59:03 +0000 (14:59 +0000)
committerMarkus Trippelsdorf <trippels@gcc.gnu.org>
Thu, 1 Dec 2016 14:59:03 +0000 (14:59 +0000)
commit56e1a4d7127256bb3f476a6d93954b1948b03985
treee7fa9f01ce547c150383e768b27b5d36e7e02f26
parentbe5ddbb86fbc4d7651f4c748528ecab6d31cd035
Fix PR tree-optimization/78598 - tree-ssa-loop-prefetch.c:835:16: runtime error: signed integer overflow

Using bootstrap-ubsan gcc to build mplayer shows:

tree-ssa-loop-prefetch.c:835:16: runtime error: signed integer overflow:
288230376151711743 * 64 cannot be represented in type 'long int'

Here signed und unsigned integers are mixed in a division resulting in
bogus values: (-83 + 64ULL -1) / 64ULL) == 288230376151711743

Fixed by casting the unsigned parameter to signed.

PR tree-optimization/78598
* tree-ssa-loop-prefetch.c (ddown): Cast to signed to avoid
overflows.

From-SVN: r243113
gcc/ChangeLog
gcc/tree-ssa-loop-prefetch.c