aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog11
-rw-r--r--gcc/c-common.c2
-rw-r--r--gcc/print-tree.c24
-rw-r--r--gcc/tree-gimple.c4
-rw-r--r--gcc/tree.c12
5 files changed, 18 insertions, 35 deletions
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 <kazu@cs.umass.edu>
+
+ * 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 <roger@eyesopen.com>
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);