re PR middle-end/65233 (ICE (segfault) on arm-linux-gnueabihf and aarch64-linux-gnu)
authorAldy Hernandez <aldyh@redhat.com>
Mon, 2 Mar 2015 05:22:03 +0000 (05:22 +0000)
committerAldy Hernandez <aldyh@gcc.gnu.org>
Mon, 2 Mar 2015 05:22:03 +0000 (05:22 +0000)
PR middle-end/65233
* ipa-polymorphic-call.c (walk_ssa_copies): Handle empty PHIs.

From-SVN: r221097

gcc/ChangeLog
gcc/ipa-polymorphic-call.c

index 7b002bb..90f5e41 100644 (file)
@@ -1,3 +1,8 @@
+2015-03-01  Aldy Hernandez  <aldyh@redhat.com>
+
+       PR middle-end/65233
+       * ipa-polymorphic-call.c (walk_ssa_copies): Handle empty PHIs.
+
 2015-02-28  Jan Hubicka  <hubicka@ucw.cz>
 
        * ipa-icf.c: Include stor-layout.h
index aaa549e..13cc7f6 100644 (file)
@@ -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);