public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Mikael Morin <mikael@gcc.gnu.org>
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	[thread overview]
Message-ID: <20230711103253.1589353-1-mikael@gcc.gnu.org> (raw)

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


             reply	other threads:[~2023-07-11 10:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-11 10:32 Mikael Morin [this message]
2023-07-11 10:32 ` [PATCH 1/3] fortran: defer class wrapper initialization after deallocation [PR92178] Mikael Morin
2023-07-11 10:32 ` [PATCH 2/3] fortran: Factor data references for scalar class argument wrapping [PR92178] Mikael Morin
2023-07-11 10:32 ` [PATCH 3/3] fortran: Reorder array argument evaluation parts [PR92178] Mikael Morin
2023-07-13 19:59 ` [PATCH 0/3] Fix argument evaluation order [PR92178] Harald Anlauf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230711103253.1589353-1-mikael@gcc.gnu.org \
    --to=mikael@gcc.gnu.org \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).