Bug of g77-3.0

Oleg Krivosheev kriol@bpmail.fnal.gov
Wed Nov 21 13:08:00 GMT 2001


Hi, Tim

On Wed, 21 Nov 2001, Tim Prince wrote:

> 
> log() is determined by the library you use, not by gcc.  

this is not true. log,sin,cos... are "overloaded" functions
in Fortran, in an sense that what would be really called is
determined by function argument.

> With glibc (usually
> installed in linux), the version of log() will depend on the optimization
> level you have chosen.  

you mean "double log(double)", than that's probably true.
See below for the fact that g77 call "right" zlog function here.

> This would be a gcc bug only if some combination of
> circumstances led to stack overflow, for example.  gcc-3.0 is obsolescent,
> many people may not have the exact version available to test.  

i could confirm the error

this is also debian sid installed.

reboot ~ $ g77-3.0 -v             
g77 version 3.0.2 (Debian) (Fortran Frontend version 0.5.26 20011023 (release))
Driving: g77-3.0 -v -c -xf77-version /dev/null -xnone
Reading specs from /usr/lib/gcc-lib/i386-linux/3.0.2/specs
Configured with: ../src/configure -v --enable-languages=c,c++,java,f77,proto,objc --prefix=/usr --infodir=/share/info --mandir=/share/man --enable-shared --with-gnu-as --with-gnu-ld --with-system-zlib --enable-long-long --enable-nls --without-included-gettext --disable-checking --enable-threads=posix --enable-java-gc=boehm --with-cpp-install-dir=bin --enable-objc-gc i386-linux
Thread model: posix
gcc version 3.0.2 (Debian)
 /usr/lib/gcc-lib/i386-linux/3.0.2/tradcpp0 -lang-fortran -v -D__GNUC__=3 -D__GNUC_MINOR__=0 -D__GNUC_PATCHLEVEL__=2 -D__ELF__ -Dunix -Dlinux -D__ELF__ -D__unix__ -D__linux__ -D__unix -D__linux -Asystem=posix -D__NO_INLINE__ -D__STDC_HOSTED__=1 -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i386__ /dev/null /dev/null
GNU traditional CPP version 3.0.2 (Debian)
 /usr/lib/gcc-lib/i386-linux/3.0.2/f771 -fnull-version -quiet -dumpbase g77-version.f -version -fversion -o /tmp/ccUBjD0f.s /dev/null
GNU F77 version 3.0.2 (Debian) (i386-linux)
        compiled by GNU C version 3.0.2 (Debian).
GNU Fortran Front End version 0.5.26 20011023 (release)
 as -V -Qy -o /tmp/ccySmJbo.o /tmp/ccUBjD0f.s
GNU assembler version 2.11.92.0.10 (i386-linux) using BFD version 2.11.92.0.10 20011021 Debian/GNU Linux
 ld -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -o /tmp/ccCQdDtx /tmp/ccySmJbo.o /usr/lib/gcc-lib/i386-linux/3.0.2/../../../crt1.o /usr/lib/gcc-lib/i386-linux/3.0.2/../../../crti.o /usr/lib/gcc-lib/i386-linux/3.0.2/crtbegin.o -L/usr/lib/gcc-lib/i386-linux/3.0.2 -L/usr/lib/gcc-lib/i386-linux/3.0.2/../../.. -lg2c -lm -lgcc -lc -lgcc /usr/lib/gcc-lib/i386-linux/3.0.2/crtend.o /usr/lib/gcc-lib/i386-linux/3.0.2/../../../crtn.o
 /tmp/ccCQdDtx
__G77_LIBF77_VERSION__: 0.5.26 20011023 (release)
@(#)LIBF77 VERSION 20000929
__G77_LIBI77_VERSION__: 0.5.26 20011023 (release)
@(#) LIBI77 VERSION pjw,dmg-mods 20001205
__G77_LIBU77_VERSION__: 0.5.26 20011023 (release)
@(#) LIBU77 VERSION 19980709

compilation was done without optimization

g77-3.0 -Wall aaa.f

assembler generated

	.file	"aaa.f"
	.section	.rodata
	.align 8
.LC0:
	.long	0xa0000000,0xbfefc017
	.long	0x60000000,0xbf9c3f40
	.data
	.align 4
	.type	__g77_cilist_0.0,@object
	.size	__g77_cilist_0.0,20
__g77_cilist_0.0:
	.long	0
	.long	6
	.long	0
	.long	0
	.long	0
	.align 4
	.type	__g77_cilist_1.1,@object
	.size	__g77_cilist_1.1,20
__g77_cilist_1.1:
	.long	0
	.long	6
	.long	0
	.long	0
	.long	0
	.section	.rodata
.LC1:
	.ascii	" A"
.LC5:
	.ascii	" B"
.LC6:
	.align 4
.LC2:
	.long	1
	.align 4
.LC3:
	.long	9
	.align 4
.LC4:
	.long	7
	.text
	.align 4
.globl MAIN__
	.type	MAIN__,@function
MAIN__:
	pushl	%ebp
	movl	%esp, %ebp
	subl	$56, %esp
	movl	.LC0, %eax
	movl	.LC0+4, %edx
	movl	%eax, -16(%ebp)
	movl	%edx, -12(%ebp)
	movl	.LC0+8, %eax
	movl	.LC0+12, %edx
	movl	%eax, -8(%ebp)
	movl	%edx, -4(%ebp)
	subl	$12, %esp
	pushl	$__g77_cilist_0.0
	call	s_wsle
	addl	$16, %esp
	pushl	$2
	pushl	$.LC1
	pushl	$.LC2
	pushl	$.LC3
	call	do_lio
	addl	$16, %esp
	pushl	$16
	leal	-16(%ebp), %eax
	pushl	%eax
	pushl	$.LC2
	pushl	$.LC4
	call	do_lio
	addl	$16, %esp
	call	e_wsle
	subl	$8, %esp
	leal	-16(%ebp), %eax
	pushl	%eax
	leal	-48(%ebp), %eax
	pushl	%eax
	call	z_log
	addl	$16, %esp
	movl	-48(%ebp), %eax
	movl	-44(%ebp), %edx
	movl	%eax, -32(%ebp)
	movl	%edx, -28(%ebp)
	movl	-40(%ebp), %eax
	movl	-36(%ebp), %edx
	movl	%eax, -24(%ebp)
	movl	%edx, -20(%ebp)
	subl	$12, %esp
	pushl	$__g77_cilist_1.1
	call	s_wsle
	addl	$16, %esp
	pushl	$2
	pushl	$.LC5
	pushl	$.LC2
	pushl	$.LC3
	call	do_lio
	addl	$16, %esp
	pushl	$16
	leal	-32(%ebp), %eax
	pushl	%eax
	pushl	$.LC2
	pushl	$.LC4
	call	do_lio
	addl	$16, %esp
	call	e_wsle
	subl	$8, %esp
	pushl	$0
	pushl	$.LC6
	call	s_stop
.Lfe1:
	.size	MAIN__,.Lfe1-MAIN__
	.ident	"GCC: (GNU) 3.0.2 (Debian)"

as you can see z_log from libg2c.a is called.

> We would be
> stabbing in the dark without more detailed information; 

You can now do stabbing in the light...

                                     Oleg Krivosheev, 
                                     MS 220, BD/Physics,
                                     Fermi National Accelerator Laboratory,
                                     P.O.Box 500, Batavia, Illinois, 60510
                                     phone: (630) 840 8460
                                     FAX  : (630) 840 6039
                                     Email: kriol@fnal.gov



More information about the Gcc-bugs mailing list