aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-polymorphic-call.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2015-03-05 08:37:40 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2015-03-05 08:37:40 +0000
commitb3406fa08329fc0510fdb83a6b200040fc30bc7d (patch)
tree910923c816c127d278507ef457cbe8c50270779d /gcc/ipa-polymorphic-call.c
parent41616a5e3834aef748e8715ba85dbb7cd3d1d854 (diff)
downloadgcc-b3406fa08329fc0510fdb83a6b200040fc30bc7d.zip
gcc-b3406fa08329fc0510fdb83a6b200040fc30bc7d.tar.gz
gcc-b3406fa08329fc0510fdb83a6b200040fc30bc7d.tar.bz2
re PR middle-end/65233 (ICE (segfault) on arm-linux-gnueabihf and aarch64-linux-gnu)
2015-03-05 Richard Biener <rguenther@suse.de> 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
Diffstat (limited to 'gcc/ipa-polymorphic-call.c')
-rw-r--r--gcc/ipa-polymorphic-call.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/gcc/ipa-polymorphic-call.c b/gcc/ipa-polymorphic-call.c
index 13cc7f6..90303f1 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<tree> **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<tree> **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);