Bug 15861 – [REG 2.069] Wrong double-to-string conversion with -O

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86
OS
All
Creation time
2016-04-01T16:25:00Z
Last change time
2016-10-01T11:46:01Z
Keywords
wrong-code
Assigned to
nobody
Creator
dlang-bugzilla

Comments

Comment #0 by dlang-bugzilla — 2016-04-01T16:25:41Z
///////////////////////// test.d ///////////////////////// import std.format; void main() { assert(format("%.18g", 4286853117.0) == "4286853117"); } ////////////////////////////////////////////////////////// Passes without -O, asserts with -O. Introduced in https://github.com/D-Programming-Language/dmd/pull/4911
Comment #1 by bugzilla — 2016-04-11T08:25:37Z
Sadly, this generates about 10,000 lines of assembler.
Comment #2 by bugzilla — 2016-04-11T09:07:47Z
Comment #3 by dlang-bugzilla — 2016-04-11T14:50:58Z
Thanks. In the future, you can let me know if you'd like a completely reduced test case.
Comment #4 by github-bugzilla — 2016-04-12T18:12:37Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/2d9a5bc18268a6c81e8cc69c2a036c5bc9c3875d fix Issue 15861 - [REG 2.069] Wrong double-to-string conversion with -O https://github.com/D-Programming-Language/dmd/commit/74ed68472924f4a7104af6ef369a9ad23920cbbf Merge pull request #5650 from WalterBright/fix15861 fix Issue 15861 - [REG 2.069] Wrong double-to-string conversion with -O
Comment #5 by bugzilla — 2016-04-12T21:44:44Z
(In reply to Vladimir Panteleev from comment #3) > Thanks. In the future, you can let me know if you'd like a completely > reduced test case. I'd always prefer a completely reduced test case!
Comment #6 by bugzilla — 2016-04-12T21:46:19Z
Vladimir's reduced test case: void main() { double val = 4286853117.; (){ assert(val == 4286853117.); }(); }
Comment #7 by github-bugzilla — 2016-04-13T05:52:47Z
Commits pushed to stable at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/241f18c260618fe9b7083d29d8d975391a8a2561 Merge pull request #5650 from WalterBright/fix15861 fix Issue 15861 - [REG 2.069] Wrong double-to-string conversion with -O https://github.com/D-Programming-Language/dmd/commit/388fb366bc309c174b63014efae273695082759d Merge pull request #5655 from 9rnsr/fix15861 Cherry-pick commits for issue 15861 fix from master into stable
Comment #8 by github-bugzilla — 2016-04-17T16:07:21Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/241f18c260618fe9b7083d29d8d975391a8a2561 Merge pull request #5650 from WalterBright/fix15861 https://github.com/dlang/dmd/commit/388fb366bc309c174b63014efae273695082759d Merge pull request #5655 from 9rnsr/fix15861
Comment #9 by github-bugzilla — 2016-10-01T11:46:01Z
Commits pushed to stable at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/2d9a5bc18268a6c81e8cc69c2a036c5bc9c3875d fix Issue 15861 - [REG 2.069] Wrong double-to-string conversion with -O https://github.com/dlang/dmd/commit/74ed68472924f4a7104af6ef369a9ad23920cbbf Merge pull request #5650 from WalterBright/fix15861