This is the mail archive of the gcc-help@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]

Re: array size limitation problem


ignat wrote:

> Using g77 (GNU project Fortran Compiler, v0.5.24) I have encountered a
> problem of array size limitation.
> I found out that size of an array is limited to 2^27 -1 = 134 217 728,
> while integer itself can be 2^31 -1 = 2 147 483 647.
> I actually need an array with 600 000 000 numbers. What can I do?

I fixed this for the 3.1 release, basically by removing a check that I
proved unnecessarily strict.

So you could try out a recent snapshot of gcc/g77 (see our home page at
http://gcc.gnu.org, entry "Snapshots" in the left column).  However, one
shouldn't use snapshot compilers for production work.

Another option is to apply the following patch to a recent release (see
entry "Releases" in the left column) and build that compiler.

Hope this helps,

-- 
Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
Join GNU Fortran 95: http://g95.sourceforge.net/ (under construction)
2001-10-22  Toon Moene  <toon@moene.indiv.nluug.nl>

	* com.c (ffecom_check_size_overflow_): Only check for TREE_OVERFLOW.

*** com.c.orig	Fri Oct 19 14:59:44 2001
--- com.c	Sun Oct 21 14:17:15 2001
*************** ffecom_check_size_overflow_ (ffesymbol s
*** 2267,2272 ****
  
    if ((tree_int_cst_sgn (TYPE_SIZE (type)) < 0)
!       || (!dummy && (((TREE_INT_CST_HIGH (TYPE_SIZE (type)) != 0))
! 		     || TREE_OVERFLOW (TYPE_SIZE (type)))))
      {
        ffebad_start (FFEBAD_ARRAY_LARGE);
--- 2267,2271 ----
  
    if ((tree_int_cst_sgn (TYPE_SIZE (type)) < 0)
!       || (!dummy && TREE_OVERFLOW (TYPE_SIZE (type))))
      {
        ffebad_start (FFEBAD_ARRAY_LARGE);

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