*BSD News Article 15607


Return to BSD News archive

Newsgroups: comp.os.386bsd.questions
Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!elroy.jpl.nasa.gov!decwrl!csus.edu!netcom.com!hasty
From: hasty@netcom.com (Amancio Hasty Jr)
Subject: Re: gcc compile error: enquire.c
Message-ID: <hastyC6IMpp.639@netcom.com>
Organization: Netcom Online Communications Services (408-241-9760 login: guest)
References: <1993May4.111203.28674@ucthpx.uct.ac.za>
Date: Tue, 4 May 1993 18:44:12 GMT
Lines: 80

In article <1993May4.111203.28674@ucthpx.uct.ac.za> crawford@comgate.ee.uct.ac.za (Brian Crawford) writes:
>Has anyone with 386bsd rel. 0.1 w/ patchescompile gcc had the following 
>problem with enquire.c:
>
>/xgcc -B./  -DIN_GCC   -g     -DNO_MEM -DNO_STDDEF -DNO_LONG_DOUBLE_IO -O0 -I.
>-c ./enquire.c
>/enquire.c: In function 'fprop':
>/enquire.c:2307: floating constant out of range
>*** Error code 1
>

In compiling gcc-2.3.3 under NetBSD, I found the same 
problem and posted the question whiche no one responded to....

So I use our news archival at minnie.cs.adfa.oz.au to get my answer :-)

Here is an old post that I found sorry I lost the header ...


Happy Reading,
Amancio Hasty

----------------------------------

The problem is not a floating constant out of range. The problem
is a floating point stack overflow. To get passed this, manually
compile fold-const.c using -S in place of -c. Edit fold-const.s
and replace "fsts" with "fstps" in _real_value_truncate. Then
assemble (as -o fold-const.o fold-const.s). 
 
There is also a circular dependancy for protoize.o/unprotoize.o in the
Makefile. Add the lines
 
        touch protoize.o
        touch unprotoize.o
 
after the line
 
        touch stamp-proto
 
After this "make bootstrap" will run to completion.
The problem is inaccurate rounding (in atof()) more than the lack of
digits.
 
>#define DBL_MAX         1.7976931348623157E+308
 
The correct rounding of the last three digits is 159, not 157.  I'm
not sure what should happen when either of these is rounded to 160
and the last 0 is dropped.  The dropped digit is really beyond the
 
        00 00 00 00 00 00 00 F0 7F
 
gas apparently has bugs too.  It should produce +Infinity.  I think it is
OK internally but it may be trusting the library too much.  gcc can easily
be changed to avoid printf for output, but input is harder.
 
One value that works is
 
#define DBL_MAX         1.7976931348623147E+308
                                        ^ was 5
 
gcc prints 58 for the last two digits and gas converts the number correctly.
Printing the number then puts 68 in the last 2 digits...
 
All this is for the stock 386BSD-0.1 gcc and gas binaries.  Partial fixes



--------------------------------------





I really believe that flexfax is g++ resistant
-- 
This message brought to you by the letters X and S and the number 3
Amancio Hasty           |  
Home: (415) 495-3046    |  ftp-site depository of all my work:
e-mail hasty@netcom.com	|  sunvis.rtpnc.epa.gov:/pub/386bsd/incoming