This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
bug in g77 for at least IA64 and AMD64
- From: Winfrid Tschiedel <winfrid dot tschiedel at hpc dot fujitsu-siemens dot com>
- To: gcc at gcc dot gnu dot org
- Cc: toon at moene dot indiv dot nluug dot nl
- Date: Thu, 30 Oct 2003 13:32:42 +0100 (MET)
- Subject: bug in g77 for at least IA64 and AMD64
- Reply-to: Winfrid dot Tschiedel at hpc dot fujitsu-siemens dot com
Hi,
This small fortran program causes a segmentation fault :
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
[winfrid@rxiX00-rhel ~]$ g77 big-mem.f
[winfrid@rxiX00-rhel ~]$ ./a.out
Segmentation fault (core dumped)
If you change n3 to 255 or if you split common /abc/ into 2 common zones
the program works
program test
parameter ( n3=257)
common /abc_1/ a
common /abc_2/ 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
time ./a.out
1. 1.
2. 3.
0.000u 0.000s 0:00.00 0.0% 0+0k 0+0io 80pf+0w
Information concerning the invirionment :
[winfrid@rxiX00-rhel ~]$ uname -a
Linux rxiX00-rhel 2.4.21-4.EL #1 SMP Fri Oct 3 17:29:39 EDT 2003 ia64 ia64 ia64 GNU/Linux
[winfrid@rxiX00-rhel ~]$ rpm -qa | fgrep g77
gcc-g77-ssa-3.5ssa-0.20030801.41
gcc-g77-3.2.3-20
Same problem on gcc-3.4 ( gcc-3.4-20030903 ) :
[winfrid@rxiX00-rhel ~]$ set path=(/opt/gcc-3.4/bin $path)
[winfrid@rxiX00-rhel ~]$ setenv LD_LIBRARY_PATH /opt/gcc-3.4/lib
[winfrid@rxiX00-rhel ~]$ g77 big-mem.f
[winfrid@rxiX00-rhel ~]$ !t
time ./a.out
Segmentation fault (core dumped)
0.000u 0.159s 0:00.15 100.0% 0+0k 0+0io 67pf+0w
[winfrid@rxiX00-rhel ~]$ g77 big-mem2.f
[winfrid@rxiX00-rhel ~]$ !t
time ./a.out
1. 1.
2. 3.
0.000u 0.000s 0:00.00 0.0% 0+0k 0+0io 78pf+0w
Same problem on AMD64 ( SLES 8 )
/home/winfrid> uname -a
Linux arima 2.4.21-111-smp #1 SMP Wed Oct 1 11:39:54 UTC 2003 x86_64 unknown
/home/winfrid> g77 -mcmodel=medium /tmp/big-mem.f/home/winfrid> time ./a.out
Segmentation fault
0.000u 0.000s 0:00.00 0.0% 0+0k 0+0io 123pf+0w
/home/winfrid> g77 -mcmodel=medium /tmp/big-mem2.f
/home/winfrid> time ./a.out
1. 1.
2. 3.
Note I could not use gcc-3.4 for the test on AMD Opteron, because of the
following error :
/home/winfrid> set path=(/home/gcc-3.4.2/bin $path)
/home/winfrid> setenv LD_LIBRARY_PATH /home/gcc-3.4.2/lib64
/home/winfrid> which g77
/home/gcc-3.4.2/bin/g77
/home/winfrid> g77 -mcmodel=medium big-mem.f
/tmp/ccROxIQa.s: Assembler messages:
/tmp/ccROxIQa.s:118: Error: .COMMon length (-2139095040.) <0! Ignored.
/tmp/ccROxIQa.s:118: Warning: rest of line ignored; first ignored character is `
,'
I hope this information will be helpful for improving g77/gcc
Take care,
Winfrid
PS.: I am on holiday until Nov. 24
--
_______________________________________________________________________________
Fujitsu Siemens Computers
SMCS G LE PCO Süd Email: winfrid.tschiedel@hpc.fujitsu-siemens.com
Otto-Hahn-Ring 6 Tel. : ++49-89-636-45652
81739 Muenchen Fax : ++49-89-636-43604
MS Exchange : winfrid.tschiedel@fujitsu-siemens.com