This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/51637] New: Add compile-time error if array is too large


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: unassigned@gcc.gnu.org
        ReportedBy: burnus@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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]