This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: g77: Different results when compiling with/without -fbounds-check ?!
- To: r dot ems at gmx dot net
- Subject: Re: g77: Different results when compiling with/without -fbounds-check ?!
- From: Toon Moene <toon at moene dot indiv dot nluug dot nl>
- Date: Thu, 13 Jul 2000 12:23:15 +0200
- CC: gcc-bugs at gcc dot gnu dot org
- Organization: Moene Computational Physics, Maartensdijk, The Netherlands
- References: <396C91AA.3A5B4AA4@gmx.net>
Richard Ems wrote:
> After 2 days searching for errors and comparing my test case result's
> with different option combinations, I found
> that compiling with -fbounds-check and without it returns (for my test
> case) different results.
I can reproduce your results using g77-2.95.2 on i686-linux.
As far as I can see, the differences are in the 7th digit, not
unreasonable for a 32-bit floating point number.
The reason they are different at all is caused by the fact that the
extra code that -fbounds-check introduces leads to more intermediate
stores of register values into memory. On the Intel architecture that
means that more rounding from 80-bit floating point values to 32-bit
ones take place in case of -fbounds-check than when not compiling that
way.
You could work around this by adding the -ffloat-store option in all
cases - however, that would slow down your program considerably.
Hope this helps,
--
Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290
Saturnushof 14, 3738 XG Maartensdijk, The Netherlands
GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
GNU Fortran 95: http://g95.sourceforge.net/ (under construction)