From ac1b13f457ad72970d58b53ef88b45ddab522d41 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Wed, 8 Dec 2004 06:39:00 +0000 Subject: c-common.c (verify_tree): Don't check code length if we know we are handling tcc_unary. * c-common.c (verify_tree): Don't check code length if we know we are handling tcc_unary. * print_tree.c (print_node): Remove code to handle RTL appearing as a part of a tree node. * tree-gimple.c (recalculate_side_effects): Rename fro as len. * tree.c (build1_stat): Don't check TREE_CODE_LENGTH. (PROCESS_ARG): Don't refer to fro. (build2_stat, build3_stat, build4_stat): Don't compute fro. From-SVN: r91855 --- gcc/ChangeLog | 11 +++++++++++ gcc/c-common.c | 2 -- gcc/print-tree.c | 24 +++--------------------- gcc/tree-gimple.c | 4 ++-- gcc/tree.c | 12 ++---------- 5 files changed, 18 insertions(+), 35 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b03f62a..9c03269 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ +2004-12-08 Kazu Hirata + + * c-common.c (verify_tree): Don't check code length if we know + we are handling tcc_unary. + * print_tree.c (print_node): Remove code to handle RTL + appearing as a part of a tree node. + * tree-gimple.c (recalculate_side_effects): Rename fro as len. + * tree.c (build1_stat): Don't check TREE_CODE_LENGTH. + (PROCESS_ARG): Don't refer to fro. + (build2_stat, build3_stat, build4_stat): Don't compute fro. + 2004-12-07 Roger Sayle PR middle-end/18293 diff --git a/gcc/c-common.c b/gcc/c-common.c index 627911d4..a6f303b 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -1365,8 +1365,6 @@ verify_tree (tree x, struct tlist **pbefore_sp, struct tlist **pno_sp, Other non-expressions need not be processed. */ if (cl == tcc_unary) { - if (TREE_CODE_LENGTH (code) == 0) - return; x = TREE_OPERAND (x, 0); writer = 0; goto restart; diff --git a/gcc/print-tree.c b/gcc/print-tree.c index f47d21a..caba377 100644 --- a/gcc/print-tree.c +++ b/gcc/print-tree.c @@ -158,7 +158,6 @@ print_node (FILE *file, const char *prefix, tree node, int indent) enum machine_mode mode; enum tree_code_class class; int len; - int first_rtl; int i; expanded_location xloc; @@ -591,29 +590,12 @@ print_node (FILE *file, const char *prefix, tree node, int indent) len = TREE_CODE_LENGTH (TREE_CODE (node)); - /* Some nodes contain rtx's, not trees, - after a certain point. Print the rtx's as rtx's. */ - first_rtl = TREE_CODE_LENGTH (TREE_CODE (node)); - for (i = 0; i < len; i++) { - if (i >= first_rtl) - { - indent_to (file, indent + 4); - fprintf (file, "rtl %d ", i); - if (TREE_OPERAND (node, i)) - print_rtl (file, (rtx) TREE_OPERAND (node, i)); - else - fprintf (file, "(nil)"); - fprintf (file, "\n"); - } - else - { - char temp[10]; + char temp[10]; - sprintf (temp, "arg %d", i); - print_node (file, temp, TREE_OPERAND (node, i), indent + 4); - } + sprintf (temp, "arg %d", i); + print_node (file, temp, TREE_OPERAND (node, i), indent + 4); } print_node (file, "chain", TREE_CHAIN (node), indent + 4); diff --git a/gcc/tree-gimple.c b/gcc/tree-gimple.c index e1cbc33..0253676 100644 --- a/gcc/tree-gimple.c +++ b/gcc/tree-gimple.c @@ -443,7 +443,7 @@ void recalculate_side_effects (tree t) { enum tree_code code = TREE_CODE (t); - int fro = TREE_CODE_LENGTH (code); + int len = TREE_CODE_LENGTH (code); int i; switch (TREE_CODE_CLASS (code)) @@ -472,7 +472,7 @@ recalculate_side_effects (tree t) case tcc_binary: /* a binary arithmetic expression */ case tcc_reference: /* a reference */ TREE_SIDE_EFFECTS (t) = TREE_THIS_VOLATILE (t); - for (i = 0; i < fro; ++i) + for (i = 0; i < len; ++i) { tree op = TREE_OPERAND (t, i); if (op && TREE_SIDE_EFFECTS (op)) diff --git a/gcc/tree.c b/gcc/tree.c index 0ff686c..0b41c71 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -2495,7 +2495,7 @@ build1_stat (enum tree_code code, tree type, tree node MEM_STAT_DECL) TREE_COMPLEXITY (t) = 0; TREE_OPERAND (t, 0) = node; TREE_BLOCK (t) = NULL_TREE; - if (node && !TYPE_P (node) && TREE_CODE_LENGTH (code) != 0) + if (node && !TYPE_P (node)) { TREE_SIDE_EFFECTS (t) = TREE_SIDE_EFFECTS (node); TREE_READONLY (t) = TREE_READONLY (node); @@ -2551,7 +2551,7 @@ build1_stat (enum tree_code code, tree type, tree node MEM_STAT_DECL) #define PROCESS_ARG(N) \ do { \ TREE_OPERAND (t, N) = arg##N; \ - if (arg##N &&!TYPE_P (arg##N) && fro > N) \ + if (arg##N &&!TYPE_P (arg##N)) \ { \ if (TREE_SIDE_EFFECTS (arg##N)) \ side_effects = 1; \ @@ -2569,7 +2569,6 @@ build2_stat (enum tree_code code, tree tt, tree arg0, tree arg1 MEM_STAT_DECL) { bool constant, read_only, side_effects, invariant; tree t; - int fro; gcc_assert (TREE_CODE_LENGTH (code) == 2); @@ -2580,7 +2579,6 @@ build2_stat (enum tree_code code, tree tt, tree arg0, tree arg1 MEM_STAT_DECL) result based on those same flags for the arguments. But if the arguments aren't really even `tree' expressions, we shouldn't be trying to do this. */ - fro = TREE_CODE_LENGTH (code); /* Expressions without side effects may be constant if their arguments are as well. */ @@ -2610,15 +2608,12 @@ build3_stat (enum tree_code code, tree tt, tree arg0, tree arg1, { bool constant, read_only, side_effects, invariant; tree t; - int fro; gcc_assert (TREE_CODE_LENGTH (code) == 3); t = make_node_stat (code PASS_MEM_STAT); TREE_TYPE (t) = tt; - fro = TREE_CODE_LENGTH (code); - side_effects = TREE_SIDE_EFFECTS (t); PROCESS_ARG(0); @@ -2659,15 +2654,12 @@ build4_stat (enum tree_code code, tree tt, tree arg0, tree arg1, { bool constant, read_only, side_effects, invariant; tree t; - int fro; gcc_assert (TREE_CODE_LENGTH (code) == 4); t = make_node_stat (code PASS_MEM_STAT); TREE_TYPE (t) = tt; - fro = TREE_CODE_LENGTH (code); - side_effects = TREE_SIDE_EFFECTS (t); PROCESS_ARG(0); -- cgit v1.1