diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2018-02-23 22:36:54 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2018-02-23 22:36:54 +0000 |
commit | 88a3ea34080ad3087a8191fbf479543153175d59 (patch) | |
tree | 34eaec34d3588e09f9a77abba776266f124dc823 /gcc/fortran/trans-array.c | |
parent | 25e15aaed275cdfef34b3ee6eb3cb4b43a48d44f (diff) | |
parent | e65055a558093bd4fc0b1b0024b7814cc187b8e8 (diff) | |
download | gccgo.tar.gz |
Merge from trunk revision 257954.gccgo
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gccgo@257955 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/trans-array.c')
-rw-r--r-- | gcc/fortran/trans-array.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c index 4ffda26ca7d..e321db35ac2 100644 --- a/gcc/fortran/trans-array.c +++ b/gcc/fortran/trans-array.c @@ -7341,7 +7341,11 @@ gfc_conv_expr_descriptor (gfc_se *se, gfc_expr *expr) else { /* Otherwise make a new one. */ - parmtype = gfc_get_element_type (TREE_TYPE (desc)); + if (expr->ts.type == BT_CHARACTER && expr->ts.deferred) + parmtype = gfc_typenode_for_spec (&expr->ts); + else + parmtype = gfc_get_element_type (TREE_TYPE (desc)); + parmtype = gfc_get_array_type_bounds (parmtype, loop.dimen, codim, loop.from, loop.to, 0, GFC_ARRAY_UNKNOWN, false); @@ -9470,29 +9474,32 @@ bool gfc_is_reallocatable_lhs (gfc_expr *expr) { gfc_ref * ref; + gfc_symbol *sym; if (!expr->ref) return false; + sym = expr->symtree->n.sym; + /* An allocatable class variable with no reference. */ - if (expr->symtree->n.sym->ts.type == BT_CLASS - && CLASS_DATA (expr->symtree->n.sym)->attr.allocatable + if (sym->ts.type == BT_CLASS + && CLASS_DATA (sym)->attr.allocatable && expr->ref && expr->ref->type == REF_COMPONENT && strcmp (expr->ref->u.c.component->name, "_data") == 0 && expr->ref->next == NULL) return true; /* An allocatable variable. */ - if (expr->symtree->n.sym->attr.allocatable + if (sym->attr.allocatable && expr->ref && expr->ref->type == REF_ARRAY && expr->ref->u.ar.type == AR_FULL) return true; /* All that can be left are allocatable components. */ - if ((expr->symtree->n.sym->ts.type != BT_DERIVED - && expr->symtree->n.sym->ts.type != BT_CLASS) - || !expr->symtree->n.sym->ts.u.derived->attr.alloc_comp) + if ((sym->ts.type != BT_DERIVED + && sym->ts.type != BT_CLASS) + || !sym->ts.u.derived->attr.alloc_comp) return false; /* Find a component ref followed by an array reference. */ |