delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1992/02/27/21:30:02

Subject: Re: help required
To: dzabel AT cs DOT tu-berlin DOT de (Dirk Zabel)
Date: Thu, 27 Feb 92 18:15:49 MST
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu
From: arrakis!thor AT uunet DOT uu DOT net (Robert B. Hood)
Status: O

Believe it or not, Dirk Zabel said:
> 
> Hi,
> could somebody who is lucky enough to have a REAL 387 try to compile
> this short program with "gcc -c -S test.c":
> 
> ------- cut here -------- test.c ---------------
> double q = 0.3e10;
> ------- cut here -------------------------------
> 
> If the generated assembly-language output does not contain
> the following bad constant, the 387-emulator has most probably another bug.
> 
> -- Dirk
> 
> ------- cut here -------- test.s ---------------
> 	.file	"test.c"
> gcc_compiled.:
> .globl _q
> .data
> 	.align 2,144
> _q:
> 	.double 0d2.999999999:0000..(((/e+09
> ------- cut here -------------------------------
>                              ~~~~~~~~~~

I have a '486, and after performing the steps you indicate above on this
C file:

	double  q = 0.3e10;

	main(void)
	{
	    return(0);
	}

this is my resulting ".s" file:

------- cut here -------- test.s ---------------
	.file	"test.c"
gcc_compiled.:
.globl _q
.data
	.align 2,144
_q:
	.double 0d3.00000000000000047684e+09
.text
	.align 2,144
.globl _main
_main:
	pushl %ebp
	movl %esp,%ebp
	xorl %eax,%eax
	jmp L1
	.align 2,144
L1:
	leave
	ret
------- cut here -------------------------------

Hope that helps!

Bob
-- 
Bob Hood    thor AT arrakis DOT denver DOT co DOT us     H: 303-980-8392  W: 303-236-8959
---------------------------------------------------------------------------
       An easily-understood, workable falsehood is more useful than a
                     complex, incomprehensible truth.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019