From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19266 invoked by alias); 9 Aug 2004 14:37:21 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 19255 invoked by uid 48); 9 Aug 2004 14:37:20 -0000 Date: Mon, 09 Aug 2004 14:37:00 -0000 From: "paulthomas2 at wanadoo dot fr" To: gcc-bugs@gcc.gnu.org Message-ID: <20040809143717.16941.paulthomas2@wanadoo.fr> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug fortran/16941] New: automatic length string as function return value causes internal compiler error X-Bugzilla-Reason: CC X-SW-Source: 2004-08/txt/msg00656.txt.bz2 List-Id: ! $ ../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 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