The following program is invalid, however, there should be no ICE. Warning
printed:
Warning: Upper array reference at (1) is out of bounds (9 > 1) in dimension 1

hello.f90:2: internal compiler error: Segmentation fault

valgrind:
==32039== Invalid read of size 4
==32039==    at 0x49C0DD: gfc_conv_scalarized_array_ref (trans-array.c:2414)
==32039==    by 0x49D9A4: gfc_conv_array_ref (trans-array.c:2462)
==32039==    by 0x4B7511: gfc_conv_variable (trans-expr.c:679)


 character(len=9) :: fmt(1)
 fmt = '("Hello")'
 WRITE(*, FMT(1:9) )  ! Invalid 1:9 is regarded as array bounds not at
substring
end

Found at:
http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/250dfb55a30226da


-- 
           Summary: ICE with invalid bounds for I/O FMT= array
           Product: gcc
           Version: 4.4.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=38568

Reply via email to