diff options
author | aldyh <aldyh@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-03-02 05:22:03 +0000 |
---|---|---|
committer | aldyh <aldyh@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-03-02 05:22:03 +0000 |
commit | 6357f22cce2f3b02c0649591b80081361fde05b3 (patch) | |
tree | 2be6027ac9b9a1f32b4327b7133854ee1b8e0c4d /gcc/ipa-polymorphic-call.c | |
parent | 2aaa1027d6b986ff5abe179e2900fcd4cc1c10dc (diff) | |
download | gcc-6357f22cce2f3b02c0649591b80081361fde05b3.tar.gz |
PR middle-end/65233
* ipa-polymorphic-call.c (walk_ssa_copies): Handle empty PHIs.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@221097 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-polymorphic-call.c')
-rw-r--r-- | gcc/ipa-polymorphic-call.c | 5 |
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); |