Hi Mikael,

thanks for working on this!

Am 07.11.21 um 17:17 schrieb Mikael Morin via Gcc-patches:
Hello,

I repost this patch series initially targetted at the 11 branch only [1],
and that I now would like to commit to master as well before.

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 2 of the series, preceded with the revert in patch 1.
I intend to commit both of them squashed together.

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


Changes from v1:

   Rebase on master.


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


Mikael Morin (2):
   Revert "Remove KIND argument from INDEX so it does not mess up
     scalarization."
   fortran: Ignore unused args in scalarization [PR97896]

  gcc/fortran/intrinsic.c               | 48 +++------------------
  gcc/fortran/intrinsic.h               |  3 +-
  gcc/fortran/iresolve.c                | 21 ++-------
  gcc/fortran/trans-array.c             | 61 ++++++++++++++++++++++++++-
  gcc/fortran/trans-array.h             |  3 ++
  gcc/fortran/trans-decl.c              | 24 +----------
  gcc/fortran/trans-intrinsic.c         |  1 +
  gcc/fortran/trans-stmt.c              | 20 +++++++++
  gcc/testsuite/gfortran.dg/index_5.f90 | 23 ++++++++++
  9 files changed, 121 insertions(+), 83 deletions(-)
  create mode 100644 gcc/testsuite/gfortran.dg/index_5.f90


LGTM at first sight.  But you may want to wait for Tobias or Thomas to
take a second look.

Thanks for the patch!

Harald

Reply via email to