diff options
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; } |