https://gcc.gnu.org/g:a2316fb8fe2cb295fa88e89652ab2eca6ee73847
commit a2316fb8fe2cb295fa88e89652ab2eca6ee73847 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 7976d672c539..5bda7e3b5cff 100644 --- a/gcc/fortran/trans-types.cc +++ b/gcc/fortran/trans-types.cc @@ -2975,7 +2975,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