This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/16941] New: automatic length string as function return value causes internal compiler error
- From: "paulthomas2 at wanadoo dot fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 Aug 2004 14:37:20 -0000
- Subject: [Bug fortran/16941] New: automatic length string as function return value causes internal compiler error
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
! $ ../bin/gfortran bug7.f90 -o test
! assertion "sym->ts.cl && sym->ts.cl->length && sym->ts.cl->length->expr_type ==
! EXPR_CONSTANT" failed: file "../../gcc/gcc/fortran/trans-expr.c", line 1053
! bug7.f90: In function `MAIN__':
! bug7.f90:33: internal compiler error: Aborted
! Please submit a full bug report,
! with preprocessed source if appropriate.
! See <URL:http://gcc.gnu.org/bugs.html> for instructions.
module t
implicit none
integer,parameter :: slen = 20
interface t1
module procedure mt1
end interface
contains
function mt1(Vector) result (Ans)
character (len = *), intent (in) :: Vector
character (len = Len(Vector)) :: Ans
!!! character (len = slen) :: Ans !!!works fine
Ans = Vector
return
end function mt1
end module t
program ft
use t
implicit none
character (len = slen) :: tsrt
tsrt = "this is a test"
print * , t1( tsrt ) !!!note: length of literal is not sent
!! print * , t1("this is a test") !!!does not send length to function
stop
end program ft
--
Summary: automatic length string as function return value causes
internal compiler error
Product: gcc
Version: 3.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: paulthomas2 at wanadoo dot fr
CC: bdavis at gcc dot gnu dot org,gcc-bugs at gcc dot gnu
dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16941