For the code

program main
implicit none
character (len=10), allocatable :: xx(:)
character (len=10)              :: yy
print*,"(5)"
allocate (xx(1))
xx(1)      = "dog"
call foo((xx),xx)
contains
subroutine foo(xx,yy)
character (len=*), intent(in)               :: xx(:)
character (len=*), intent(out), allocatable :: yy(:)
allocate (yy(size(xx)))
yy = xx
end subroutine foo
end program main

the program compiled by gfortran with the default options crashes at run time
with a pop-up box saying "An unhandled win32 exception occurred in a.exe
[55596]"

gfortran -v says

Using built-in specs.
Target: i586-pc-mingw32
Configured with: ../trunk/configure --prefix=/mingw
--enable-languages=c,fortran --with-gmp=/home/FX/local --with-ld=/mingw/bin/ld
--with-as=/mingw/bin/as --disable-werror --enable-bootstrap --enable-threads
--disable-nls --build=i586-pc-mingw32 --enable-libgomp --disable-shared
Thread model: win32
gcc version 4.4.0 20080603 (experimental) [trunk revision 136333] (GCC)


-- 
           Summary: crash with character allocatable array argument
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: vivekrao4 at yahoo dot com


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

Reply via email to