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: unassig...@gcc.gnu.org
        ReportedBy: bur...@gcc.gnu.org
                CC: pa...@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

Reply via email to