if (chrec_contains_undetermined (scev))
{
*gloog_error = true;
- return false;
+ new_expr = build_zero_cst (TREE_TYPE (old_name));
}
-
- new_expr = chrec_apply_map (scev, iv_map);
+ else
+ new_expr = chrec_apply_map (scev, iv_map);
/* The apply should produce an expression tree containing
the uses of the new induction variables. We should be
|| tree_contains_chrecs (new_expr, NULL))
{
*gloog_error = true;
- return false;
+ new_expr = build_zero_cst (TREE_TYPE (old_name));
}
+ else
+ /* Replace the old_name with the new_expr. */
+ new_expr = force_gimple_operand (unshare_expr (new_expr), &stmts,
+ true, NULL_TREE);
- /* Replace the old_name with the new_expr. */
- 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);
if (rename_uses (copy, rename_map, &gsi_tgt, region, loop, iv_map,
gloog_error))
- fold_stmt_inplace (copy);
-
- if (*gloog_error)
- break;
+ {
+ gcc_assert (gsi_stmt (gsi_tgt) == copy);
+ fold_stmt_inplace (&gsi_tgt);
+ }
update_stmt (copy);
}