+2017-07-24 Thomas Koenig <tkoenig@gcc.gnu.org>
+ Mikael Morin <mikael@gcc.gnu.org>
+
+ PR fortran/66102
+ * fortran/trans-array.c (gfc_conv_resolve_dependencies):
+ Break if dependency has been found.
+
2017-07-23 Alexander Monakov <amonakov@ispras.ru>
* interface.c (pair_cmp): Fix gfc_symbol comparison. Adjust comment.
&& gfc_check_dependency (dest_expr, ss_expr, false))
ss_info->data.scalar.needs_temporary = 1;
- continue;
+ if (nDepend)
+ break;
+ else
+ continue;
}
if (dest_expr->symtree->n.sym != ss_expr->symtree->n.sym)
+2017-07-24 Thomas Koenig <tkoenig@gcc.gnu.org>
+ Mikael Morin <mikael@gcc.gnu.org>
+
+ PR fortran/66102
+ * gfortran.dg/realloc_on_assign_28.f90: New test.
+
2017-07-23 David Edelsohn <dje.gcc@gmail.com>
* gcc.dg/pr56727-2.c: Limit to powerpc-linux.
--- /dev/null
+! { dg-do run }
+!
+! PR fortran/66102
+!
+! Contributed by Vladimir Fuka <vladimir.fuka@gmail.com>
+!
+ type t
+ integer,allocatable :: i
+ end type
+
+ type(t) :: e
+ type(t), allocatable, dimension(:) :: a, b
+ integer :: chksum = 0
+
+ do i=1,3 ! Was 100 in original
+ e%i = i
+ chksum = chksum + i
+ if (.not.allocated(a)) then
+ a = [e]
+ b = first_arg([e], [e])
+ else
+ call foo
+ end if
+ end do
+
+ if (sum ([(a(i)%i, i=1,size(a))]) .ne. chksum) call abort
+ if (any([(a(i)%i, i=1,size(a))] /= [(i, i=1,size(a))])) call abort
+ if (size(a) /= size(b)) call abort
+ if (any([(b(i)%i, i=1,size(b))] /= [(i, i=1,size(b))])) call abort
+contains
+ subroutine foo
+ b = first_arg([b, e], [a, e])
+ a = [a, e]
+ end subroutine
+ elemental function first_arg(arg1, arg2)
+ type(t), intent(in) :: arg1, arg2
+ type(t) :: first_arg
+ first_arg = arg1
+ end function first_arg
+end