From patchwork Sun Nov 7 16:17:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mikael Morin X-Patchwork-Id: 47189 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2AD7F3858030 for ; Sun, 7 Nov 2021 16:23:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2AD7F3858030 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1636302222; bh=Df6Y8KPxfVXpaLPHZpP2bxfBoE7u77wPwFOQ4cHw05A=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=j9YEkUgd+BWil2DL2z2FEWpO3mZzcyeHLreSTaocngq6KPYShEe4SncQq9ceRj20W eQGiFzZyRcIPLzc0KRIUQenCc6PKU2I+FasWaCulkERTa5VYVeo6SSZvVZKafNDtMJ ufAlKDVv9HoFSOhfd7Zp7HXnQvJx4ejBZ7mx9ZLQ= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp.smtpout.orange.fr (smtp09.smtpout.orange.fr [80.12.242.131]) by sourceware.org (Postfix) with ESMTPS id 79EA23857C67 for ; Sun, 7 Nov 2021 16:17:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 79EA23857C67 Received: from cyrano.home ([92.167.144.168]) by smtp.orange.fr with ESMTPA id jkramFF3NE8xTjkrfm8czv; Sun, 07 Nov 2021 17:17:51 +0100 X-ME-Helo: cyrano.home X-ME-Auth: MDU4MTIxYWM4YWI0ZGE4ZTUwZWZmNTExZmI2ZWZlMThkM2ZhYiE5OWRkOGM= X-ME-Date: Sun, 07 Nov 2021 17:17:51 +0100 X-ME-IP: 92.167.144.168 To: fortran@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [PATCH 0/2] fortran: Ignore unused arguments for scalarisation [PR97896] Date: Sun, 7 Nov 2021 17:17:44 +0100 Message-Id: <20211107161746.1167205-1-mikael@gcc.gnu.org> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 X-Spam-Status: No, score=-5.8 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, KAM_SHORT, 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-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-Patchwork-Original-From: Mikael Morin via Gcc-patches From: Mikael Morin Reply-To: Mikael Morin Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "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