https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123983

--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
This is caused by r16-5780-g65a3849eb46df2 which does this semantic change
in the following hunk and reverting this fixes the issue - the IV is then
correctly only updated on the edge to the epilog, not on the use for the
live operation.

I'm testing reversal of that hunk.

@@ -2419,8 +2434,15 @@ vect_update_ivs_after_vectorizer (loop_vec_info
loop_vinf
o,
          gsi_insert_seq_before (&last_gsi, new_stmts, GSI_SAME_STMT);
        }

-      /* Fix phi expressions in the successor bb.  */
-      adjust_phi_and_debug_stmts (phi1, update_e, ni_name);
+      /* Fix phi expressions in all out of loop bb.  */
+      imm_use_iterator imm_iter;
+      gimple *use_stmt;
+      use_operand_p use_p;
+      tree ic_var = PHI_ARG_DEF_FROM_EDGE (phi1, update_e);
+      FOR_EACH_IMM_USE_STMT (use_stmt, imm_iter, ic_var)
+       if (!flow_bb_inside_loop_p (loop, gimple_bb (use_stmt)))
+         FOR_EACH_IMM_USE_ON_STMT (use_p, imm_iter)
+           SET_USE (use_p, ni_name);
     }
 }

Reply via email to