From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 66471 invoked by alias); 11 Jan 2016 23:53:07 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 66452 invoked by uid 89); 11 Jan 2016 23:53:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=no version=3.3.2 spammy=2016-01-12, 20160112 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 11 Jan 2016 23:53:05 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 7374FC0BF2AA; Mon, 11 Jan 2016 23:53:04 +0000 (UTC) Received: from tucnak.zalov.cz ([10.3.113.3]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u0BNr1YK013886 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 11 Jan 2016 18:53:03 -0500 Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id u0BNqx4d008619; Tue, 12 Jan 2016 00:53:00 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id u0BNqwDi007174; Tue, 12 Jan 2016 00:52:58 +0100 Date: Mon, 11 Jan 2016 23:53:00 -0000 From: Jakub Jelinek To: Jason Merrill Cc: Nathan Sidwell , gcc-patches@gcc.gnu.org Subject: Re: C++ patch ping Message-ID: <20160111235258.GB3017@tucnak.redhat.com> Reply-To: Jakub Jelinek References: <20160109074122.GP18720@tucnak.redhat.com> <56940A23.4040501@acm.org> <5694224E.9090707@redhat.com> <20160111215217.GA3017@tucnak.redhat.com> <569426E0.2050301@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <569426E0.2050301@redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-IsSubscribed: yes X-SW-Source: 2016-01/txt/msg00658.txt.bz2 On Mon, Jan 11, 2016 at 05:04:16PM -0500, Jason Merrill wrote: > >You mean: > > > >--- gcc/cp/pt.c.jj 2016-01-05 16:46:02.891896607 +0100 > >+++ gcc/cp/pt.c 2016-01-11 21:33:09.065184178 +0100 > >@@ -12207,6 +12207,8 @@ tsubst_decl (tree t, tree args, tsubst_f > > DECL_TEMPLATE_INSTANTIATED (r) = 0; > > if (type == error_mark_node) > > RETURN (error_mark_node); > >+ if (DECL_LANG_SPECIFIC (r)) > >+ DECL_TEMPLATE_INFO (r) = NULL_TREE; > > if (TREE_CODE (type) == FUNCTION_TYPE) > > { > > /* It may seem that this case cannot occur, since: > > > >I'm almost through bootstrapping that, but regtesting will take some more > >time. That version regressed: +FAIL: g++.dg/cpp1y/var-templ16.C -std=c++14 (internal compiler error) +FAIL: g++.dg/cpp1y/var-templ16.C -std=c++14 (test for excess errors) +FAIL: g++.dg/cpp1y/var-templ18.C -std=c++14 (internal compiler error) +FAIL: g++.dg/cpp1y/var-templ18.C -std=c++14 (test for excess errors) +FAIL: g++.dg/cpp1y/var-templ27.C -std=c++14 (internal compiler error) +FAIL: g++.dg/cpp1y/var-templ27.C -std=c++14 (test for excess errors) > >Do you mean: > > > >--- gcc/cp/pt.c.jj 2016-01-05 16:46:02.891896607 +0100 > >+++ gcc/cp/pt.c 2016-01-11 22:49:12.303477700 +0100 > >@@ -12292,8 +12292,13 @@ tsubst_decl (tree t, tree args, tsubst_f > > SET_DECL_IMPLICIT_INSTANTIATION (r); > > register_specialization (r, gen_tmpl, argvec, false, hash); > > } > >- else if (!cp_unevaluated_operand) > >- register_local_specialization (r, t); > >+ else > >+ { > >+ if (VAR_P (r) && DECL_LANG_SPECIFIC (r)) > >+ DECL_TEMPLATE_INFO (r) = NULL_TREE; > >+ if (!cp_unevaluated_operand) > >+ register_local_specialization (r, t); > >+ } > > > > DECL_CHAIN (r) = NULL_TREE; > > > >or something different? Or should it be cleared also for non-VAR_DECLs > >if they have DECL_LANG_SPECIFIC? > > Yes, like that. You don't need to check VAR_P, since TYPE_DECL also has > DECL_TEMPLATE_INFO. But following patch passed bootstrap on x86_64-linux and bootstrap + regtest on i686-linux, ok for trunk if it also passes regtest on x86_64-linux? 2016-01-12 Jakub Jelinek PR c++/66808 PR c++/69000 * pt.c (tsubst_decl): If not local_p, clear DECL_TEMPLATE_INFO. * g++.dg/tls/pr66808.C: New test. * g++.dg/tls/pr69000.C: New test. --- gcc/cp/pt.c.jj 2016-01-05 16:46:02.891896607 +0100 +++ gcc/cp/pt.c 2016-01-11 23:22:54.742344987 +0100 @@ -12292,8 +12292,13 @@ tsubst_decl (tree t, tree args, tsubst_f SET_DECL_IMPLICIT_INSTANTIATION (r); register_specialization (r, gen_tmpl, argvec, false, hash); } - else if (!cp_unevaluated_operand) - register_local_specialization (r, t); + else + { + if (DECL_LANG_SPECIFIC (r)) + DECL_TEMPLATE_INFO (r) = NULL_TREE; + if (!cp_unevaluated_operand) + register_local_specialization (r, t); + } DECL_CHAIN (r) = NULL_TREE; --- gcc/testsuite/g++.dg/tls/pr69000.C.jj 2015-12-21 14:03:38.362847547 +0100 +++ gcc/testsuite/g++.dg/tls/pr69000.C 2015-12-21 14:04:17.839291295 +0100 @@ -0,0 +1,19 @@ +// PR c++/69000 +// { dg-do compile } +// { dg-require-effective-target tls } + +class A {}; + +template +struct B +{ + static int *& foo () { static __thread int *c = 0; return c; } +}; + +B d; + +void +bar () +{ + d.foo (); +} --- gcc/testsuite/g++.dg/tls/pr66808.C.jj 2015-12-21 14:06:06.791756074 +0100 +++ gcc/testsuite/g++.dg/tls/pr66808.C 2015-12-21 14:06:02.651814409 +0100 @@ -0,0 +1,10 @@ +// PR c++/66808 +// { dg-do compile { target c++11 } } +// { dg-require-effective-target tls } + +template +class A { + int *b = foo (); + int *foo () { static __thread int a; return &a; } +}; +A b; Jakub