aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/expr.c
diff options
context:
space:
mode:
authorJanus Weil <janus@gcc.gnu.org>2018-09-11 08:33:39 +0200
committerJanus Weil <janus@gcc.gnu.org>2018-09-11 08:33:39 +0200
commitf5da9bfb9e7b729db8243f656a1c7341e2d97655 (patch)
tree5ec7bac40b1c423111fc052dbe818d0d620b71a8 /gcc/fortran/expr.c
parent672ce110a853a23adf8b43c58c48957258d9bf86 (diff)
downloadgcc-f5da9bfb9e7b729db8243f656a1c7341e2d97655.zip
gcc-f5da9bfb9e7b729db8243f656a1c7341e2d97655.tar.gz
gcc-f5da9bfb9e7b729db8243f656a1c7341e2d97655.tar.bz2
re PR fortran/86830 (Contiguous array pointer function result not recognized as contiguous)
fix PR 86830 2018-09-11 Janus Weil <janus@gcc.gnu.org> PR fortran/86830 * expr.c (gfc_is_simply_contiguous): Handle type-bound procedure calls with non-polymorphic objects. 2018-09-11 Janus Weil <janus@gcc.gnu.org> PR fortran/86830 * gfortran.dg/typebound_call_30.f90: New test case. From-SVN: r264201
Diffstat (limited to 'gcc/fortran/expr.c')
-rw-r--r--gcc/fortran/expr.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c
index c5bf822..97792fe 100644
--- a/gcc/fortran/expr.c
+++ b/gcc/fortran/expr.c
@@ -5385,16 +5385,13 @@ gfc_is_simply_contiguous (gfc_expr *expr, bool strict, bool permit_element)
return expr->value.function.esym->result->attr.contiguous;
else
{
- /* We have to jump through some hoops if this is a vtab entry. */
- gfc_symbol *s;
- gfc_ref *r, *rc;
-
- s = expr->symtree->n.sym;
- if (s->ts.type != BT_CLASS)
+ /* Type-bound procedures. */
+ gfc_symbol *s = expr->symtree->n.sym;
+ if (s->ts.type != BT_CLASS && s->ts.type != BT_DERIVED)
return false;
- rc = NULL;
- for (r = expr->ref; r; r = r->next)
+ gfc_ref *rc = NULL;
+ for (gfc_ref *r = expr->ref; r; r = r->next)
if (r->type == REF_COMPONENT)
rc = r;