re PR c++/12161 (ICE during bootstrap, locale-inst.c, cp/call.c: 4571)
authorGeoffrey Keating <geoffk@apple.com>
Thu, 4 Sep 2003 19:48:22 +0000 (19:48 +0000)
committerGeoffrey Keating <geoffk@gcc.gnu.org>
Thu, 4 Sep 2003 19:48:22 +0000 (19:48 +0000)
PR 12161
* decl2.c (mark_used): Use ggc_push_context/ggc_pop_context.
* tree.c (cp_cannot_inline_tree_fn): Likewise.

From-SVN: r71084

gcc/cp/ChangeLog
gcc/cp/decl2.c
gcc/cp/tree.c

index 3c3112dc5252b2cba13eab694c216c7a1f2e538e..ca8ea06d7fc8a6937b9973b1e22e796ed6cfdca4 100644 (file)
@@ -1,3 +1,9 @@
+2003-09-02  Geoffrey Keating  <geoffk@apple.com>
+
+       PR 12161
+       * decl2.c (mark_used): Use ggc_push_context/ggc_pop_context.
+       * tree.c (cp_cannot_inline_tree_fn): Likewise.
+
 2003-09-04  Nathan Sidwell  <nathan@codesourcery.com>
 
        * cp-tree.h (finish_sizeof, finish_alignof): Remove.
index d74f2907424eeaa8db7c14ddf188bd1dcab1d6b4..7ca20c8ef309f7fd52b7a2249f6e3c0d19a192aa 100644 (file)
@@ -4226,7 +4226,10 @@ mark_used (tree decl)
                  information.  */
               || cp_function_chain->can_throw);
 
+      /* Our caller is likely to have lots of data on the stack.  */
+      ggc_push_context ();
       instantiate_decl (decl, defer);
+      ggc_pop_context ();
     }
 }
 
index 71742a7bba7bb949e65598a8abe5405d6a6dd0ba..1dddad4933d618dda66f0cc5ea659a6c19cf8edc 100644 (file)
@@ -1992,7 +1992,16 @@ cp_cannot_inline_tree_fn (tree* fnp)
       if (!DECL_INLINE (DECL_TEMPLATE_RESULT 
                        (template_for_substitution (fn))))
        return 1;
+
+      /* Our caller does not expect us to call ggc_collect, but
+        instantiate_decl can call rest_of_compilation so we must
+        protect our caller.  */
+      ggc_push_context();
+      
       fn = *fnp = instantiate_decl (fn, /*defer_ok=*/0);
+
+      ggc_pop_context();
+
       if (TI_PENDING_TEMPLATE_FLAG (DECL_TEMPLATE_INFO (fn)))
        return 1;
     }