]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fortran: ICE in derived type with a PDT component [PR102241,PR105380]
authorPaul Thomas <pault@gcc.gnu.org>
Tue, 30 Sep 2025 08:24:11 +0000 (09:24 +0100)
committerPaul Thomas <pault@gcc.gnu.org>
Tue, 30 Sep 2025 08:24:11 +0000 (09:24 +0100)
commitfb0702c6bd2d265aed452ba96e639d0ec4847d4f
treedf98bbdfca598519acbb2caa18615ffff4bd8031
parente0e93379fbadd90435fc7306f4af573f6a9554ff
Fortran: ICE in derived type with a PDT component [PR102241,PR105380]

2025-09-30  Paul Thomas  <pault@gcc.gnu.org>

gcc/fortran
PR fortran/102241
* gfortran.h: Add symbol attribute 'pdt_comp'.
* module.cc : Add 'pdt_comp' to 'ab_attribute' and 'attr_bits'.
(mio_symbol_attribute): Set 'pdt_comp'.
* resolve.cc (resolve_component): If a PDT component is found
in a non-PDT type, generate the PDT instance, if necessary, and
set the 'pdt_comp' attribute. Fix some whitespace issues.
* trans-decl.cc (gfc_get_symbol_decl, gfc_trans_deferred_vars):
If 'pdt_comp' set, initialize the PDT components.
* trans-stmt.cc (gfc_trans_deallocate): Verify that a typespec
parameter list is available for PDT components of ordinary
derived types.

gcc/testsuite/
PR fortran/105380
* gfortran.dg/pdt_49.f03: New test.

PR fortran/102241
* gfortran.dg/pdt_11.f03: Deallocate 'o_fdef'.
* gfortran.dg/pdt_15.f03: Reinstate final 'pop_8' and update
the tree dump counts.
* gfortran.dg/pdt_20.f03: Deallocate 'x'.
* gfortran.dg/pdt_23.f03: Deallocate 'x'.
* gfortran.dg/pdt_3.f03: Eliminate the temporary 'matrix' and
use w%d directly in the allocation. Change the TODO comment and
comment on memory leak in allocation.
* gfortran.dg/pdt_39.f03: Comments on memory leaks.
* gfortran.dg/pdt_40.f03: Deallocate 'foo' and bar%x.
* gfortran.dg/pdt_50.f03: New test.
14 files changed:
gcc/fortran/gfortran.h
gcc/fortran/module.cc
gcc/fortran/resolve.cc
gcc/fortran/trans-decl.cc
gcc/fortran/trans-stmt.cc
gcc/testsuite/gfortran.dg/pdt_11.f03
gcc/testsuite/gfortran.dg/pdt_15.f03
gcc/testsuite/gfortran.dg/pdt_20.f03
gcc/testsuite/gfortran.dg/pdt_23.f03
gcc/testsuite/gfortran.dg/pdt_3.f03
gcc/testsuite/gfortran.dg/pdt_39.f03
gcc/testsuite/gfortran.dg/pdt_40.f03
gcc/testsuite/gfortran.dg/pdt_49.f03 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/pdt_50.f03 [new file with mode: 0644]