From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from cc-smtpout2.netcologne.de (cc-smtpout2.netcologne.de [89.1.8.212]) by sourceware.org (Postfix) with ESMTPS id B84873858D3C; Thu, 16 Sep 2021 06:27:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B84873858D3C Received: from cc-smtpin1.netcologne.de (cc-smtpin1.netcologne.de [89.1.8.201]) by cc-smtpout2.netcologne.de (Postfix) with ESMTP id 307D412639; Thu, 16 Sep 2021 08:27:02 +0200 (CEST) Received: from [IPv6:2001:4dd7:2b84:0:7285:c2ff:fe6c:992d] (2001-4dd7-2b84-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de [IPv6:2001:4dd7:2b84:0:7285:c2ff:fe6c:992d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by cc-smtpin1.netcologne.de (Postfix) with ESMTPSA id E199211DF1; Thu, 16 Sep 2021 08:26:59 +0200 (CEST) Subject: Re: [PATCH] PR fortran/102287 - optional allocatable array arguments (intent out) of derived types with allocatable components are not properly passed to subroutines To: Harald Anlauf , fortran , gcc-patches References: From: Thomas Koenig Message-ID: <85db1be8-82f9-eb68-9d4e-127e19b76d11@netcologne.de> Date: Thu, 16 Sep 2021 08:26:59 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-NetCologne-Spam: L X-Rspamd-Queue-Id: E199211DF1 X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham 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-List-Received-Date: Thu, 16 Sep 2021 06:27:05 -0000 Hello Harald, > As nicely described in the PR, we mishandled the case of passing > optional allocatable DT arguments with allocatable components > when the INTENT was declared as INTENT(OUT), as we unconditionally > tried to deallocate these components even when the argument was not > present. The obvious solution is to wrap the code for deallocation > by a check for presence. Looks good. > Regtested on x86_64-pc-linux-gnu. OK for mainline? Sure! > As this is a potentially nasty wrong-code bug, I'd like to backport > to at least 11-branch. OK for all open branches as far as you want to go. Thanks for the patch! Best regards Thomas