Commit ac1b13f4 by Kazu Hirata Committed by Kazu Hirata

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
parent 7fd64ba3
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> 2004-12-07 Roger Sayle <roger@eyesopen.com>
PR middle-end/18293 PR middle-end/18293
......
...@@ -1365,8 +1365,6 @@ verify_tree (tree x, struct tlist **pbefore_sp, struct tlist **pno_sp, ...@@ -1365,8 +1365,6 @@ verify_tree (tree x, struct tlist **pbefore_sp, struct tlist **pno_sp,
Other non-expressions need not be processed. */ Other non-expressions need not be processed. */
if (cl == tcc_unary) if (cl == tcc_unary)
{ {
if (TREE_CODE_LENGTH (code) == 0)
return;
x = TREE_OPERAND (x, 0); x = TREE_OPERAND (x, 0);
writer = 0; writer = 0;
goto restart; goto restart;
......
...@@ -158,7 +158,6 @@ print_node (FILE *file, const char *prefix, tree node, int indent) ...@@ -158,7 +158,6 @@ print_node (FILE *file, const char *prefix, tree node, int indent)
enum machine_mode mode; enum machine_mode mode;
enum tree_code_class class; enum tree_code_class class;
int len; int len;
int first_rtl;
int i; int i;
expanded_location xloc; expanded_location xloc;
...@@ -591,30 +590,13 @@ print_node (FILE *file, const char *prefix, tree node, int indent) ...@@ -591,30 +590,13 @@ print_node (FILE *file, const char *prefix, tree node, int indent)
len = TREE_CODE_LENGTH (TREE_CODE (node)); 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++) 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); sprintf (temp, "arg %d", i);
print_node (file, temp, TREE_OPERAND (node, i), indent + 4); print_node (file, temp, TREE_OPERAND (node, i), indent + 4);
} }
}
print_node (file, "chain", TREE_CHAIN (node), indent + 4); print_node (file, "chain", TREE_CHAIN (node), indent + 4);
break; break;
......
...@@ -443,7 +443,7 @@ void ...@@ -443,7 +443,7 @@ void
recalculate_side_effects (tree t) recalculate_side_effects (tree t)
{ {
enum tree_code code = TREE_CODE (t); enum tree_code code = TREE_CODE (t);
int fro = TREE_CODE_LENGTH (code); int len = TREE_CODE_LENGTH (code);
int i; int i;
switch (TREE_CODE_CLASS (code)) switch (TREE_CODE_CLASS (code))
...@@ -472,7 +472,7 @@ recalculate_side_effects (tree t) ...@@ -472,7 +472,7 @@ recalculate_side_effects (tree t)
case tcc_binary: /* a binary arithmetic expression */ case tcc_binary: /* a binary arithmetic expression */
case tcc_reference: /* a reference */ case tcc_reference: /* a reference */
TREE_SIDE_EFFECTS (t) = TREE_THIS_VOLATILE (t); 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); tree op = TREE_OPERAND (t, i);
if (op && TREE_SIDE_EFFECTS (op)) if (op && TREE_SIDE_EFFECTS (op))
......
...@@ -2495,7 +2495,7 @@ build1_stat (enum tree_code code, tree type, tree node MEM_STAT_DECL) ...@@ -2495,7 +2495,7 @@ build1_stat (enum tree_code code, tree type, tree node MEM_STAT_DECL)
TREE_COMPLEXITY (t) = 0; TREE_COMPLEXITY (t) = 0;
TREE_OPERAND (t, 0) = node; TREE_OPERAND (t, 0) = node;
TREE_BLOCK (t) = NULL_TREE; 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_SIDE_EFFECTS (t) = TREE_SIDE_EFFECTS (node);
TREE_READONLY (t) = TREE_READONLY (node); TREE_READONLY (t) = TREE_READONLY (node);
...@@ -2551,7 +2551,7 @@ build1_stat (enum tree_code code, tree type, tree node MEM_STAT_DECL) ...@@ -2551,7 +2551,7 @@ build1_stat (enum tree_code code, tree type, tree node MEM_STAT_DECL)
#define PROCESS_ARG(N) \ #define PROCESS_ARG(N) \
do { \ do { \
TREE_OPERAND (t, N) = arg##N; \ 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)) \ if (TREE_SIDE_EFFECTS (arg##N)) \
side_effects = 1; \ side_effects = 1; \
...@@ -2569,7 +2569,6 @@ build2_stat (enum tree_code code, tree tt, tree arg0, tree arg1 MEM_STAT_DECL) ...@@ -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; bool constant, read_only, side_effects, invariant;
tree t; tree t;
int fro;
gcc_assert (TREE_CODE_LENGTH (code) == 2); 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) ...@@ -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 result based on those same flags for the arguments. But if the
arguments aren't really even `tree' expressions, we shouldn't be trying arguments aren't really even `tree' expressions, we shouldn't be trying
to do this. */ to do this. */
fro = TREE_CODE_LENGTH (code);
/* Expressions without side effects may be constant if their /* Expressions without side effects may be constant if their
arguments are as well. */ arguments are as well. */
...@@ -2610,15 +2608,12 @@ build3_stat (enum tree_code code, tree tt, tree arg0, tree arg1, ...@@ -2610,15 +2608,12 @@ build3_stat (enum tree_code code, tree tt, tree arg0, tree arg1,
{ {
bool constant, read_only, side_effects, invariant; bool constant, read_only, side_effects, invariant;
tree t; tree t;
int fro;
gcc_assert (TREE_CODE_LENGTH (code) == 3); gcc_assert (TREE_CODE_LENGTH (code) == 3);
t = make_node_stat (code PASS_MEM_STAT); t = make_node_stat (code PASS_MEM_STAT);
TREE_TYPE (t) = tt; TREE_TYPE (t) = tt;
fro = TREE_CODE_LENGTH (code);
side_effects = TREE_SIDE_EFFECTS (t); side_effects = TREE_SIDE_EFFECTS (t);
PROCESS_ARG(0); PROCESS_ARG(0);
...@@ -2659,15 +2654,12 @@ build4_stat (enum tree_code code, tree tt, tree arg0, tree arg1, ...@@ -2659,15 +2654,12 @@ build4_stat (enum tree_code code, tree tt, tree arg0, tree arg1,
{ {
bool constant, read_only, side_effects, invariant; bool constant, read_only, side_effects, invariant;
tree t; tree t;
int fro;
gcc_assert (TREE_CODE_LENGTH (code) == 4); gcc_assert (TREE_CODE_LENGTH (code) == 4);
t = make_node_stat (code PASS_MEM_STAT); t = make_node_stat (code PASS_MEM_STAT);
TREE_TYPE (t) = tt; TREE_TYPE (t) = tt;
fro = TREE_CODE_LENGTH (code);
side_effects = TREE_SIDE_EFFECTS (t); side_effects = TREE_SIDE_EFFECTS (t);
PROCESS_ARG(0); PROCESS_ARG(0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment