public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Mikael Morin <mikael@gcc.gnu.org>
To: fortran@gcc.gnu.org
Cc: gcc-patches@gcc.gnu.org, Mikael Morin <morin-mikael@orange.fr>
Subject: [PATCH v2 0/7] fortran: Ignore unused arguments for scalarisation [PR97896]
Date: Thu,  5 Aug 2021 18:26:07 +0200	[thread overview]
Message-ID: <20210805162614.647806-1-mikael@gcc.gnu.org> (raw)

Hello,

This is the second submit of a patch series whose first version[1] was not
welcome because of its C++ usage.

After some thought I figured out that rewriting the series without C++
features would not be that impacting after all.
So here you go, the (not so) good old-fashioned way.

The problematic case is intrinsic procedures where an argument is actually not used in the code generated (KIND argument of INDEX in the testcase), which confuses the scalariser.

Thomas König comitted a change to workaround the problem, but it regressed in PR97896.  These patch put the workaround where I think it is more appropriate, namely at the beginning of the scalarisation procedure.  This is the patch 7 of the series, preceded with the revert in patch 6.  I intend to commit both of them squashed together.

The rest of the series (patches 1-5) is preliminary work to be able to identify the KIND argument of the INDEX intrinsic by its name, rather than using the right number of next->next->next indirections starting with the first argument.  It is probably overkill for just this use case, but I think it’s worth having that facility in the long term.

I intend to submit a separate patch for the release branch with only patch 6 and 7 and the next->next->next indirections.

Regression-tested on x86_64-linux-gnu.  Ok for master? 


[1] https://gcc.gnu.org/pipermail/fortran/2021-August/056303.html

Mikael Morin (7):
  fortran: new wrapper class gfc_dummy_arg
  fortran: Tiny sort_actual internal refactoring
  fortran: Reverse actual vs dummy argument mapping
  fortran: simplify elemental arguments walking
  fortran: Delete redundant missing_arg_type field
  Revert "Remove KIND argument from INDEX so it does not mess up
    scalarization."
  fortran: Ignore unused args in scalarization [PR97896]

 gcc/fortran/gfortran.h                |  41 +++++++++--
 gcc/fortran/interface.c               |  77 ++++++++++++++++++--
 gcc/fortran/intrinsic.c               | 101 +++++++++++---------------
 gcc/fortran/intrinsic.h               |   3 +-
 gcc/fortran/iresolve.c                |  21 +-----
 gcc/fortran/trans-array.c             |  74 ++++++++++++++-----
 gcc/fortran/trans-array.h             |   5 +-
 gcc/fortran/trans-decl.c              |  24 +-----
 gcc/fortran/trans-expr.c              |   9 ++-
 gcc/fortran/trans-intrinsic.c         |   3 +-
 gcc/fortran/trans-stmt.c              |  30 ++++----
 gcc/fortran/trans.h                   |   4 +-
 gcc/testsuite/gfortran.dg/index_5.f90 |  23 ++++++
 13 files changed, 262 insertions(+), 153 deletions(-)
 create mode 100644 gcc/testsuite/gfortran.dg/index_5.f90

-- 
2.30.2


             reply	other threads:[~2021-08-05 16:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-05 16:26 Mikael Morin [this message]
2021-08-05 16:26 ` [PATCH v2 1/7] fortran: new wrapper class gfc_dummy_arg Mikael Morin
2021-08-05 16:26 ` [PATCH v2 2/7] fortran: Tiny sort_actual internal refactoring Mikael Morin
2021-08-05 16:26 ` [PATCH v2 3/7] fortran: Reverse actual vs dummy argument mapping Mikael Morin
2021-08-05 16:26 ` [PATCH v2 4/7] fortran: simplify elemental arguments walking Mikael Morin
2021-08-05 16:26 ` [PATCH v2 5/7] fortran: Delete redundant missing_arg_type field Mikael Morin
2021-08-05 16:26 ` [PATCH v2 6/7] Revert "Remove KIND argument from INDEX so it does not mess up scalarization." Mikael Morin
2021-08-05 16:26 ` [PATCH v2 7/7] fortran: Ignore unused args in scalarization [PR97896] 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=20210805162614.647806-1-mikael@gcc.gnu.org \
    --to=mikael@gcc.gnu.org \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=morin-mikael@orange.fr \
    /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).