]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-phinodes.c (resize_phi_node): Copy only a portion of the PHI node currently...
authorKazu Hirata <kazu@cs.umass.edu>
Wed, 3 Nov 2004 21:23:54 +0000 (21:23 +0000)
committerKazu Hirata <kazu@gcc.gnu.org>
Wed, 3 Nov 2004 21:23:54 +0000 (21:23 +0000)
* tree-phinodes.c (resize_phi_node): Copy only a portion of
the PHI node currently in use.

From-SVN: r90035

gcc/ChangeLog
gcc/tree-phinodes.c

index 5511a4bf95cd67bbccaed88f3421214dcb4cb946..3f19c86b739f612318c86d97df3377ed1de29729 100644 (file)
@@ -1,3 +1,8 @@
+2004-11-03  Kazu Hirata  <kazu@cs.umass.edu>
+
+       * tree-phinodes.c (resize_phi_node): Copy only a portion of
+       the PHI node currently in use.
+
 2004-11-03  Andrew Pinski  <pinskia@physics.uc.edu>
 
        PR tree-opt/18231
index ba46c7864599c25bfe583f017e933d853d0fa207..5c5be3f774245acac16ec59c7ab4967deb466f79 100644 (file)
@@ -254,9 +254,11 @@ resize_phi_node (tree *phi, int len)
 
   gcc_assert (len >= PHI_ARG_CAPACITY (*phi));
 
-  /* Note that OLD_SIZE is guaranteed to be smaller than SIZE.  */
+  /* The garbage collector will not look at the PHI node beyond the
+     first PHI_NUM_ARGS elements.  Therefore, all we have to copy is a
+     portion of the PHI node currently in use.  */
   old_size = (sizeof (struct tree_phi_node)
-            + (PHI_ARG_CAPACITY (*phi) - 1) * sizeof (struct phi_arg_d));
+            + (PHI_NUM_ARGS (*phi) - 1) * sizeof (struct phi_arg_d));
 
   new_phi = allocate_phi_node (len);