https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66940
--- Comment #3 from ktkachov at gcc dot gnu.org --- Author: ktkachov Date: Wed May 25 15:53:21 2016 New Revision: 236728 URL: https://gcc.gnu.org/viewcvs?rev=236728&root=gcc&view=rev Log: [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. Added: trunk/gcc/testsuite/gcc.c-torture/execute/pr66940.c Modified: trunk/gcc/ChangeLog trunk/gcc/ifcvt.c trunk/gcc/testsuite/ChangeLog