re PR c++/24686 (ICE when building a variation of NMSTL)
authorJason Merrill <jason@redhat.com>
Fri, 11 Nov 2005 17:14:49 +0000 (12:14 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Fri, 11 Nov 2005 17:14:49 +0000 (12:14 -0500)
        PR c++/24686
        * gimplify.c (gimplify_cleanup_point_expr): Also save and restore
        the cleanup list.

From-SVN: r106786

gcc/ChangeLog
gcc/gimplify.c

index c9f0917d50b15f77a525c45b5a83e52ba9dba9dd..7a871c4a26bbaa9233d593a17a0315fe1d89270b 100644 (file)
@@ -1,3 +1,9 @@
+2005-11-11  Jason Merrill  <jason@redhat.com>
+
+       PR c++/24686
+       * gimplify.c (gimplify_cleanup_point_expr): Also save and restore 
+       the cleanup list.
+
 2005-11-11  Zdenek Dvorak  <dvorakz@suse.cz>
 
        PR rtl-optimization/22509
index 9e25aef25c2de92915d270f3217b66bfc0ca31c3..b232112bea3ff95731e6b0c0486bee2e77d594af 100644 (file)
@@ -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); )
     {