Date: Thu, 9 Apr 1998 18:42:59 -0700 (PDT) Message-Id: <199804100142.SAA14921@adit.ap.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: Kbwms , bug-gcc AT gnu DOT com, djgpp AT delorie DOT com From: Nate Eldredge Subject: Re: Problem with Optimizer in GCC Precedence: bulk At 02:39 4/7/1998 EDT, Kbwms wrote: >The following problem pertains to MSDOS. > >When compiling enquire.c using optimizer level three, serious >problems occur. For example, enquire reports that the number >of bits in the significand of a float is 64. It says exactly >the same thing for type double. Did you notice this comment in enquire.c? Don't use any optimisation flags: the program may not work if you do. Though "while (a+1.0-a-1.0 == 0.0)" may look like "while(1)" to an optimiser, to a floating-point unit there's a world of difference. >Several other errors occurred during testing as shown in the >listing which I have included in enquire.zip (attached). It >is especially troubling that an execution of the program will >often leave the FP processor in an error state. The result >is a status dump which I have also included in the zip file. This is because DJGPP does not reset the FPU on SIGFPE, leaving it filled with garbage to crash the next thing to run. I seem to recall there being a good reason for this; however, I've forgotten what it was. Can somebody remind me? If there isn't a good reason not to, it's a simple fix: Just add `fninit', or whatever it is, to `_exit' in crt0.S. >The attached zip file, enquire.zip, contains > > 1. enquire.c I didn't get this attachment, although that's probably a good thing (large binary posts to comp.os.msdos.djgpp are discouraged). I assume you're using the same enquire.c that comes with GCC? (I use 2.7.2.1.) Nate Eldredge eldredge AT ap DOT net