module str_mod
contains
function copy_str(xx) result(yy)
character (len=*), intent(in) :: xx(:)
character (len=1)       :: yy(size(xx))
yy = (/xx/)
end function copy_str
subroutine print_vec(labels)
character (len=*), intent(in) :: labels(:)
print*,labels
end subroutine print_vec
!
function ccopy(yy) result(xy)
character (len=*), intent(in) :: yy(:)
character (len=1) :: xy(size(yy))
xy = yy
end function ccopy
end module str_mod
!
program xx
use str_mod, only: print_vec,ccopy,copy_str
implicit none
call print_vec(ccopy("_"//copy_str(["a"])))
end program xx

gfortran -c -v xxgfortran_bug.f90

Using built-in specs.
Target: i386-pc-mingw32
Configured with: ../trunk/configure --prefix=/mingw
--enable-languages=c,fortran --with-gmp=/home/coudert/local --disable-nls
--with-ld=/mingw/bin/ld --with-as=/mingw/bin/as --disable-werror
--enable-bootstrap --enable-threads --build=i386-pc-mingw32 --disable-shared
--enable-libgomp
Thread model: win32
gcc version 4.3.0 20070506 (experimental)
 c:/programs/gfortran/bin/../libexec/gcc/i386-pc-mingw32/4.3.0/f951.exe
xxgfortran_bug.f90 -quiet -dumpbase xxgfortran_bug.f90 -mtune=i386 -auxbase
xxgfortran_bug -version -fintrinsic-modules-path
c:/programs/gfortran/bin/../lib/gcc/i386-pc-mingw32/4.3.0/finclude -o
C:\DOCUME~1\vrao\LOCALS~1\Temp/ccB1NNxN.s
GNU F95 version 4.3.0 20070506 (experimental) (i386-pc-mingw32)
        compiled by GNU C version 4.3.0 20070506 (experimental).
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096

xxgfortran_bug.f90: In function 'MAIN__':
xxgfortran_bug.f90:20: internal compiler error: in gfc_conv_expr_descriptor, at
fortran/trans-array.c:4474
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.


-- 
           Summary: ICE with function having array of character variables
                    argument
           Product: gcc
           Version: 4.3.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=31879

Reply via email to