summaryrefslogtreecommitdiff
path: root/gcc/tree-gimple.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2004-07-01 00:01:23 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2004-07-01 00:01:23 +0000
commita0bff9d0752f5c992b3825644d53cf58f8567f85 (patch)
tree15e0d7f1b9088b09a8c4a105e75791fa3a879647 /gcc/tree-gimple.c
parent63e104a6778136736657ccdf5d33f95f61ea7505 (diff)
downloadgcc-a0bff9d0752f5c992b3825644d53cf58f8567f85.tar.gz
* tree-gimple.c (right_assocify_expr): Kill
(rationalize_compound_expr): Kill. * tree-gimple.h: Likewise. * tree-inline.c (expand_call_inline): Don't call it. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@83940 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-gimple.c')
-rw-r--r--gcc/tree-gimple.c70
1 files changed, 0 insertions, 70 deletions
diff --git a/gcc/tree-gimple.c b/gcc/tree-gimple.c
index b1f08dfee4a..4d209ec8c8e 100644
--- a/gcc/tree-gimple.c
+++ b/gcc/tree-gimple.c
@@ -524,76 +524,6 @@ get_call_expr_in (tree t)
return NULL_TREE;
}
-
-/* Given an _EXPR TOP, reorganize all of the nested _EXPRs with the same
- code so that they only appear as the second operand. This should only
- be used for tree codes which are truly associative, such as
- COMPOUND_EXPR and TRUTH_ANDIF_EXPR. Arithmetic is not associative
- enough, due to the limited precision of arithmetic data types.
-
- This transformation is conservative; the operand 0 of a matching tree
- node will only change if it is also a matching node. */
-
-tree
-right_assocify_expr (tree top)
-{
- tree *p = &top;
- enum tree_code code = TREE_CODE (*p);
- while (TREE_CODE (*p) == code)
- {
- tree cur = *p;
- tree lhs = TREE_OPERAND (cur, 0);
- if (TREE_CODE (lhs) == code)
- {
- /* There's a left-recursion. If we have ((a, (b, c)), d), we
- want to rearrange to (a, (b, (c, d))). */
- tree *q;
-
- /* Replace cur with the lhs; move (a, *) up. */
- *p = lhs;
-
- if (code == COMPOUND_EXPR)
- {
- /* We need to give (b, c) the type of c; previously lhs had
- the type of b. */
- TREE_TYPE (lhs) = TREE_TYPE (cur);
- if (TREE_SIDE_EFFECTS (cur))
- TREE_SIDE_EFFECTS (lhs) = 1;
- }
-
- /* Walk through the op1 chain from there until we find something
- with a different code. In this case, c. */
- for (q = &TREE_OPERAND (lhs, 1); TREE_CODE (*q) == code;
- q = &TREE_OPERAND (*q, 1))
- TREE_TYPE (*q) = TREE_TYPE (cur);
-
- /* Change (*, d) into (c, d). */
- TREE_OPERAND (cur, 0) = *q;
-
- /* And plug it in where c used to be. */
- *q = cur;
- }
- else
- p = &TREE_OPERAND (cur, 1);
- }
- return top;
-}
-
-/* Normalize the statement TOP. If it is a COMPOUND_EXPR, reorganize it so
- that we can traverse it without recursion. If it is null, replace it
- with a nop. */
-
-tree
-rationalize_compound_expr (tree top)
-{
- if (top == NULL_TREE)
- top = build_empty_stmt ();
- else if (TREE_CODE (top) == COMPOUND_EXPR)
- top = right_assocify_expr (top);
-
- return top;
-}
-
/* Given a memory reference expression, return the base address. Note that,
in contrast with get_base_var, this will not recurse inside INDIRECT_REF
expressions. Therefore, given the reference PTR->FIELD, this function