From patchwork Tue Mar 14 14:20:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Schmidt X-Patchwork-Id: 738712 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 3vjH2Q5D73z9s1y for ; Wed, 15 Mar 2017 01:20:30 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="BMN0u1+D"; 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 :content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:references:to:message-id; q=dns; s= default; b=JyLVn3xKPS58EsAmbkq3pmwX0MvYysVS162vSQiqGvVLzKxICYgq9 8nPq6KgCxb9fhITvUchGGYnEl2Jtmw6n6BwZUjxPrwRlIZyeUKy2zjnLxzBL5WFM ECVmWlORHxmOrKZ1U2pO5cbRFWsY0QUqpojG8CaFd0EIlMgO38MlJY= 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 :content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:references:to:message-id; s=default; bh=ab5POGpLZcp0OLCkrloSw7Lfi4w=; b=BMN0u1+DcvoafyRaOWDmGTDTSs5L V8mioL3BidmQUThT6WDvdXM3cKOBsQ5gpHZgGCkVLMVgrIsA4X8tSs7GeDXIhJk+ 3uNcWt83MVwXu7D0Df9iNineXzrvCOwdb17CiPSPZr3gGilrpDQdaZ4l+fBFxSHl exWTyDvGI5Ep+1w= Received: (qmail 47660 invoked by alias); 14 Mar 2017 14:20:20 -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 47623 invoked by uid 89); 14 Mar 2017 14:20:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-10.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy= X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0a-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.156.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 14 Mar 2017 14:20:18 +0000 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v2EEJ1oi015951 for ; Tue, 14 Mar 2017 10:20:17 -0400 Received: from e18.ny.us.ibm.com (e18.ny.us.ibm.com [129.33.205.208]) by mx0a-001b2d01.pphosted.com with ESMTP id 296gbdervu-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 14 Mar 2017 10:20:16 -0400 Received: from localhost by e18.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 14 Mar 2017 10:20:14 -0400 Received: from b03cxnp08028.gho.boulder.ibm.com (9.17.130.20) by e18.ny.us.ibm.com (146.89.104.205) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 14 Mar 2017 10:20:12 -0400 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp08028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v2EEKBTh15794636; Tue, 14 Mar 2017 07:20:11 -0700 Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 23570C603C; Tue, 14 Mar 2017 08:20:11 -0600 (MDT) Received: from bigmac.rchland.ibm.com (unknown [9.10.86.201]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTPS id EA0C3C6051; Tue, 14 Mar 2017 08:20:10 -0600 (MDT) Mime-Version: 1.0 (Mac OS X Mail 10.2 \(3259\)) Subject: Re: [PATCH] Fix PR79908 From: Bill Schmidt In-Reply-To: <9FCC5CC2-575B-4FD0-BC72-5A658841D156@linux.vnet.ibm.com> Date: Tue, 14 Mar 2017 09:20:10 -0500 Cc: GCC Patches References: <1698034f-0529-cc1c-2ffd-745d5193144e@linux.vnet.ibm.com> <9FCC5CC2-575B-4FD0-BC72-5A658841D156@linux.vnet.ibm.com> To: Richard Biener X-TM-AS-GCONF: 00 x-cbid: 17031414-0044-0000-0000-000002D061FF X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006781; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000206; SDB=6.00833715; UDB=6.00409351; IPR=6.00611371; BA=6.00005209; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00014646; XFM=3.00000013; UTC=2017-03-14 14:20:13 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17031414-0045-0000-0000-000006FE80A4 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-03-14_08:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1702020001 definitions=main-1703140114 X-IsSubscribed: yes > On Mar 14, 2017, at 7:50 AM, Bill Schmidt wrote: > > >> On Mar 14, 2017, at 3:57 AM, Richard Biener wrote: >> >> On Tue, Mar 14, 2017 at 1:04 AM, Bill Schmidt >> wrote: >>> >>> Index: gcc/tree-stdarg.c >>> =================================================================== >>> --- gcc/tree-stdarg.c (revision 246109) >>> +++ gcc/tree-stdarg.c (working copy) >>> @@ -1057,7 +1057,7 @@ expand_ifn_va_arg_1 (function *fun) >>> types. */ >>> gimplify_assign (lhs, expr, &pre); >>> } >>> - else >>> + else if (is_gimple_addressable (expr)) >>> gimplify_expr (&expr, &pre, &post, is_gimple_lvalue, fb_lvalue); >> >> This is wrong - we lose side-effects this way and the only reason we gimplify >> is to _not_ lose them. >> >> Better is sth like >> >> Index: gcc/tree-stdarg.c >> =================================================================== >> --- gcc/tree-stdarg.c (revision 246082) >> +++ gcc/tree-stdarg.c (working copy) >> @@ -1058,7 +1058,7 @@ expand_ifn_va_arg_1 (function *fun) >> gimplify_assign (lhs, expr, &pre); >> } >> else >> - gimplify_expr (&expr, &pre, &post, is_gimple_lvalue, fb_lvalue); >> + gimplify_expr (&expr, &pre, &post, is_gimple_val, fb_either); >> >> input_location = saved_location; >> pop_gimplify_context (NULL); > > OK, thanks for the explanation. Unfortunately this fails bootstrap with a failed > assert a little later. I'll dig further. Looks like is_gimple_val is too restrictive for MEM_REFs, for which is_gimple_lvalue passes. Trying this now: > > Bill > Index: gcc/tree-stdarg.c =================================================================== --- gcc/tree-stdarg.c (revision 246109) +++ gcc/tree-stdarg.c (working copy) @@ -1057,8 +1057,10 @@ expand_ifn_va_arg_1 (function *fun) types. */ gimplify_assign (lhs, expr, &pre); } + else if (is_gimple_addressable (expr)) + gimplify_expr (&expr, &pre, &post, is_gimple_lvalue, fb_lvalue); else - gimplify_expr (&expr, &pre, &post, is_gimple_lvalue, fb_lvalue); + gimplify_expr (&expr, &pre, &post, is_gimple_val, fb_rvalue); input_location = saved_location; pop_gimplify_context (NULL);