summaryrefslogtreecommitdiff
path: root/asmcomp/selectgen.ml
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>2015-11-16 15:12:21 +0100
committerXavier Leroy <xavier.leroy@inria.fr>2015-11-16 15:12:21 +0100
commitdcecfaf9808dbd087a0664db95f97ea20555a058 (patch)
tree6ae4fa3b37efd370faf40a8f4c38d7e9e8ca6534 /asmcomp/selectgen.ml
parent9b1a3712917c20a2b8f9332672b0553c159b8eb4 (diff)
downloadocaml-PR7042.tar.gz
Fix for PR#7024: CSE confuses +0.0 and -0.0PR7042
The fix consists in representing float literals by their bit patterns (int64) in the Mach and Linear intermediate languages. A regression test was added to the test suite.
Diffstat (limited to 'asmcomp/selectgen.ml')
-rw-r--r--asmcomp/selectgen.ml2
1 files changed, 1 insertions, 1 deletions
diff --git a/asmcomp/selectgen.ml b/asmcomp/selectgen.ml
index 79d95b4313..92c7b1a216 100644
--- a/asmcomp/selectgen.ml
+++ b/asmcomp/selectgen.ml
@@ -449,7 +449,7 @@ method emit_expr env exp =
Some(self#insert_op (Iconst_blockheader n) [||] r)
| Cconst_float n ->
let r = self#regs_for typ_float in
- Some(self#insert_op (Iconst_float n) [||] r)
+ Some(self#insert_op (Iconst_float (Int64.bits_of_float n)) [||] r)
| Cconst_symbol n ->
let r = self#regs_for typ_val in
Some(self#insert_op (Iconst_symbol n) [||] r)