This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/47517] New: Rallocate on assignment: Segfault
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 28 Jan 2011 15:18:34 +0000
- Subject: [Bug fortran/47517] New: Rallocate on assignment: Segfault
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47517
Summary: Rallocate on assignment: Segfault
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Keywords: wrong-code
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: burnus@gcc.gnu.org
CC: pault@gcc.gnu.org
Created attachment 23154
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23154
James' allocate_assign.f90
Follow up to bug 35810 comment 0.
The following program ends with a segfault and works with ifort (-assume
realloc_lhs). I do not know whether the program is valid.
Cf. also
http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/7d5d1e7f4a48071c/7c63fef65ba5ea70?lnk=gst&q=realloc_lhs
The attached program - which is James program from c.l.f except that I
drastically reduced the loop count and removed some line wraps, causes a
segfault in gfortran.
[...]
x2(3)%headers(5)%parts = 1,2,3,4,5,6
size(x2(3)%headers(6)%parts) = 6
x2(3)%headers(6)%parts = 1,2,3,4,5,6
1 0
Segmentation fault (core dumped)
Result with ifort -assume realloc_lhs:
x2(3)%headers(5)%parts = 1,2,3,4,5,6
size(x2(3)%headers(6)%parts) = 6
x2(3)%headers(6)%parts = 1,2,3,4,5,6
1 0
1 0
1 2
[...]
10000 39998
10000 39998
40000