From patchwork Wed Sep 19 09:40:41 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Jambor X-Patchwork-Id: 184962 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 71FE22C007F for ; Wed, 19 Sep 2012 19:41:04 +1000 (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=1348652465; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Date: From:To:Cc:Subject:Message-ID:Mail-Followup-To:References: MIME-Version:Content-Type:Content-Disposition:In-Reply-To: User-Agent:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=/sGsOjn aHrNlBOvy9n4zB0oTM2k=; b=YWRWq6pfquOheuSKyP3Me95FDRKqS0+mN/6J6Y4 q+RFHK0M+Ts7ZR5Wls2rI7aZPNDnHVPNRVvJUf1zm8UTLgClZ8ODsIp5XsEhYBG9 ZBXYXGSfgxNdim43ysgDjm3opm/s5y8hBWrrx2UQBqiqPISJCYFEFFTngsD05MBr LA3o= 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:Cc:Subject:Message-ID:Mail-Followup-To:References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To:User-Agent:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=XO99nfQf5QRTIZf2Zm2EwF0hc7ryXb9ky69fXsJQ3oBQ79d4cJ0F4UnvjejLN+ O601Z/K0QBTKTnbuPbv4NVuRxcWtLDssASqPRXePQxoSOQAJI+hhaOecPGm7HbK4 X+rzIGVxUlaESWm86D0JNZetBVMFsIRSd3PftinTSlQ/U=; Received: (qmail 2560 invoked by alias); 19 Sep 2012 09:40:58 -0000 Received: (qmail 2548 invoked by uid 22791); 19 Sep 2012 09:40:57 -0000 X-SWARE-Spam-Status: No, hits=-5.3 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, RCVD_IN_DNSWL_HI, TW_JF 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; Wed, 19 Sep 2012 09:40:44 +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 CD584A329D; Wed, 19 Sep 2012 11:40:42 +0200 (CEST) Date: Wed, 19 Sep 2012 11:40:41 +0200 From: Martin Jambor To: GCC Patches Cc: Richard Guenther , Dehao Chen , Jan Hubicka , David Li , Michael Matz Subject: Re: [PATCH] Combine location with block using block_locations Message-ID: <20120919094040.GA3014@virgil.arch.suse.de> Mail-Followup-To: GCC Patches , Richard Guenther , Dehao Chen , Jan Hubicka , David Li , Michael Matz References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) 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 Hi, On Wed, Sep 12, 2012 at 04:17:45PM +0200, Michael Matz wrote: > Hi, > > On Wed, 12 Sep 2012, Michael Matz wrote: > > > > Hm, but we shouldn't end up streaming any BLOCKs at this point (nor > > > local TYPE_DECLs). Those are supposed to be in the local function > > > sections only where no fixup for prevailing decls happens. > > > > That's true, something is fishy with the patch, will try to investigate. > > ipa-prop creates the problem. Its tree mapping can contain expressions, > expressions can have locations, locations now have blocks. The tree maps > are stored as part of jump functions, and hence as part of node summaries. > Node summaries are global, hence blocks, and therefore block vars can be > placed in the global blob. > > That's not supposed to happen. The patch below fixes this instance of the > problem and makes the testcase work with Dehaos patch with the > LTO_NO_PREVAIL call added back in. > The following patch implements the unsharing and location pruning at all required places in a way that passes bootstrap and testing on an x86_64-linux. Honza pre-approved it on IRC so unless there are any objections within a few hours I'm going to commit it. (The patch does not introduce any of the asserts Michael's patch had because, as far as I my grep told me, IS_UNKNOWN_LOCATION is not in trunk yet and I suppose the pre-approval does not cover introducing things like that.) Thanks, Martin 2012-09-18 Martin Jambor * ipa-prop.c (prune_expression_for_jf): New function. (ipa_set_jf_constant): Use it. (ipa_set_jf_arith_pass_through): Likewise. (determine_known_aggregate_parts): Likewise. Index: src/gcc/ipa-prop.c =================================================================== --- src.orig/gcc/ipa-prop.c +++ src/gcc/ipa-prop.c @@ -287,6 +287,19 @@ ipa_print_all_jump_functions (FILE *f) } } +/* Return the expression tree EXPR unshared and with location stripped off. */ + +static tree +prune_expression_for_jf (tree exp) +{ + if (EXPR_P (exp)) + { + exp = unshare_expr (exp); + SET_EXPR_LOCATION (exp, UNKNOWN_LOCATION); + } + return exp; +} + /* Set JFUNC to be a known type jump function. */ static void @@ -305,7 +318,7 @@ static void ipa_set_jf_constant (struct ipa_jump_func *jfunc, tree constant) { jfunc->type = IPA_JF_CONST; - jfunc->value.constant = constant; + jfunc->value.constant = prune_expression_for_jf (constant); } /* Set JFUNC to be a simple pass-through jump function. */ @@ -327,7 +340,7 @@ ipa_set_jf_arith_pass_through (struct ip tree operand, enum tree_code operation) { jfunc->type = IPA_JF_PASS_THROUGH; - jfunc->value.pass_through.operand = operand; + jfunc->value.pass_through.operand = prune_expression_for_jf (operand); jfunc->value.pass_through.formal_id = formal_id; jfunc->value.pass_through.operation = operation; jfunc->value.pass_through.agg_preserved = false; @@ -1344,7 +1357,7 @@ determine_known_aggregate_parts (gimple { struct ipa_agg_jf_item item; item.offset = list->offset - arg_offset; - item.value = list->constant; + item.value = prune_expression_for_jf (list->constant); VEC_quick_push (ipa_agg_jf_item_t, jfunc->agg.items, item); } list = list->next;