aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-polymorphic-call.c
diff options
context:
space:
mode:
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 aaa549e..13cc7f6 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);