aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@cygnus.com>1999-01-09 10:37:42 -0800
committerRichard Henderson <rth@gcc.gnu.org>1999-01-09 10:37:42 -0800
commitdfa27ef1db156b9c72a8f0a4164c507a613f5b6c (patch)
treee093a56744e204b091f418d279f1b78733259460 /gcc/tree.c
parentdfb31eec9d163d706940539f4a2b0375c752a107 (diff)
downloadgcc-dfa27ef1db156b9c72a8f0a4164c507a613f5b6c.zip
gcc-dfa27ef1db156b9c72a8f0a4164c507a613f5b6c.tar.gz
gcc-dfa27ef1db156b9c72a8f0a4164c507a613f5b6c.tar.bz2
tree.c (make_node): Call bzero instead of inline clear.
* tree.c (make_node): Call bzero instead of inline clear. (copy_node, make_tree_vec, build1): Likewise. (get_identifier): Call strlen instead of inline count. (maybe_get_identifier): Likewise. From-SVN: r24599
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c27
1 files changed, 6 insertions, 21 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 6cb3864..62d2a12 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -1071,19 +1071,13 @@ make_node (code)
}
t = (tree) obstack_alloc (obstack, length);
+ bzero (t, length);
#ifdef GATHER_STATISTICS
tree_node_counts[(int)kind]++;
tree_node_sizes[(int)kind] += length;
#endif
- /* Clear a word at a time. */
- for (i = (length / sizeof (int)) - 1; i >= 0; i--)
- ((int *) t)[i] = 0;
- /* Clear any extra bytes. */
- for (i = length / sizeof (int) * sizeof (int); i < length; i++)
- ((char *) t)[i] = 0;
-
TREE_SET_CODE (t, code);
if (obstack == &permanent_obstack)
TREE_PERMANENT (t) = 1;
@@ -1189,12 +1183,7 @@ copy_node (node)
}
t = (tree) obstack_alloc (current_obstack, length);
-
- for (i = (length / sizeof (int)) - 1; i >= 0; i--)
- ((int *) t)[i] = ((int *) node)[i];
- /* Clear any extra bytes. */
- for (i = length / sizeof (int) * sizeof (int); i < length; i++)
- ((char *) t)[i] = ((char *) node)[i];
+ bzero (t, length);
/* EXPR_WITH_FILE_LOCATION must keep filename info stored in TREE_CHAIN */
if (TREE_CODE (node) != EXPR_WITH_FILE_LOCATION)
@@ -1262,7 +1251,7 @@ get_identifier (text)
register int len, hash_len;
/* Compute length of text in len. */
- for (len = 0; text[len]; len++);
+ len = strlen (text);
/* Decide how much of that length to hash on */
hash_len = len;
@@ -1325,7 +1314,7 @@ maybe_get_identifier (text)
register int len, hash_len;
/* Compute length of text in len. */
- for (len = 0; text[len]; len++);
+ len = strlen (text);
/* Decide how much of that length to hash on */
hash_len = len;
@@ -1565,9 +1554,7 @@ make_tree_vec (len)
#endif
t = (tree) obstack_alloc (obstack, length);
-
- for (i = (length / sizeof (int)) - 1; i >= 0; i--)
- ((int *) t)[i] = 0;
+ bzero (t, length);
TREE_SET_CODE (t, TREE_VEC);
TREE_VEC_LENGTH (t) = len;
@@ -3074,15 +3061,13 @@ build1 (code, type, node)
length = sizeof (struct tree_exp);
t = (tree) obstack_alloc (obstack, length);
+ bzero (t, length);
#ifdef GATHER_STATISTICS
tree_node_counts[(int)kind]++;
tree_node_sizes[(int)kind] += length;
#endif
- for (i = (length / sizeof (int)) - 1; i >= 0; i--)
- ((int *) t)[i] = 0;
-
TREE_TYPE (t) = type;
TREE_SET_CODE (t, code);