///////////////////////// 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
Sadly, this generates about 10,000 lines of assembler.
https://github.com/D-Programming-Language/dmd/pull/5650
Thanks. In the future, you can let me know if you'd like a completely reduced test case.
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
(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!
Vladimir's reduced test case: void main() { double val = 4286853117.; (){ assert(val == 4286853117.); }(); }
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
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
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