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]

f77 for AMD64-x86; large array allocation bug


Dear, GCC-bugs,

This is a bug sample of f77 on AMD x86.
(It seems f77 is a part of gcc system, thus I am sending 
this report to you.)
   The large array of size 4GB or more is not allocated
with the proper size but of size modulo 2^32 bytes. 
This can be verified by the size command for the object file 
or the a.out executable file.
  NOTE: If the assembler source that f77 -S produced is 
modified by hand about the strage area allocation macro .comm line, 
the executable produced from that assembler source works fine.

Hiroshi Murakami
<dm@tmca.ac.jp>

Script started on Sun 11 Jan 2004 10:11:56 PM EST
$
$ f77 a.f
$
$ size a.out
   text	   data	    bss	    dec	    hex	filename
   2598	    680	     32	   3310	    cee	a.out
$
$ cat a.f
*===========================================
      program main
      implicit none
      integer mb,n
      parameter(mb=1024*1024/8,n=4096)
      integer i,j
* This is an array of 2^32 bytes in size.
      real*8 a(mb,n)
*
      do j=1,n
        print*, '< ',j
        do i=1,mb
          a(i,j)=dreal(i+j)
        enddo
      enddo
      end
*===========================================
$
$ ./a.out
 <  1
Segmentation fault
$
$ exit
exit

Script done on Sun 11 Jan 2004 10:12:18 PM EST


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