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

             Bug #: 51637
           Summary: Add compile-time error if array is too large
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: bur...@gcc.gnu.org


The following program compiles and produces the dump on x86-64-linux:
  struct t a[-1];
  a[-9223372036854775808] = t.0;

and with -m32
  struct t a[-1];
  a[0] = t.0;

Expected: An error is printed such as

ftn-951 crayftn: ERROR MAIN, File = rc1.f90, Line = 4, Column = 79
   The extent for dimension 1 is too large for array "A". 

TYPE T
END TYPE T
TYPE(T), DIMENSION(-9223372036854775807_8: 9223372036854775807_8) :: A
a(1) = t()
end

Motivated by the discussion starting at
http://j3-fortran.org/pipermail/interop-tr/2011-December/000942.html / Example
taken from http://j3-fortran.org/pipermail/interop-tr/2011-December/000964.html

Reply via email to