From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from cc-smtpout3.netcologne.de (cc-smtpout3.netcologne.de [89.1.8.213]) by sourceware.org (Postfix) with ESMTPS id B6994385828F; Sun, 26 Jun 2022 08:43:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B6994385828F Received: from cc-smtpin2.netcologne.de (cc-smtpin2.netcologne.de [89.1.8.202]) by cc-smtpout3.netcologne.de (Postfix) with ESMTP id 89C9C123AD; Sun, 26 Jun 2022 10:43:18 +0200 (CEST) Received: from [IPV6:2001:4dd7:3fa9:0:7285:c2ff:fe6c:992d] (2001-4dd7-3fa9-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de [IPv6:2001:4dd7:3fa9:0:7285:c2ff:fe6c:992d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by cc-smtpin2.netcologne.de (Postfix) with ESMTPSA id 437C311E7A; Sun, 26 Jun 2022 10:43:16 +0200 (CEST) Message-ID: <5d6f01a6-fa94-2d03-4257-c65cfda3074a@netcologne.de> Date: Sun, 26 Jun 2022 10:43:15 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH] Fortran: handle explicit-shape specs with constant bounds [PR105954] Content-Language: en-US To: Harald Anlauf , fortran , gcc-patches References: From: Thomas Koenig In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-NetCologne-Spam: L X-Spamd-Bar: --- X-Rspamd-Queue-Id: 437C311E7A X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_LOW, 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 X-BeenThere: fortran@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Fortran mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jun 2022 08:43:23 -0000 Hello Harald, > after simplification of constant bound expressions of an explicit > shape spec of an array, we need to ensure that we never obtain > negative extents. In some cases this did happen, and we ICEd > as we hit an assert that this should never happen... > > The original testcase by Gerhard exhibited this for sizeof() > of a derived type with an array component, but the issue is > more fundamental and affects other intrinsics during > simplification. > > A straightforward solution "fixes up" the upper bound in the > shape spec when it is known to be below lower bounds minus one. > > Regtested on x86_64-pc-linux-gnu. OK for mainline? OK. Thanks for the patch! Regards Thomas