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 05AD43858D1E; Fri, 1 Sep 2023 20:48:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 05AD43858D1E 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=1693601316; x=1694206116; i=anlauf@gmx.de; bh=YWctaEVuq6S3klNxiftydT73GcLuZlXYnUUeWpAw/P0=; h=X-UI-Sender-Class:Date:Subject:To:References:From:In-Reply-To; b=gDjdGA8vSxYCnvg6fpcY0omwcSULWra1mMUfgJx27f8/H1DVjEBS6i8OIGy8qiiwflb4o1s P3H5nLfgs/ekAxM9t0I/y6irdoxhHN3K3dpbeImnVoejB9yXShCjAV9TxtlIPnwJaxQErA9Ds WelrnPKKMx/hr2DxbceobkW2nlNHfnNF8wHnxAil0NJH35Rfbkd1nWPbx/RbNxuaH8d5K2Qqx TDgG4Vy8eT8eO7sGaBxyPjZAcyvgtrVYBfsYOwLdlWa29IBtrzbshDTEi0RQIuu7n1JK/4+kg g81x3w6nhu9zFJ+CF2dod2XBsVpaDjjeVauEHV2q/aI1zDaryJWA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [192.168.178.29] ([79.251.2.50]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MLiCu-1qKVgy02Pg-00HemT; Fri, 01 Sep 2023 22:48:36 +0200 Message-ID: Date: Fri, 1 Sep 2023 22:48:34 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] Fortran: runtime bounds-checking in presence of array constructors [PR31059] To: Mikael Morin , 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:X5PQvXR6v0hrY/JCXfLoE+/CVqGRdkEsFzlErnz1h6PuZuXNgb5 PNLZmesjiswh7xQBJ9I2h1tGfFUbC+OYdvPSVNRk2PFTaSETBOk8+atiZkKS8FDQn/Y0HB5 2BXfqgSzCeGaKPjFBkxV4JJWvFPhcaIR+i3grQgzTIPBgwCWINjAon0mq6yngKhcZufMKpG FtsWzCfDmw95ewzDSb13A== UI-OutboundReport: notjunk:1;M01:P0:6qKaAIYOYZE=;HV2f+L3gKM7LCbCOPhdUtyfqQdK 6i4jzxwdxnpCs/YgUMFWHTCmBqFEnZjiXBXsCz+IxTcgqEKRI2mTVt2z+X7T3bkgwTCmrYe+i RbP3cB+ju4z8poioGFbw7Rg/fPfxy+vctmSEgGflkjBYTzKLCpZ4gBhsaxr8GAVpwhELm37YH BTTqvFlBxVffe9sn1ygqxWYa8woLT/AtGZXXE8wFTZCfh0qZe8iJtp7lTQZvdLEewio4FuFNJ PjPulv+j7Msvyq43AeqE8aOqpdlI/YFhNGkwFMSAJcqcKAQNh7qAlS8vgKo/43cV9uW8ypFqc 0L+rqjm3L/qKxVyr2WbQv8knuz2xHY1Sdgy6j8yuWJ0N4LkfFUP9mdvqQfD8LhvVZSkSoOFQf SIiG8ETDG6kQW9cBI45amhL5pgoxVnCPR3KnkvuUjcCuFgyezwtOQ+VIw4TnMjZ3m3SMoFFmk 03x+wjFcXS2bR3x4YQVmhbHIjsvHtotMgXYTmhj88Ry35hdwew5qXxf1+VXZ2r64BYsU5f2Z1 AaHD71AEquNRfgxM++WyBZet2NdZPmE2Xs7+6thcrrH46aC85fKVO2BhWi349pufrN9TSAGx4 NZC79M4fxsiMhw3mqsNjoGm2tYyp1h73ToM99uV7PZAGWq5mI2YlTZSY0Opp/wFE13WyezPSH TVqDaKevCK4khSm3QNYZSkv/xeZtBVtaixr9yhleuB9f92XT2fQdk5mi1ADplpHYlkfu3MOJm npQatWtpc5gwIDzM5KHPlQGR/4CHxfMD4Ld6iw0k6apfXIMaRdGBZNYCmwXgFYX8MKObdOh77 7rVqtUW+TVDbzGldJ2ZeaGQ03uyaYFQuAMUXLmeRExhK0dZ3upvW23mch1XUZIHyBRXlb0Qb4 SgWhp0/N90cviMh/1lNzHqWeC+Gb08A3x/yOE+R5kt+O0dZiFW8l6pZbkDjPY/9YDrG7vo6OD rBuqvA== X-Spam-Status: No, score=-5.0 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_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,TXREP 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 Mikael, On 9/1/23 10:41, Mikael Morin via Gcc-patches wrote: > Le 31/08/2023 =C3=A0 22:42, Harald Anlauf via Fortran a =C3=A9crit=C2=A0= : >> 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.=C2=A0 (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.=C2=A0 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 >> > >