From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) by sourceware.org (Postfix) with ESMTPS id 416873857C45; Fri, 24 Feb 2023 21:25:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 416873857C45 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmx.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1677273936; i=anlauf@gmx.de; bh=VVZMSs/lEYWX/sJufmZWC4J6r1QC59pTmpntvWHTelo=; h=X-UI-Sender-Class:Date:Subject:To:References:From:In-Reply-To; b=G5q7MSov5HKPdYQj5Gkd9DNlMci3bwiJZ0G/Bq3roq1GgLZOuvUA/wLHtlEklkzZP eetrdKIp/fiPmfWbZyimLdOVzQnIfDhHRIn+hyyIsY8X5cFt2pUVlLQadnrSwbXx4n lwwWLEeb0clLQUgtvkaWKo841XAApLGF/7lYkEKcTFvBnMT9Hk153PruS2eh4APNe5 uczM5gfZcVz2WmL1gTG+QUXKzOlaU6/wFgvrSkd7tXyU5J7r1AEPPiTqgprAI2Cws5 JqeIp+KGWH2ucl4o1sZcj8nlIcfoT3JJTGZJ7O0zKben95uMCKb26mY1akC/5ijRZ3 qNIDLCoa9x+XQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [192.168.178.29] ([93.207.80.111]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MHXBp-1pIB2v09T7-00DYB4; Fri, 24 Feb 2023 22:25:36 +0100 Message-ID: <6bad55d7-d508-04af-88c2-8f0ec7e15419@gmx.de> Date: Fri, 24 Feb 2023 22:25:34 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [Patch] Fortran: Skip bound conv in gfc_conv_gfc_desc_to_cfi_desc with intent(out) ptr [PR108621] To: Tobias Burnus , gcc-patches , fortran Newsgroups: gmane.comp.gcc.patches,gmane.comp.gcc.fortran References: <07be8524-0755-6b77-49bd-af5c688404d5@codesourcery.com> Content-Language: en-US From: Harald Anlauf In-Reply-To: <07be8524-0755-6b77-49bd-af5c688404d5@codesourcery.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:rjB3Sc4j0lkXHMZYDcmbjWtgMPXA8LHint5G6bNmaHekMG/9RKn tPtUAThoN9RrQfEGfP1oxqF//Cl5FwiKsVeYOaySJulSlrtzX9t5tw3TR332m7+/EE3Ht26 4OmxxtmE6dBCr4h0/EoIPLqeYzdKXwnI6MMMojT5JfEZ9SgvN4ZjnJw3bAL1c7GVeRWqmvZ +r2hnj3epBdjbX2hGBinA== UI-OutboundReport: notjunk:1;M01:P0:e1p/VizK5hE=;YOPmYcK7+ZygGOYkaWwsdF0QZhi zi0EuhoTaXk1gZlsVgqTVbR+i3mOsuH3tcNDjpCAoBh4N6M6qNngOJEX74gB78Rbdx9JhBicA LwcRu5lBuRYKk3wZz6Td3bOUdoEy+vN4LDTwmin27n5AInCmT8qyfJqaieaNQcqCPBvlJGs55 6XvxkjSAPXWVRUFczszqtfv6Gv3r7fPpPsHGmiimLXUyR43e1Y7N5xs2vncoBURttMcGtSXb7 9J4zKmxjRdRAmJDF0mI1UAFiNHgQ9woVW3jPWqR8aFAp0yGY0HDCaQASjOAgFwgED7yZmGLp2 BAhxCQXDhdsOeqCbn4uhDP0NvaNgAO1X2famkKHPeJlZEAFzakqBlc9i2afpEG2MbtswRrq5L 2h+VN6zr5bloxWm0ruNLLlx6k4c9Xdm0jOI0ty4MloT6HJ7TQlg4y/075jX55Xil9/j0EIkuj e8JCoveP3oXJHcKSGuGjNIohW7eTFErxSzxUoUqAvi35hvRPpgUXwc3d3JLhMYc7okConIocW 35Ims2/5bsN+dX9INna+MrUf3SGPhFrAdATLGjw9x9y41VS0YhU3dgBABc8XpWKihVUf0LaAh S1Fm1+P5XevuDfWQknJ7p+hgQCyKZAjhenioMoNMg3U9R19c0n4wazLZ8OFAXfooAvotCVK5C vtb0iHg/NU1HC2bg4bFKRdIgkq9wEDZHBXt+JqJ9UqnWJYWp+f2LzaOBUcwuGNDyRJtT2bTrO niKTzv+OtlT9ioq8gZURCd/YFWvoZlmjRkuOCAHbxhv6M6fKYyaDy5TeZB2rwF01xi1f+4nQi G87Lc0szYBi9sgJh/raqXhIBgZlVXGAAATH5HWJhemVS/8Ki3nbcIzOLorkbWdnmU+TTGGj67 C7OkipFbSkvRWHpDZKLSfiS6TyyuDLhMGfym/ZrFa+JuRO+MBpLpuALR1PtWJbbvj7W9G2dkE hPtoPugIBY4gwJbI9gdH504LXzc= X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A,RCVD_IN_BARRACUDACENTRAL,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,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: Hi Tobias, Am 24.02.23 um 12:31 schrieb Tobias Burnus: > (B) The attached patch: > > With 'intent(out)' there is no reason to do the conversions. While for > nullified > pointers the bounds-conversion loop is skipped, it may still be executed > for undefined > pointers. (Which is usually harmless.) In either case, not generating > this code makes > sense. > > OK for mainline? LGTM. I was pondering whether one should keep the testcase closer to the one in the PR, but the essence of the bug and the fix is well represented in the reduced version, and also the tree dump tells the whole story anyway. > Regarding GCC 12:=C2=A0 I am not really sure as it is no real regression= . > Besides bogus > warnings, there might be an issue for undefined pointers and > -fsanitize=3Dundefined, namely > if 'ubound - lbound' evaluated on random numbers overflows (such as for > ubound =3D huge(..) > and lbound =3D -huge(..)). But that looks like a rather special case. - > Thoughts? I'd rather consider the case of undefined pointers as of practical importance. It's up to you or others to decide whether it should be backported. I would not oppose. Thanks for the patch! Harald > Tobias > ----------------- > Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstra=C3=9Fe = 201, > 80634 M=C3=BCnchen; Gesellschaft mit beschr=C3=A4nkter Haftung; Gesch=C3= =A4ftsf=C3=BChrer: > Thomas Heurung, Frank Th=C3=BCrauf; Sitz der Gesellschaft: M=C3=BCnchen; > Registergericht M=C3=BCnchen, HRB 106955