diff options
author | Kazu Hirata <kazu@cs.umass.edu> | 2004-11-03 21:23:54 +0000 |
---|---|---|
committer | Kazu Hirata <kazu@gcc.gnu.org> | 2004-11-03 21:23:54 +0000 |
commit | 57f60923b282714a7a0cdc5965991b20fe07e5eb (patch) | |
tree | 5d8be87ff05ab3ae6b303c5d092a02370024ed73 | |
parent | 269b75261a0652b4c1d3a495ba0071941e344604 (diff) | |
download | gcc-57f60923b282714a7a0cdc5965991b20fe07e5eb.zip gcc-57f60923b282714a7a0cdc5965991b20fe07e5eb.tar.gz gcc-57f60923b282714a7a0cdc5965991b20fe07e5eb.tar.bz2 |
tree-phinodes.c (resize_phi_node): Copy only a portion of the PHI node currently in use.
* tree-phinodes.c (resize_phi_node): Copy only a portion of
the PHI node currently in use.
From-SVN: r90035
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/tree-phinodes.c | 6 |
2 files changed, 9 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5511a4b..3f19c86 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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 diff --git a/gcc/tree-phinodes.c b/gcc/tree-phinodes.c index ba46c78..5c5be3f 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); |