From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.smtpout.orange.fr (smtp-11.smtpout.orange.fr [80.12.242.11]) by sourceware.org (Postfix) with ESMTPS id 427D93858D35 for ; Sat, 4 Mar 2023 22:29:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 427D93858D35 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=orange.fr Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=orange.fr Received: from [192.168.1.16] ([86.215.161.51]) by smtp.orange.fr with ESMTPA id YaNmpH0mBc4q6YaNmpxXNi; Sat, 04 Mar 2023 23:29:43 +0100 X-ME-Helo: [192.168.1.16] X-ME-Auth: bW9yaW4tbWlrYWVsQG9yYW5nZS5mcg== X-ME-Date: Sat, 04 Mar 2023 23:29:43 +0100 X-ME-IP: 86.215.161.51 Content-Type: multipart/mixed; boundary="------------nCj9oD00vgiuyP7CxTrL0G7b" Message-ID: Date: Sat, 4 Mar 2023 23:29:38 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 From: Mikael Morin Subject: Re: [PATCH, v2] Fortran: fix CLASS attribute handling [PR106856] To: Harald Anlauf , sgk@troutmask.apl.washington.edu, Harald Anlauf via Fortran Cc: gcc-patches , tobias@codesourcery.com References: <5b42f0b7-e217-555d-b1f2-4b623f3ae150@orange.fr> <5f1e8202-303e-5da2-c42b-8eab00a12a97@orange.fr> <48caf060-4349-b077-24da-8bf53ed4b650@gmx.de> <614d6385-49fe-4869-ef4b-8afa175d3693@orange.fr> <871e46b4-af10-c8fc-105c-9aec987e2cac@gmx.de> Content-Language: en-US, fr In-Reply-To: <871e46b4-af10-c8fc-105c-9aec987e2cac@gmx.de> X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM,GIT_PATCH_0,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,KAM_SHORT,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: This is a multi-part message in MIME format. --------------nCj9oD00vgiuyP7CxTrL0G7b Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Le 04/03/2023 à 22:20, Harald Anlauf a écrit : > Hi Mikael, > > Am 04.03.23 um 18:09 schrieb Mikael Morin: >> There was a comment about the old_symbol thing at the end of my previous >> message: >> https://gcc.gnu.org/pipermail/gcc-patches/2023-March/613354.html > > I think Tobias might be the better person to answer this. > But when playing with variations of that else-branch, > I always hit an issue with class_74.f90, where the class > variables are not dummy arguments but local variables. > > E.g. take the following reduced testcase: > > subroutine foo >   class(*)  :: y >   dimension :: y(:,:) >   pointer   :: y > end subroutine foo > > So when we see the dimension but haven't seen the > pointer (or allocatable) declaration, we appear to > generate an error with bad consequences (ICE). > > If this is a resolution issue, maybe it can be fixed > differently, but likely needs digging deeper.  With > the patch as-is at least I do not see a memory leak > in that context. > One of my suggestions was to fix it as attached. It is probably more clear with an actual patch to look at. It seems to work on your example and class_74 as well. It seems to also fix some valgrind errors on this example: subroutine foo pointer :: y dimension :: y(:,:) class(*) :: y end subroutine foo I'm fine with that fix if it works for you. I suggest waiting for next stage 1, but it's your call, you have the green light from Steve anyway. Thanks for your work. --------------nCj9oD00vgiuyP7CxTrL0G7b Content-Type: text/x-patch; charset=UTF-8; name="old_symbol_as.diff" Content-Disposition: attachment; filename="old_symbol_as.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2djYy9mb3J0cmFuL2RlY2wuY2MgYi9nY2MvZm9ydHJhbi9kZWNsLmNj CmluZGV4IGE2NWM2ZGNiOTk0Li5jOGYwYmI4M2MyYyAxMDA2NDQKLS0tIGEvZ2NjL2ZvcnRy YW4vZGVjbC5jYworKys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