aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimplify.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2005-11-11 17:14:49 +0000
committerJason Merrill <jason@redhat.com>2005-11-11 17:14:49 +0000
commit101cee88f524abfdc6b90bfae79595fd1b8e0655 (patch)
tree31f98d4599a66a5410481c3cad61fa9efd5df0e1 /gcc/gimplify.c
parent9c0e676db424e5ee840dc8aa0c0ccca236e058e9 (diff)
PR c++/24686
* gimplify.c (gimplify_cleanup_point_expr): Also save and restore the cleanup list. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@106786 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r--gcc/gimplify.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 9e25aef25c2..b232112bea3 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -3810,14 +3810,18 @@ gimplify_cleanup_point_expr (tree *expr_p, tree *pre_p)
tree temp = voidify_wrapper_expr (*expr_p, NULL);
/* We only care about the number of conditions between the innermost
- CLEANUP_POINT_EXPR and the cleanup. So save and reset the count. */
+ CLEANUP_POINT_EXPR and the cleanup. So save and reset the count and
+ any cleanups collected outside the CLEANUP_POINT_EXPR. */
int old_conds = gimplify_ctxp->conditions;
+ tree old_cleanups = gimplify_ctxp->conditional_cleanups;
gimplify_ctxp->conditions = 0;
+ gimplify_ctxp->conditional_cleanups = NULL_TREE;
body = TREE_OPERAND (*expr_p, 0);
gimplify_to_stmt_list (&body);
gimplify_ctxp->conditions = old_conds;
+ gimplify_ctxp->conditional_cleanups = old_cleanups;
for (iter = tsi_start (body); !tsi_end_p (iter); )
{