On Thu, Dec 12, 2013 at 5:36 AM, Jakub Jelinek <ja...@redhat.com> wrote: > On Wed, Dec 11, 2013 at 11:51:55AM -0500, Jason Merrill wrote: >> It's only safe to free the targs if they weren't used to instantiate >> any templates, so I lean toward option #1. Did you test this with >> strict gc? > > Ok, after IRC discussion and another bootstrap/regtest I've installed > this variant instead: > > 2013-12-12 Jakub Jelinek <ja...@redhat.com> > > PR c++/58627 > * call.c (add_template_candidate_real): Don't call ggc_free on targs. > > --- gcc/cp/class.c.jj 2013-11-28 08:18:58.000000000 +0100 > +++ gcc/cp/class.c 2013-12-11 20:57:40.155059669 +0100 > @@ -7475,8 +7475,6 @@ resolve_address_of_overloaded_function ( > /* See if there's a match. */ > if (same_type_p (target_fn_type, static_fn_type (instantiation))) > matches = tree_cons (instantiation, fn, matches); > - > - ggc_free (targs); > } > > /* Now, remove all but the most specialized of the matches. */ >
Has this been checked in? I still see random: FAIL: 17_intro/headers/c++200x/stdc++.cc (test for excess errors) FAIL: 17_intro/headers/c++200x/stdc++_multiple_inclusion.cc (test for excess errors) http://gcc.gnu.org/ml/gcc-testresults/2013-12/msg01230.html -- H.J.