gcc/ChangeLog.gimple-classes: * tree-ssa-coalesce.c (build_ssa_conflict_graph): Replace is_gimple_assign with dyn_cast, introducing local "assign_stmt", using it in place of "stmt" for typesafety. (create_outofssa_var_map): Within case GIMPLE_ASSIGN introduce local "assign_stmt", using it in place of "stmt" for typesafety. --- gcc/ChangeLog.gimple-classes | 8 ++++++++ gcc/tree-ssa-coalesce.c | 15 ++++++++------- 2 files changed, 16 insertions(+), 7 deletions(-)
diff --git a/gcc/ChangeLog.gimple-classes b/gcc/ChangeLog.gimple-classes index ca6b1be..c7ca9fd 100644 --- a/gcc/ChangeLog.gimple-classes +++ b/gcc/ChangeLog.gimple-classes @@ -1,5 +1,13 @@ 2014-11-03 David Malcolm <dmalc...@redhat.com> + * tree-ssa-coalesce.c (build_ssa_conflict_graph): Replace + is_gimple_assign with dyn_cast, introducing local "assign_stmt", + using it in place of "stmt" for typesafety. + (create_outofssa_var_map): Within case GIMPLE_ASSIGN introduce + local "assign_stmt", using it in place of "stmt" for typesafety. + +2014-11-03 David Malcolm <dmalc...@redhat.com> + * tree-ssa-ccp.c (get_default_value): Replace is_gimple_assign with a dyn_cast, introducing local "assign_stmt", using it in place of "stmt" for typesafety. diff --git a/gcc/tree-ssa-coalesce.c b/gcc/tree-ssa-coalesce.c index 7d1825d..74ea352 100644 --- a/gcc/tree-ssa-coalesce.c +++ b/gcc/tree-ssa-coalesce.c @@ -850,11 +850,11 @@ build_ssa_conflict_graph (tree_live_info_p liveinfo) This is handled by simply removing the SRC of the copy from the live list, and processing the stmt normally. */ - if (is_gimple_assign (stmt)) + if (gassign *assign_stmt = dyn_cast <gassign *> (stmt)) { - tree lhs = gimple_assign_lhs (stmt); - tree rhs1 = gimple_assign_rhs1 (stmt); - if (gimple_assign_copy_p (stmt) + tree lhs = gimple_assign_lhs (assign_stmt); + tree rhs1 = gimple_assign_rhs1 (assign_stmt); + if (gimple_assign_copy_p (assign_stmt) && TREE_CODE (lhs) == SSA_NAME && TREE_CODE (rhs1) == SSA_NAME) live_track_clear_var (live, rhs1); @@ -1003,9 +1003,10 @@ create_outofssa_var_map (coalesce_list_p cl, bitmap used_in_copy) { case GIMPLE_ASSIGN: { - tree lhs = gimple_assign_lhs (stmt); - tree rhs1 = gimple_assign_rhs1 (stmt); - if (gimple_assign_ssa_name_copy_p (stmt) + gassign *assign_stmt = as_a <gassign *> (stmt); + tree lhs = gimple_assign_lhs (assign_stmt); + tree rhs1 = gimple_assign_rhs1 (assign_stmt); + if (gimple_assign_ssa_name_copy_p (assign_stmt) && gimple_can_coalesce_p (lhs, rhs1)) { v1 = SSA_NAME_VERSION (lhs); -- 1.7.11.7