This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: c/5914: Infinite loop when compiling with optimisation on of z_log.c of libf2c


Ulrich Jakobus wrote:

> I wrote:

> >Ah, now I see - you really meant this a *C* bug report :-)

> Yes, I meant this to be a *C* bug of the optimiser (and I
> submitted it as a C bug). Obviously the created code with
> -O2 or -O3 is not correct, resulting in an infinite loop.
> Compiling exactly the same code with -O works, and also
> using e.g. gcc-2.95.2 with -O2 or -O3 works fine.

Oh, perhaps you think that this is a regression w.r.t. 2.95.2 - it
isn't.  The fact that 2.95.2 happened to compile this "correctly" is
purely by chance.  In general, if you code a floating point
fixed-point-finder by comparing one estimate with the other for
equality, you'll lose on such targets as the x86, because it keeps
variables in registers with a different precision than the corresponding
memory location.

-ffloat-store is the flag to use to circumvent this problem.

-- 
Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
Join GNU Fortran 95: http://g95.sourceforge.net/ (under construction)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]