summaryrefslogtreecommitdiffstats
path: root/gcc/tree-phinodes.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-phinodes.c')
-rw-r--r--gcc/tree-phinodes.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/tree-phinodes.c b/gcc/tree-phinodes.c
index ba46c786459..5c5be3f7742 100644
--- a/gcc/tree-phinodes.c
+++ b/gcc/tree-phinodes.c
@@ -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);
OpenPOWER on IntegriCloud