Fortran: fix simplification of INDEX(str1,str2) [PR105691]
authorHarald Anlauf <anlauf@gmx.de>
Tue, 21 Jun 2022 21:20:18 +0000 (23:20 +0200)
committerHarald Anlauf <anlauf@gmx.de>
Thu, 30 Jun 2022 20:03:16 +0000 (22:03 +0200)
commit26ea506a1e8719f8b1f559e70bee9f5d3392eb37
treebb034089b0732867eef1aa5d98245937468db71b
parenteb4336f546b2a770717af608c79b4d46f45ef7c2
Fortran: fix simplification of INDEX(str1,str2) [PR105691]

gcc/fortran/ChangeLog:

PR fortran/105691
* simplify.cc (gfc_simplify_index): Replace old simplification
code by the equivalent of the runtime library implementation.  Use
HOST_WIDE_INT instead of int for string index, length variables.

gcc/testsuite/ChangeLog:

PR fortran/105691
* gfortran.dg/index_6.f90: New test.

(cherry picked from commit ff35dbc02092fbcd3d814fcd9fe8e871c3f741fd)
gcc/fortran/simplify.cc
gcc/testsuite/gfortran.dg/index_6.f90 [new file with mode: 0644]