http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45586
--- Comment #64 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-02-14 13:20:37 UTC --- Index: gcc/fortran/trans-types.c =================================================================== --- gcc/fortran/trans-types.c (revision 184203) +++ gcc/fortran/trans-types.c (working copy) @@ -2042,7 +2042,8 @@ gfc_nonrestricted_type (tree t) } if (!field) break; - ret = build_variant_type_copy (t); + ret = build_distinct_type_copy (t); + TYPE_CANONICAL (ret) = TYPE_CANONICAL (t); TYPE_FIELDS (ret) = NULL_TREE; /* Here we make sure that as soon as we know we have to copy works here, but I suspect it would not fix the Fortran -flto ICEs in PR51765 (which happen on pristine trunk, much to the same issue I suppose).