diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bbac099a2c8cea5fc990e00e3e825c2c0f8659e8..85b1c37eadd42d3ea981db7ca0973c1fe99114e6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-03-29 Segher Boessenkool <segher@kernel.crashing.org> + + PR rtl-optimization/80233 + * combine.c (combine_instructions): Only take NONDEBUG_INSN_P insns + as last_combined_insn. Do not test for BARRIER_P separately. + 2017-03-29 Andreas Schwab <schwab@suse.de> PR ada/80146 diff --git a/gcc/combine.c b/gcc/combine.c index c118aa25806be21dcdd4144f86115c8de853386d..87daa28bc8eff311ffd5228307967ac7debaffed 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -1250,10 +1250,10 @@ combine_instructions (rtx_insn *f, unsigned int nregs) continue; while (last_combined_insn - && last_combined_insn->deleted ()) + && (!NONDEBUG_INSN_P (last_combined_insn) + || last_combined_insn->deleted ())) last_combined_insn = PREV_INSN (last_combined_insn); if (last_combined_insn == NULL_RTX - || BARRIER_P (last_combined_insn) || BLOCK_FOR_INSN (last_combined_insn) != this_basic_block || DF_INSN_LUID (last_combined_insn) <= DF_INSN_LUID (insn)) last_combined_insn = insn; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ce511267046e8c3447656546cf7875a7c163037d..e7f7334f1194ce59604b989e6833d35f70276a25 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-03-29 Segher Boessenkool <segher@kernel.crashing.org> + + PR rtl-optimization/80233 + * gcc.c-torture/compile/pr80233.c: New testcase. + 2017-03-28 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/80254 diff --git a/gcc/testsuite/gcc.c-torture/compile/pr80233.c b/gcc/testsuite/gcc.c-torture/compile/pr80233.c new file mode 100644 index 0000000000000000000000000000000000000000..eb9b4a47246d37793edcdd340dfc6da9c61f6d04 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr80233.c @@ -0,0 +1,22 @@ +/* PR rtl-optimization/80233 */ + +int xg; + +void +t4 (int o9) +{ + int it; + + if (o9 == 0) + { + int fx; + + xg *= it; + if (xg == 0) + it /= 0; + + fx = (it != 0) ? (xg < 0) : (xg / o9); + if (fx != 0) + xg = 0; + } +}