This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/55939] [4.6/4.7/4.8 regression] gcc miscompiles gmp-5.0.5 on m68k-linux
- From: "aldyh at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 18 Feb 2013 19:38:40 +0000
- Subject: [Bug target/55939] [4.6/4.7/4.8 regression] gcc miscompiles gmp-5.0.5 on m68k-linux
- Auto-submitted: auto-generated
- References: <bug-55939-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55939
Aldy Hernandez <aldyh at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |aldyh at gcc dot gnu.org
--- Comment #21 from Aldy Hernandez <aldyh at gcc dot gnu.org> 2013-02-18 19:38:40 UTC ---
Another less invasive option could be to force the return value of my_ldexp()
to go through memory, thus chopping off the excess precision before returning:
--- a.c 2013-02-18 20:37:23.000000000 +0100
+++ b.c 2013-02-18 20:36:42.000000000 +0100
@@ -404,7 +404,11 @@
e += 1;
}
} else
- return d;
+ {
+ volatile double force_round = d;
+ return force_round;
+
+ }
}
}
But basically, you'd have to carefully keep track of when you have to use
volatiles.