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 3080F3857BA3 for ; Sun, 26 Jun 2022 20:23:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3080F3857BA3 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1o5Yma-000ARm-Hs for fortran@gcc.gnu.org; Sun, 26 Jun 2022 22:23:00 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: fortran@gcc.gnu.org From: Harald Anlauf Subject: Re: [PATCH] Fortran: fix simplification of INDEX(str1,str2) [PR105691] Date: Sun, 26 Jun 2022 22:22:56 +0200 Message-ID: References: <901c2c54-57a9-92ac-59e1-535a1f4227c6@netcologne.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Content-Language: en-US In-Reply-To: <901c2c54-57a9-92ac-59e1-535a1f4227c6@netcologne.de> X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00, BODY_8BITS, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, NICE_REPLY_A, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no 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 20:23:04 -0000 Message-ID: <20220626202256.3itTm9FLMOJP7gNM8p74lYfmCiEVdLuDdJsUvWbLcmg@z> Hi Thomas, thanks for the reviews! Harald Am 26.06.22 um 11:14 schrieb Thomas Koenig via Fortran: > Hello Harald, > >> compile time simplification of INDEX(str1,str2,back=.true.) gave wrong >> results.  Looking at gfc_simplify_index, this appeared to be close to >> a complete mess, while the runtime library code - which was developed >> later - was a relief. >> >> The solution is to use the runtime library code as template to fix this. >> I took the opportunity to change string index and length variables >> in gfc_simplify_index to HOST_WIDE_INT. >> >> Regtested on x86_64-pc-linux-gnu.  OK for mainline? >> >> As this is a wrong-code issue, would this qualify for backports to >> open branches? > > OK for both. > > Thanks for the patch! > > > Best regards > >     Thomas >