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 7b002bbcdfc76f54259fe76b4c4b355457ca48cd..90f5e41edd1917ec3b6e088d4b762c4de07de18c 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 aaa549e03d39238d1921f6d943cf0f486550cacf..13cc7f647ff1c1888a700803fdde469418e8b919 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);