[RTL ifcvt] PR rtl-optimization/66940: Avoid signed overflow in noce_get_alt_condition
authorKyrylo Tkachov <kyrylo.tkachov@arm.com>
Wed, 25 May 2016 15:53:21 +0000 (15:53 +0000)
committerKyrylo Tkachov <ktkachov@gcc.gnu.org>
Wed, 25 May 2016 15:53:21 +0000 (15:53 +0000)
commit5c42d3414397b59b0431be58732900c2c0165c72
tree131f0f77d0d7c2be0f18092dc8ec7993aaff6922
parentbf9a1a07adb0594b8060bbe23e2cde3475885fdc
[RTL ifcvt] PR rtl-optimization/66940: Avoid signed overflow in noce_get_alt_condition

PR rtl-optimization/66940
* ifcvt.c (noce_get_alt_condition): Check that incrementing or
decrementing desired_val will not overflow before performing these
operations.

* gcc.c-torture/execute/pr66940.c: New test.

From-SVN: r236728
gcc/ChangeLog
gcc/ifcvt.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/pr66940.c [new file with mode: 0644]