From b3406fa08329fc0510fdb83a6b200040fc30bc7d Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Thu, 5 Mar 2015 08:37:40 +0000 Subject: [PATCH] re PR middle-end/65233 (ICE (segfault) on arm-linux-gnueabihf and aarch64-linux-gnu) 2015-03-05 Richard Biener PR middle-end/65233 * ipa-polymorphic-call.c: Include tree-ssa-operands.h and tree-into-ssa.h. (walk_ssa_copies): Revert last chage. Instead do not walk SSA names registered for SSA update. From-SVN: r221203 --- gcc/ChangeLog | 8 ++++++++ gcc/ipa-polymorphic-call.c | 11 ++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 55e212dffd5..93b88681e5f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2015-03-05 Richard Biener + + PR middle-end/65233 + * ipa-polymorphic-call.c: Include tree-ssa-operands.h and + tree-into-ssa.h. + (walk_ssa_copies): Revert last chage. Instead do not walk + SSA names registered for SSA update. + 2015-03-03 Jan Hubicka PR ipa/65270 diff --git a/gcc/ipa-polymorphic-call.c b/gcc/ipa-polymorphic-call.c index 13cc7f647ff..90303f1bcfc 100644 --- a/gcc/ipa-polymorphic-call.c +++ b/gcc/ipa-polymorphic-call.c @@ -81,6 +81,8 @@ along with GCC; see the file COPYING3. If not see #include "data-streamer.h" #include "lto-streamer.h" #include "streamer-hooks.h" +#include "tree-ssa-operands.h" +#include "tree-into-ssa.h" /* Return true when TYPE contains an polymorphic type and thus is interesting for devirtualization machinery. */ @@ -804,7 +806,9 @@ walk_ssa_copies (tree op, hash_set **global_visited = NULL) STRIP_NOPS (op); while (TREE_CODE (op) == SSA_NAME && !SSA_NAME_IS_DEFAULT_DEF (op) - && SSA_NAME_DEF_STMT (op) + /* We might be called via fold_stmt during cfgcleanup where + SSA form need not be up-to-date. */ + && !name_registered_for_update_p (op) && (gimple_assign_single_p (SSA_NAME_DEF_STMT (op)) || gimple_code (SSA_NAME_DEF_STMT (op)) == GIMPLE_PHI)) { @@ -835,10 +839,7 @@ walk_ssa_copies (tree op, hash_set **global_visited = NULL) { gimple phi = SSA_NAME_DEF_STMT (op); - if (gimple_phi_num_args (phi) > 2 - /* We can be called while cleaning up the CFG and can - have empty PHIs about to be removed. */ - || gimple_phi_num_args (phi) == 0) + if (gimple_phi_num_args (phi) > 2) goto done; if (gimple_phi_num_args (phi) == 1) op = gimple_phi_arg_def (phi, 0); -- 2.30.2