public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Mikael Morin <mikael@gcc.gnu.org>
To: gcc-patches@gcc.gnu.org, fortran@gcc.gnu.org
Subject: [PATCH v2 0/9] fortran: clobber fixes [PR41453]
Date: Sun, 18 Sep 2022 22:15:36 +0200	[thread overview]
Message-ID: <20220918201545.453296-1-mikael@gcc.gnu.org> (raw)

Hello,

this is the second version of a set of changes around the clobber we
generate in the caller before a procedure call, for each actual argument
whose associated dummy has the INTENT(OUT) attribute.

The clobbering of partial variables (array elements, structure components) 
proved to be unsupported by the middle-end optimizers, even if it seemed
to work in practice.  So this version just removes it.

v1 of the series was posted here:
https://gcc.gnu.org/pipermail/gcc-patches/2022-September/601713.html
https://gcc.gnu.org/pipermail/fortran/2022-September/058165.html

Changes from v1:
 - patch 9/10 (clobber subreferences) has been dropped.
 - patch 10/10 (now 9/9): The test has been adjusted because some checks
   were failing without the dropped patch.  Basically there are less
   clobbers generated.
 - patch 5: In the test, an explicit kind has been added to integers,
   so that the dump match is not dependent on the
   -fdefault-integer-8 option.
 - patches 3, 4, 5, 8, and 10/10 (now 9/9): The tests have been renamed
   so that they are numbered in increasing order.

The first patch is a refactoring moving the clobber generation in
gfc_conv_procedure_call where it feels more appropriate.
The second patch is a fix for the ICE originally motivating my work
on this topic.
The third patch is a fix for some wrong code issue discovered with an
earlier version of this series.
The following patches are gradual condition loosenings to enable clobber 
generation in more and more cases.

Each patch has been tested through an incremental bootstrap and a
partial testsuite run on fortran *intent* tests, and the whole lot has
been run through the full fortran regression testsuite.
OK for master?


Harald Anlauf (1):
  fortran: Support clobbering with implicit interfaces [PR105012]

Mikael Morin (8):
  fortran: Move the clobber generation code
  fortran: Fix invalid function decl clobber ICE [PR105012]
  fortran: Move clobbers after evaluation of all arguments [PR106817]
  fortran: Support clobbering of reference variables [PR41453]
  fortran: Support clobbering of SAVE variables [PR87395]
  fortran: Support clobbering of ASSOCIATE variables [PR87397]
  fortran: Support clobbering of allocatables and pointers [PR41453]
  fortran: Support clobbering of derived types [PR41453]

 gcc/fortran/trans-expr.cc                     | 81 ++++++++++++-------
 gcc/fortran/trans.h                           |  3 +-
 .../gfortran.dg/intent_optimize_4.f90         | 43 ++++++++++
 .../gfortran.dg/intent_optimize_5.f90         | 24 ++++++
 .../gfortran.dg/intent_optimize_6.f90         | 34 ++++++++
 .../gfortran.dg/intent_optimize_7.f90         | 42 ++++++++++
 .../gfortran.dg/intent_optimize_8.f90         | 66 +++++++++++++++
 gcc/testsuite/gfortran.dg/intent_out_15.f90   | 27 +++++++
 8 files changed, 290 insertions(+), 30 deletions(-)
 create mode 100644 gcc/testsuite/gfortran.dg/intent_optimize_4.f90
 create mode 100644 gcc/testsuite/gfortran.dg/intent_optimize_5.f90
 create mode 100644 gcc/testsuite/gfortran.dg/intent_optimize_6.f90
 create mode 100644 gcc/testsuite/gfortran.dg/intent_optimize_7.f90
 create mode 100644 gcc/testsuite/gfortran.dg/intent_optimize_8.f90
 create mode 100644 gcc/testsuite/gfortran.dg/intent_out_15.f90

-- 
2.35.1


             reply	other threads:[~2022-09-18 20:15 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-18 20:15 Mikael Morin [this message]
2022-09-18 20:15 ` [PATCH v2 1/9] fortran: Move the clobber generation code Mikael Morin
2022-09-18 20:15 ` [PATCH v2 2/9] fortran: Fix invalid function decl clobber ICE [PR105012] Mikael Morin
2022-09-18 20:15 ` [PATCH v2 3/9] fortran: Move clobbers after evaluation of all arguments [PR106817] Mikael Morin
2022-09-18 20:15 ` [PATCH v2 4/9] fortran: Support clobbering with implicit interfaces [PR105012] Mikael Morin
2022-09-18 20:15 ` [PATCH v2 5/9] fortran: Support clobbering of reference variables [PR41453] Mikael Morin
2022-09-18 20:15 ` [PATCH v2 6/9] fortran: Support clobbering of SAVE variables [PR87395] Mikael Morin
2022-09-18 20:15 ` [PATCH v2 7/9] fortran: Support clobbering of ASSOCIATE variables [PR87397] Mikael Morin
2022-09-18 20:15 ` [PATCH v2 8/9] fortran: Support clobbering of allocatables and pointers [PR41453] Mikael Morin
2022-09-18 20:15 ` [PATCH v2 9/9] fortran: Support clobbering of derived types [PR41453] Mikael Morin
2022-09-22 20:42 ` [PATCH v2 0/9] fortran: clobber fixes [PR41453] Harald Anlauf
2022-09-23  7:54   ` Mikael Morin
2022-09-25 12:53     ` Mikael Morin
2022-10-10 18:58     ` Mikael Morin

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=20220918201545.453296-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).