https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66089

            Bug ID: 66089
           Summary: elemental dependency mishandling when derived types
                    are involved
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mikael at gcc dot gnu.org
  Target Milestone: ---

This is a followup to pr65894.
We don't handle correctly the dependencies when elemental procedures and
derived types are involved.
Test:

  type :: t
    integer :: c
  end type t

  type(t), dimension(5) :: a, b, c

  a = t(1)
  b = t(7)
  c = t(13)
  c = plus(c(1), b)
  print *, c
  if (any(c%c /= 20)) call abort

contains

  elemental function plus(lhs, rhs)
    type(t), intent(in) :: lhs, rhs
    type(t)             :: plus
    plus%c = lhs%c + rhs%c
  end function plus

end

Reply via email to