From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) by sourceware.org (Postfix) with ESMTPS id 5FCD53858404; Tue, 13 Jun 2023 17:45:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5FCD53858404 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=troutmask.apl.washington.edu Authentication-Results: sourceware.org; spf=none smtp.mailfrom=troutmask.apl.washington.edu Received: from troutmask.apl.washington.edu (localhost [127.0.0.1]) by troutmask.apl.washington.edu (8.17.1/8.17.1) with ESMTPS id 35DHjH9R056779 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 13 Jun 2023 10:45:17 -0700 (PDT) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.17.1/8.17.1/Submit) id 35DHjH90056778; Tue, 13 Jun 2023 10:45:17 -0700 (PDT) (envelope-from sgk) Date: Tue, 13 Jun 2023 10:45:17 -0700 From: Steve Kargl To: Harald Anlauf via Fortran Cc: gcc-patches Subject: Re: [PATCH] Fortran: fix passing of zero-sized array arguments to procedures [PR86277] Message-ID: Reply-To: sgk@troutmask.apl.washington.edu References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,KAM_DMARC_STATUS,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Mon, Jun 12, 2023 at 11:12:45PM +0200, Harald Anlauf via Fortran wrote: > Dear all, > > the attached - actually rather small - patch is the result of a > rather intensive session with Mikael in an attempt to fix the > situation that we did not create proper temporaries when passing > zero-sized array arguments to procedures. When the dummy argument > was declared as OPTIONAL, in many cases it was mis-detected as > non-present. This also depended on the type of argument, and > was different for different intrinsic types, notably character, > and derived types, and should explain the rather large ratio of > the size of the provided testcases to the actual fix... > > (What the patch does not address: we still generate too much code > for unneeded temporaries, often two temporaries instead of just > one. I'll open a separate PR to track this.) > > Regtested on x86_64-pc-linux-gnu. OK for mainline? > > If this survives long enough on 14-trunk, would this be eligible > for a backport to 13-branch in time for 13.2? > OK to commit. I've reviewed the bugzilla exchange between Mikael and you, and agree with committing this and opening a new PR to track the unneeded temporaries issue. -- Steve