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