From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.smtpout.orange.fr (smtp-20.smtpout.orange.fr [80.12.242.20]) by sourceware.org (Postfix) with ESMTPS id B1EEB3857B98 for ; Tue, 11 Jul 2023 10:33:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B1EEB3857B98 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gcc.gnu.org Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=gcc.gnu.org Received: from cyrano.home ([86.215.161.51]) by smtp.orange.fr with ESMTPA id JAfuqCdJWn02aJAg1qNA3v; Tue, 11 Jul 2023 12:33:02 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1689071582; bh=OhyX3KNS5lvI0Ag1BA5ddCd863CRfUGBEzZWUDAIP7g=; h=From:To:Subject:Date; b=jDEG/jOprQX0EAw5byRP8L46q52Ojdtx6cZSmFnp296uqXbVv8biVPLwYN7ulDOXl xqcBs/HfZy+2r7bl2mT63XzUuIwNoOD1fyUKDrEykzGebcD9+wJ4+r7gjCGKiX/unm GePYtxHKOVrHahetZ6CPH0GsPBPhOZj0sB+MLWKCp8/vFNsBCaknCsbzZWvrzwPJji 0bKOS/MBMubOv5ncM100oBxuP6By6xOMQEhWsE01l9TtlrPZsWMJP+0DGPqiYLOZrQ w0tQrQh8d/PhJpulStLDNqnKXrK93CmVATQzt5zlIYRtnxTQUNy7iFNimjacj4eBIS 9P3Nk04hrBrFw== X-ME-Helo: cyrano.home X-ME-Auth: bW9yaW4tbWlrYWVsQG9yYW5nZS5mcg== X-ME-Date: Tue, 11 Jul 2023 12:33:02 +0200 X-ME-IP: 86.215.161.51 From: Mikael Morin To: fortran@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [PATCH 0/3] Fix argument evaluation order [PR92178] Date: Tue, 11 Jul 2023 12:32:50 +0200 Message-Id: <20230711103253.1589353-1-mikael@gcc.gnu.org> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=0.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,FORGED_SPF_HELO,JMQ_SPF_NEUTRAL,KAM_SHORT,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_NEUTRAL,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hello, this is a followup to Harald's recent work [1] on the evaluation order of arguments, when one of them is passed to an intent(out) allocatable dummy and is deallocated before the call. This extends Harald's fix to support: - scalars passed to assumed rank dummies (patch 1), - scalars passed to assumed rank dummies with the data reference depending on its own content (patch 2), - arrays with the data reference depending on its own content (patch 3). There is one (last?) case which is not supported, for which I have opened a separate PR [2]. Regression tested on x86_64-pc-linux-gnu. OK for master? [1] https://gcc.gnu.org/pipermail/fortran/2023-July/059562.html [2] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110618 Mikael Morin (3): fortran: defer class wrapper initialization after deallocation [PR92178] fortran: Factor data references for scalar class argument wrapping [PR92178] fortran: Reorder array argument evaluation parts [PR92178] gcc/fortran/trans-array.cc | 3 + gcc/fortran/trans-expr.cc | 130 +++++++++++++++++--- gcc/fortran/trans.cc | 28 +++++ gcc/fortran/trans.h | 8 +- gcc/testsuite/gfortran.dg/intent_out_19.f90 | 22 ++++ gcc/testsuite/gfortran.dg/intent_out_20.f90 | 33 +++++ gcc/testsuite/gfortran.dg/intent_out_21.f90 | 33 +++++ 7 files changed, 236 insertions(+), 21 deletions(-) create mode 100644 gcc/testsuite/gfortran.dg/intent_out_19.f90 create mode 100644 gcc/testsuite/gfortran.dg/intent_out_20.f90 create mode 100644 gcc/testsuite/gfortran.dg/intent_out_21.f90 -- 2.40.1