From a2544177b989c29fe893e55d422c8d9e6f27c6b3 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Thu, 26 Sep 2013 13:18:31 +0000 Subject: tree-ssa-live.c (var_map_base_init): Handle SSA names with DECL_IGNORED_P base VAR_DECLs like anonymous SSA names. 2013-09-26 Richard Biener * tree-ssa-live.c (var_map_base_init): Handle SSA names with DECL_IGNORED_P base VAR_DECLs like anonymous SSA names. (loe_visit_block): Use gcc_checking_assert. * tree-ssa-coalesce.c (create_outofssa_var_map): Use gimple_assign_ssa_name_copy_p. (gimple_can_coalesce_p): Adjust according to the var_map_base_init change. * gcc.dg/tree-ssa/coalesce-2.c: New testcase. From-SVN: r202944 --- gcc/tree-ssa-coalesce.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'gcc/tree-ssa-coalesce.c') diff --git a/gcc/tree-ssa-coalesce.c b/gcc/tree-ssa-coalesce.c index d86e0b8..cfcd1e0 100644 --- a/gcc/tree-ssa-coalesce.c +++ b/gcc/tree-ssa-coalesce.c @@ -980,10 +980,7 @@ create_outofssa_var_map (coalesce_list_p cl, bitmap used_in_copy) { tree lhs = gimple_assign_lhs (stmt); tree rhs1 = gimple_assign_rhs1 (stmt); - - if (gimple_assign_copy_p (stmt) - && TREE_CODE (lhs) == SSA_NAME - && TREE_CODE (rhs1) == SSA_NAME + if (gimple_assign_ssa_name_copy_p (stmt) && gimple_can_coalesce_p (lhs, rhs1)) { v1 = SSA_NAME_VERSION (lhs); @@ -1347,7 +1344,11 @@ gimple_can_coalesce_p (tree name1, tree name2) { /* First check the SSA_NAME's associated DECL. We only want to coalesce if they have the same DECL or both have no associated DECL. */ - if (SSA_NAME_VAR (name1) != SSA_NAME_VAR (name2)) + tree var1 = SSA_NAME_VAR (name1); + tree var2 = SSA_NAME_VAR (name2); + var1 = (var1 && (!VAR_P (var1) || !DECL_IGNORED_P (var1))) ? var1 : NULL_TREE; + var2 = (var2 && (!VAR_P (var2) || !DECL_IGNORED_P (var2))) ? var2 : NULL_TREE; + if (var1 != var2) return false; /* Now check the types. If the types are the same, then we should -- cgit v1.1