From patchwork Thu Aug 14 09:07:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 379874 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 8333114009B for ; Thu, 14 Aug 2014 19:11:11 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:in-reply-to:message-id:references :mime-version:content-type; q=dns; s=default; b=PRnyX8xvb2Wv6T/t 0VhiC8vmzLPkY/TSN1y95GV8AztXOtNav8wMfhyQEmXg+0itMMrsCu8Jc+7SfBS0 4UF7mmZdT4IhszPey0xLucX4bWDviIkAJHHN6Uhi14hh2bszkbG2eK7rmxG11EXx zEwMUEivjrdnQNEZSUAVVRhyxnA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:in-reply-to:message-id:references :mime-version:content-type; s=default; bh=zeEB2d8pkF2qAW+fTLH3cY TF4jE=; b=HxOhGT8O1WuneyqctT5S9wVDIpVYw5GemlhgXjm5uT1QldDQhdARZQ ipvoAMT7K7w0e/ouHQyU+hlI8cPQ0mUkoNH63PPGewKWCuKZb6AlGDBgAZobqkbJ QM685n1RWRyEqQkabE3GZkK79Zuh+pwxBgvByPbSkPzQi8tVrYLkI= Received: (qmail 17386 invoked by alias); 14 Aug 2014 09:11:04 -0000 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 Received: (qmail 17375 invoked by uid 89); 14 Aug 2014 09:11:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.6 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx2.suse.de Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Thu, 14 Aug 2014 09:11:02 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 0D2ABAB43; Thu, 14 Aug 2014 09:10:59 +0000 (UTC) Date: Thu, 14 Aug 2014 11:07:48 +0200 (CEST) From: Richard Biener To: Jason Merrill cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] Fix PR62077 In-Reply-To: <53EBA53D.7050508@redhat.com> Message-ID: References: <53EBA53D.7050508@redhat.com> User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 On Wed, 13 Aug 2014, Jason Merrill wrote: > On 08/13/2014 10:28 AM, Richard Biener wrote: > > Sofar the patch survived building stage2 in a LTO bootstrap on the > > 4.9 branch, full testing is scheduled for trunk. > > The patch breaks a lot of C++ testcases, such as > g++.old-deja/g++.other/cvt1.C; I think you need to share the "set the > canonical type" code with the template path. > > > Jason, are you happy with that (esp. ripping out the odd > > type completion stuff that also messes with types recorded in > > said hashtable)? > > I'm nervous about it, since it leads to ARRAY_TYPEs with different TYPE_ALIGN > than their elements, though I'm not sure this actually breaks anything. > Perhaps we could copy TYPE_ALIGN and TYPE_USER_ALIGN at the same place we copy > TYPE_NEEDS_CONSTRUCTING. Um, ok. I don't feel like fiddling with this C++ frontend part and am going to try workaround it in tree.c with sth like as I seem to have other GC-related LTO IL differences to chase. So - can you take over this C++ frontend issue? Thanks, Richard. Index: gcc/tree.c =================================================================== --- gcc/tree.c (revision 213814) +++ gcc/tree.c (working copy) @@ -6759,6 +6759,13 @@ type_hash_canon (unsigned int hashcode, t1 = type_hash_lookup (hashcode, type); if (t1 != 0) { + if (TYPE_MAIN_VARIANT (t1) != t1) + { + /* Oops. C++ FE fun. Overwrite the entry. */ + type_hash_add (hashcode, type); + return type; + } + gcc_assert (TYPE_MAIN_VARIANT (t1) == t1); if (GATHER_STATISTICS) { tree_code_counts[(int) TREE_CODE (type)]--;