This is the mail archive of the 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: numerical instability and estimate-probability

> Date: Thu, 15 Nov 2001 15:47:07 +0100
> From: Jan Hubicka <>
> To:,,

> I am getting bootstrap comparison failure in i386 on the cfg-branch
> now.  It is due to estimate-probability to have off-by-one error
> when computing the probability that causes tracer to behave
> differently.

> I am currently solving it by adding volatile to the variable so it
> is stored to memory and truncated each time it is seen.  Would be
> such trick acceptable sollution or do we want to make better?  What?


It is advantageous to have gcc emit the same code, on different hosts
for the same source code.  This currently works.  (Last I checked.)  I
don't favor people breaking this.

One can `fix' this by doing the arithmetic in double, doing it safely,
and then chopping the number down to say, 5 or 10 digits at the end.
This way increase the odds that the numbers will be the same of all
platforms, and that the same code will be generated.  [ crossed
fingers we can do without a portible math library ]

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