+2013-01-14 Richard Biener <rguenther@suse.de>
+
+ * tree-cfgcleanup.c (remove_forwarder_block): Unshare propagated
+ PHI argument.
+ * graphite-sese-to-poly.c (insert_out_of_ssa_copy): Properly
+ unshare reference.
+ (insert_out_of_ssa_copy_on_edge): Likewise.
+ (rewrite_close_phi_out_of_ssa): Likewise.
+ * tree-ssa.c (insert_debug_temp_for_var_def): Properly unshare
+ debug expressions.
+ * tree-ssa-pre.c (insert_into_preds_of_block): Properly unshare
+ propagated constants.
+ * tree-cfg.c (tree_node_can_be_shared): Handled component-refs
+ can not be shared.
+
2013-01-14 Georg-Johann Lay <avr@gjlay.de>
* config/avr/avr-modes.def: Add GPL copyright notice.
gimple_seq stmts;
gimple_stmt_iterator gsi;
tree var = force_gimple_operand (expr, &stmts, true, NULL_TREE);
- gimple stmt = gimple_build_assign (res, var);
+ gimple stmt = gimple_build_assign (unshare_expr (res), var);
vec<gimple> x;
x.create (3);
gimple_stmt_iterator gsi;
gimple_seq stmts = NULL;
tree var = force_gimple_operand (expr, &stmts, true, NULL_TREE);
- gimple stmt = gimple_build_assign (res, var);
+ gimple stmt = gimple_build_assign (unshare_expr (res), var);
basic_block bb;
vec<gimple> x;
x.create (3);
{
tree zero_dim_array = create_zero_dim_array (res, "Close_Phi");
- stmt = gimple_build_assign (res, zero_dim_array);
+ stmt = gimple_build_assign (res, unshare_expr (zero_dim_array));
if (TREE_CODE (arg) == SSA_NAME)
insert_out_of_ssa_copy (scop, zero_dim_array, arg,
gimple phi = gsi_stmt (*psi);
basic_block bb = gimple_bb (phi);
tree res = gimple_phi_result (phi);
- tree var;
tree zero_dim_array = create_zero_dim_array (res, "phi_out_of_ssa");
gimple stmt;
- gimple_seq stmts;
for (i = 0; i < gimple_phi_num_args (phi); i++)
{
insert_out_of_ssa_copy_on_edge (scop, e, zero_dim_array, arg);
}
- var = force_gimple_operand (zero_dim_array, &stmts, true, NULL_TREE);
-
- stmt = gimple_build_assign (res, var);
+ stmt = gimple_build_assign (res, unshare_expr (zero_dim_array));
remove_phi_node (psi, false);
SSA_NAME_DEF_STMT (res) = stmt;
-
- insert_stmts (scop, stmt, stmts, gsi_after_labels (bb));
+ insert_stmts (scop, stmt, NULL, gsi_after_labels (bb));
}
/* Rewrite the degenerate phi node at position PSI from the degenerate
if (TREE_CODE (t) == CASE_LABEL_EXPR)
return true;
- while (((TREE_CODE (t) == ARRAY_REF || TREE_CODE (t) == ARRAY_RANGE_REF)
- && is_gimple_min_invariant (TREE_OPERAND (t, 1)))
- || TREE_CODE (t) == COMPONENT_REF
- || TREE_CODE (t) == REALPART_EXPR
- || TREE_CODE (t) == IMAGPART_EXPR)
- t = TREE_OPERAND (t, 0);
-
if (DECL_P (t))
return true;
{
gimple phi = gsi_stmt (gsi);
source_location l = gimple_phi_arg_location_from_edge (phi, succ);
- add_phi_arg (phi, gimple_phi_arg_def (phi, succ->dest_idx), s, l);
+ tree def = gimple_phi_arg_def (phi, succ->dest_idx);
+ add_phi_arg (phi, unshare_expr (def), s, l);
}
}
}
gcc_assert (get_expr_type (ae) == type
|| useless_type_conversion_p (type, get_expr_type (ae)));
if (ae->kind == CONSTANT)
- add_phi_arg (phi, PRE_EXPR_CONSTANT (ae), pred, UNKNOWN_LOCATION);
+ add_phi_arg (phi, unshare_expr (PRE_EXPR_CONSTANT (ae)),
+ pred, UNKNOWN_LOCATION);
else
add_phi_arg (phi, PRE_EXPR_NAME (ae), pred, UNKNOWN_LOCATION);
}
&& (!gimple_assign_single_p (def_stmt)
|| is_gimple_min_invariant (value)))
|| is_gimple_reg (value))
- value = unshare_expr (value);
+ ;
else
{
gimple def_temp;
that was unshared when we found it had a single debug
use, or a DEBUG_EXPR_DECL, that can be safely
shared. */
- SET_USE (use_p, value);
+ SET_USE (use_p, unshare_expr (value));
/* If we didn't replace uses with a debug decl fold the
resulting expression. Otherwise we end up with invalid IL. */
if (TREE_CODE (value) != DEBUG_EXPR_DECL)