https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110622

--- Comment #15 from Xi Ruoyao <xry111 at gcc dot gnu.org> ---
(In reply to Mathieu Malaterre from comment #14)
> (In reply to Andrew Pinski from comment #13)
> > (In reply to Mathieu Malaterre from comment #12)
> > > I am seeing a difference in result (log1p computation) in the range:
> > > 
> > > 4318952042648305665 - 0x1.0000000000001p-64
> > > 4368493837572636672 - 0x1.002p-53
> > > 
> > > the other values seems to match expectation of log1p computation.
> > 
> > But you used excess-precision=fast
> > 
> > *** This bug has been marked as a duplicate of bug 323 ***
> 
> AFAIK bug #323 does not mention my trick:
> 
>   asm volatile("" : "+r"(y.raw[0]) : : "memory");
> 
> That simple line totally changed the optimizer code generation.

Because in x87 the excessive precision only exists in x87 stack-like registers.
 The "memory" clobber forces a store and reload for all non-register variables,
thus the value is truncated into a normal double value and the excessive
precision is lost.

There are infinite ways to work around an issue, but it does not mean PR 323
must mention all of them.

Reply via email to