aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorZack Weinberg <zack@gcc.gnu.org>2000-06-09 21:47:40 +0000
committerZack Weinberg <zack@gcc.gnu.org>2000-06-09 21:47:40 +0000
commitf8a83ee3a90a5da4bbb83dd424e54028b033efb7 (patch)
treec3287938dc002562d04b768dfaa35a310e1a8fc3 /gcc/tree.c
parentfe06b6968b5d88aa4785716043233a864774f374 (diff)
downloadgcc-f8a83ee3a90a5da4bbb83dd424e54028b033efb7.zip
gcc-f8a83ee3a90a5da4bbb83dd424e54028b033efb7.tar.gz
gcc-f8a83ee3a90a5da4bbb83dd424e54028b033efb7.tar.bz2
ggc-none.c, [...] (ggc_alloc_obj): Rename it ggc_alloc, drop second argument, never clear returned memory.
toplevel: * ggc-none.c, ggc-simple.c, ggc-page.c (ggc_alloc_obj): Rename it ggc_alloc, drop second argument, never clear returned memory. * ggc-common.c (ggc_alloc_string): Use ggc_alloc. (ggc_alloc_cleared): New. * ggc.h: Prototype ggc_alloc and ggc_alloc_cleared, not ggc_alloc_obj. Remove ggc_alloc macro. (ggc_alloc_rtx, ggc_alloc_rtvec, ggc_alloc_tree): Use ggc_alloc. * rtl.c (rtvec_alloc): Clear the vector always. (rtx_alloc): Clear the first word always. Remove dirty obstack tricks (this routine is no longer a bottleneck). * tree.c (make_node): Clear the new node always. (make_tree_vec): Likewise. (tree_cons): Clear the common structure always. (build1): Likewise; also, clear TREE_COMPLEXITY. * gengenrtl.c: Use puts wherever possible. Remove extra newlines. (gendef): Clear the first word of an RTX in the generator function, irrespective of ggc_p. Initialize '0' slots to NULL. (genlegend): Don't generate obstack_alloc_rtx routine, just a thin wrapper macro around obstack_alloc. * stmt.c (expand_fixup): Use ggc_alloc. * c-typeck.c (add_pending_init): Use ggc_alloc. * emit-rtl.c (init_emit_once): Clear CONST_DOUBLE_CHAIN(tem). * varasm.c (immed_double_const): Set CONST_DOUBLE_MEM(r) to const0_rtx when it is created. (immed_real_const_1): Set CONST_DOUBLE_CHAIN(r) to NULL_RTX if we are not in a function. * tree.c (tree_class_check_failed): Make second arg an int. * tree.h: Update prototype. cp: * call.c (add_candidate): Use ggc_alloc_cleared. * decl.c (lookup_label): Likewise. * lex.c (retrofit_lang_decl): Likewise. From-SVN: r34478
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c32
1 files changed, 14 insertions, 18 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 9eee62b..1032403 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -1041,10 +1041,9 @@ make_node (code)
if (ggc_p)
t = ggc_alloc_tree (length);
else
- {
- t = (tree) obstack_alloc (obstack, length);
- memset ((PTR) t, 0, length);
- }
+ t = (tree) obstack_alloc (obstack, length);
+
+ memset ((PTR) t, 0, length);
#ifdef GATHER_STATISTICS
tree_node_counts[(int)kind]++;
@@ -1604,11 +1603,9 @@ make_tree_vec (len)
if (ggc_p)
t = ggc_alloc_tree (length);
else
- {
- t = (tree) obstack_alloc (obstack, length);
- bzero ((PTR) t, length);
- }
+ t = (tree) obstack_alloc (obstack, length);
+ memset ((PTR) t, 0, length);
TREE_SET_CODE (t, TREE_VEC);
TREE_VEC_LENGTH (t) = len;
TREE_SET_PERMANENT (t);
@@ -2164,10 +2161,9 @@ tree_cons (purpose, value, chain)
if (ggc_p)
node = ggc_alloc_tree (sizeof (struct tree_list));
else
- {
- node = (tree) obstack_alloc (current_obstack, sizeof (struct tree_list));
- memset (node, 0, sizeof (struct tree_common));
- }
+ node = (tree) obstack_alloc (current_obstack, sizeof (struct tree_list));
+
+ memset (node, 0, sizeof (struct tree_common));
#ifdef GATHER_STATISTICS
tree_node_counts[(int) x_kind]++;
@@ -3384,20 +3380,20 @@ build1 (code, type, node)
if (ggc_p)
t = ggc_alloc_tree (length);
else
- {
- t = (tree) obstack_alloc (obstack, length);
- memset ((PTR) t, 0, length);
- }
+ t = (tree) obstack_alloc (obstack, length);
+
+ memset ((PTR) t, 0, sizeof (struct tree_common));
#ifdef GATHER_STATISTICS
tree_node_counts[(int)kind]++;
tree_node_sizes[(int)kind] += length;
#endif
- TREE_TYPE (t) = type;
TREE_SET_CODE (t, code);
TREE_SET_PERMANENT (t);
+ TREE_TYPE (t) = type;
+ TREE_COMPLEXITY (t) = 0;
TREE_OPERAND (t, 0) = node;
if (node && first_rtl_op (code) != 0 && TREE_SIDE_EFFECTS (node))
TREE_SIDE_EFFECTS (t) = 1;
@@ -5599,7 +5595,7 @@ tree_check_failed (node, code, file, line, function)
void
tree_class_check_failed (node, cl, file, line, function)
const tree node;
- char cl;
+ int cl;
const char *file;
int line;
const char *function;