/* Make sure that the loops in the SESE_LOOP_NEST are ordered. It
can be the case that an inner loop is inserted before an outer
loop. To avoid this, semi-sort once. */
- for (i = 0; VEC_iterate (loop_p, SESE_LOOP_NEST (region), i, loop0); i++)
+ FOR_EACH_VEC_ELT (loop_p, SESE_LOOP_NEST (region), i, loop0)
{
if (VEC_length (loop_p, SESE_LOOP_NEST (region)) == i + 1)
break;
use_operand_p use_p;
ssa_op_iter op_iter;
+ if (is_gimple_debug (copy))
+ {
+ if (gimple_debug_bind_p (copy))
+ gimple_debug_bind_reset_value (copy);
+ else
+ gcc_unreachable ();
+
+ return;
+ }
+
FOR_EACH_SSA_USE_OPERAND (use_p, copy, op_iter, SSA_OP_ALL_USES)
{
tree old_name = USE_FROM_PTR (use_p);
|| (TREE_CODE (new_expr) != SSA_NAME
&& is_gimple_reg (old_name)))
{
- tree var;
-
- if (is_gimple_debug (copy))
- {
- if (gimple_debug_bind_p (copy))
- gimple_debug_bind_reset_value (copy);
- else
- gcc_unreachable ();
-
- break;
- }
-
- var = create_tmp_var (type_old_name, "var");
+ tree var = create_tmp_var (type_old_name, "var");
if (type_old_name != type_new_expr)
new_expr = fold_convert (type_old_name, new_expr);
&& !tree_contains_chrecs (new_expr, NULL));
/* Replace the old_name with the new_expr. */
- new_expr = force_gimple_operand (new_expr, &stmts, true, NULL);
+ new_expr = force_gimple_operand (unshare_expr (new_expr), &stmts,
+ true, NULL_TREE);
gsi_insert_seq_before (gsi_tgt, stmts, GSI_SAME_STMT);
replace_exp (use_p, new_expr);
set_rename (rename_map, old_name, new_expr);