From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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-Archive: List-Post: List-Help: Sender: gcc-patches-owner@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 13:06:00 -0000 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: Content-Type: multipart/mixed; boundary="------------030407090304010404010005" X-SW-Source: 2015-04/txt/msg01613.txt.bz2 --------------030407090304010404010005 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-length: 716 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 --------------030407090304010404010005 Content-Type: text/x-patch; name="0001-Return-side-effect-free-result-in-gimplify_va_arg_in.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-Return-side-effect-free-result-in-gimplify_va_arg_in.pa"; filename*1="tch" Content-length: 922 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 --------------030407090304010404010005--