https://gcc.gnu.org/g:f37e0ff4a7367fdc96419995b2fab0b5e090fd24
commit f37e0ff4a7367fdc96419995b2fab0b5e090fd24 Author: Mikael Morin <mik...@gcc.gnu.org> Date: Wed Apr 23 21:08:02 2025 +0200 Correction régression transfer_class_3 Diff: --- gcc/fortran/trans-types.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gcc/fortran/trans-types.cc b/gcc/fortran/trans-types.cc index 74f922ffc2d3..92d592f52f12 100644 --- a/gcc/fortran/trans-types.cc +++ b/gcc/fortran/trans-types.cc @@ -3205,6 +3205,13 @@ gfc_get_derived_type (gfc_symbol * derived, int codimen) gfc_build_array_type should use !is_ptr instead of c->attr.pointer and codim unconditionally without '? :'. */ akind = GFC_ARRAY_ASSUMED_SHAPE; + + /* Use char as array element type for unlimited_polymorphic + entities. */ + if (c->ts.type == BT_DERIVED + && c->ts.u.derived->attr.unlimited_polymorphic + && field_type == ptr_type_node) + field_type = char_type_node; /* Pointers to arrays aren't actually pointer types. The descriptors are separate, but the data is common. Every array pointer in a coarray derived type needs to provide space