Error in PGF90 - arrays in pure functions

The following code compiles happily, but segfaults whenever its run. The problem appears to be in inspecting the length of an array argument inside a pure function. This happens with all of 6.1, 6.2, and 7.0, which is what I have to hand.

module test

contains
  pure function length(a)
    integer, intent(in) :: a(:)
    integer :: length
    
    length = size(a)
  end function length

  function out(a)
    integer, intent(in) :: a(:)
    character(len=length(a)) :: out

    out =""
  end function out

end module test

program run

  use test

  character(len=10) :: s
  integer :: i(3)

  i = 0

  s = out(i)

end program run

Hi,

Please try 7.1-1. It works in 7.1-1.

Hongyon