tree-gimple.c (right_assocify_expr): Kill

* 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.

From-SVN: r83940
This commit is contained in:
Richard Henderson 2004-06-30 17:01:23 -07:00 committed by Richard Henderson
parent 521d8de07f
commit 2b9ef4fa61
4 changed files with 5 additions and 76 deletions

View File

@ -1,5 +1,10 @@
2004-06-30 Richard Henderson <rth@redhat.com>
* 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.
* function.h (struct function): Remove x_last_parm_insn,
inl_last_parm_insn.
(last_parm_insn): Remove.

View File

@ -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

View File

@ -33,8 +33,6 @@ extern tree get_initialized_tmp_var (tree, tree *, tree *);
extern tree get_formal_tmp_var (tree, tree *);
extern void declare_tmp_vars (tree, tree);
extern tree rationalize_compound_expr (tree);
extern tree right_assocify_expr (tree);
extern void annotate_all_with_locus (tree *, location_t);
/* Validation of GIMPLE expressions. Note that these predicates only check

View File

@ -1652,10 +1652,6 @@ expand_call_inline (tree *tp, int *walk_subtrees, void *data)
{
tree save_decl;
/* Keep the new trees in gimple form. */
BIND_EXPR_BODY (expr)
= rationalize_compound_expr (BIND_EXPR_BODY (expr));
/* We want to create a new variable to hold the result of the inlined
body. This new variable needs to be added to the function which we
are inlining into, thus the saving and restoring of