From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ciao.gmane.io (ciao.gmane.io [116.202.254.214]) by sourceware.org (Postfix) with ESMTPS id 479E73857727 for ; Fri, 15 Sep 2023 19:17:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 479E73857727 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=gmx.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=m.gmane-mx.org Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1qhEJL-0009tM-Ky for gcc-patches@gcc.gnu.org; Fri, 15 Sep 2023 21:17:03 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: gcc-patches@gcc.gnu.org From: Harald Anlauf Subject: Re: [PATCH] Fortran: improve bounds-checking for array sections [PR30802] Date: Fri, 15 Sep 2023 21:16:56 +0200 Message-ID: <48c24c0b-5f3e-4858-bf0c-45180e5eb834@gmx.de> References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Mozilla Thunderbird Content-Language: en-US In-Reply-To: Cc: fortran@gcc.gnu.org X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,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: Message-ID: <20230915191656.eGZcxv1XgF5sDDCocJ4nUmmA7S95JMINQmRbmMdIZm0@z> Hi Paul, On 9/15/23 11:13, Paul Richard Thomas via Gcc-patches wrote: > Hi Harald, > > The statement, > > in array_bound_check_elemental is redundant since the call is > determined by a more restrictive condition. > > + if (!(gfc_option.rtcheck & GFC_RTCHECK_BOUNDS)) > + return; yeah, this was left over from playing, since I thought the outlined function could be used more than once. I've removed those lines before pushing. Thanks for the review! Harald > Apart from that, it looks good to me. OK for mainline. > > Thanks for the patch. > > Paul > > On Thu, 14 Sept 2023 at 21:22, Harald Anlauf via Fortran > wrote: >> >> Dear all, >> >> array bounds checking was missing a few cases of array sections >> that are handled via gfc_conv_expr_descriptor. Bounds checking >> was done for the dimensions with ranges, but not for elemental >> dimensions. >> >> The attached patch implements that and fixes pr30802 and also >> pr97039, maybe a few more similar cases. >> >> Regtested on x86_64-pc-linux-gnu. OK for mainline? >> >> Thanks, >> Harald >> >