From patchwork Mon Feb 13 14:48:38 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 140914 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 22890B6FB6 for ; Tue, 14 Feb 2012 01:48:58 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1329749340; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Date: From:To:Subject:Message-ID:User-Agent:MIME-Version:Content-Type: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=PplQYf8Lwk3w1MPy+pjc XcTg6xY=; b=YLwmBjV4PpdNID6nLtjhCIJk7f6gs5irz2I6F/VKbGcZzDjDdo2O lvM9jLM+SitPE3PqIa31+l9GwWQoPpv7FXFGWGkFIbB923Ny3pXZnOHKKR5sGNNm Q+Sq9wNszZc6yfExcmhxXL5AoxqJlc259Oyq5MkmBx6sv6ZeWJM+lI8= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Date:From:To:Subject:Message-ID:User-Agent:MIME-Version:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=mlq7f7V1fPzLHbNFOnjnYbDMU0V4BK0NfUOTexiWgBUnDUflC55V9BcIe5uR7y 71Pr1OfNp0m5REX5sCkI8CJkDkvjNmMU98/JpKJkQW3pbh68S9Yy8ixteB0CoBUU gZII5AsWOcPkqPrxR/VmbC3pe8/2wrb7CgwKG6Abce0Zo=; Received: (qmail 9143 invoked by alias); 13 Feb 2012 14:48:54 -0000 Received: (qmail 9130 invoked by uid 22791); 13 Feb 2012 14:48:53 -0000 X-SWARE-Spam-Status: No, hits=-5.7 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 13 Feb 2012 14:48:39 +0000 Received: from relay1.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 893368891E for ; Mon, 13 Feb 2012 15:48:38 +0100 (CET) Date: Mon, 13 Feb 2012 15:48:38 +0100 (CET) From: Richard Guenther To: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix PR52178 Message-ID: User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 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 PR52178, the failure to bootstrap Ada with LTO (well, until you hit the next problem). A self-referential DECL_QUALIFIER makes us think that a QUAL_UNION_TYPE type is of variable-size which makes us stream that type locally, wrecking type merging and later ICEing in the type verifier. While it looks that variably_modified_type_p should not inspect DECL_QUALIFIER a less intrusive patch for 4.7 notices that DECL_QUALIFIER is unused after gimplification and thus clears it and does not stream it instead. LTO bootstrapped until I hit an optimization ICE when optimizing gnat1, a regular bootstrap & regtest is pending on x86_64-unknown-linux-gnu. Richard. 2012-02-13 Richard Guenther PR lto/52178 * tree-streamer-in.c (lto_input_ts_field_decl_tree_pointers): Do not stream DECL_QUALIFIER. * tree-streamer-out.c (write_ts_field_decl_tree_pointers): Likewise. * tree.c (free_lang_data_in_decl): Free DECL_QUALIFIER. (find_decls_types_r): Do not walk DECL_QUALIFIER. Index: gcc/tree-streamer-in.c =================================================================== --- gcc/tree-streamer-in.c (revision 184151) +++ gcc/tree-streamer-in.c (working copy) @@ -640,7 +640,7 @@ lto_input_ts_field_decl_tree_pointers (s { DECL_FIELD_OFFSET (expr) = stream_read_tree (ib, data_in); DECL_BIT_FIELD_TYPE (expr) = stream_read_tree (ib, data_in); - DECL_QUALIFIER (expr) = stream_read_tree (ib, data_in); + /* Do not stream DECL_QUALIFIER, it is useless after gimplification. */ DECL_FIELD_BIT_OFFSET (expr) = stream_read_tree (ib, data_in); DECL_FCONTEXT (expr) = stream_read_tree (ib, data_in); } Index: gcc/tree-streamer-out.c =================================================================== --- gcc/tree-streamer-out.c (revision 184151) +++ gcc/tree-streamer-out.c (working copy) @@ -552,7 +552,7 @@ write_ts_field_decl_tree_pointers (struc { stream_write_tree (ob, DECL_FIELD_OFFSET (expr), ref_p); stream_write_tree (ob, DECL_BIT_FIELD_TYPE (expr), ref_p); - stream_write_tree (ob, DECL_QUALIFIER (expr), ref_p); + /* Do not stream DECL_QUALIFIER, it is useless after gimplification. */ stream_write_tree (ob, DECL_FIELD_BIT_OFFSET (expr), ref_p); stream_write_tree (ob, DECL_FCONTEXT (expr), ref_p); } Index: gcc/tree.c =================================================================== --- gcc/tree.c (revision 184151) +++ gcc/tree.c (working copy) @@ -4596,7 +4596,10 @@ free_lang_data_in_decl (tree decl) free_lang_data_in_one_sizepos (&DECL_SIZE (decl)); free_lang_data_in_one_sizepos (&DECL_SIZE_UNIT (decl)); if (TREE_CODE (decl) == FIELD_DECL) - free_lang_data_in_one_sizepos (&DECL_FIELD_OFFSET (decl)); + { + free_lang_data_in_one_sizepos (&DECL_FIELD_OFFSET (decl)); + DECL_QUALIFIER (decl) = NULL_TREE; + } if (TREE_CODE (decl) == FUNCTION_DECL) { @@ -4800,7 +4803,6 @@ find_decls_types_r (tree *tp, int *ws, v { fld_worklist_push (DECL_FIELD_OFFSET (t), fld); fld_worklist_push (DECL_BIT_FIELD_TYPE (t), fld); - fld_worklist_push (DECL_QUALIFIER (t), fld); fld_worklist_push (DECL_FIELD_BIT_OFFSET (t), fld); fld_worklist_push (DECL_FCONTEXT (t), fld); }