From patchwork Fri Sep 16 20:24:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikael Morin X-Patchwork-Id: 25 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5044:0:0:0:0:0 with SMTP id h4csp916188wrt; Fri, 16 Sep 2022 13:27:47 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5pWZV9W20yKXIS8bsG2DRhDP6Z8A0UWBZBqfLfPmqQ6pEw+P5skDeSjbI5J1RaBK/Cx9fL X-Received: by 2002:a17:907:2cf3:b0:77d:89da:499c with SMTP id hz19-20020a1709072cf300b0077d89da499cmr4543353ejc.694.1663360067712; Fri, 16 Sep 2022 13:27:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663360067; cv=none; d=google.com; s=arc-20160816; b=PTXzj+MpnuH5ArK2guqBirksDCzlB+XFpRk7jBB4J1SlXQKmvFTpjWhUYWKhnjQ1h4 5k+/w65zPgXw1oh9wVmoICCNXraA6B1Zd0CYIRXGJEIbP5FniX2831SVfqjYOWvujruT sboos4aXP/4p/P6LaknB+Uk3GUEpWxCtIXQ6pzw44yOwk1Zwb5eLSNLREkerWezXF1va t4vQ5iccS4Op1uxdPYjkynthFQz3LyGWRt/z5kGLP9j0uCl6J2cBtF579V3RpsCjGeGt qySGLa3s8FREEoVoGJ5Csd7blANInNS2eGKT9Dbldmko5r9dkBHNQHgcMHsnhWudxNp9 kMgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:to :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=IFBRHvlfStWl26aqxVmB9dYlHu/LglLSVIAevU5P2Ks=; b=v7owGQvqTY6gojuWsUIGDOiOYpeCVmoZrno9d6UmnMiqezkC80nI8/qhT70d1H188x tG2ECDWEw/sRwWSHTJ/Lnr6iVkbUu0O1fBrFYVTNtfSoCQzllTsmTxRojDfYFM3BC4K/ TjnvTixv+mBgshbG6xzh+RoTBF3cOIege77Ied7jFNXh/Hp2qCw6szN84zMWIOcYndmg wKWfRk/FklZaAntpbmu3qYUE3ntB55ozjH3Wuw9RJtbHwwGM4h8YqizDdXJqhbToRK2o uRiidxkaV+MCXsOhWDvn56bTzkTjHr9SXSzj249qDb+ylL9pFM5Thb3Ruye9xnskBOCa AWMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=ojM23HcK; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id ec40-20020a0564020d6800b0044f0eedd1d7si2598928edb.438.2022.09.16.13.27.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Sep 2022 13:27:47 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=ojM23HcK; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0811838A8161 for ; Fri, 16 Sep 2022 20:26:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0811838A8161 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1663359964; bh=IFBRHvlfStWl26aqxVmB9dYlHu/LglLSVIAevU5P2Ks=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=ojM23HcKIhBs1iJLg2mPMtbin/HTH30VFrjQlWz7aMNf723DqOJT39XxFQqZLYSmg PeGdTFXOMrGOVBqczAFJqssKZ0H323r4rFWtAV9dxDJBbfhM3qrz2y2J4xSRnzIz0/ TuqFLsx2ZBsunFQ2Dt/kkkh4Eurrl+TzqIub4aj8= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp.smtpout.orange.fr (smtp-12.smtpout.orange.fr [80.12.242.12]) by sourceware.org (Postfix) with ESMTPS id 7A70D385417F for ; Fri, 16 Sep 2022 20:24:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7A70D385417F Received: from cyrano.home ([86.215.174.255]) by smtp.orange.fr with ESMTPA id ZHt9oWAI9LFqbZHtEowxzY; Fri, 16 Sep 2022 22:24:44 +0200 X-ME-Helo: cyrano.home X-ME-Auth: bW9yaW4tbWlrYWVsQG9yYW5nZS5mcg== X-ME-Date: Fri, 16 Sep 2022 22:24:44 +0200 X-ME-IP: 86.215.174.255 To: gcc-patches@gcc.gnu.org, fortran@gcc.gnu.org Subject: [PATCH 00/10] fortran: clobber fixes [PR41453] Date: Fri, 16 Sep 2022 22:24:29 +0200 Message-Id: <20220916202439.549820-1-mikael@gcc.gnu.org> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, KHOP_HELO_FCRDNS, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NEUTRAL, TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1744159446727119812?= X-GMAIL-MSGID: =?utf-8?q?1744159446727119812?= Hello, this is 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 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 (9): 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 variable subreferences [PR88364] fortran: Support clobbering of derived types [PR41453] gcc/fortran/trans-expr.cc | 78 ++++++++++++------- gcc/fortran/trans.h | 3 +- .../gfortran.dg/intent_optimize_4.f90 | 24 ++++++ .../gfortran.dg/intent_optimize_5.f90 | 34 ++++++++ .../gfortran.dg/intent_optimize_6.f90 | 42 ++++++++++ .../gfortran.dg/intent_optimize_7.f90 | 65 ++++++++++++++++ .../gfortran.dg/intent_optimize_8.f90 | 67 ++++++++++++++++ .../gfortran.dg/intent_optimize_9.f90 | 43 ++++++++++ gcc/testsuite/gfortran.dg/intent_out_15.f90 | 27 +++++++ 9 files changed, 353 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_optimize_9.f90 create mode 100644 gcc/testsuite/gfortran.dg/intent_out_15.f90