]> 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>
Fri, 25 Oct 2024 08:58:06 +0000 (09:58 +0100)
commitb5211c13cf2ca3576ae287b204640516de20ecff
treefdf4a991c942467773827606848ee90098de19ca
parentab84a8a4b78990942e006e9f060dc2705f2c6d8f
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.

(cherry picked from commit 9f966b6a8ff0244dd6f8bf36d876799d5f9bbaee)
gcc/fortran/simplify.cc
gcc/fortran/trans-expr.cc
gcc/testsuite/gfortran.dg/pr84868.f90 [new file with mode: 0644]