diff options
author | Geoffrey Keating <geoffk@apple.com> | 2003-09-04 19:48:22 +0000 |
---|---|---|
committer | Geoffrey Keating <geoffk@gcc.gnu.org> | 2003-09-04 19:48:22 +0000 |
commit | 1a9861e6292552cfef9fb0a9b59ce8ce9e596a15 (patch) | |
tree | 69d634a7730e9df14e91a4d51a6c844a166814eb /gcc/cp/tree.c | |
parent | 33d05111e79f43a85e169f38ac31bb2a5d8a1715 (diff) | |
download | gcc-1a9861e6292552cfef9fb0a9b59ce8ce9e596a15.zip gcc-1a9861e6292552cfef9fb0a9b59ce8ce9e596a15.tar.gz gcc-1a9861e6292552cfef9fb0a9b59ce8ce9e596a15.tar.bz2 |
re PR c++/12161 (ICE during bootstrap, locale-inst.c, cp/call.c: 4571)
PR 12161
* decl2.c (mark_used): Use ggc_push_context/ggc_pop_context.
* tree.c (cp_cannot_inline_tree_fn): Likewise.
From-SVN: r71084
Diffstat (limited to 'gcc/cp/tree.c')
-rw-r--r-- | gcc/cp/tree.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 71742a7..1dddad4 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -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; } |