------- Comment #35 from rguenth at gcc dot gnu dot org 2009-07-24 19:14 ------- Ok, less hacky is the following.
Index: gcc/fortran/trans-types.c =================================================================== --- gcc/fortran/trans-types.c.orig 2009-07-24 21:13:28.000000000 +0200 +++ gcc/fortran/trans-types.c 2009-07-24 21:13:05.000000000 +0200 @@ -1602,7 +1602,9 @@ gfc_get_array_type_bounds (tree etype, i int n; base_type = gfc_get_array_descriptor_base (dimen); - fat_type = build_variant_type_copy (base_type); + fat_type = build_distinct_type_copy (base_type); + TYPE_CANONICAL (fat_type) = base_type; + TYPE_STUB_DECL (fat_type) = TYPE_STUB_DECL (base_type); tmp = TYPE_NAME (etype); if (tmp && TREE_CODE (tmp) == TYPE_DECL) I think that is the right thing to do (together with the GC patch). So if it passes bootstrap & testing ... -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40005