Fortran: [PDT] Fix faults in fiats runtime [PR123545,PR123673,PR122949]
2026-02-08 Paul Thomas <pault@gcc.gnu.org>
gcc/fortran
PR fortran/123545
PR fortran/123673
* decl.cc (gfc_get_pdt_instance): If a pdt_type component is
allocatable or has allocatable components, mark it alloc_comp.
(gfc_match_decl_type_spec): Sometimes in compiling contained
functions, the symtree for the constructor points to the type
instead of the constructor symbol. This corrects itself later
in compilation so return MATCH_YES.
* trans-decl.cc (gfc_generate_function_code): Unconditionally
nullify allocatable components as well as applying the default
initializer.
* trans-expr.cc (gfc_trans_alloc_subarray_assign): Restrict the
freeing of the destination data to non-allocatable expressions
and, instead, add the se finalblock to the encompassing final_
block.
gcc/testsuite
PR fortran/123545
* gfortran.dg/pdt_82.f03: New test.
PR fortran/123673
* gfortran.dg/pdt_83.f03: New test.
PR fortran/122949
* gfortran.dg/pr122949.f90: New test.