🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #51520

Pb with Gcc-1.40 on 386

#51520
From: Pierre Ficheux
Date: Mon, 10 May 1993 18:45
98 lines
2581 bytes
	Hi,

	I have a pb with gcc-1.40 (and 1.42 too) on a 386 computer. I have ported
gcc on Coherent 4.0.1 but it seems to generate FPU instructions even with
m80387 flag disabled (#define TARGET_DEFAULT 0 in tm.h file). Here is an example :

foo ()
{
    double x = 1.23, y = 23.4, z;

    z = x / y;
}

==> generates :

	.file	"b1.c"
gcc_compiled.:
.text
	.align 4
.LC0:
	.double 1.2299999999999999000000e+00
	.align 4
.LC1:
	.double 2.3399999999999998000000e+01
	.align 4
.globl foo
foo:
	pushl %ebp
	movl %esp,%ebp
	subl $24,%esp
	pushl %ebx
	movl .LC0,%ecx
	movl .LC0+4,%ebx
	movl %ecx,-8(%ebp)
	movl %ebx,-4(%ebp)
	movl .LC1,%ecx
	movl .LC1+4,%ebx
	movl %ecx,-16(%ebp)
	movl %ebx,-12(%ebp)
	pushl -12(%ebp)
	pushl -16(%ebp)
	pushl -4(%ebp)
	pushl -8(%ebp)
	call __divdf3
	addl $16,%esp
	addl $-8,%esp
	fstpl (%esp)		<====== this is a 80387 instruction !!!
	popl %eax
	popl %edx
	movl %eax,-24(%ebp)
	movl %edx,-20(%ebp)
.L1:
	leal -28(%ebp),%esp
	popl %ebx
	leave
	ret


with -m80387 option, it seems to work correctly :

	.file	"b1.c"
gcc_compiled.:
.text
	.align 4
.LC0:
	.double 1.2299999999999999000000e+00
	.align 4
.LC1:
	.double 2.3399999999999998000000e+01
	.align 4
.globl foo
foo:
	pushl %ebp
	movl %esp,%ebp
	subl $24,%esp
	fldl .LC0
	fstpl -8(%ebp)
	fldl .LC1
	fstpl -16(%ebp)
	fldl -8(%ebp)
	fdivl -16(%ebp)
	fstpl -24(%ebp)
.L1:
	leave
	ret


	Any idea ?

-- 
 ._______________________________.__________________________. 
+-------------------------------'--------------------------'|
| Pierre FICHEUX                | tel   : +33 56 68 80 00  ||
| Lectra Systemes               | fax   : +33 56 78 88 31  ||
| ZI Marticot 33610 CESTAS      | E-mail: pierre@lectra.fr ||          
| FRANCE                        |     			   ||	
`-------------------------------^--------------------------'
Le succes depend de l'attention portee aux details. -- DOGEN --
Technical Details
Message-ID: <1993May10.184542@lectra.fr>
Path: arc1-ca.pugleaf.net!gmd.de!ira.uka.de!howland.reston.ans.net!europa.eng.gtefsd.com!wx.gtegsc.com!wlbr!voder!gatekeeper.nsc.com!psinntp!psinntp!tfd!afp!gna!lectra.fr!pierre

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,81a93bfd1b4451e9,start
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1993-05-14 22:18:17 PST
Newsgroups: gnu.gcc.help
Path: arc1-ca.pugleaf.net!gmd.de!ira.uka.de!howland.reston.ans.net!europa.eng.gtefsd.com!wx.gtegsc.com!wlbr!voder!gatekeeper.nsc.com!psinntp!psinntp!tfd!afp!gna!lectra.fr!pierre
From: pierre@lectra.fr (Pierre Ficheux)
Subject: Pb with Gcc-1.40 on 386
Organization: Lectra Systemes, Cestas, France
Date: Mon, 10 May 1993 18:45:42 GMT
Message-ID: <1993May10.184542@lectra.fr>
Sender: pierre@lectra (Pierre Ficheux)
Lines: 98