This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/57365] New: Soured allocation fails in subroutines
- From: "rxs at hotmail dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 22 May 2013 07:21:48 +0000
- Subject: [Bug fortran/57365] New: Soured allocation fails in subroutines
- Auto-submitted: auto-generated
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