This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/323] optimized code gives strange floating point results
- From: "egon at heaven dot industries dot cz" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Jan 2007 16:29:18 -0000
- Subject: [Bug rtl-optimization/323] optimized code gives strange floating point results
- References: <bug-323-4315@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #88 from egon at heaven dot industries dot cz 2007-01-18 16:29 -------
> const volatile double y2 = x + 1.0;
I'd also favor this "selective" approach, because the instability is harmless
in most cases. But it is dangerous sometimes, as mentioned in the binary
search or when sorting, where the faulty cmpfn() could turn the sort function
to infinite loop.
So, could you please advise a body of hypothetical
double discard_extended_precision(double a);
function (possibly some 387 FP insn?) that reliably truncates the argument to
64bit? Would
inline double discard_extended_precision(volatile double a) { return a; }
do the trick?
--
egon at heaven dot industries dot cz changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |egon at heaven dot
| |industries dot cz
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=323