From Bugzilla Helper: User-Agent: Mozilla/4.8 [en] (Windows NT 5.0; U) Description of problem: The following program allocates an array larger 2 GB : program test parameter ( n3=257) common /abc/ a,b real*8 a(1024,1024,n3),b(1024,1024,255) b(1,100,3)=1.0d0 a(1,100,3)=1.0d0 a(1024,1024,n3)=2.d0 b(1024,1024,255)=3.0 print *,a(1,100,3),b(1,100,3) print *,a(1024,1024,n3),b(1024,1024,255) end [root@CD-IA64-rhel root]# g77 -O3 /tmp/big-mem.f [root@CD-IA64-rhel root]# time ./a.out Segmentation fault real 0m0.002s user 0m0.001s sys 0m0.001s If you use Intel fortran this error does not occur. Version-Release number of selected component (if applicable): gcc-g77-3.2.3-16 How reproducible: Always Steps to Reproduce: 1. Copy the source to file 2. compile : g77 bigmem.f 3. execute : ./a.out Actual Results: [root@CD-IA64-rhel root]# g77 -O3 /tmp/big-mem.f [root@CD-IA64-rhel root]# time ./a.out Segmentation fault real 0m0.002s user 0m0.001s sys 0m0.001s Expected Results: Result with efc from Intel : [root@CD-IA64-rhel ~]# efc -O3 /tmp/big-mem.f program TEST real*8 a(1024,1024,n3),b(1024,1024,255) ^ Warning 2 at (4:/tmp/big-mem.f) : Type size specifiers are an extension to stand ard Fortran 95 11 Lines Compiled /opt/intel/compiler70/ia64/lib/libIEPCF90.a(f90fioerr.o)(.text+0x9c0): In functi on `f_f77ioerr': : undefined reference to `__ctype_b' [root@CD-IA64-rhel ~]# efc -O3 /tmp/big-mem.f -i_dynamic program TEST real*8 a(1024,1024,n3),b(1024,1024,255) ^ Warning 2 at (4:/tmp/big-mem.f) : Type size specifiers are an extension to stand ard Fortran 95 11 Lines Compiled [root@CD-IA64-rhel ~]# ./a.out 1.00000000000000 1.00000000000000 2.00000000000000 3.00000000000000 Additional info: This error occurs also with previous versions of g77 ( e.g. 2.96 ) or most recent versions from gcc.org ( e.g. 3.4 ) And this error occurs also on x86_64.
Try ftp://people.redhat.com/jakub/gcc/3.2.3-23/ It should fix this bug and a bunch of others (mostly related to handling stack frames within one function bigger than 2GB on various 64-bit arches).
An errata has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on the solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2003-354.html