This is the mail archive of the gcc-bugs@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]
Other format: [Raw text]

[Bug target/55939] [4.6/4.7/4.8 regression] gcc miscompiles gmp-5.0.5 on m68k-linux


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.


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