expr.c (expand_expr, [...]): Make sure cleanups live on the function_obstack as they...
authorMike Stump <mrs@gcc.gnu.org>
Tue, 16 Jan 1996 22:40:15 +0000 (22:40 +0000)
committerMike Stump <mrs@gcc.gnu.org>
Tue, 16 Jan 1996 22:40:15 +0000 (22:40 +0000)
* expr.c (expand_expr, case COND_EXPR): Make sure cleanups live on
the function_obstack as they are used by the exception handling code.
(defer_cleanups_to): Ditto.
(TRUTH_ANDIF_EXPR): Ditto.
(TRUTH_ORIF_EXPR): Ditto.
Fixes eh43.C

From-SVN: r11033

gcc/expr.c

index f2ed65c1277544f5006789881c42569e7b867f5a..941ee6cc2c4677d284532041348d4c3b505bcbf5 100644 (file)
@@ -6406,6 +6406,10 @@ expand_expr (exp, target, tmode, modifier)
            /* ??? deprecated, use sequences instead.  */
            reorder_insns (NEXT_INSN (last), get_last_insn (), dest_right_flag);
 
+           /* All cleanups must be on the function_obstack.  */
+           push_obstacks_nochange ();
+           resume_temporary_allocation ();
+
            /* convert flag, which is an rtx, into a tree. */
            cond = make_node (RTL_EXPR);
            TREE_TYPE (cond) = integer_type_node;
@@ -6422,6 +6426,8 @@ expand_expr (exp, target, tmode, modifier)
                                  left_cleanups, right_cleanups);
            new_cleanups = fold (new_cleanups);
 
+           pop_obstacks ();
+
            /* Now add in the conditionalized cleanups. */
            cleanups_this_call
              = tree_cons (NULL_TREE, new_cleanups, cleanups_this_call);
@@ -9156,6 +9162,10 @@ defer_cleanups_to (old_cleanups)
       /* reverse them so that we can build them in the right order.  */
       cleanups = nreverse (cleanups);
 
+      /* All cleanups must be on the function_obstack.  */
+      push_obstacks_nochange ();
+      resume_temporary_allocation ();
+
       while (cleanups)
        {
          if (new_cleanups)
@@ -9166,6 +9176,8 @@ defer_cleanups_to (old_cleanups)
 
          cleanups = TREE_CHAIN (cleanups);
        }
+
+      pop_obstacks ();
     }
 
   return new_cleanups;
@@ -9361,6 +9373,10 @@ do_jump (exp, if_false_label, if_true_label)
            emit_move_insn (flag, const1_rtx);
            emit_insns (seq2);
 
+           /* All cleanups must be on the function_obstack.  */
+           push_obstacks_nochange ();
+           resume_temporary_allocation ();
+
            /* convert flag, which is an rtx, into a tree. */
            cond = make_node (RTL_EXPR);
            TREE_TYPE (cond) = integer_type_node;
@@ -9373,6 +9389,8 @@ do_jump (exp, if_false_label, if_true_label)
                                  cleanups, integer_zero_node);
            new_cleanups = fold (new_cleanups);
 
+           pop_obstacks ();
+
            /* Now add in the conditionalized cleanups. */
            cleanups_this_call
              = tree_cons (NULL_TREE, new_cleanups, cleanups_this_call);
@@ -9419,6 +9437,10 @@ do_jump (exp, if_false_label, if_true_label)
            emit_move_insn (flag, const1_rtx);
            emit_insns (seq2);
 
+           /* All cleanups must be on the function_obstack.  */
+           push_obstacks_nochange ();
+           resume_temporary_allocation ();
+
            /* convert flag, which is an rtx, into a tree. */
            cond = make_node (RTL_EXPR);
            TREE_TYPE (cond) = integer_type_node;
@@ -9431,6 +9453,8 @@ do_jump (exp, if_false_label, if_true_label)
                                  cleanups, integer_zero_node);
            new_cleanups = fold (new_cleanups);
 
+           pop_obstacks ();
+
            /* Now add in the conditionalized cleanups. */
            cleanups_this_call
              = tree_cons (NULL_TREE, new_cleanups, cleanups_this_call);