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/57365] New: Soured allocation fails in subroutines


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57365

            Bug ID: 57365
           Summary: Soured allocation fails in subroutines
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rxs at hotmail dot de

The following program compiles without problems but it will cause an
segmentation fault during execution. The sourced allocation within the
subroutine is causing the problem, but only when the type of the source object
is character, other type work fine. 

The problem is reproducible with gfortran 4.8.0 (macports), the same program
compiles and runs fine with ifort and pgf. 

Program:


program bug

    implicit none
    character(len=50) :: test

    test = "A test case"
    call allocate_test(test)

contains

    subroutine allocate_test(var)
        class(*) :: var
        class(*), pointer :: copyofvar
        allocate(copyofvar, source=var)
    end subroutine

end program bug


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