From patchwork Wed Oct 5 20:02:10 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Diego Novillo X-Patchwork-Id: 117912 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id F05EBB7010 for ; Thu, 6 Oct 2011 07:02:32 +1100 (EST) Received: (qmail 15486 invoked by alias); 5 Oct 2011 20:02:28 -0000 Received: (qmail 15468 invoked by uid 22791); 5 Oct 2011 20:02:27 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RP_MATCHES_RCVD, SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.44.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 05 Oct 2011 20:02:12 +0000 Received: from wpaz37.hot.corp.google.com (wpaz37.hot.corp.google.com [172.24.198.101]) by smtp-out.google.com with ESMTP id p95K2BEi019975; Wed, 5 Oct 2011 13:02:12 -0700 Received: from topo.tor.corp.google.com (topo.tor.corp.google.com [172.29.41.2]) by wpaz37.hot.corp.google.com with ESMTP id p95K2ArA025999; Wed, 5 Oct 2011 13:02:10 -0700 Received: by topo.tor.corp.google.com (Postfix, from userid 54752) id 2F5D91DA1A5; Wed, 5 Oct 2011 16:02:10 -0400 (EDT) To: reply@codereview.appspotmail.com, crowl@google.com, gcc-patches@gcc.gnu.org Subject: [pph] Fix template class tables streaming (issue5199041) Message-Id: <20111005200210.2F5D91DA1A5@topo.tor.corp.google.com> Date: Wed, 5 Oct 2011 16:02:10 -0400 (EDT) From: dnovillo@google.com (Diego Novillo) X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 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. --- This patch is available for review at http://codereview.appspot.com/5199041 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"