From c9dfc4144a464f1ee0306ff388ee85e2c178f18c Mon Sep 17 00:00:00 2001 From: Paul Thomas Date: Sun, 4 Jul 2010 14:40:34 +0000 Subject: re PR fortran/44596 ([OOP] Dynamic dispatch uses broken types) 2010-07-04 Paul Thomas PR fortran/44596 PR fortran/44745 * trans-types.c (gfc_get_derived_type): Derived type fields with the vtype attribute must have TYPE_REF_CAN_ALIAS_ALL set. From-SVN: r161801 --- gcc/fortran/ChangeLog | 7 +++++++ gcc/fortran/trans-types.c | 4 ++++ 2 files changed, 11 insertions(+) (limited to 'gcc/fortran') diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index c8801b0..3dcb424 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,10 @@ +2010-07-04 Paul Thomas + + PR fortran/44596 + PR fortran/44745 + * trans-types.c (gfc_get_derived_type): Derived type fields + with the vtype attribute must have TYPE_REF_CAN_ALIAS_ALL set. + 2010-07-02 Mikael Morin PR fortran/44662 diff --git a/gcc/fortran/trans-types.c b/gcc/fortran/trans-types.c index f4e78c2..1de624f 100644 --- a/gcc/fortran/trans-types.c +++ b/gcc/fortran/trans-types.c @@ -2152,6 +2152,10 @@ gfc_get_derived_type (gfc_symbol * derived) && !c->attr.proc_pointer) field_type = build_pointer_type (field_type); + /* vtype fields can point to different types to the base type. */ + if (c->ts.type == BT_DERIVED && c->ts.u.derived->attr.vtype) + TYPE_REF_CAN_ALIAS_ALL (field_type) = true; + field = gfc_add_field_to_struct (&fieldlist, typenode, get_identifier (c->name), field_type, &chain); -- cgit v1.1