PR tree-optimization/78574
* tree-ssa-loop-ivopts.c (find_deriving_biv_for_expr): Skip loop
header PHI that doesn't define biv.
gcc/testsuite
PR tree-optimization/78574
* gcc.c-torture/compile/pr78574.c: New test.
From-SVN: r243026
+2016-11-30 Bin Cheng <bin.cheng@arm.com>
+
+ PR tree-optimization/78574
+ * tree-ssa-loop-ivopts.c (find_deriving_biv_for_expr): Skip loop
+ header PHI that doesn't define biv.
+
2016-11-30 Jakub Jelinek <jakub@redhat.com>
* emit-rtl.c (verify_insn_sharing): Call verify_rtx_sharing instead of
+2016-11-30 Bin Cheng <bin.cheng@arm.com>
+
+ PR tree-optimization/78574
+ * gcc.c-torture/compile/pr78574.c: New test.
+
2016-11-30 Andre Vehreschild <vehre@gcc.gnu.org>
* caf/single.c (_gfortran_caf_is_present): Prevent fallthrough
--- /dev/null
+/* PR tree-optimization/78574 */
+
+int a, d, f, g;
+int b[1];
+short h;
+int main() {
+ long j;
+ int k, i;
+ for (; j; j++) {
+ i = 0;
+ for (; i < 6; i++) {
+ int l = a, m = d || g;
+ L:
+ l ^ m | a;
+ }
+ b[j + 1] = 2;
+ ++k;
+ for (; g; g++) {
+ d ^= h;
+ if (f)
+ for (;;)
+ ;
+ }
+ }
+ if (k)
+ goto L;
+}
{
ssa_op_iter iter;
use_operand_p use_p;
+ basic_block phi_bb = gimple_bb (phi);
+
+ /* Skip loop header PHI that doesn't define biv. */
+ if (phi_bb->loop_father == data->current_loop)
+ return NULL;
if (virtual_operand_p (gimple_phi_result (phi)))
return NULL;