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

--- Comment #14 from anlauf at gcc dot gnu.org ---
Further reduced:

program p
  implicit none
  integer, parameter :: nx = 64
  real, dimension(nx) :: x, s, d, f
  print *, shape (x), shape (s), shape (d), shape (f)
  call sub (x,s,d,f)
contains
  subroutine sub  (v, w, e, g)
    real, intent(in)                        :: v(:)
    real, intent(out), dimension (size (v)) :: w ! OK
    real, intent(out), dimension (size (v)) :: e ! not OK
    real, intent(out), dimension (size (v)) :: g ! not OK
    real,              dimension (size (v)) :: x
    real,              dimension (size (v)) :: y
    print *, shape (v), shape (w), shape (e), shape (g), shape (x), shape (y)
  end subroutine sub
end


Should print:

          64          64          64          64
          64          64          64          64          64          64

Now prints:

          64          64          64          64
          64          64           0           0          64          64

It looks like only the first intent(out) argument of sub has the right size,
the second and third do not.

Replacing in the size() expressions in the declarations of dummies e or g
array v by w does not fix the problem.

Seems to affect only dummies, not local arrays.

Reply via email to