c/5914: Infinite loop when compiling with optimisation on of z_log.c of libf2c
Toon Moene
toon@moene.indiv.nluug.nl
Wed Mar 13 14:06:00 GMT 2002
The following reply was made to PR c/5914; it has been noted by GNATS.
From: Toon Moene <toon@moene.indiv.nluug.nl>
To: Ulrich Jakobus <jakobus@emss.co.za>
Cc: "gcc-bugs@gcc.gnu.org" <gcc-bugs@gcc.gnu.org>,
"gcc-gnats@gcc.gnu.org" <gcc-gnats@gcc.gnu.org>,
"gcc-prs@gcc.gnu.org" <gcc-prs@gcc.gnu.org>,
"nobody@gcc.gnu.org" <nobody@gcc.gnu.org>,
"toon@gcc.gnu.org" <toon@gcc.gnu.org>
Subject: Re: c/5914: Infinite loop when compiling with optimisation on of z_log.c
of libf2c
Date: Wed, 13 Mar 2002 21:04:38 +0100
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)
More information about the Gcc-prs
mailing list