]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-phinodes.c (remove_phi_arg_num): Don't remove PHIs without any PHI arguments...
authorSteven Bosscher <steven@gcc.gnu.org>
Wed, 27 Oct 2004 17:14:19 +0000 (17:14 +0000)
committerSteven Bosscher <steven@gcc.gnu.org>
Wed, 27 Oct 2004 17:14:19 +0000 (17:14 +0000)
* tree-phinodes.c (remove_phi_arg_num): Don't remove PHIs
without any PHI arguments left.  Make sure the argument that
we're supposed to remove exists at all.

From-SVN: r89689

gcc/ChangeLog
gcc/tree-phinodes.c

index 68fc9443ea181091d01dc1ab96aaf39553a7656b..db8f25f51a272b26f8a74020f689e741e43d06f5 100644 (file)
@@ -1,3 +1,9 @@
+2004-10-27  Steven Bosscher  <stevenb@suse.de>
+
+       * tree-phinodes.c (remove_phi_arg_num): Don't remove PHIs
+       without any PHI arguments left.  Make sure the argument that
+       we're supposed to remove exists at all.
+
 2004-10-27  Paul Brook  <paul@codesourcery.com>
 
        * configure.ac: Don't test for [build] __cxa_atexit when building a
 
 2004-10-26  Fariborz Jahanian <fjahanian@apple.com>
 
-       * config/rs6000/rs6000.md (andsi3_internal8): Set CR when splitting
+       * config/rs6000/rs6000.md (andsi3_internal8): Set CR when splitting 
        into rotlsi3.
 
 2004-10-26  Kazu Hirata  <kazu@cs.umass.edu>
index 6dc5c7692ded5c8f51a89b21036e627c0bfe7e43..64fab712a4d890142b1cb6c3e5bfb97a02bbaac5 100644 (file)
@@ -407,6 +407,8 @@ remove_phi_arg_num (tree phi, int i)
 {
   int num_elem = PHI_NUM_ARGS (phi);
 
+  gcc_assert (i < num_elem);
+
   /* If we are not at the last element, switch the last element
      with the element we want to delete.  */
   if (i != num_elem - 1)
@@ -421,11 +423,6 @@ remove_phi_arg_num (tree phi, int i)
   PHI_ARG_EDGE (phi, num_elem - 1) = NULL;
   PHI_ARG_NONZERO (phi, num_elem - 1) = false;
   PHI_NUM_ARGS (phi)--;
-
-  /* If we removed the last PHI argument, then go ahead and
-     remove the PHI node.  */
-  if (PHI_NUM_ARGS (phi) == 0)
-    remove_phi_node (phi, NULL, bb_for_stmt (phi));
 }
 
 /* Remove PHI node PHI from basic block BB.  If PREV is non-NULL, it is