From patchwork Thu Dec 8 09:38:23 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 130121 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 996B91007D7 for ; Thu, 8 Dec 2011 20:38:51 +1100 (EST) Received: (qmail 5035 invoked by alias); 8 Dec 2011 09:38:40 -0000 Received: (qmail 5016 invoked by uid 22791); 8 Dec 2011 09:38:39 -0000 X-SWARE-Spam-Status: No, hits=-3.8 required=5.0 tests=AWL, BAYES_00, 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; Thu, 08 Dec 2011 09:38:24 +0000 Received: from relay1.suse.de (nat.nue.novell.com [195.135.221.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 7395D8A95F; Thu, 8 Dec 2011 10:38:23 +0100 (CET) Date: Thu, 8 Dec 2011 10:38:23 +0100 (CET) From: Richard Guenther To: Diego Novillo Cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH][LTO] Fix PR48437 In-Reply-To: Message-ID: References: <4EDF89CB.1020303@google.com> <4EDF8AFD.9040607@google.com> <4EDF8E32.1000801@google.com> 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 On Wed, 7 Dec 2011, Diego Novillo wrote: > On Wed, Dec 7, 2011 at 11:16, Richard Guenther wrote: > > > I'm going to apply it tomorrow, when full testing hopefully finished > > Sure. But remember the zombie kitties! I have applied the fix for PR48437, the fix for PR49945 required adjustment as otherwise we'd ICE gcc.dg/lto/20090706-1_0.c in the type checker. We also have to localize FIELD_DECLs of variable size types. Thus I'm re-testing the following and will commit that variant if it succeeds. I suppose at some point we need to look at the efficiency of the variably_modified_type_p call, as tree_is_indexable is called for each component type and variably_modified_type_p recurses itself (thus, overall this is quadratic, but with cheap constant factor as we are calling it with a NULL function arg). Richard. 2011-12-08 Richard Guenther PR lto/49945 * lto-streamer-out.c (tree_is_indexable): Localize variably modified types and their FIELD_DECLs. Index: gcc/lto-streamer-out.c =================================================================== --- gcc/lto-streamer-out.c (revision 182101) +++ gcc/lto-streamer-out.c (working copy) @@ -139,6 +139,16 @@ tree_is_indexable (tree t) && DECL_CONTEXT (t) && TREE_CODE (DECL_CONTEXT (t)) == FUNCTION_DECL) return false; + /* Variably modified types need to be streamed alongside function + bodies because they can refer to local entities. Together with + them we have to localize their members as well. + ??? In theory that includes non-FIELD_DECLs as well. */ + else if (TYPE_P (t) + && variably_modified_type_p (t, NULL_TREE)) + return false; + else if (TREE_CODE (t) == FIELD_DECL + && variably_modified_type_p (DECL_CONTEXT (t), NULL_TREE)) + return false; else return (TYPE_P (t) || DECL_P (t) || TREE_CODE (t) == SSA_NAME); }