https://gcc.gnu.org/g:b33b93e06ab1f1f2f0da259b1e4383da7284fda4
commit b33b93e06ab1f1f2f0da259b1e4383da7284fda4 Author: Mikael Morin <mik...@gcc.gnu.org> Date: Thu Mar 13 21:46:02 2025 +0100 Correction régression allocate_with_source_16.f90 Diff: --- gcc/fortran/trans-types.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gcc/fortran/trans-types.cc b/gcc/fortran/trans-types.cc index 7e4859bb434a..2ba3455ab6a0 100644 --- a/gcc/fortran/trans-types.cc +++ b/gcc/fortran/trans-types.cc @@ -2967,7 +2967,10 @@ gfc_get_derived_type (gfc_symbol * derived, int codimen) if (canonical_sym == derived) self_is_canonical = true; else if (canonical_sym != nullptr) - class_canonical = gfc_get_derived_type (canonical_sym, codimen); + { + tree canonical_decl = gfc_get_derived_type (canonical_sym, codimen); + class_canonical = TYPE_CANONICAL (canonical_decl); + } } /* The derived types from an earlier namespace can be used as the