float->double->float conversion with 19991122 snapshot (Linux/Intel)

Stephen L Moshier moshier@mediaone.net
Wed Dec 1 15:25:00 GMT 1999


> float
> fdf (float xx)
> {
>   double x = xx;
>   return x;
> }

What an amazing mess!
Offhand it looks i386-specific.  Sparc generates a reasonable program.

					
./xgcc -B./ -O0 -S tst4.c

	.file	"tst4.c"
	.version	"01.01"
gcc2_compiled.:
	.section	.rodata
	.align 4
.LC0:
	.long	0x7fc00000
.text
	.align 16
.globl fdf
	.type	 fdf,@function
fdf:
	pushl	%ebp
	movl	%esp, %ebp
	subl	$24, %esp
	fldl	-8(%ebp)
	fstp	%st(0)
	flds	8(%ebp)
	fstp	%st(0)
	fldl	-8(%ebp)
	fstps	-12(%ebp)
	flds	-12(%ebp)
	jmp	.L2
	flds	.LC0
.L2:
	movl	%ebp, %esp
	popl	%ebp
	ret
.Lfe1:
	.size	 fdf,.Lfe1-fdf
	.ident	"GCC: (GNU) 2.96 19991122 (experimental)"



More information about the Gcc-bugs mailing list