http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47890
--- Comment #5 from Ira Rosen <irar at il dot ibm.com> 2011-02-26 14:45:30 UTC
---
Similar to your patch, Richard, but with different related stmt:
@@ -2886,6 +3024,10 @@ get_initial_def_for_induction (gimple iv
gimple_assign_set_lhs (new_stmt, induc_def);
si = gsi_start_bb (bb);
gsi_insert_before (&si, new_stmt, GSI_SAME_STMT);
+ set_vinfo_for_stmt (new_stmt,
+ new_stmt_vec_info (new_stmt, loop_vinfo, NULL));
+ STMT_VINFO_RELATED_STMT (vinfo_for_stmt (new_stmt))
+ = STMT_VINFO_RELATED_STMT (vinfo_for_stmt (induction_phi));
}
The problem is that we first create copies and store them in RELATED_STMT
starting from INDUCTION_PHI, and then handle the cast. So, this patch copies
RELATED_STMT from INDUCTION_PHI to the VIEW_CONVERT stmt.
Ira