Bugzilla – Bug 218
VMCore mishandles double -0.0
Last modified: 2004-02-01 16:50:37
You need to log in before you can comment on or make changes to this bug.
While looking into Bug 216, I noticed that storing -0.0 (which is double 0x8000000000000000) to a bytecode file and reading it back in causes it to lose its sign. I would guess that this is the same problem as Bug 212. -Chris
Just a note, this looks like the ValueMap (an std::map) in Constants.cpp cannot differentiate between -0.0 and 0.0. Grr. I wonder if < does not work for 0 and -0? -Chris
Yup, it looks like C, at least on X86, considers -0.0 and 0.0 to be to be equal! In particular, both -0.0 < 0.0 AND 0.0 < -0.0 are false. No wonder std::map gets confused. Bork. -Chris
Fixed. Testcase here: test/Regression/Assembler/2004-02-01-NegativeZero.llx Patches: http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20040126/011055.html http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20040126/011056.html Comparisons between 0.0 and -0.0 are trixy! -Chris