Bug 5649 – std.conv.parse faulty for floating point with -O -m32
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Linux
Creation time
2011-02-23T20:33:00Z
Last change time
2013-03-04T01:50:49Z
Keywords
wrong-code
Assigned to
nobody
Creator
acehreli
Comments
Comment #0 by acehreli — 2011-02-23T20:33:02Z
The following assert fails when compiled with dmd's command line options -O -m32:
import std.conv;
void main()
{
char[] input = "1.5e3".dup;
assert(1500 == parse!double(input)); // <-- FAILS
}
It fails for float and real as well.
Please note that this combination works: -O -m64
Ali
Comment #1 by dsimcha — 2011-02-24T06:24:18Z
Under platform, please put x86 if it's a 32-bit bug, even if you ran the code on a 64-bit machine.
I can also reproduce this on Windows. Note that the answer is correct if -release is also enabled.
Comment #2 by dsimcha — 2011-02-24T06:53:15Z
This one was introduced in DMD 2.048 -> it's a regression. Also, since optimization settings affect the result, I think it's safe to call this a wrong-code bug.