Commit f5da9bfb by Janus Weil

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
parent 672ce110
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-10 Janus Weil <janus@gcc.gnu.org> 2018-09-10 Janus Weil <janus@gcc.gnu.org>
PR fortran/85395 PR fortran/85395
......
...@@ -5385,16 +5385,13 @@ gfc_is_simply_contiguous (gfc_expr *expr, bool strict, bool permit_element) ...@@ -5385,16 +5385,13 @@ gfc_is_simply_contiguous (gfc_expr *expr, bool strict, bool permit_element)
return expr->value.function.esym->result->attr.contiguous; return expr->value.function.esym->result->attr.contiguous;
else else
{ {
/* We have to jump through some hoops if this is a vtab entry. */ /* Type-bound procedures. */
gfc_symbol *s; gfc_symbol *s = expr->symtree->n.sym;
gfc_ref *r, *rc; if (s->ts.type != BT_CLASS && s->ts.type != BT_DERIVED)
s = expr->symtree->n.sym;
if (s->ts.type != BT_CLASS)
return false; return false;
rc = NULL; gfc_ref *rc = NULL;
for (r = expr->ref; r; r = r->next) for (gfc_ref *r = expr->ref; r; r = r->next)
if (r->type == REF_COMPONENT) if (r->type == REF_COMPONENT)
rc = r; rc = r;
......
2018-09-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/86830
* gfortran.dg/typebound_call_30.f90: New test case.
2018-09-10 Janus Weil <janus@gcc.gnu.org> 2018-09-10 Janus Weil <janus@gcc.gnu.org>
PR fortran/85395 PR fortran/85395
......
! { dg-do compile }
!
! PR 86830: [8/9 Regression] Contiguous array pointer function result not recognized as contiguous
!
! Contributed by <only_for_nouse@gmx.de>
module m
implicit none
type :: t1
contains
procedure :: get_ptr
end type
type :: t2
class(t1), allocatable :: c
end type
contains
function get_ptr(this)
class(t1) :: this
real, dimension(:), contiguous, pointer :: get_ptr
end function
subroutine test()
real, dimension(:), contiguous, pointer:: ptr
type(t2) :: x
ptr => x%c%get_ptr()
end subroutine
end module
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment