Reported by Jorge at http://gcc.gnu.org/ml/fortran/2009-08/msg00474.html

integer, dimension (4) :: ier = 0
integer, dimension (:), allocatable :: a
allocate (a (16), stat = ier)
end

Gives a segfault with GCC 4.1 to 4.5. With the current trunk, valgrind shows:

==26026== Invalid read of size 4
==26026==    at 0x533591: gfc_conv_scalarized_array_ref (trans-array.c:2477)
==26026==    by 0x533CA4: gfc_conv_array_ref (trans-array.c:2527)
==26026==  Address 0x188 is not stack'd, malloc'd or (recently) free'd
test.f90: In function 'MAIN__':
test.f90:1:0: internal compiler error: Segmentation fault


-- 
           Summary: ICE with ALLOCATE and nonscalar STAT= variable
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41197

Reply via email to