From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.smtpout.orange.fr (smtp-16.smtpout.orange.fr [80.12.242.16]) by sourceware.org (Postfix) with ESMTPS id 5E98A3854811 for ; Mon, 31 Oct 2022 09:58:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5E98A3854811 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.17] ([86.215.174.255]) by smtp.orange.fr with ESMTPA id pRYMo8BO6sfCIpRYRoSOWU; Mon, 31 Oct 2022 10:58:04 +0100 X-ME-Helo: [192.168.1.17] X-ME-Auth: bW9yaW4tbWlrYWVsQG9yYW5nZS5mcg== X-ME-Date: Mon, 31 Oct 2022 10:58:04 +0100 X-ME-IP: 86.215.174.255 Message-ID: <85a5951a-7ea4-57b3-895a-ff7dbf1ef92e@orange.fr> Date: Mon, 31 Oct 2022 10:57:58 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.3 Subject: Re: [PATCH] Fortran: ordering of hidden procedure arguments [PR107441] From: Mikael Morin To: Harald Anlauf , fortran , gcc-patches References: <7d8ddf07-e66d-2678-de99-0e575c70ea17@orange.fr> <327319ac-4ef9-1e48-e993-57113d802d3b@orange.fr> Content-Language: fr, en-US In-Reply-To: <327319ac-4ef9-1e48-e993-57113d802d3b@orange.fr> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,BODY_8BITS,FREEMAIL_FROM,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,TXREP 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: Le 30/10/2022 à 22:25, Mikael Morin a écrit : > Le 30/10/2022 à 20:23, Mikael Morin a écrit : >> Another probable issue is your change to create_function_arglist >> changes arglist/hidden_arglist without also changing >> typelist/hidden_typelist accordingly.  I think a change to >> gfc_get_function_type is also necessary: as the function decl is >> changed, the decl type need to be changed as well. >> >> I will see whether I can manage to exhibit testcases for these issues. >> > Here is a test for the type vs decl mismatch. > > ! { dg-do run } > ! > ! PR fortran/107441 > ! Check that procedure types and procedure decls match when the procedure > ! has both chaacter-typed and optional value args. > > program p >   interface >     subroutine i(c, o) >       character(*) :: c >       integer, optional, value :: o >     end subroutine i >   end interface >   procedure(i), pointer :: pp A pointer initialization is missing here: pp => s >   call pp("abcd") > contains >   subroutine s(c, o) >     character(*) :: c >     integer, optional, value :: o >     if (present(o)) stop 1 >     if (len(c) /= 4) stop 2 >     if (c /= "abcd") stop 3 >   end subroutine s > end program p > With the additional initialization, the test passes, so it's not very useful. The type mismatch is visible in the dump though, so maybe a dump match can be used.