gcc/ChangeLog.gimple-classes: * gimplify-me.c (gimple_regimplify_operands): Replace a couple of is_gimple_assign calls with dyn_cast, introducing locals "assign_stmt" and using them in place of "stmt" for typesafety. --- gcc/ChangeLog.gimple-classes | 6 ++++++ gcc/gimplify-me.c | 12 +++++++----- 2 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/gcc/ChangeLog.gimple-classes b/gcc/ChangeLog.gimple-classes index e8d2d6e..33911d3 100644 --- a/gcc/ChangeLog.gimple-classes +++ b/gcc/ChangeLog.gimple-classes @@ -1,5 +1,11 @@ 2014-11-03 David Malcolm <dmalc...@redhat.com> + * gimplify-me.c (gimple_regimplify_operands): Replace a couple of + is_gimple_assign calls with dyn_cast, introducing locals + "assign_stmt" and using them in place of "stmt" for typesafety. + +2014-11-03 David Malcolm <dmalc...@redhat.com> + * auto-profile.c (afdo_propagate_circuit): Replace a check for GIMPLE_ASSIGN within the while loop with a dyn_cast, introducing a local "def_assign", using it in place of "stmt" for typesafety. diff --git a/gcc/gimplify-me.c b/gcc/gimplify-me.c index 9d969de..280d95c 100644 --- a/gcc/gimplify-me.c +++ b/gcc/gimplify-me.c @@ -240,17 +240,18 @@ gimple_regimplify_operands (gimple stmt, gimple_stmt_iterator *gsi_p) for (i = num_ops; i > 0; i--) { tree op = gimple_op (stmt, i - 1); + gassign *assign_stmt; if (op == NULL_TREE) continue; if (i == 1 && (is_gimple_call (stmt) || is_gimple_assign (stmt))) gimplify_expr (&op, &pre, NULL, is_gimple_lvalue, fb_lvalue); else if (i == 2 - && is_gimple_assign (stmt) + && (assign_stmt = dyn_cast <gassign *> (stmt)) && num_ops == 2 && get_gimple_rhs_class (gimple_expr_code (stmt)) == GIMPLE_SINGLE_RHS) gimplify_expr (&op, &pre, NULL, - rhs_predicate_for (gimple_assign_lhs (stmt)), + rhs_predicate_for (gimple_assign_lhs (assign_stmt)), fb_rvalue); else if (i == 2 && is_gimple_call (stmt)) { @@ -269,13 +270,14 @@ gimple_regimplify_operands (gimple stmt, gimple_stmt_iterator *gsi_p) if (lhs && !is_gimple_reg (lhs)) { bool need_temp = false; + gassign *assign_stmt; - if (is_gimple_assign (stmt) + if ((assign_stmt = dyn_cast <gassign *> (stmt)) && num_ops == 2 && get_gimple_rhs_class (gimple_expr_code (stmt)) == GIMPLE_SINGLE_RHS) - gimplify_expr (gimple_assign_rhs1_ptr (stmt), &pre, NULL, - rhs_predicate_for (gimple_assign_lhs (stmt)), + gimplify_expr (gimple_assign_rhs1_ptr (assign_stmt), &pre, NULL, + rhs_predicate_for (gimple_assign_lhs (assign_stmt)), fb_rvalue); else if (is_gimple_reg (lhs)) { -- 1.7.11.7