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 F237F3858C39 for ; Fri, 1 Sep 2023 20:48:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org F237F3858C39 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 1qcB4K-0005AP-7f for gcc-patches@gcc.gnu.org; Fri, 01 Sep 2023 22:48:40 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: gcc-patches@gcc.gnu.org From: Harald Anlauf Subject: Re: [PATCH] Fortran: runtime bounds-checking in presence of array constructors [PR31059] Date: Fri, 1 Sep 2023 22:48:34 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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: <20230901204834.ldFsRc1Nh1fUPXBJRthBqUcpLEGQS8E-bD8EKaMOdBE@z> Hi Mikael, On 9/1/23 10:41, Mikael Morin via Gcc-patches wrote: > Le 31/08/2023 à 22:42, Harald Anlauf via Fortran a écrit : >> Dear all, >> >> gfortran's array bounds-checking code does a mostly reasonable >> job for array sections in expressions and assignments, but >> forgot the case that (rank-1) expressions can involve array >> constructors, which have a shape ;-) >> >> The attached patch walks over the loops generated by the >> scalarizer, checks for the presence of a constructor, and >> takes the first shape found as reference.  (If several >> constructors are present, discrepancies in their shape >> seems to be already detected at compile time). >> >> For more details on what will be caught now see testcase. >> >> Regtested on x86_64-pc-linux-gnu.  OK for mainline? >> > This is OK. I've pushed this is the first step. > May I suggest to handle functions the same way? I'll have a look at them, but will need to gather a few suitable testcases first. Thanks for the review! Harald > > Thanks. > >> Thanks, >> Harald >> > >