summaryrefslogtreecommitdiff
path: root/gcc/ggc-common.c
diff options
context:
space:
mode:
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>2000-05-27 15:21:17 +0000
committerRichard Kenner <kenner@gcc.gnu.org>2000-05-27 11:21:17 -0400
commit8d5e6e2527f07e6cfda3b62f1fd826006931d551 (patch)
treee4055b6cf63a0bcf4381fb7092adf5db521626a7 /gcc/ggc-common.c
parent0777f60c79e32b504c03b6a703d6833ca6bc91c5 (diff)
downloadgcc-8d5e6e2527f07e6cfda3b62f1fd826006931d551.tar.gz
tree.h (TREE_CODE_LENGTH): New macro.
* tree.h (TREE_CODE_LENGTH): New macro. * c-common.c (c_find_base_decl): Use it. * expr.c (safe_from_p): Likewise. * print-tree.c (print_node): Likewise. * tree.c (make_node, copy_node, get_identifier): Likewie. (first_rtl_op, contains_placeholder_p, substitute_in_expr): Likewise. (build, build_nt, build_parse_node, simple_cst_equal): Likewise. * fold-const.c (make_range): Likewise. (fold): Likewise; also use first_rtl_op. * c-iterate.c (collect_iterators): Use first_rtl_op. * calls.c (calls_function_1): Likewise; also rename TYPE to CLASS. Use IS_EXPR_CODE_CLASS. (preexpand_calls): Likewise. * ggc-common.c (ggc_mark_trees): Rework to use first_rtl_op and TREE_CODE_LENGTH. * stmt.c (warn_if_unused_value): If no operands, no unused value. * ch/lang.c (deep_const_expr): Use first_rtl_op. * ch/satisfy.c (satisfy): Use TREE_CODE_LENGTH. * cp/method.c (mangle_expression): Use TREE_CODE_LENGTH. * cp/tree.c (break_out_calls, build_min_nt): Use TREE_CODE_LENGTH. (built_min, cp_tree_equal): Likewise. From-SVN: r34203
Diffstat (limited to 'gcc/ggc-common.c')
-rw-r--r--gcc/ggc-common.c31
1 files changed, 11 insertions, 20 deletions
diff --git a/gcc/ggc-common.c b/gcc/ggc-common.c
index b70852e9324..74b554702f7 100644
--- a/gcc/ggc-common.c
+++ b/gcc/ggc-common.c
@@ -348,28 +348,12 @@ ggc_mark_trees ()
case TREE_VEC:
{
int i = TREE_VEC_LENGTH (t);
+
while (--i >= 0)
ggc_mark_tree (TREE_VEC_ELT (t, i));
continue;
}
- case SAVE_EXPR:
- ggc_mark_tree (TREE_OPERAND (t, 0));
- ggc_mark_tree (SAVE_EXPR_CONTEXT (t));
- ggc_mark_rtx (SAVE_EXPR_RTL (t));
- continue;
-
- case RTL_EXPR:
- ggc_mark_rtx (RTL_EXPR_SEQUENCE (t));
- ggc_mark_rtx (RTL_EXPR_RTL (t));
- continue;
-
- case CALL_EXPR:
- ggc_mark_tree (TREE_OPERAND (t, 0));
- ggc_mark_tree (TREE_OPERAND (t, 1));
- ggc_mark_rtx (CALL_EXPR_RTL (t));
- continue;
-
case COMPLEX_CST:
ggc_mark_tree (TREE_REALPART (t));
ggc_mark_tree (TREE_IMAGPART (t));
@@ -450,10 +434,17 @@ ggc_mark_trees ()
case 'r': case '<': case '1':
case '2': case 'e': case 's': /* Expressions. */
{
- int i = tree_code_length[TREE_CODE (t)];
+ int i = TREE_CODE_LENGTH (TREE_CODE (t));
+ int first_rtl = first_rtl_op (TREE_CODE (t));
+
while (--i >= 0)
- ggc_mark_tree (TREE_OPERAND (t, i));
- break;
+ {
+ if (i >= first_rtl)
+ ggc_mark_rtx ((rtx) TREE_OPERAND (t, i));
+ else
+ ggc_mark_tree (TREE_OPERAND (t, i));
+ }
+ break;
}
case 'x':