diff options
author | Mark Mitchell <mark@codesourcery.com> | 2000-03-05 20:43:44 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2000-03-05 20:43:44 +0000 |
commit | 9f93702662f417705f1fc306ffbd078fef8abe02 (patch) | |
tree | 7b9b1d01cf0d4c4508ab5b483e757d3c608c3305 /gcc/function.c | |
parent | 591ccf92b35994b10f846ef630cd1a58d53a8f12 (diff) | |
download | gcc-9f93702662f417705f1fc306ffbd078fef8abe02.zip gcc-9f93702662f417705f1fc306ffbd078fef8abe02.tar.gz gcc-9f93702662f417705f1fc306ffbd078fef8abe02.tar.bz2 |
tree.def (RTL_EXPR): Update documentation.
* tree.def (RTL_EXPR): Update documentation.
* tree.h (RTL_EXPR_HAS_NO_SCOPE): New macro.
* expr.c (expand_expr): Handle RTL_EXPR_HAS_NO_SCOPE.
* function.c (preserve_rtl_expr_temp): New function.
(preserve_rtl_expr_temps): Likewise.
(preserve_rtl_expr_result): Use it.
From-SVN: r32344
Diffstat (limited to 'gcc/function.c')
-rw-r--r-- | gcc/function.c | 38 |
1 files changed, 33 insertions, 5 deletions
diff --git a/gcc/function.c b/gcc/function.c index 78c5ab8..fe7f61b 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -293,6 +293,7 @@ static void mark_function_chain PARAMS ((void *)); static void prepare_function_start PARAMS ((void)); static void do_clobber_return_reg PARAMS ((rtx, void *)); static void do_use_return_reg PARAMS ((rtx, void *)); +static void preserve_rtl_expr_temp PARAMS ((struct temp_slot *)); /* Pointer to chain of `struct function' for containing functions. */ struct function *outer_function_chain; @@ -1129,6 +1130,36 @@ preserve_temp_slots (x) p->level--; } +/* Preserve the temporary slot given by P (originally created during + the building of an RTL_EXPR) at least as long as things in our + current scope. */ + +static void +preserve_rtl_expr_temp (p) + struct temp_slot *p; +{ + /* Set the slot level to that of the currently prevailing scope. */ + p->level = MIN (p->level, temp_slot_level); + /* This slot is no longer associated with the RTL_EXPR from which it + originated. */ + p->rtl_expr = NULL_TREE; +} + +/* Preserve the temporary slots created during the building of the + RTL_EXPR given by T at least as long as things in our current + scope. */ + +void +preserve_rtl_expr_temps (t) + tree t; +{ + struct temp_slot *p; + + for (p = temp_slots; p; p = p->next) + if (p->in_use && p->rtl_expr == t) + preserve_rtl_expr_temp (p); +} + /* X is the result of an RTL_EXPR. If it is a temporary slot associated with that RTL_EXPR, promote it into a temporary slot at the present level so it will not be freed when we free slots made in the @@ -1148,11 +1179,8 @@ preserve_rtl_expr_result (x) /* If we can find a match, move it to our level unless it is already at an upper level. */ p = find_temp_slot_from_address (XEXP (x, 0)); - if (p != 0) - { - p->level = MIN (p->level, temp_slot_level); - p->rtl_expr = 0; - } + if (p) + preserve_rtl_expr_temp (p); return; } |