From patchwork Mon Apr 27 13:06:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 465006 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 42EC7140082 for ; Mon, 27 Apr 2015 23:06:44 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass reason="1024-bit key; unprotected key" header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=YPr8BHFH; dkim-adsp=none (unprotected policy); dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; q=dns; s=default; b=gkM24NS1wyDCYZwWG s56oEFHKDPZzGePgMg0IqWTPRz4wzDkAg0f2gOTdBMkyXW3YPpP95CWcUHcLAcJA gkG2jSznKHYN0N+kLTmCsVIm+A3RWjHggd1XDyBOPgOsdAgON9FkaDajrvUm6+Jn Dcn+XeKGdVqVsoy3JTB4QzuKSU= 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 :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; s=default; bh=Chf/uSGm77EKGvcnSDd7/6w K2LQ=; b=YPr8BHFHGH+ilNYY/L1Y2JX+F8YgzoTAs38owvLfQTLitkx/du+nxCV WlNzEJi8+X9aFPOh6BbHAdpkTfq3C6aSEOFHZB0k7CuhMj2XKGRLJvS5uIv7gyDA 0kb9J0LPSF0Cw5fWdpgRBqMSnShuxznTyb/K9DdthbUDHdIp7WDk= Received: (qmail 101054 invoked by alias); 27 Apr 2015 13:06:35 -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 101032 invoked by uid 89); 27 Apr 2015 13:06:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 27 Apr 2015 13:06:33 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-01.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1Ymik1-0002ph-Ia from Tom_deVries@mentor.com ; Mon, 27 Apr 2015 06:06:29 -0700 Received: from [127.0.0.1] (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.3.224.2; Mon, 27 Apr 2015 14:06:28 +0100 Message-ID: <553E3451.5010300@mentor.com> Date: Mon, 27 Apr 2015 15:06:25 +0200 From: Tom de Vries User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Richard Biener CC: GCC Patches , John David Anglin Subject: Re: [PATCH][PR65818][bootstrap, hppa] Return side-effect free result in gimplify_va_arg_internal References: <553B89FB.7000009@mentor.com> In-Reply-To: On 27-04-15 10:17, Richard Biener wrote: >> This patch fixes that by gimplifying the address expression of the mem-ref >> >returned by the target hook (borrowing code from gimplify_expr, case >> >MEM_REF). >> > >> >Bootstrapped and reg-tested on x86_64. >> > >> >Bootstrapped and reg-tested on hppa2.0w-hp-hpux11.11. >> > >> >OK for trunk? > Hmm, that assert looks suspicious... > > Can't you simply always do > > gimplify_expr (expr, pre_p, post_p, is_gimple_lvalue, fb_lvalue); It's a bit counter-intuitive for me, using is_gimple_lvalue for something (the result of va_arg) we use as rvalue. But, it seems to work (with & in front of expr). OK if bootstrap and reg-test on x86_64 succeeds? Thanks, - Tom Return side-effect free result in gimplify_va_arg_internal 2015-04-27 Tom de Vries PR tree-optimization/65818 * gimplify.c (gimplify_va_arg_internal): Ensure that only side-effect free values are returned. --- gcc/gimplify.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gcc/gimplify.c b/gcc/gimplify.c index c68bd47..4a68c87 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -9352,7 +9352,9 @@ gimplify_va_arg_internal (tree valist, tree type, location_t loc, else gimplify_expr (&valist, pre_p, post_p, is_gimple_min_lval, fb_lvalue); - return targetm.gimplify_va_arg_expr (valist, type, pre_p, post_p); + tree expr = targetm.gimplify_va_arg_expr (valist, type, pre_p, post_p); + gimplify_expr (&expr, pre_p, post_p, is_gimple_lvalue, fb_lvalue); + return expr; } /* Gimplify __builtin_va_arg, aka VA_ARG_EXPR, which is not really a -- 1.9.1