[Bug fortran/55733] -fno-automatic: Fails for scalar allocatables

burnus at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Dec 18 15:25:00 GMT 2012


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55733

--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-12-18 15:24:16 UTC ---
The following test case also fails; I think the problem is the string
components which isn't marked as TREE_STATIC:

! { dg-do run }
! { dg-options "-fno-automatic" }
!
subroutine foo()
  logical, save :: first = .false.
  character(len=:), allocatable :: str(:)
  if (first) then
    if (allocated (str)) call abort ()
    str = ["ABCDEF", "ABCDEF" ]
  end if
  if (.not. allocated (str)) call abort ()
  if (len (str) /= 6) call abort ()
  if (any (str(:)(1:6) /= "ABCDEF")) call abort ()
end subroutine foo

call foo()
call foo()
end



More information about the Gcc-bugs mailing list