The problem is r12-5300-gf98f373dd822b35c allows phiopt to recognize more basic blocks
but missed one location where phiopt could move an assignment from the middle block
to the non-middle one. This patch fixes that.
OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions.
PR tree-optimization/103288
gcc/ChangeLog:
* tree-ssa-phiopt.c (value_replacement): Return early if middle
block has more than one pred.
gcc/testsuite/ChangeLog:
* gcc.c-torture/compile/pr103288-1.c: New test.
--- /dev/null
+
+int ui_5;
+long func_14_uli_8;
+void func_14() {
+ ui_5 &= (func_14_uli_8 ? 60 : ui_5) ? 5 : 0;
+}
}
}
+ if (!single_pred_p (middle_bb))
+ return 0;
+
/* Now optimize (x != 0) ? x + y : y to just x + y. */
gsi = gsi_last_nondebug_bb (middle_bb);
if (gsi_end_p (gsi))