This fixes the problem I described in http://gcc.gnu.org/ml/gcc-patches/2011-10/msg00376.html The tests are now failing assembly comparisons because the elements in these tables are emitted in different sequence in the pph and non-pph case. Other than that, the assembly produced is identical. Tested on x86_64. Committed to branch. Diego. cp/ChangeLog.pph * pt.c (reregister_specialization): Call htab_find_slot with NO_INSERT. testsuite/ChangeLog.pph * g++.dg/pph/x1tmplclass2.cc: Mark partially fixed. * g++.dg/pph/x4tmplclass2.cc: Likewise. * g++.dg/pph/z4tmplclass2.cc: Likewise. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 04e7767..2366dc9 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -1648,8 +1648,8 @@ reregister_specialization (tree spec, tree tinfo, tree new_spec) elt.args = TI_ARGS (tinfo); elt.spec = NULL_TREE; - slot = (spec_entry **) htab_find_slot (decl_specializations, &elt, INSERT); - if (*slot) + slot = (spec_entry **) htab_find_slot (decl_specializations, &elt, NO_INSERT); + if (slot && *slot) { gcc_assert ((*slot)->spec == spec || (*slot)->spec == new_spec); gcc_assert (new_spec != NULL_TREE); diff --git a/gcc/testsuite/g++.dg/pph/x1tmplclass2.cc b/gcc/testsuite/g++.dg/pph/x1tmplclass2.cc index f04335d..a254106 100644 --- a/gcc/testsuite/g++.dg/pph/x1tmplclass2.cc +++ b/gcc/testsuite/g++.dg/pph/x1tmplclass2.cc @@ -1,5 +1,3 @@ -// { dg-xfail-if "BOGUS" { "*-*-*" } { "-fpph-map=pph.map" } } -// { dg-bogus "x1tmplclass2.cc:1:0: internal compiler error: in pph_in_record_marker, at cp/pph-streamer.h" "" { xfail *-*-* } 0 } - +// pph asm xdiff 37711 #include "x0tmplclass23.h" #include "a0tmplclass2_u.h" diff --git a/gcc/testsuite/g++.dg/pph/x4tmplclass2.cc b/gcc/testsuite/g++.dg/pph/x4tmplclass2.cc index 585d4c0..e605e40 100644 --- a/gcc/testsuite/g++.dg/pph/x4tmplclass2.cc +++ b/gcc/testsuite/g++.dg/pph/x4tmplclass2.cc @@ -1,6 +1,4 @@ -// { dg-xfail-if "BOGUS" { "*-*-*" } { "-fpph-map=pph.map" } } -// { dg-bogus "x4tmplclass2.cc:1:0: internal compiler error: in pph_in_record_marker, at cp/pph-streamer.h" "" { xfail *-*-* } 0 } - +// pph asm xdiff 49533 #include "x0tmplclass21.h" #include "x0tmplclass22.h" #include "a0tmplclass2_u.h" diff --git a/gcc/testsuite/g++.dg/pph/z4tmplclass2.cc b/gcc/testsuite/g++.dg/pph/z4tmplclass2.cc index 0243829..d025942 100644 --- a/gcc/testsuite/g++.dg/pph/z4tmplclass2.cc +++ b/gcc/testsuite/g++.dg/pph/z4tmplclass2.cc @@ -1,6 +1,4 @@ -// { dg-xfail-if "BOGUS" { "*-*-*" } { "-fpph-map=pph.map" } } -// { dg-bogus "z4tmplclass2.cc:1:0: internal compiler error: in pph_in_record_marker, at cp/pph-streamer.h" "" { xfail *-*-* } 0 } - +// pph asm xdiff 59292 #include "x0tmplclass23.h" #include "x0tmplclass24.h" #include "a0tmplclass2_u.h" -- This patch is available for review at http://codereview.appspot.com/5199041