diff options
author | Mark Mitchell <mark@codesourcery.com> | 2000-05-01 05:50:40 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2000-05-01 05:50:40 +0000 |
commit | 738e281059b7bd0f19aec2f0a08d00598c9a7469 (patch) | |
tree | e41de7e1f2eea4b105de1a4b38766e800772579c /gcc/cp/expr.c | |
parent | e3fdc58a352cfb510340ae819be8f27b30af1206 (diff) | |
download | gcc-738e281059b7bd0f19aec2f0a08d00598c9a7469.zip gcc-738e281059b7bd0f19aec2f0a08d00598c9a7469.tar.gz gcc-738e281059b7bd0f19aec2f0a08d00598c9a7469.tar.bz2 |
expr.c (cplus_expand_expr): Preserve temporaries when expanding STMT_EXPRs.
* expr.c (cplus_expand_expr): Preserve temporaries when expanding
STMT_EXPRs.
* optimize.c (struct inline_data): Add target_exprs field.
(declare_return_variable): When a function returns an aggregate,
use the variable declared in the TARGET_EXPR as the remapped
DECL_RESULT.
(expand_call_inline): Update the pending target_exprs stack.
(optimize_function): Initialize the stack.
From-SVN: r33561
Diffstat (limited to 'gcc/cp/expr.c')
-rw-r--r-- | gcc/cp/expr.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/gcc/cp/expr.c b/gcc/cp/expr.c index ebf7c94..c47d390 100644 --- a/gcc/cp/expr.c +++ b/gcc/cp/expr.c @@ -143,10 +143,21 @@ cplus_expand_expr (exp, target, tmode, modifier) case STMT_EXPR: { - tree rtl_expr = expand_start_stmt_expr (); + tree rtl_expr; + rtx result; + + /* Since expand_expr_stmt calls free_temp_slots after every + expression statement, we must call push_temp_slots here. + Otherwise, any temporaries in use now would be considered + out-of-scope after the first EXPR_STMT from within the + STMT_EXPR. */ + push_temp_slots (); + rtl_expr = expand_start_stmt_expr (); expand_stmt (STMT_EXPR_STMT (exp)); expand_end_stmt_expr (rtl_expr); - return expand_expr (rtl_expr, target, tmode, modifier); + result = expand_expr (rtl_expr, target, tmode, modifier); + pop_temp_slots (); + return result; } break; |