https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128103
--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Mikael Morin <[email protected]>: https://gcc.gnu.org/g:73f6a2a76473bd42fcb86d973bbb43ae89a98f73 commit r17-5518-g73f6a2a76473bd42fcb86d973bbb43ae89a98f73 Author: Mikael Morin <[email protected]> Date: Fri Oct 23 11:40:45 2026 +0200 fortran: Unwrap class container from descritors' element type [PR128103] Fortran-tested on aarch64-unknown-linux-gnu. It's simple enough; I plan to push it to mainline, today or tomorrow. -- >8 -- The testcase shows one example where we use a class container type as element type of an array descriptor. This causes the element length to be initialized to the wrong value, with an effect visible by the ASSOCIATED intrinsic at execution time. This change fixes the problem by detecting the class container and unwrapping it before using it for array descriptor type creation. PR fortran/128103 gcc/fortran/ChangeLog: * trans-array.cc (gfc_conv_expr_descriptor): Unwrap any class container from the type to use as array descriptor element type. gcc/testsuite/ChangeLog: * gfortran.dg/associated_9.f90: New test.
