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>
Sun, 26 Jun 2022 20:06:12 +0000 (22:06 +0200)
commitff35dbc02092fbcd3d814fcd9fe8e871c3f741fd
tree8f37d23b6a4c57cf227d568dd989b0a5981ecab7
parenta312407bd715647f7c11b67e0a52effc94d0f15d
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.
gcc/fortran/simplify.cc
gcc/testsuite/gfortran.dg/index_6.f90 [new file with mode: 0644]