From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.smtpout.orange.fr (smtp06.smtpout.orange.fr [80.12.242.128]) by sourceware.org (Postfix) with ESMTPS id A8AB5395BC09 for ; Tue, 3 Aug 2021 15:39:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A8AB5395BC09 Received: from cyrano.home ([92.167.144.168]) by mwinf5d37 with ME id d3fl250063eCq5G033frDP; Tue, 03 Aug 2021 17:39:51 +0200 X-ME-Helo: cyrano.home X-ME-Auth: bW9yaW4tbWlrYWVsQG9yYW5nZS5mcg== X-ME-Date: Tue, 03 Aug 2021 17:39:51 +0200 X-ME-IP: 92.167.144.168 From: Mikael Morin To: fortran@gcc.gnu.org, gcc-patches@gcc.gnu.org, Mikael Morin Subject: [PATCH 0/7] fortran: Ignore unused arguments for scalarisation [PR97896] Date: Tue, 3 Aug 2021 17:39:38 +0200 Message-Id: <20210803153945.1309734-1-mikael@gcc.gnu.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=2.0 required=5.0 tests=BAYES_05, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NEUTRAL, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Aug 2021 15:39:54 -0000 Hello, I have had these patches fixing PR97896 almost ready for a while. Now is time to actually submit them, at last. 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. These patches use some c++ features, namely class inheritance and virtual functions; I know this is frowned upon by some (fortran) maintainers; let’s see what they will say. 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? Mikael Morin (7): fortran: new abstract 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 | 45 +++++--- gcc/fortran/interface.c | 14 +-- gcc/fortran/intrinsic.c | 152 +++++++++++++------------- gcc/fortran/intrinsic.h | 3 +- gcc/fortran/iresolve.c | 21 +--- gcc/fortran/resolve.c | 10 +- gcc/fortran/symbol.c | 19 ++++ gcc/fortran/trans-array.c | 75 ++++++++++--- gcc/fortran/trans-array.h | 5 +- gcc/fortran/trans-decl.c | 24 +--- gcc/fortran/trans-expr.c | 7 +- 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 ++++ 15 files changed, 252 insertions(+), 183 deletions(-) create mode 100644 gcc/testsuite/gfortran.dg/index_5.f90 -- 2.30.2