This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/16941] New: automatic length string as function return value causes internal compiler error


!  $ ../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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]