From: Aldy Hernandez Date: Mon, 2 Mar 2015 05:22:03 +0000 (+0000) Subject: re PR middle-end/65233 (ICE (segfault) on arm-linux-gnueabihf and aarch64-linux-gnu) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=34a108c813ff0644384f4f8796797cdb30811644;p=gcc.git 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7b002bbcdfc..90f5e41edd1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2015-03-01 Aldy Hernandez + + PR middle-end/65233 + * ipa-polymorphic-call.c (walk_ssa_copies): Handle empty PHIs. + 2015-02-28 Jan Hubicka * ipa-icf.c: Include stor-layout.h 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 **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);