summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpault <pault@138bc75d-0d04-0410-961f-82ee72b054a4>2010-07-04 14:40:34 +0000
committerpault <pault@138bc75d-0d04-0410-961f-82ee72b054a4>2010-07-04 14:40:34 +0000
commit4acb7fcc85761ef62d62aceeda5ca85ff71fb8a2 (patch)
tree096f9841645f1ba083ccf0998dcc00297a52d38e
parentbc6af3fe93d454e9b47d68317c8998413e9e9469 (diff)
downloadgcc-4acb7fcc85761ef62d62aceeda5ca85ff71fb8a2.tar.gz
2010-07-04 Paul Thomas <pault@gcc.gnu.org>
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@161801 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/fortran/ChangeLog7
-rw-r--r--gcc/fortran/trans-types.c4
2 files changed, 11 insertions, 0 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index c8801b0d264..3dcb42489bb 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,10 @@
+2010-07-04 Paul Thomas <pault@gcc.gnu.org>
+
+ 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 <mikael@gcc.gnu.org>
PR fortran/44662
diff --git a/gcc/fortran/trans-types.c b/gcc/fortran/trans-types.c
index f4e78c25d4f..1de624fb819 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);