From 2b9ef4fa61d2ad90cbca7baa59ce18f609a56274 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Wed, 30 Jun 2004 17:01:23 -0700 Subject: [PATCH] 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 --- gcc/ChangeLog | 5 ++++ gcc/tree-gimple.c | 70 ----------------------------------------------- gcc/tree-gimple.h | 2 -- gcc/tree-inline.c | 4 --- 4 files changed, 5 insertions(+), 76 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 202621ba2d8..5ea91872bf5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2004-06-30 Richard Henderson + * 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. 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 = ⊤ - 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 diff --git a/gcc/tree-gimple.h b/gcc/tree-gimple.h index 3be53891346..8fb22710516 100644 --- a/gcc/tree-gimple.h +++ b/gcc/tree-gimple.h @@ -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 diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index ed2afeec2e0..aa579c34186 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -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 -- 2.30.2