------- Comment #25 from rguenth at gcc dot gnu dot org 2009-07-24 15:54 ------- Ah, btw I remember that the Fortran FE creates a new type copy for each array descriptor and links them in the type variant chains (wtf?).
Can you try Index: gcc/fortran/trans-types.c =================================================================== --- gcc/fortran/trans-types.c.orig 2009-07-24 17:54:08.000000000 +0200 +++ gcc/fortran/trans-types.c 2009-07-24 17:53:51.000000000 +0200 @@ -1602,7 +1602,7 @@ 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); tmp = TYPE_NAME (etype); if (tmp && TREE_CODE (tmp) == TYPE_DECL) ? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40005