This is the mail archive of the gcc@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]

Re: Bug with g77 and -mieee on Alpha Linux


[ Oh, I see I forgot one important issue - Emil, I hope you don't mind
  if I discuss this private e-mail on the list: ]

Emil Hallin wrote:
> 
> Toon Moene wrote:
> 
> > Of course one could always set up a scenario where, using the fact that
> > you cannot know whether a floating point value is 80-, 64- or 32-bits
> > wide, you can generate small differences (which should have been zero)
> > that, suitably multiplied which each other, will generate a denormal
> > (especially if you start close to FLT_MIN).  My point is that you have
> > to cleverly set this up, because it will not show up in normal practice.
> 
> I still think the egcs compiler should do the right thing and spill 80 bit fp
> values when it has to. (IBM thought noone would ever use more than 640K "in
> normal practice" either and look what that did to us!).
> 
> I am a  physicist so I appreciate your arguments; my programs are not likely to
> break on this issue, but I can't *guarantee* that they won't break, and I
> dislike having to rely on results that might be different depending on whether
> or not I clicked on the mouse at the wrong time, forcing a context switch and
> register spills at an inopportune moment.

Ah, ho, keep it right there !

The saving of floating point registers on interrupt is an OS-issue.  The
compiler cannot do anything about that.

[I hope and actually am quite confident that Linux actually saves the
 complete 8x80 bit contents of the ia32 floating point stack]

This, indeed, is not the sort of impredictability one would like to have
(even if your algorithms are robust against small differences in
floating point arithmetic, having two subsequent runs with the same
input differ would be rather scary).

The discussion is whether spills to the stack of floating point
registers *by the compiler* should be done in full 80-bit accuracy, even
if the relevant variable was only declared as REAL (32 bits) or DOUBLE
PRECISION (64 bits).  This is not done now, and that might mean that two
runs with the same code and same input, but a different version of the
compiler, could give you different results.

OTOH, a new version of the compiler could also decide to evaluate your
expressions differently (within the limits required by the Standard, of
course) and causing output to differ that way.

Hope this helps,

-- 
Toon Moene (toon@moene.indiv.nluug.nl)
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
Phone: +31 346 214290; Fax: +31 346 214286
GNU Fortran: http://world.std.com/~burley/g77.html


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