+ /* All cleanups must be on the function_obstack. */
+ push_obstacks_nochange ();
+ resume_temporary_allocation ();
+
+ cond = build_decl (VAR_DECL, NULL_TREE, type_for_mode (word_mode, 1));
+ DECL_RTL (cond) = flag;
+
+ /* Conditionalize the cleanup. */
+ cleanup = build (COND_EXPR, void_type_node,
+ truthvalue_conversion (cond),
+ cleanup, integer_zero_node);
+ cleanup = fold (cleanup);
+
+ pop_obstacks ();
+
+ cleanups = thisblock->data.block.cleanup_ptr;
+ }
+
+ /* All cleanups must be on the function_obstack. */
+ push_obstacks_nochange ();
+ resume_temporary_allocation ();
+ cleanup = unsave_expr (cleanup);
+ pop_obstacks ();
+
+ t = *cleanups = temp_tree_cons (decl, cleanup, *cleanups);
+
+ if (! cond_context)
+ /* If this block has a cleanup, it belongs in stack_block_stack. */
+ stack_block_stack = thisblock;
+
+ if (cond_context)
+ {
+ start_sequence ();
+ }
+
+ /* If this was optimized so that there is no exception region for the
+ cleanup, then mark the TREE_LIST node, so that we can later tell
+ if we need to call expand_eh_region_end. */
+ if (! using_eh_for_cleanups_p
+ || expand_eh_region_start_tree (decl, cleanup))
+ TREE_ADDRESSABLE (t) = 1;
+ /* If that started a new EH region, we're in a new block. */
+ thisblock = block_stack;
+
+ if (cond_context)
+ {
+ seq = get_insns ();
+ end_sequence ();
+ if (seq)
+ thisblock->data.block.last_unconditional_cleanup
+ = emit_insns_after (seq,
+ thisblock->data.block.last_unconditional_cleanup);
+ }
+ else
+ {
+ thisblock->data.block.last_unconditional_cleanup
+ = get_last_insn ();
+ thisblock->data.block.cleanup_ptr = &thisblock->data.block.cleanups;
+ }
+ }
+ return 1;
+}
+
+/* Like expand_decl_cleanup, but suppress generating an exception handler
+ to perform the cleanup. */
+
+int
+expand_decl_cleanup_no_eh (decl, cleanup)
+ tree decl, cleanup;
+{
+ int save_eh = using_eh_for_cleanups_p;
+ int result;