]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fortran: Create fresh ts.u.cl for result in gfc_get_symbol_for_expr [PR118441]
authorTobias Burnus <tburnus@baylibre.com>
Thu, 16 Jan 2025 10:50:26 +0000 (11:50 +0100)
committerTobias Burnus <tburnus@baylibre.com>
Thu, 16 Jan 2025 10:50:26 +0000 (11:50 +0100)
commitc5a8e22c5dacf4f9d4f66e60990bf34c70f04714
tree7dc4ee304c4039cd8f958fe3643bbfc3e8189a04
parent462a7f45caf78466ee6d9a1256a1e2848e4ec49c
Fortran: Create fresh ts.u.cl for result in gfc_get_symbol_for_expr [PR118441]

For intrinsic routines, called in libraries, the prototype is created from
the call via gfc_get_symbol_for_expr. For the actual arguments, it calls
gfc_copy_formal_args_intr which already ensures that the ts.u.cl is freshly
allocated.

This commit now ensures the same for character-returning functions.

PR fortran/118441

gcc/fortran/ChangeLog:

* trans-intrinsic.cc (gfc_get_symbol_for_expr): Use
gfc_new_charlen for character-returning functions.

gcc/testsuite/ChangeLog:

* gfortran.dg/gomp/intrinsic_pack_7.f90: New test.
gcc/fortran/trans-intrinsic.cc
gcc/testsuite/gfortran.dg/gomp/intrinsic_pack_7.f90 [new file with mode: 0644]