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 EDD6B3865C2D; Tue, 2 Feb 2021 13:59:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org EDD6B3865C2D 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: uVjNRzrVByQsR69NnTY41OtS8aFgesHuZe6WnSHpADXQcn1+B/hgNA1a3ixKco9n01w5HgalAT SmvNZRDc9HRPnv4f9RUw2lErFGJMoFze0jvmTn95gr8lqDdMPa4lWwLEF/5/r70JcQ6DVEnciW I8T0ag9QUivpJ4rCO/KqGhLGuiVFqm8d6wAsCtszXQyhjkvXqfKbwDqJRvKcIE0xxi8oMnBAu8 S6DxlqS1BwArnRF584TbMPzH98X79rM2kHe2KRJAUWGF8x9PB+pd4lA3pVepqHkl4/gwqy2Vpl VRE= X-IronPort-AV: E=Sophos;i="5.79,395,1602576000"; d="f90'?scan'208";a="57825005" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa4.mentor.iphmx.com with ESMTP; 02 Feb 2021 05:59:51 -0800 IronPort-SDR: J6rdot5GySV0pI0zE3dNFnaPGEZyVYuFBfCcAcD+ZKMfGzY4+DR6rO3CY/E8RRGuUVN78ubgd6 ThQkrV4QQ7C6059a4j6AL4vLui4EbfnVy+T7XYbJyPos0L+5eD/uat7pq9Kn49xydeJnQobVKE K/BIjy51y1mORBdrRlQCIEawaaaXrLo45bMpKXuQ5/fJ8EJgOQjKerPk4WD/YAIfdNMVOBLfkG PK7Fz2VXwYjseC4z10gcCvqourKBr4XgfwjzwyxpXq7UWKV5lXPFNUZpd2Df31ppV2FK/NS2XN MWc= Subject: Re: [Patch, fortran] PR98897 - Erroneous procedure attribute for associate name To: Paul Richard Thomas , "fortran@gcc.gnu.org" , gcc-patches References: From: Tobias Burnus Message-ID: <33375e26-9020-328a-5d64-4bfeb4862369@codesourcery.com> Date: Tue, 2 Feb 2021 14:59:45 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/mixed; boundary="------------61A0439F03F67F01B4466136" Content-Language: en-US X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: SVR-IES-MBX-07.mgc.mentorg.com (139.181.222.7) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-Spam-Status: No, score=-6.3 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: Tue, 02 Feb 2021 13:59:54 -0000 --------------61A0439F03F67F01B4466136 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: quoted-printable Hi Paul, On 02.02.21 13:20, Paul Richard Thomas via Gcc-patches wrote: > This is more or less 'obvious' and does not require any further explanati= on. Well, I am not sure whether calling resolve is premature or not. In any case, it still fails for the attached testcase. (Related but separate issue.) The second testcase fails with "Selector at (1) has no type" / "Symbol 'var' at (1) has no IMPLICIT type". Disclaimer: I am not 100% sure whether those two or your/the PR's testcase is valid. (It fails to compile with ifort 19.1. I have not read the spec and assume that the original testcase is valid.) Thus, please confirm that all three are valid. If so, do you see a way to make the two new ones pass as well? If we are sure that the current patch is still the right approach, I am also fine to do it stepwise. Thanks, Tobias > Regtests with FC33/x86_64 - OK for master (and ....)? > > Paul > > Fortran: Fix calls to associate name typebound subroutines [PR98897]. > > 2021-02-02 Paul Thomas > > gcc/fortran > PR fortran/98897 > * match.c (gfc_match_call): Include associate names as possible > entities with typebound subroutines. The target needs to be > resolved for the type. > > gcc/testsuite/ > PR fortran/98897 > * gfortran.dg/typebound_call_32.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 --------------61A0439F03F67F01B4466136 Content-Type: text/x-fortran; charset="UTF-8"; name="foo.f90" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="foo.f90" module m implicit none contains subroutine double(i) integer :: i i = 2*i end subroutine double function bar() result(res) procedure(double), pointer :: res res => double end function bar subroutine foo(i) integer :: i ! This works: procedure(), pointer :: proc call double(i) proc => bar() call proc(i) ! This fails: associate (var => bar()) call var(i) ! { dg-bogus "VARIABLE attribute of 'var' conflicts with PROCEDURE attribute" } end associate end subroutine foo end module m program test use m implicit none (type, external) integer :: i i = 50 call foo(i) if (i /= 50*2*2) stop 1 end program test --------------61A0439F03F67F01B4466136 Content-Type: text/x-fortran; charset="UTF-8"; name="foo3.f90" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="foo3.f90" module m implicit none contains subroutine double(i) integer :: i i = 2*i end subroutine double function bar() result(res) procedure(double), pointer :: res res => double end function bar subroutine foo(i) integer :: i procedure(bar) :: var procedure(double), pointer :: proc associate (var => bar()) proc => var end associate call proc(i) end subroutine foo end module m program test use m implicit none (type, external) integer :: i i = 50 call foo(i) if (i /= 50*2) stop 1 end program test --------------61A0439F03F67F01B4466136--