diff options
author | Mark Mitchell <mark@codesourcery.com> | 2002-04-17 01:47:36 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2002-04-17 01:47:36 +0000 |
commit | b2123dc0d8b3c18313c9aae7bddf57af0b4a6bf7 (patch) | |
tree | 945ba924fcaf4c9312b124d4f9724e8c510bc166 /gcc/c-common.c | |
parent | f0871dfe8ff3366c0404f151a722fc5de3f614c7 (diff) | |
download | gcc-b2123dc0d8b3c18313c9aae7bddf57af0b4a6bf7.zip gcc-b2123dc0d8b3c18313c9aae7bddf57af0b4a6bf7.tar.gz gcc-b2123dc0d8b3c18313c9aae7bddf57af0b4a6bf7.tar.bz2 |
c-common.h (STMT_EXPR_NO_SCOPE): New macro.
* c-common.h (STMT_EXPR_NO_SCOPE): New macro.
* c-common.c (c_expand_expr): Respect STMT_EXPR_NO_SCOPE.
* tree.h (expand_start_stmt_expr): Update prototype.
* stmt.c (expand_start_stmt_expr): Add has_scope parameter.
* tree-inline.c (expand_call_inline): Set STMT_EXPR_NO_SCOPE
on the STMT_EXPR created for the inline function.
* trans.c (tree_transform): Add has_scope argument to
expand_start_stmt_expr.
* com.c (ffecom_expr_power_integer): Add has_scope argument to
call to expand_start_stmt_expr.
* init.c (begin_init_stmts): Remove commented out code.
(finish_init_stmts): Set STMT_EXPR_NO_SCOPE.
* semantics.c (begin_gobal_stmt_expr): Adjust call to
expand_start_stmt_expr.
From-SVN: r52395
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r-- | gcc/c-common.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c index 79dab3f..1e7a065 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -3666,7 +3666,7 @@ c_expand_expr (exp, target, tmode, modifier) out-of-scope after the first EXPR_STMT from within the STMT_EXPR. */ push_temp_slots (); - rtl_expr = expand_start_stmt_expr (); + rtl_expr = expand_start_stmt_expr (!STMT_EXPR_NO_SCOPE (exp)); /* If we want the result of this expression, find the last EXPR_STMT in the COMPOUND_STMT and mark it as addressable. */ @@ -3703,6 +3703,12 @@ c_expand_expr (exp, target, tmode, modifier) preserve_temp_slots (result); } + /* If the statment-expression does not have a scope, then the + new temporaries we created within it must live beyond the + statement-expression. */ + if (STMT_EXPR_NO_SCOPE (exp)) + preserve_temp_slots (NULL_RTX); + pop_temp_slots (); return result; } |