From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa4.mentor.iphmx.com (esa4.mentor.iphmx.com [68.232.137.252]) by sourceware.org (Postfix) with ESMTPS id 1B3C1385BF9E; Fri, 26 Mar 2021 11:22:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 1B3C1385BF9E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=Tobias_Burnus@mentor.com IronPort-SDR: pHI5QIMHHJC3dQC1NTUA/ttpC+LkCN5TsPKNMw9GAR0OAxyq34X+juFU8w3ZL6rzBUQRSqyEv0 PMlw7/OXI2GzBsUjRfMdNtmxoNAo9qsgIDg95JPAD4bMpLWc7OzlV1OfscbGPV2MoPvpAwYmv+ 5XpIj6SCzoO4lY4Ewe5C84HshojcvqUOqu+xKXob1npKSPUc9kQH0FiorLQRCddx8NjjaclZs4 bGNWPuNEkLTzy1KIVPvtfqAIJqRmclWcjXULlSeLFJH0S9GHXRIHua/C1c/VFEDcziq1+kQyBv S1E= X-IronPort-AV: E=Sophos;i="5.81,280,1610438400"; d="f90'?scan'208";a="59648780" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa4.mentor.iphmx.com with ESMTP; 26 Mar 2021 03:22:24 -0800 IronPort-SDR: 5WA+FFXL0jOomo8f6f2kH/4bGJulOa+dU5JtZUQvZA7bKNFaAAq5hAtPdPhtA7Yks3TBSzfYtj w7Bp911XE3lAsj1n0VsQVVoeBNeC8mbGThHAkKDLtbS61/eriZBRy/aNKdHCslWd+zabikXsiX u+Il682wV1IuIl8ZV/5A6DyyeqRpFzlw3xyt5JJJch0q/tuaWVp8eTg1D2g+f91zIGElflSMRZ gI1gItfhbBu3HbEFt7yT7YGxnVxr53lcJpPf3IBGqzex6Jw01LuLwEqprsxjGiz4GEfalTquPB QLU= Subject: Re: [Patch, fortran] PR99602 - [11 regression] runtime error: pointer actual argument not associated To: Paul Richard Thomas , "fortran@gcc.gnu.org" , gcc-patches CC: =?UTF-8?Q?J=c3=bcrgen_Reuter?= References: From: Tobias Burnus Message-ID: Date: Fri, 26 Mar 2021 12:22:11 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/mixed; boundary="------------921346280D4AE781FE75C533" Content-Language: en-US X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: SVR-IES-MBX-03.mgc.mentorg.com (139.181.222.3) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, NICE_REPLY_A, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: fortran@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Fortran mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Mar 2021 11:22:27 -0000 --------------921346280D4AE781FE75C533 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: quoted-printable Hi Paul, I do not understand the !UNLIMITED_POLY(fsym) part of the patch. In particular, your patch causes foo.f90 to fail by wrongly diagnosting: Fortran runtime error: Pointer actual argument 'cptr' is not associated I have only did some light tests =E2=80=93 but it seems that just removing '&& !UNLIMITED_POLY(fsym)' seems to be enough. (But I did not run the testsuite.) Hence: - Please include the attached testcases or some variants of them. - Check that removing !UNLIMITED_POLY does not cause any regressions If that works: OK for mainline Thanks for looking into this issue and working on the patches. Tobias On 26.03.21 07:58, Paul Richard Thomas via Fortran wrote: > This patch is straightforward but the isolation of the problem was rather > less so. Many thanks to Juergen for testcase reduction. > > Regtested on FC33/x86_64 - OK for master? > > Paul > > Fortran: Fix problem with runtime pointer chack [PR99602]. > > 2021-03-26 Paul Thomas > > gcc/fortran/ChangeLog > > PR fortran/99602 > * trans-expr.c (gfc_conv_procedure_call): Use the _data attrs > for class expressions and detect proc pointer evaluations by > the non-null actual argument list. > > gcc/testsuite/ChangeLog > > PR fortran/99602 > * gfortran.dg/pr99602.f90: New test. > * gfortran.dg/pr99602a.f90: New test. > * gfortran.dg/pr99602b.f90: New test. ----------------- Mentor Graphics (Deutschland) GmbH, Arnulfstrasse 201, 80634 M=C3=BCnchen R= egistergericht M=C3=BCnchen HRB 106955, Gesch=C3=A4ftsf=C3=BChrer: Thomas H= eurung, Frank Th=C3=BCrauf --------------921346280D4AE781FE75C533 Content-Type: text/x-fortran; charset="UTF-8"; name="bar.f90" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="bar.f90" ! { dg-do compile } ! { dg-options "-fcheck=pointer -fdump-tree-original" } ! ! PR fortran/99602 ! module m implicit none contains subroutine wr(y) class(*) :: y stop 1 end end module m use m implicit none integer, pointer :: iptr class(*), pointer :: cptr nullify (cptr, iptr) call wr(iptr) call wr(cptr) end ! { dg-final { scan-tree-dump-times "_gfortran_runtime_error_at" "original" 2 } } ! { dg-final { scan-tree-dump-times "Pointer actual argument 'cptr'" "original" 1 } } ! { dg-final { scan-tree-dump-times "Pointer actual argument 'iptr'" "original" 1 } } --------------921346280D4AE781FE75C533 Content-Type: text/x-fortran; charset="UTF-8"; name="foo.f90" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="foo.f90" ! { dg-do compile } ! { dg-options "-fcheck=pointer -fdump-tree-original" } ! ! PR fortran/99602 ! module m implicit none contains subroutine wr(y) class(*), pointer :: y if (associated (y)) stop 1 end end module m use m implicit none class(*), pointer :: cptr nullify (cptr) call wr(cptr) end ! { dg-final { scan-tree-dump-not "_gfortran_runtime_error_at" "original" } } ! { dg-final { scan-tree-dump-not "Pointer actual argument" "original" } } --------------921346280D4AE781FE75C533--