(j3.2006) New manifestation of PR 55824: ICE on PACK of unlimited polymorphic source array in ALLOCATE

Damian Rouson damian
Tue Jun 30 00:31:42 UTC 2015


GFortran developers,

I'm guessing the errors below demonstrate another manifestation of Bug 55824 (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55824).  I just added this as a comment in that bug report.  The code below causes an ICE in gfortran 6.0.0 20150621.  With gfortran 5.1.0  and 4.9.2, it generates what I believe is an erroneous message stating a requirement for an array specification.

Damian

$ cat ice-on-pack-unlimited-polymorphic.f90 
contains
  subroutine array_to_vector(array)
    class(*), allocatable :: vector(:),array(:,:)
    allocate(vector,source=pack(array,.true.))
  end subroutine
end

$ gfortran ice-on-pack-unlimited-polymorphic.f90 
ice-on-pack-unlimited-polymorphic.f90:4:0:

     allocate(vector,source=pack(array,.true.))
1
internal compiler error: Segmentation fault: 11

ice-on-pack-unlimited-polymorphic.f90:4:0: internal compiler error: Abort trap: 6
gfortran: internal compiler error: Abort trap: 6 (program f951)
Please submit a full bug report,
with preprocessed source if appropriate.
See <
https://trac.macports.org/newticket
> for instructions.

$ gfortran --version
GNU Fortran (MacPorts gcc6 6-20150621_0) 6.0.0 20150621 (experimental)
...

$ sudo port select --set gcc mp-gcc5
Selecting 'mp-gcc5' for 'gcc' succeeded. 'mp-gcc5' is now active.

$ gfortran ice-on-pack-unlimited-polymorphic.f90 
ice-on-pack-unlimited-polymorphic.f90:4:13:

     allocate(vector,source=pack(array,.true.))
             1
Error: Array specification required in ALLOCATE statement at (1)




More information about the J3 mailing list