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 9B2373858C74 for ; Sun, 26 Jun 2022 20:22:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9B2373858C74 X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.178.29] ([79.232.152.225]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MWzfl-1o81lo18Dx-00XNyt; Sun, 26 Jun 2022 22:22:57 +0200 Message-ID: Date: Sun, 26 Jun 2022 22:22:56 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [PATCH] Fortran: fix simplification of INDEX(str1,str2) [PR105691] Content-Language: en-US To: Thomas Koenig , fortran Newsgroups: gmane.comp.gcc.fortran References: <901c2c54-57a9-92ac-59e1-535a1f4227c6@netcologne.de> From: Harald Anlauf In-Reply-To: <901c2c54-57a9-92ac-59e1-535a1f4227c6@netcologne.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:t19MirIdgPF360IrUDZ3+uY09C213OxXAUnyqasAmEwLprsNlbc fhVsACxIrMGEtKvfLq752u1ZkQz2Kya6Qg9SMryM7E7361hEXyamcg7mvNIj6+W974qjbbT wGI7FBYRZ5x2UY68kPKwsvWui+lKZTnUkhmwLrCX6KfWl0FWu193d4RdSXEvKLG+6M/A8dq ztYfCLzoFZxUcPsbDFwzw== X-UI-Out-Filterresults: notjunk:1;V03:K0:fWw6TmsV/nI=:YCNcSKYSYFRb63vN8iBxjx TWFKZ0S108qXM5SB9kD3FrDicvzd5azE3gkhLYazqkG7nvHX2k0ZO56BuK6m1zJzbScYDmsZ9 ED2S7VJsynedJM94SDgbU9kG9FuOmYM/pbTHJiU/ed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AYES_00, BODY_8BITS, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, NICE_REPLY_A, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, 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 20:23:01 -0000 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=3D.true.) gave wron= g >> results.=C2=A0 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.=C2=A0 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 > > =C2=A0=C2=A0=C2=A0=C2=A0Thomas > 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 >