summaryrefslogtreecommitdiff
path: root/gcc/ipa-polymorphic-call.c
diff options
context:
space:
mode:
authorAldy Hernandez <aldyh@redhat.com>2015-03-02 05:22:03 +0000
committerAldy Hernandez <aldyh@gcc.gnu.org>2015-03-02 05:22:03 +0000
commit34a108c813ff0644384f4f8796797cdb30811644 (patch)
tree2be6027ac9b9a1f32b4327b7133854ee1b8e0c4d /gcc/ipa-polymorphic-call.c
parent4630573709177f43b6b755326c90d6b777fbb2ab (diff)
re PR middle-end/65233 (ICE (segfault) on arm-linux-gnueabihf and aarch64-linux-gnu)
PR middle-end/65233 * ipa-polymorphic-call.c (walk_ssa_copies): Handle empty PHIs. From-SVN: r221097
Diffstat (limited to 'gcc/ipa-polymorphic-call.c')
-rw-r--r--gcc/ipa-polymorphic-call.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/ipa-polymorphic-call.c b/gcc/ipa-polymorphic-call.c
index aaa549e03d3..13cc7f647ff 100644
--- a/gcc/ipa-polymorphic-call.c
+++ b/gcc/ipa-polymorphic-call.c
@@ -835,7 +835,10 @@ 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)
+ 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)
goto done;
if (gimple_phi_num_args (phi) == 1)
op = gimple_phi_arg_def (phi, 0);