From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.smtpout.orange.fr (smtp04.smtpout.orange.fr [80.12.242.126]) by sourceware.org (Postfix) with ESMTPS id AB2E5385701D for ; Mon, 19 Sep 2022 07:31:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AB2E5385701D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=orange.fr Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=orange.fr Received: from [192.168.1.17] ([86.215.174.255]) by smtp.orange.fr with ESMTPA id aBFyolrFtOizNaBFzoNOS3; Mon, 19 Sep 2022 09:31:56 +0200 X-ME-Helo: [192.168.1.17] X-ME-Auth: bW9yaW4tbWlrYWVsQG9yYW5nZS5mcg== X-ME-Date: Mon, 19 Sep 2022 09:31:56 +0200 X-ME-IP: 86.215.174.255 Message-ID: <62e5ef00-b739-37b2-269d-67b9089dfc94@orange.fr> Date: Mon, 19 Sep 2022 09:31:54 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 From: Mikael Morin Subject: Re: [PATCH 09/10] fortran: Support clobbering of variable subreferences [PR88364] To: Richard Biener Cc: Thomas Koenig , Mikael Morin , gcc-patches@gcc.gnu.org, fortran@gcc.gnu.org References: Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-16.0 required=5.0 tests=BAYES_00,FREEMAIL_FROM,GIT_PATCH_0,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Le 18/09/2022 à 12:48, Richard Biener a écrit : > >> Does *(&a[1]) count as a pointer dereference? > > Yes, technically. > >> Even in the original dump it is already simplified to a straight a[1]. > > But this not anymore. The check can probably be relaxed, it stems from the dual purpose of CLOBBER. > So the following makes the frontend-emitted IL valid, by handing the simplification over to the middle-end, but I can't help thinking that behavior won't be more reliable. diff --git a/gcc/fortran/trans-expr.cc b/gcc/fortran/trans-expr.cc index f8fcd2d97d9..5fb9a3a536d 100644 --- a/gcc/fortran/trans-expr.cc +++ b/gcc/fortran/trans-expr.cc @@ -6544,8 +6544,9 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym, && !sym->attr.elemental) { tree var; - var = build_fold_indirect_ref_loc (input_location, - parmse.expr); + var = build1_loc (input_location, INDIRECT_REF, + TREE_TYPE (TREE_TYPE (parmse.expr)), + parmse.expr); tree clobber = build_clobber (TREE_TYPE (var)); gfc_add_modify (&clobbers, var, clobber); }