lkrupp at gcc dot changed:

           What    |Removed                     |Added
                 CC|                            |lkrupp at gcc dot

--- Comment #6 from lkrupp at gcc dot ---
I started looking at this until I read all of the comments and realized that
someone had already come up with a patch, and one that is probably better and
certainly simpler than whatever I would have done.

It might be worth noting that the problem seems to come up when an array is
passed to an intrinsic function that returns a scalar when its argument is a
scalar and that returns an array when it's passed an array.  In the sample
program in the description, the intrinsic function is integer to real
conversion.  The following sample program reproduces that problem with a simple
array instead of an implied do loop, and also with the square root function. 
Compiling this with -fbounds-check makes the program fail on the assignment

program assign_allocatable
implicit none

  call s_int_real_cvt
  call s_sqrt


  subroutine s_int_real_cvt
  implicit none
  integer, parameter :: r(3) = [101, 102, 103]
  real, allocatable :: k(:)

  k = r

  if (any(k /= r)) call abort

  end subroutine

  subroutine s_sqrt
  implicit none
  real, parameter :: r(5) = [1, 4, 9, 16, 25]
  real, allocatable :: a(:)

  a = sqrt(r)

  if (any(a /= [1, 2, 3, 4, 5])) call abort

  end subroutine

end program

Array-value intrinsics like TRANSFER and PACK don't seem to trigger this

Reply via email to