Use them to provide various gimple_assign_ accessors with gassign * rather than plain gimple.
gcc/ChangeLog.gimple-classes: * gimple.h (is_a_helper <const gassign *>::test): New. (gimple_assign_copy_p): Update return type from bool to gassign *, returning GS if the predicate holds. (gimple_assign_ssa_name_copy_p): Likewise. (gimple_assign_single_p): Likewise for new non-const overload. (gimple_assign_load_p): Likewise. (gimple_assign_cast_p): Introduce local "assign" via dyn_cast, using it in place of "s" for typesafety. (gimple_clobber_p): Introduce local "assign" via call to gimple_assign_single_p, using it in place of "s" for typesafety. * asan.c (maybe_instrument_assignment): Strengthen local "s" from gimple to gassign * via a checked cast. * gimple-walk.c (walk_stmt_load_store_addr_ops): Introduce local "assign" via call to gimple_assign_single_p, using it in place of "stmt" for typesafety. * gimple.c (gimple_assign_copy_p): Update return type from bool to gassign *, returning GS if the predicate holds. (gimple_assign_ssa_name_copy_p): Likewise. * ipa-polymorphic-call.c (extr_type_from_vtbl_ptr_store): Likewise, replacing local "stmt". * ipa-prop.c (extr_type_from_vtbl_ptr_store): Likewise. (load_from_unmodified_param): Likewise. (get_ancestor_addr_info): Rename gimple param "assign" to "stmt", reintroducing name "assign" as a gassign * via a call to gimple_assign_single_p. (get_ssa_def_if_simple_copy): Introduce local "assign" via call to gimple_assign_single_p, using it in place of "def_stmt" for typesafety. (determine_locally_known_aggregate_parts): Likewise for "stmt". (ipa_get_stmt_member_ptr_load_param): Likewise. (ipcp_modif_dom_walker::before_dom_children): Strengthen local "stmt" from gimple to gassign * via use of gimple_assign_load_p. * tree-if-conv.c (ifcvt_can_use_mask_load_store): Introduce local "assign" via call to gimple_assign_single_p, using it in place of "stmt" for typesafety. (predicate_mem_writes): Strengthen local "stmt" from gimple to gassign * via use of gimple_assign_single_p. * tree-inline.c (remap_gimple_stmt): Introduce local "assign" via call to gimple_assign_copy_p, using it in place of "stmt" for typesafety. * tree-nrv.c (pass_nrv::execute): Likewise. * tree-ssa-ccp.c (insert_clobber_before_stack_restore): Likewise via call to gimple_assign_ssa_name_copy_p. * tree-ssa-copyrename.c (pass_rename_ssa_copies::execute): Likewise. * tree-ssa-loop-niter.c (get_val_for): Likewise. * tree-vect-stmts.c (exist_non_indexing_operands_for_use_p): Likewise via call to gimple_assign_copy_p. --- gcc/ChangeLog.gimple-classes | 52 ++++++++++++++++++++++++++++++++++++ gcc/asan.c | 2 +- gcc/gimple-walk.c | 8 +++--- gcc/gimple.c | 20 +++++++++----- gcc/gimple.h | 63 ++++++++++++++++++++++++++++++++++---------- gcc/ipa-polymorphic-call.c | 7 ++--- gcc/ipa-prop.c | 38 +++++++++++++++----------- gcc/tree-if-conv.c | 17 ++++++------ gcc/tree-inline.c | 9 ++++--- gcc/tree-nrv.c | 12 +++++---- gcc/tree-ssa-ccp.c | 4 +-- gcc/tree-ssa-copyrename.c | 6 ++--- gcc/tree-ssa-loop-niter.c | 4 +-- gcc/tree-vect-stmts.c | 7 ++--- 14 files changed, 177 insertions(+), 72 deletions(-) diff --git a/gcc/ChangeLog.gimple-classes b/gcc/ChangeLog.gimple-classes index 5c3cbd5..a60a771 100644 --- a/gcc/ChangeLog.gimple-classes +++ b/gcc/ChangeLog.gimple-classes @@ -1,5 +1,57 @@ 2014-10-31 David Malcolm <dmalc...@redhat.com> + * gimple.h (is_a_helper <const gassign *>::test): New. + (gimple_assign_copy_p): Update return type from bool to + gassign *, returning GS if the predicate holds. + (gimple_assign_ssa_name_copy_p): Likewise. + (gimple_assign_single_p): Likewise for new non-const overload. + (gimple_assign_load_p): Likewise. + (gimple_assign_cast_p): Introduce local "assign" via dyn_cast, + using it in place of "s" for typesafety. + (gimple_clobber_p): Introduce local "assign" via call to + gimple_assign_single_p, using it in place of "s" for typesafety. + + * asan.c (maybe_instrument_assignment): Strengthen local "s" from + gimple to gassign * via a checked cast. + * gimple-walk.c (walk_stmt_load_store_addr_ops): Introduce local + "assign" via call to gimple_assign_single_p, using it in place of + "stmt" for typesafety. + * gimple.c (gimple_assign_copy_p): Update return type from bool to + gassign *, returning GS if the predicate holds. + (gimple_assign_ssa_name_copy_p): Likewise. + * ipa-polymorphic-call.c (extr_type_from_vtbl_ptr_store): + Likewise, replacing local "stmt". + * ipa-prop.c (extr_type_from_vtbl_ptr_store): Likewise. + (load_from_unmodified_param): Likewise. + (get_ancestor_addr_info): Rename gimple param "assign" to "stmt", + reintroducing name "assign" as a gassign * via a call to + gimple_assign_single_p. + (get_ssa_def_if_simple_copy): Introduce local "assign" via call to + gimple_assign_single_p, using it in place of "def_stmt" for + typesafety. + (determine_locally_known_aggregate_parts): Likewise for "stmt". + (ipa_get_stmt_member_ptr_load_param): Likewise. + (ipcp_modif_dom_walker::before_dom_children): Strengthen local + "stmt" from gimple to gassign * via use of gimple_assign_load_p. + * tree-if-conv.c (ifcvt_can_use_mask_load_store): Introduce local + "assign" via call to gimple_assign_single_p, using it in place of + "stmt" for typesafety. + (predicate_mem_writes): Strengthen local "stmt" from gimple to + gassign * via use of gimple_assign_single_p. + * tree-inline.c (remap_gimple_stmt): Introduce local "assign" via + call to gimple_assign_copy_p, using it in place of "stmt" for + typesafety. + * tree-nrv.c (pass_nrv::execute): Likewise. + * tree-ssa-ccp.c (insert_clobber_before_stack_restore): Likewise + via call to gimple_assign_ssa_name_copy_p. + * tree-ssa-copyrename.c (pass_rename_ssa_copies::execute): + Likewise. + * tree-ssa-loop-niter.c (get_val_for): Likewise. + * tree-vect-stmts.c (exist_non_indexing_operands_for_use_p): + Likewise via call to gimple_assign_copy_p. + +2014-10-31 David Malcolm <dmalc...@redhat.com> + * tree-ssa-forwprop.c (simplify_builtin_call): Strengthen local "stmt2" from gimple to gcall * via a checked cast. Replace is_gimple_call with a dyn_cast, introducing local "call_stmt1", diff --git a/gcc/asan.c b/gcc/asan.c index 68b4676..1f65fe6 100644 --- a/gcc/asan.c +++ b/gcc/asan.c @@ -1980,7 +1980,7 @@ instrument_builtin_call (gimple_stmt_iterator *iter) static bool maybe_instrument_assignment (gimple_stmt_iterator *iter) { - gimple s = gsi_stmt (*iter); + gassign *s = as_a <gassign *> (gsi_stmt (*iter)); gcc_assert (gimple_assign_single_p (s)); diff --git a/gcc/gimple-walk.c b/gcc/gimple-walk.c index 767e584..9a800e2 100644 --- a/gcc/gimple-walk.c +++ b/gcc/gimple-walk.c @@ -709,17 +709,17 @@ walk_stmt_load_store_addr_ops (gimple stmt, void *data, { bool ret = false; unsigned i; - if (gimple_assign_single_p (stmt)) + if (gassign *assign = gimple_assign_single_p (stmt)) { tree lhs, rhs, arg; if (visit_store) { - arg = gimple_assign_lhs (stmt); + arg = gimple_assign_lhs (assign); lhs = get_base_loadstore (arg); if (lhs) ret |= visit_store (stmt, lhs, arg, data); } - arg = gimple_assign_rhs1 (stmt); + arg = gimple_assign_rhs1 (assign); rhs = arg; while (handled_component_p (rhs)) rhs = TREE_OPERAND (rhs, 0); @@ -749,7 +749,7 @@ walk_stmt_load_store_addr_ops (gimple stmt, void *data, TREE_OPERAND (OBJ_TYPE_REF_OBJECT (val), 0), arg, data); } - lhs = gimple_assign_lhs (stmt); + lhs = gimple_assign_lhs (assign); if (TREE_CODE (lhs) == TARGET_MEM_REF && TREE_CODE (TMR_BASE (lhs)) == ADDR_EXPR) ret |= visit_addr (stmt, TREE_OPERAND (TMR_BASE (lhs), 0), lhs, data); diff --git a/gcc/gimple.c b/gcc/gimple.c index d86ca49..45831d3 100644 --- a/gcc/gimple.c +++ b/gcc/gimple.c @@ -1464,22 +1464,28 @@ gimple_call_return_flags (const gcall *stmt) /* Return true if GS is a copy assignment. */ -bool +gassign * gimple_assign_copy_p (gimple gs) { - return (gimple_assign_single_p (gs) - && is_gimple_val (gimple_op (gs, 1))); + gassign *assign = gimple_assign_single_p (gs); + if (assign) + if (is_gimple_val (gimple_op (gs, 1))) + return assign; + return NULL; } /* Return true if GS is a SSA_NAME copy assignment. */ -bool +gassign * gimple_assign_ssa_name_copy_p (gimple gs) { - return (gimple_assign_single_p (gs) - && TREE_CODE (gimple_assign_lhs (gs)) == SSA_NAME - && TREE_CODE (gimple_assign_rhs1 (gs)) == SSA_NAME); + gassign *assign = gimple_assign_single_p (gs); + if (assign) + if (TREE_CODE (gimple_assign_lhs (assign)) == SSA_NAME + && TREE_CODE (gimple_assign_rhs1 (assign)) == SSA_NAME) + return assign; + return NULL; } diff --git a/gcc/gimple.h b/gcc/gimple.h index 582bbbb..50e1555 100644 --- a/gcc/gimple.h +++ b/gcc/gimple.h @@ -1127,6 +1127,14 @@ is_a_helper <const gasm *>::test (const_gimple gs) template <> template <> inline bool +is_a_helper <const gassign *>::test (const_gimple gs) +{ + return gs->code == GIMPLE_ASSIGN; +} + +template <> +template <> +inline bool is_a_helper <const gbind *>::test (const_gimple gs) { return gs->code == GIMPLE_BIND; @@ -1380,8 +1388,8 @@ bool gimple_call_same_target_p (const_gimple, const_gimple); int gimple_call_flags (const_gimple); int gimple_call_arg_flags (const gcall *, unsigned); int gimple_call_return_flags (const gcall *); -bool gimple_assign_copy_p (gimple); -bool gimple_assign_ssa_name_copy_p (gimple); +gassign *gimple_assign_copy_p (gimple); +gassign *gimple_assign_ssa_name_copy_p (gimple); bool gimple_assign_unary_nop_p (gimple); void gimple_set_bb (gimple, basic_block); void gimple_assign_set_rhs_from_tree (gimple_stmt_iterator *, tree); @@ -2488,8 +2496,20 @@ gimple_assign_rhs_class (const_gimple gs) static inline bool gimple_assign_single_p (const_gimple gs) { - return (is_gimple_assign (gs) - && gimple_assign_rhs_class (gs) == GIMPLE_SINGLE_RHS); + return gimple_assign_single_p (const_cast <gimple> (gs)); +} + +/* As above, but non-const, and return GS as a gassign * if + the predicate holds. */ + +static inline gassign * +gimple_assign_single_p (gimple gs) +{ + gassign *assign = dyn_cast <gassign *> (gs); + if (assign) + if (gimple_assign_rhs_class (assign) == GIMPLE_SINGLE_RHS) + return assign; + return NULL; } /* Return true if GS performs a store to its lhs. */ @@ -2506,15 +2526,27 @@ gimple_store_p (const_gimple gs) static inline bool gimple_assign_load_p (const_gimple gs) { + return gimple_assign_load_p (const_cast <gimple> (gs)); +} + +/* As above, but non-const, and return GS as a gassign * if + the predicate holds. */ + +static inline gassign * +gimple_assign_load_p (gimple gs) +{ tree rhs; - if (!gimple_assign_single_p (gs)) - return false; - rhs = gimple_assign_rhs1 (gs); + gassign *assign = gimple_assign_single_p (gs); + if (!assign) + return NULL; + rhs = gimple_assign_rhs1 (assign); if (TREE_CODE (rhs) == WITH_SIZE_EXPR) - return true; + return assign; rhs = get_base_address (rhs); - return (DECL_P (rhs) - || TREE_CODE (rhs) == MEM_REF || TREE_CODE (rhs) == TARGET_MEM_REF); + if (DECL_P (rhs) + || TREE_CODE (rhs) == MEM_REF || TREE_CODE (rhs) == TARGET_MEM_REF) + return assign; + return NULL; } @@ -2523,9 +2555,9 @@ gimple_assign_load_p (const_gimple gs) static inline bool gimple_assign_cast_p (const_gimple s) { - if (is_gimple_assign (s)) + if (const gassign *assign = dyn_cast <const gassign *> (s)) { - enum tree_code sc = gimple_assign_rhs_code (s); + enum tree_code sc = gimple_assign_rhs_code (assign); return CONVERT_EXPR_CODE_P (sc) || sc == VIEW_CONVERT_EXPR || sc == FIX_TRUNC_EXPR; @@ -2539,8 +2571,11 @@ gimple_assign_cast_p (const_gimple s) static inline bool gimple_clobber_p (const_gimple s) { - return gimple_assign_single_p (s) - && TREE_CLOBBER_P (gimple_assign_rhs1 (s)); + gassign *assign = gimple_assign_single_p (const_cast <gimple> (s)); + if (assign) + if (TREE_CLOBBER_P (gimple_assign_rhs1 (assign))) + return true; + return false; } /* Return true if GS is a GIMPLE_CALL. */ diff --git a/gcc/ipa-polymorphic-call.c b/gcc/ipa-polymorphic-call.c index 3f2d303..1bdbfb3 100644 --- a/gcc/ipa-polymorphic-call.c +++ b/gcc/ipa-polymorphic-call.c @@ -1152,11 +1152,12 @@ extr_type_from_vtbl_ptr_store (gimple stmt, struct type_change_info *tci, HOST_WIDE_INT offset, size, max_size; tree lhs, rhs, base; - if (!gimple_assign_single_p (stmt)) + gassign *assign = gimple_assign_single_p (stmt); + if (!assign) return NULL_TREE; - lhs = gimple_assign_lhs (stmt); - rhs = gimple_assign_rhs1 (stmt); + lhs = gimple_assign_lhs (assign); + rhs = gimple_assign_rhs1 (assign); if (TREE_CODE (lhs) != COMPONENT_REF || !DECL_VIRTUAL_P (TREE_OPERAND (lhs, 1))) { diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c index 6495e2b..334b2c3 100644 --- a/gcc/ipa-prop.c +++ b/gcc/ipa-prop.c @@ -700,11 +700,12 @@ extr_type_from_vtbl_ptr_store (gimple stmt, struct prop_type_change_info *tci) HOST_WIDE_INT offset, size, max_size; tree lhs, rhs, base, binfo; - if (!gimple_assign_single_p (stmt)) + gassign *assign = gimple_assign_single_p (stmt); + if (!assign) return NULL_TREE; - lhs = gimple_assign_lhs (stmt); - rhs = gimple_assign_rhs1 (stmt); + lhs = gimple_assign_lhs (assign); + rhs = gimple_assign_rhs1 (assign); if (TREE_CODE (lhs) != COMPONENT_REF || !DECL_VIRTUAL_P (TREE_OPERAND (lhs, 1))) return NULL_TREE; @@ -1062,7 +1063,8 @@ load_from_unmodified_param (struct func_body_info *fbi, int index; tree op1; - if (!gimple_assign_single_p (stmt)) + gassign *assign = gimple_assign_single_p (stmt); + if (!assign) return -1; op1 = gimple_assign_rhs1 (stmt); @@ -1386,7 +1388,7 @@ compute_complex_assign_jump_func (struct func_body_info *fbi, } } -/* Extract the base, offset and MEM_REF expression from a statement ASSIGN if +/* Extract the base, offset and MEM_REF expression from a statement STMT if it looks like: iftmp.1_3 = &obj_2(D)->D.1762; @@ -1398,12 +1400,13 @@ compute_complex_assign_jump_func (struct func_body_info *fbi, RHS stripped off the ADDR_EXPR is stored into *OBJ_P. */ static tree -get_ancestor_addr_info (gimple assign, tree *obj_p, HOST_WIDE_INT *offset) +get_ancestor_addr_info (gimple stmt, tree *obj_p, HOST_WIDE_INT *offset) { HOST_WIDE_INT size, max_size; tree expr, parm, obj; - if (!gimple_assign_single_p (assign)) + gassign *assign = gimple_assign_single_p (stmt); + if (!assign) return NULL_TREE; expr = gimple_assign_rhs1 (assign); @@ -1607,8 +1610,8 @@ get_ssa_def_if_simple_copy (tree rhs) { gimple def_stmt = SSA_NAME_DEF_STMT (rhs); - if (gimple_assign_single_p (def_stmt)) - rhs = gimple_assign_rhs1 (def_stmt); + if (gassign *assign = gimple_assign_single_p (def_stmt)) + rhs = gimple_assign_rhs1 (assign); else break; } @@ -1778,11 +1781,12 @@ determine_locally_known_aggregate_parts (gcall *call, tree arg, if (!stmt_may_clobber_ref_p_1 (stmt, &r)) continue; - if (!gimple_assign_single_p (stmt)) + gassign *assign = gimple_assign_single_p (stmt); + if (!assign) break; - lhs = gimple_assign_lhs (stmt); - rhs = gimple_assign_rhs1 (stmt); + lhs = gimple_assign_lhs (assign); + rhs = gimple_assign_rhs1 (assign); if (!is_gimple_reg_type (TREE_TYPE (rhs)) || TREE_CODE (lhs) == BIT_FIELD_REF || contains_bitfld_component_ref_p (lhs)) @@ -2036,10 +2040,11 @@ ipa_get_stmt_member_ptr_load_param (gimple stmt, bool use_delta, { tree rhs, rec, ref_field, ref_offset, fld, ptr_field, delta_field; - if (!gimple_assign_single_p (stmt)) + gassign *assign = gimple_assign_single_p (stmt); + if (!assign) return NULL_TREE; - rhs = gimple_assign_rhs1 (stmt); + rhs = gimple_assign_rhs1 (assign); if (TREE_CODE (rhs) == COMPONENT_REF) { ref_field = TREE_OPERAND (rhs, 1); @@ -5378,13 +5383,14 @@ ipcp_modif_dom_walker::before_dom_children (basic_block bb) for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi)) { struct ipa_agg_replacement_value *v; - gimple stmt = gsi_stmt (gsi); + gassign *stmt; tree rhs, val, t; HOST_WIDE_INT offset, size; int index; bool by_ref, vce; - if (!gimple_assign_load_p (stmt)) + stmt = gimple_assign_load_p (gsi_stmt (gsi)); + if (!stmt) continue; rhs = gimple_assign_rhs1 (stmt); if (!is_gimple_reg_type (TREE_TYPE (rhs))) diff --git a/gcc/tree-if-conv.c b/gcc/tree-if-conv.c index 62b1632..ba3cb47 100644 --- a/gcc/tree-if-conv.c +++ b/gcc/tree-if-conv.c @@ -737,26 +737,27 @@ ifcvt_can_use_mask_load_store (gimple stmt) enum machine_mode mode; basic_block bb = gimple_bb (stmt); bool is_load; + gassign *assign; if (!(flag_tree_loop_vectorize || bb->loop_father->force_vectorize) || bb->loop_father->dont_vectorize - || !gimple_assign_single_p (stmt) + || !(assign = gimple_assign_single_p (stmt)) || gimple_has_volatile_ops (stmt)) return false; /* Check whether this is a load or store. */ - lhs = gimple_assign_lhs (stmt); - if (gimple_store_p (stmt)) + lhs = gimple_assign_lhs (assign); + if (gimple_store_p (assign)) { - if (!is_gimple_val (gimple_assign_rhs1 (stmt))) + if (!is_gimple_val (gimple_assign_rhs1 (assign))) return false; is_load = false; ref = lhs; } - else if (gimple_assign_load_p (stmt)) + else if (gimple_assign_load_p (assign)) { is_load = true; - ref = gimple_assign_rhs1 (stmt); + ref = gimple_assign_rhs1 (assign); } else return false; @@ -1849,7 +1850,7 @@ predicate_mem_writes (loop_p loop) basic_block bb = ifc_bbs[i]; tree cond = bb_predicate (bb); bool swap; - gimple stmt; + gassign *stmt; if (is_true_predicate (cond)) continue; @@ -1862,7 +1863,7 @@ predicate_mem_writes (loop_p loop) } for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi)) - if (!gimple_assign_single_p (stmt = gsi_stmt (gsi))) + if (!(stmt = gimple_assign_single_p (gsi_stmt (gsi)))) continue; else if (gimple_plf (stmt, GF_PLF_2)) { diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index 53b5d35..51885f6 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -1526,9 +1526,10 @@ remap_gimple_stmt (gimple stmt, copy_body_data *id) } else { - if (gimple_assign_copy_p (stmt) - && gimple_assign_lhs (stmt) == gimple_assign_rhs1 (stmt) - && auto_var_in_fn_p (gimple_assign_lhs (stmt), id->src_fn)) + gassign *assign = gimple_assign_copy_p (stmt); + if (assign + && gimple_assign_lhs (assign) == gimple_assign_rhs1 (assign) + && auto_var_in_fn_p (gimple_assign_lhs (assign), id->src_fn)) { /* Here we handle statements that are not completely rewritten. First we detect some inlining-induced bogosities for @@ -1537,7 +1538,7 @@ remap_gimple_stmt (gimple stmt, copy_body_data *id) /* Some assignments VAR = VAR; don't generate any rtl code and thus don't count as variable modification. Avoid keeping bogosities like 0 = 0. */ - tree decl = gimple_assign_lhs (stmt), value; + tree decl = gimple_assign_lhs (assign), value; tree *n; n = id->decl_map->get (decl); diff --git a/gcc/tree-nrv.c b/gcc/tree-nrv.c index 182039e..e960eed 100644 --- a/gcc/tree-nrv.c +++ b/gcc/tree-nrv.c @@ -202,11 +202,12 @@ pass_nrv::execute (function *fun) && gimple_get_lhs (stmt) == result) { tree rhs; + gassign *assign = gimple_assign_copy_p (stmt); - if (!gimple_assign_copy_p (stmt)) + if (!assign) return 0; - rhs = gimple_assign_rhs1 (stmt); + rhs = gimple_assign_rhs1 (assign); /* Now verify that this return statement uses the same value as any previously encountered return statement. */ @@ -280,10 +281,11 @@ pass_nrv::execute (function *fun) for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); ) { gimple stmt = gsi_stmt (gsi); + gassign *assign; /* If this is a copy from VAR to RESULT, remove it. */ - if (gimple_assign_copy_p (stmt) - && gimple_assign_lhs (stmt) == result - && gimple_assign_rhs1 (stmt) == found) + if ((assign = gimple_assign_copy_p (stmt)) + && gimple_assign_lhs (assign) == result + && gimple_assign_rhs1 (assign) == found) { unlink_stmt_vdef (stmt); gsi_remove (&gsi, true); diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c index bf7577a..a331e5c 100644 --- a/gcc/tree-ssa-ccp.c +++ b/gcc/tree-ssa-ccp.c @@ -1943,8 +1943,8 @@ insert_clobber_before_stack_restore (tree saved_val, tree var, insert_clobber_before_stack_restore (gimple_phi_result (stmt), var, visited); } - else if (gimple_assign_ssa_name_copy_p (stmt)) - insert_clobber_before_stack_restore (gimple_assign_lhs (stmt), var, + else if (gassign *assign = gimple_assign_ssa_name_copy_p (stmt)) + insert_clobber_before_stack_restore (gimple_assign_lhs (assign), var, visited); else gcc_assert (is_gimple_debug (stmt)); diff --git a/gcc/tree-ssa-copyrename.c b/gcc/tree-ssa-copyrename.c index cd7bac5..42e5062 100644 --- a/gcc/tree-ssa-copyrename.c +++ b/gcc/tree-ssa-copyrename.c @@ -368,10 +368,10 @@ pass_rename_ssa_copies::execute (function *fun) gsi_next (&gsi)) { stmt = gsi_stmt (gsi); - if (gimple_assign_ssa_name_copy_p (stmt)) + if (gassign *assign = gimple_assign_ssa_name_copy_p (stmt)) { - tree lhs = gimple_assign_lhs (stmt); - tree rhs = gimple_assign_rhs1 (stmt); + tree lhs = gimple_assign_lhs (assign); + tree rhs = gimple_assign_rhs1 (assign); copy_rename_partition_coalesce (map, lhs, rhs, debug); } diff --git a/gcc/tree-ssa-loop-niter.c b/gcc/tree-ssa-loop-niter.c index fd4d5bf..36a9027 100644 --- a/gcc/tree-ssa-loop-niter.c +++ b/gcc/tree-ssa-loop-niter.c @@ -2271,8 +2271,8 @@ get_val_for (tree x, tree base) /* STMT must be either an assignment of a single SSA name or an expression involving an SSA name and a constant. Try to fold that expression using the value for the SSA name. */ - if (gimple_assign_ssa_name_copy_p (stmt)) - return get_val_for (gimple_assign_rhs1 (stmt), base); + if (gassign *assign = gimple_assign_ssa_name_copy_p (stmt)) + return get_val_for (gimple_assign_rhs1 (assign), base); else if (gimple_assign_rhs_class (stmt) == GIMPLE_UNARY_RHS && TREE_CODE (gimple_assign_rhs1 (stmt)) == SSA_NAME) { diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c index a282cea..a65cdbf 100644 --- a/gcc/tree-vect-stmts.c +++ b/gcc/tree-vect-stmts.c @@ -403,7 +403,8 @@ exist_non_indexing_operands_for_use_p (tree use, gimple stmt) Therefore, all we need to check is if STMT falls into the first case, and whether var corresponds to USE. */ - if (!gimple_assign_copy_p (stmt)) + gassign *assign = gimple_assign_copy_p (stmt); + if (!assign) { if (is_gimple_call (stmt) && gimple_call_internal_p (stmt)) @@ -425,9 +426,9 @@ exist_non_indexing_operands_for_use_p (tree use, gimple stmt) return false; } - if (TREE_CODE (gimple_assign_lhs (stmt)) == SSA_NAME) + if (TREE_CODE (gimple_assign_lhs (assign)) == SSA_NAME) return false; - operand = gimple_assign_rhs1 (stmt); + operand = gimple_assign_rhs1 (assign); if (TREE_CODE (operand) != SSA_NAME) return false; -- 1.7.11.7