From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by sourceware.org (Postfix) with ESMTPS id 4441D3851C12 for ; Tue, 14 Jul 2020 13:57:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 4441D3851C12 Received: by mail-wr1-x441.google.com with SMTP id j4so21773586wrp.10 for ; Tue, 14 Jul 2020 06:57:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:user-agent:in-reply-to:references :mime-version:content-transfer-encoding:subject:to:cc:from :message-id; bh=IJ3f6SS2SpoDoLRfvpqFaYpR1mzHNuPONUdhPrpZP4c=; b=XPkHtDyTonHGPjHUDjOIa+LcC4FTQl58KJA7ZglNl+m82IqtHNUU4usrffOxfQbLXs nWntX02wdyuieFRQuq2oHQRYAZVCKMpAp+Adl93E6OqiVKBd2trdG37Y58+1KVr+CS5H ntT8n1OMxLPKD5EojcVDifupiyJaqkCufP5Xy/SKbsO+Ii6YRmol9nH4aZ6bSGdqIVRm Db8MNf9gxc5chEISOevjinrHdCN4yoP58Ia5fDq570vKXD5EWCN63jZ/XpO4/So0QMXH lK3ytcE+Q0AkWNdl+Zy3nVTaX2kRwi7NPoqMrNh8sBlY6aoJctTtJNGDfGlcSwXuAdCL BvKw== X-Gm-Message-State: AOAM531//c76c+badGHoEPA610C53OdHCKjIsOcsAlrouQhjsMmFknvy Njk85zKF5hBtM3tjcrYuL78= X-Google-Smtp-Source: ABdhPJy9wLzVwRvws+rMNDp3hikGIINvHiVCr+3LTpHfvWhgvH2BK8zC8Zd5+YYJH/D67F7gBx9snQ== X-Received: by 2002:adf:d084:: with SMTP id y4mr5576428wrh.161.1594735034286; Tue, 14 Jul 2020 06:57:14 -0700 (PDT) Received: from [10.181.130.22] (x2f7fe16.dyn.telefonica.de. [2.247.254.22]) by smtp.gmail.com with ESMTPSA id x185sm4784567wmg.41.2020.07.14.06.57.13 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Jul 2020 06:57:13 -0700 (PDT) Date: Tue, 14 Jul 2020 15:57:10 +0200 User-Agent: K-9 Mail for Android In-Reply-To: <20200714133735.GV2363@tucnak> References: <202007070401.06741bpX024052@ignucius.se.axis.com> <20200714133735.GV2363@tucnak> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PATCH] expr: Unbreak build of mesa [PR96194] To: Jakub Jelinek CC: Hans-Peter Nilsson ,GCC Patches From: Richard Biener Message-ID: <4CF08327-C8E0-4279-BE71-961262598236@gmail.com> X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jul 2020 13:57:16 -0000 On July 14, 2020 3:37:35 PM GMT+02:00, Jakub Jelinek w= rote: >Hi! > >On Tue, Jul 07, 2020 at 09:04:40AM +0200, Richard Biener via >Gcc-patches wrote: >> > The store to the whole of each volatile object was picked apart >> > like there had been an individual assignment to each of the >> > fields=2E Reads were added as part of that; see PR for details=2E >> > The reads from volatile memory were a clear bug; individual >> > stores questionable=2E A separate patch clarifies the docs=2E >> > >> > Tested x86_64-linux, powerpc64le-linux and cris-elf=2E >> > Ok to commit? Backport to gcc-10? >>=20 >> OK for both=2E > >This breaks building of mesa on both the trunk and 10 branch=2E > >The problem is that the middle-end may never create temporaries of >non-POD >(TREE_ADDRESSABLE) types, those can be only created when the language >says >so and thus only the FE is allowed to create those=2E > >This patch just reverts the behavior to what we used to do before for >the >stores to volatile non-PODs=2E Perhaps we want to do something else, but >definitely we can't create temporaries of the non-POD type=2E It is up >to >discussions on what should happen in those cases=2E > >Bootstrapped/regtested on x86_64-linux and i686-linux, ok for >trunk/10=2E2? OK=2E=20 Richard=2E=20 >2020-07-14 Jakub Jelinek > > PR middle-end/96194 > * expr=2Ec (expand_constructor): Don't create temporary for store to > volatile MEM if exp has an addressable type=2E > > * g++=2Edg/opt/pr96194=2EC: New test=2E > >--- gcc/expr=2Ec=2Ejj 2020-07-13 19:09:33=2E173872178 +0200 >+++ gcc/expr=2Ec 2020-07-14 13:07:26=2E228801996 +0200 >@@ -8382,7 +8382,9 @@ expand_constructor (tree exp, rtx target > || GET_CODE (target) =3D=3D PARALLEL || modifier =3D=3D EXPAND_STAC= K_PARM > /* Also make a temporary if the store is to volatile memory, to > avoid individual accesses to aggregate members=2E */ >- || (GET_CODE (target) =3D=3D MEM && MEM_VOLATILE_P (target))) >+ || (GET_CODE (target) =3D=3D MEM >+ && MEM_VOLATILE_P (target) >+ && !TREE_ADDRESSABLE (TREE_TYPE (exp)))) > { > if (avoid_temp_mem) > return NULL_RTX; >--- gcc/testsuite/g++=2Edg/opt/pr96194=2EC=2Ejj 2020-07-14 13:15:32=2E185= 733939 >+0200 >+++ gcc/testsuite/g++=2Edg/opt/pr96194=2EC 2020-07-14 13:16:16=2E03309619= 7 >+0200 >@@ -0,0 +1,21 @@ >+// PR middle-end/96194 >+// { dg-do compile } >+// { dg-options "-O2" } >+ >+#include >+ >+struct A { ~A (); }; >+struct B : A { float e[64]; }; >+ >+B * >+foo () >+{ >+ return new ((void *) 0) B (); >+} >+ >+B * >+bar (void *x, bool y) >+{ >+ void *p =3D y ? x : (void *) 0; >+ return new (p) B (); >+} > > > Jakub