[RTL ifcvt] PR rtl-optimization/66940: Avoid signed overflow in noce_get_alt_condition
commit239a4beafbd743137954b847d3fed3bda913f91d
authorktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 25 May 2016 15:53:21 +0000 (25 15:53 +0000)
committerktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 25 May 2016 15:53:21 +0000 (25 15:53 +0000)
tree131f0f77d0d7c2be0f18092dc8ec7993aaff6922
parentbf6382badd9778ccfc384143cb980a68947b9ae9
[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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@236728 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/ifcvt.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/pr66940.c [new file with mode: 0644]