summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>2004-10-29 14:05:43 +0000
committerkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>2004-10-29 14:05:43 +0000
commitebfac782ee8b6eba04e02969ce46e3d402ed297e (patch)
treef850779f7e0847588424ea3a7b14bd3e933cc19d
parent9eb0191ea203f5ceebe503ee90d2aebe8ded254d (diff)
downloadgcc-ebfac782ee8b6eba04e02969ce46e3d402ed297e.tar.gz
* tree-phinodes.c (make_phi_node, resize_phi_node): Don't zero
the whole PHI node. * tree.h (tree_phi_node): Tell the garbage collector to chase num_args arguments. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@89844 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/tree-phinodes.c17
-rw-r--r--gcc/tree.h2
3 files changed, 15 insertions, 11 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b88ed384f1c..fb4b35c51f2 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2004-10-29 Kazu Hirata <kazu@cs.umass.edu>
+
+ * tree-phinodes.c (make_phi_node, resize_phi_node): Don't zero
+ the whole PHI node.
+ * tree.h (tree_phi_node): Tell the garbage collector to chase
+ num_args arguments.
+
2004-10-29 Richard Earnshaw <rearnsha@arm.com>
* opts.c (decode_options): Lower the crossjump threshold for -Os.
diff --git a/gcc/tree-phinodes.c b/gcc/tree-phinodes.c
index 1cc613cc4af..f45479e1708 100644
--- a/gcc/tree-phinodes.c
+++ b/gcc/tree-phinodes.c
@@ -199,7 +199,12 @@ make_phi_node (tree var, int len)
}
- memset (phi, 0, size);
+ /* We do not have to clear a part of the PHI node that stores PHI
+ arguments, which is safe because we tell the garbage collector to
+ scan up to num_args elements in the array of PHI arguments. In
+ other words, the garbage collector will not follow garbage
+ pointers in the unused portion of the array. */
+ memset (phi, 0, sizeof (struct tree_phi_node) - sizeof (struct phi_arg_d));
TREE_SET_CODE (phi, PHI_NODE);
PHI_ARG_CAPACITY (phi) = len;
TREE_TYPE (phi) = TREE_TYPE (var);
@@ -234,7 +239,7 @@ resize_phi_node (tree *phi, int len)
{
int size, old_size;
tree new_phi;
- int i, old_len, bucket = NUM_BUCKETS - 2;
+ int bucket = NUM_BUCKETS - 2;
gcc_assert (len >= PHI_ARG_CAPACITY (*phi));
@@ -271,16 +276,8 @@ resize_phi_node (tree *phi, int len)
memcpy (new_phi, *phi, old_size);
- old_len = PHI_ARG_CAPACITY (new_phi);
PHI_ARG_CAPACITY (new_phi) = len;
- for (i = old_len; i < len; i++)
- {
- SET_PHI_ARG_DEF (new_phi, i, NULL_TREE);
- PHI_ARG_EDGE (new_phi, i) = NULL;
- PHI_ARG_NONZERO (new_phi, i) = false;
- }
-
*phi = new_phi;
}
diff --git a/gcc/tree.h b/gcc/tree.h
index 9f74ef9cd98..001c967178e 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -1405,7 +1405,7 @@ struct tree_phi_node GTY(())
/* Dataflow information. */
struct dataflow_d *df;
- struct phi_arg_d GTY ((length ("((tree)&%h)->phi.capacity"))) a[1];
+ struct phi_arg_d GTY ((length ("((tree)&%h)->phi.num_args"))) a[1];
};