{
rse.expr = gfc_class_data_get (rse.expr);
gfc_add_modify (&lse.pre, desc, rse.expr);
- /* Set the lhs span. */
- tmp = TREE_TYPE (rse.expr);
- tmp = TYPE_SIZE_UNIT (gfc_get_element_type (tmp));
- tmp = fold_convert (gfc_array_index_type, tmp);
- gfc_conv_descriptor_span_set (&lse.pre, desc, tmp);
}
else
{
--- /dev/null
+! { dg-do run }
+!
+! Check the span of the descriptor of an array pointer after it has been
+! assigned to from a polymorphic function result.
+
+program test
+ implicit none
+ type t
+ integer :: c
+ end type t
+ type, extends(t) :: u
+ integer :: d
+ end type u
+ type(t), pointer :: p(:)
+ class(t), allocatable, target :: a(:)
+ p => f()
+ ! print *, p%c
+ if (any(p%c /= [2,5,11,17,23])) error stop 1
+contains
+ function f()
+ class(t), pointer :: f(:)
+ a = [ u(2,3), u(5,7), u(11,13), u(17,19), u(23,29) ]
+ f => a
+ end function
+end program