Message-Id: Comments: Authenticated sender is From: "Salvador Eduardo Tropea (SET)" Organization: INTI To: molnarl AT cdata DOT tvnet DOT hu, djgpp-workers AT delorie DOT com Date: Tue, 10 Mar 1998 16:12:22 +0000 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Re: ISN'T A BUG in 2.8.0 In-reply-to: Precedence: bulk molnarl AT cdata DOT tvnet DOT hu wrote: > On Tue, Mar 10, 1998 at 09:57:47AM +0000, Salvador Eduardo Tropea (SET) > wrote: > > molnarl AT cdata DOT tvnet DOT hu wrote: > > >Hi! > > > > > >I'm not sure whether it is a new bug. I've found it with the latest > > >test version of perl. > > > > > >This program is a feature test for perl. Compile this with -O0 and it > > >prints 0, but with -O2 it prints 1. This bug also appears on linux > > >(2.7.2.3). > [...] > > That's isn't considered as a bug by the gcc maintainers. Just compile > like > > that: -O2 -ffloat-store and you'll get 0. > > The perl folks will use another work around, because -ffloat-store is a > little bit too gcc specific for this feature test :-) But it's still > interesting that pgcc doesn't have this problem. I don't know if pgcc enables the -fno-float-store like gcc 2.7.x and 2.8.x does when you use optimization. This problem was reported to bug-gcc a lot of time ago and the maintainers said that is not a bug. Is hard to determine, floating point values have a limited resolution and the format can vary from platform to platform so you can't use a code that suppose some kind of "special resolution" or "special format". The code that you posted makes some assumptions that can or can't be true, in fact if the compiler generates code that uses extra precision it fails. SET ------------------------------------ 0 -------------------------------- Visit my home page: http://set-soft.home.ml.org/ or http://www.geocities.com/SiliconValley/Vista/6552/ Salvador Eduardo Tropea (SET). (Electronics Engineer) Alternative e-mail: set-sot AT usa DOT net - ICQ: 2951574 Address: Curapaligue 2124, Caseros, 3 de Febrero Buenos Aires, (1678), ARGENTINA TE: +(541) 759 0013