From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) by sourceware.org (Postfix) with ESMTPS id 1A4A63858000; Tue, 13 Feb 2024 18:13:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1A4A63858000 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmx.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 1A4A63858000 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=212.227.17.21 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707848021; cv=none; b=FDhBODp6iaD36VPL9OeZLACRVgDjQQG/HerOXaEAcZzIuy72lE+EzjsNSdPr2pVSVikdPHDTomvVVrN//0cD3zf9W0+1WDHF2qUR30+sWhnY+4nPvWdUAo0cN/ZDLlYQJWjwBGcmlFEqMSuXbw2Z5iyXe0MQuLhzfnFTdZEEp3k= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707848021; c=relaxed/simple; bh=fykVpjpk1bKysaPJya+Ny9B6WsFwFhTK+2fzCNkSIDI=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=KYNAM3pjhE8UaT9LuU++PPqq+siJvDDQu86PQe0NWoQe4omzl/Mx+zkKmuOSGe8DseBcT4PF70CK8atccG1NYemVvooGhI2cePSiExJRGrORKGoTJm6mgLO9NSGK8lb8RKxgUutdm9TZzeIryrzQlxtHi4aYnVQ+fdciCHJgUJY= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1707848013; x=1708452813; i=anlauf@gmx.de; bh=fykVpjpk1bKysaPJya+Ny9B6WsFwFhTK+2fzCNkSIDI=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From: In-Reply-To; b=CJ+Irapy28M8h1p6qZ/mlNl7CYWhZ/WSb+NG2OfZvbknDBY86hmfxfiDNurrHUIO zo0B4T7og9+0dFQo2lyeYb4Pwwg0v5UrU4RcQkz5l3GqAmxU8jsQi0LjOkbx3cFm0 KOCSGlE5xRtNEQ9xW6VpuD/3csFVXuU0bCl900GkUatmpITXazPyu2g3vykEgQ9uK WfCeiesqNQQ5FUt6eo4D+A2KVo3zqmRTLSXxstKr+KbcoU+GmpH0gaSQPPiHRNtwI LAYjd4E7ZMNPLtF9T2n+Sb4y6qXNdin95YlNwSAUH50p7n2MauJoKG7xU3HA3a4DW /GhmMRAQPErBTatrog== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [192.168.178.29] ([79.232.145.143]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MZCfJ-1rVIRo0le5-00V8hv; Tue, 13 Feb 2024 19:13:33 +0100 Message-ID: <93681591-f729-42ee-ab4e-368f01ddc6ae@gmx.de> Date: Tue, 13 Feb 2024 19:13:31 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] Fortran: fix passing of optional dummies to bind(c) procedures [PR113866] To: sgk@troutmask.apl.washington.edu Cc: fortran , gcc-patches Newsgroups: gmane.comp.gcc.patches,gmane.comp.gcc.fortran References: Content-Language: en-US From: Harald Anlauf In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:DtbJZ2bU5bwUP1pR/95CgQhYHOhXGN9eOJZbR94hbdQnlPn/wfJ W5mxL0aezNx5oJ4AYUtsXvSa52E/bVZKZ+6cfrTp3Y+KpxtXVIPBuJMaACgGsWy0Z7XhWbj dO6ua/S7ToJEQyUk+F85S/a9W7500pa+bL7T89zLfgK07FO/Do4DtvkFzqDojg6MKbIENhR sEZiTwIg4Ppnymrvghysg== UI-OutboundReport: notjunk:1;M01:P0:1TaSGty0N6Y=;lZV2UndQPybL/JOoDinLscnMY23 mgcHuTLumpNk4L9XM+RDQ4wqrzf9A0UzWSUlHHmng9DXmKG2EuxV+HcA6AfrlXQj4VXon1Ayr KNZ6WWCVggwe1NqdtzsINVLgpkN0sFnP+gfSHNvE225IxnPge2+DAMrc8QVGZavhTDXY+r1hk NzE2t7urEYvf67OdNSyQ/x+RbUfmuwJcJv013wHR4ZvT+PDIk84vCg6SCX6rn4/VbXl7Kg9n/ JPGNwx8O8oqNrsZVL9Apxk11xA27b4cVo+NUVc+tSktf/q7WfKcFU/Kjj5dJ8wbQdDu1aR6OZ UYUZEv2UoEs14HKXbHU3w35doT0LdszXkq/efDqQPHz7VDL7TGclTT7l7Cfu9W/lblEw7FkLj DjUCeYhQlv116EpBkYqj06c4kLDPk6a9QRJFznV7GRc/XAE+AtH+LQITrDC1TI91bSkiyQxQO QdxkX/RqOF/VQqSIdU3rPeWqi7g0uXAvLbn45P761FsGDOfK/drn6+1rXprhkafNpuiWvm7+r jsw3cRqoD4pm+dypTOxmLzFdrUZRurz8R/s0mAknD232QlqZSx4IAQLHBsu00SdCxjskdEfPR BqIuq5cwYjIY4rwgMtylc6Ry2QgF100T0B9yrUdfCJMGNwg+jfSJyE6iFDrFptNXFQNgg2lh7 HsVB9ACsMh7wWZM7c/+m15+RJQ9dxMVCdES6mhBHMidC9aWjIocnugf22XXvBAxwKuC0HXVWm sZSiha4KTzkdMmHiT2aDcUB3wwKhyQ9qIvHGzSNfUOv2wyrPEUrY8UJIR+HWtlY7vOGnMdlaH 15oTt70iFKNTg1NxEjIdmhIVKRhnOc7mFphTJVkr2ueO4= X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE 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: Hi Steve, Am 13.02.24 um 18:21 schrieb Steve Kargl: > On Mon, Feb 12, 2024 at 09:57:08PM +0100, Harald Anlauf wrote: >> Dear all, >> >> the attached patch fixes a mis-handling of optional dummy arguments >> passed to optional dummy arguments of procedures with the bind(c) >> attribute. When those procedures are expecting CFI descriptors, >> there is no special treatment like a presence check necessary >> that by default passes a NULL pointer as default. >> >> The testcase tries to exercise various combinations of passing >> assumed-length character between bind(c) and non-bind(c), which >> apparently was insufficiently covered in the testsuite. >> >> Regtested on x86_64-pc-linux-gnu. OK for mainline? >> > > Yes. Thanks for filling out the more detailed testcase. indeed the new testcase just regressed due to commit r14-8947-g6caec7d9ec37e6 ... :-( Reduced testcase which fails on trunk: program p implicit none integer, parameter :: n =3D 100, l =3D 10 character(l) :: a =3D 'a234567890', b(n) =3D 'bcdefghijk' character(:), allocatable :: d, e(:) allocate (d, source=3Da) allocate (e, source=3Db) print *, len (d), len (e), size (e) call not_bindc_optional_deferred (d, e) deallocate (d, e) contains subroutine not_bindc_optional_deferred (c5, c6) character(:), allocatable, optional :: c5, c6(:) if (.not. present (c5) .or. .not. present (c6)) stop 6 print *, len (c5), len (c6), size (c6) if (len (c5) /=3D l .or. len (c6) /=3D l) stop 84 end end Expected: 10 10 100 10 10 100 After above commit: 10 10 100 10 0 100 STOP 84 Will have to wait until the cause is found and fixed...