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/82934] New: Segfault on assumed character length in allocate


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82934

            Bug ID: 82934
           Summary: Segfault on assumed character length in allocate
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pault at gcc dot gnu.org
  Target Milestone: ---

Reported by FortranFan on clf:
https://groups.google.com/forum/#!topic/comp.lang.fortran/Lg8tBwlkS6A

   character(len=42), allocatable :: foo

   call alloc( foo )

   print *, "len(foo) = ", len(foo), "; expected = 42"

contains

   subroutine alloc( bar )

      character(len=*), allocatable :: bar

      allocate( character(len=*) :: bar )

   end subroutine

end 

[pault@pc30 pr78990]$ gfortran -static-libgfortran f*.f90 -O2
fortranfan1.f90:15:0:

       allocate( character(len=*) :: bar , barbar)
 1
internal compiler error: in gfc_trans_allocate, at fortran/trans-stmt.c:5316

GNU Fortran (GCC) 5.1.1 20150618 (Red Hat 5.1.1-4)

Goes through all the way to trunk.

Paul

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