aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-array.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran/trans-array.c')
-rw-r--r--gcc/fortran/trans-array.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c
index a3aab8e..d0dfc26 100644
--- a/gcc/fortran/trans-array.c
+++ b/gcc/fortran/trans-array.c
@@ -8220,9 +8220,17 @@ structure_alloc_comps (gfc_symbol * der_type, tree decl,
/* Shortcut to get the attributes of the component. */
if (c->ts.type == BT_CLASS)
- attr = &CLASS_DATA (c)->attr;
+ {
+ attr = &CLASS_DATA (c)->attr;
+ if (attr->class_pointer)
+ continue;
+ }
else
- attr = &c->attr;
+ {
+ attr = &c->attr;
+ if (attr->pointer)
+ continue;
+ }
if ((c->ts.type == BT_DERIVED && !c->attr.pointer)
|| (c->ts.type == BT_CLASS && !CLASS_DATA (c)->attr.class_pointer))