public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Arraysizes in g77 (gcc-2.95.2)
@ 2000-01-26 22:11 Andre Albsmeier
  2000-01-27 12:24 ` Martin v. Loewis
  0 siblings, 1 reply; 3+ messages in thread
From: Andre Albsmeier @ 2000-01-26 22:11 UTC (permalink / raw)
  To: gcc

Hello all,

I am using GCC 2.95.2. I have a program for antenna simulation which
is mostly written in fortran. I am using an array of complex variables
(the size of one element is 16 bytes). I can allocate only 33554431 of
these elements. When trying to use more than that, the compiler stops
with an error:

cd .; /usr/local/bin/g77 -O2 -finit-local-zero -fomit-frame-pointer -s -c qustn.f
celem.inc: In subroutine `qust':
celem.inc:3:
         complex*16  celem(ndim)
                     ^
Array `celem' at (^) is too large to handle

33554431 * 16 is exactly 512 * 1024 * 1024 - 16 bytes. So I
assume it is not possible to declare an array that is bigger
than 512MB - sizeof(one_element).

Now my question: Do you know if I can simply bump some number
in some file of GCC to increase this limit a bit?

Thanks a lot in advance!

        -Andre

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Arraysizes in g77 (gcc-2.95.2)
  2000-01-26 22:11 Arraysizes in g77 (gcc-2.95.2) Andre Albsmeier
@ 2000-01-27 12:24 ` Martin v. Loewis
  0 siblings, 0 replies; 3+ messages in thread
From: Martin v. Loewis @ 2000-01-27 12:24 UTC (permalink / raw)
  To: andre.albsmeier; +Cc: gcc

> Now my question: Do you know if I can simply bump some number
> in some file of GCC to increase this limit a bit?

I don't know much about fortran, but you may want to check the release
branch. One problem in gcc is that the array size is represented in
the number of bits, so that value probably overflows if the array gets
larger than 512 MB. I found the same problem in g++, and the g++
mainline has fixed it. I'm not sure whether the fix was specific to
C++, or whether that was a back-end thing, though.

In any case, there is probably not much you can do about it, if the
cause is really that integer flows over.

Regards,
Martin

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Arraysizes in g77 (gcc-2.95.2)
@ 2000-01-27 14:44 toon
  0 siblings, 0 replies; 3+ messages in thread
From: toon @ 2000-01-27 14:44 UTC (permalink / raw)
  To: gcc

Martin v. Loewis wrote:

> Andre Albsmeier wrote:

> > Now my question: Do you know if I can simply bump some number
> > in some file of GCC to increase this limit a bit?

> I don't know much about fortran, but you may want to check the release
> branch. One problem in gcc is that the array size is represented in
> the number of bits, so that value probably overflows if the array gets
> larger than 512 MB. I found the same problem in g++, and the g++
> mainline has fixed it. I'm not sure whether the fix was specific to
> C++, or whether that was a back-end thing, though.

AFAIK the bitsize thingy is a backend limitation.  I know that shortly afte
the release of g77 (February '95) I run into all sorts of sub-optimisations
due to the fact that the *8 (bits/byte) / 32 (bits/real) weren't folded 
completely (next to the problem of incomplete induction variable elimination
in loops.

So I think that this is a "middle-end" problem - I would be interested if
this were solved by the current CVS trunk of GCC.

Cheers,
Toon.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2000-01-27 14:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-01-26 22:11 Arraysizes in g77 (gcc-2.95.2) Andre Albsmeier
2000-01-27 12:24 ` Martin v. Loewis
2000-01-27 14:44 toon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).