]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fortran: Simplify len_trim with array ref and fix mapping bug[PR84868].
authorPaul Thomas <pault@gcc.gnu.org>
Tue, 16 Jul 2024 14:56:44 +0000 (15:56 +0100)
committerPaul Thomas <pault@gcc.gnu.org>
Tue, 16 Jul 2024 14:56:44 +0000 (15:56 +0100)
commit9f966b6a8ff0244dd6f8bf36d876799d5f9bbaee
tree918c996efa3d62a7337970352212964318acd3bb
parentfec38d7987dd6d68b234b0076b57ac66a30a3a1d
Fortran: Simplify len_trim with array ref and fix mapping bug[PR84868].

2024-07-16  Paul Thomas  <pault@gcc.gnu.org>

gcc/fortran
PR fortran/84868
* simplify.cc (gfc_simplify_len_trim): If the argument is an
element of a parameter array, simplify all the elements and
build a new parameter array to hold the result, after checking
that it doesn't already exist.
* trans-expr.cc (gfc_get_interface_mapping_array) if a string
length is available, use it for the typespec.
(gfc_add_interface_mapping): Supply the se string length.

gcc/testsuite/
PR fortran/84868
* gfortran.dg/pr84868.f90: New test.
gcc/fortran/simplify.cc
gcc/fortran/trans-expr.cc
gcc/testsuite/gfortran.dg/pr84868.f90 [new file with mode: 0644]