This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c/5914: Infinite loop when compiling with optimisation on of z_log.c of libf2c
- From: Toon Moene <toon at moene dot indiv dot nluug dot nl>
- To: Ulrich Jakobus <jakobus at emss dot co dot za>
- Cc: "gcc-bugs at gcc dot gnu dot org" <gcc-bugs at gcc dot gnu dot org>, "gcc-gnats at gcc dot gnu dot org" <gcc-gnats at gcc dot gnu dot org>, "gcc-prs at gcc dot gnu dot org" <gcc-prs at gcc dot gnu dot org>, "nobody at gcc dot gnu dot org" <nobody at gcc dot gnu dot org>, "toon at gcc dot gnu dot org" <toon at gcc dot gnu dot org>
- Date: Wed, 13 Mar 2002 21:04:38 +0100
- Subject: Re: c/5914: Infinite loop when compiling with optimisation on of z_log.c of libf2c
- Organization: Moene Computational Physics, Maartensdijk, The Netherlands
- References: <20020313045953.D3551D3F6@mail.emss.co.za>
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)