Bug 16027 – Wrong result of double multiplication

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2016-05-15T14:12:00Z
Last change time
2016-05-18T03:19:46Z
Assigned to
nobody
Creator
schuetzm

Comments

Comment #0 by schuetzm — 2016-05-15T14:12:09Z
void main() { double value = 1.0; value *= -1.0; assert(value == -1.0); // fails, value is +1.0 value = 1.0; value = value * -1.0; assert(value == -1.0); } This is a regression introduced by this PR: https://github.com/dlang/dmd/pull/5534 Reported by a user here: https://forum.dlang.org/post/[email protected]
Comment #1 by temtaime — 2016-05-15T18:31:01Z
Seems all the backend "improvements" lead to the regressions
Comment #2 by bugzilla — 2016-05-15T19:44:38Z
Comment #3 by github-bugzilla — 2016-05-17T02:13:53Z
Commits pushed to stable at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/86b6999759d18f5c2467c31b19a682c02bed9173 fix Issue 16027 - Wrong result of double multiplication https://github.com/dlang/dmd/commit/f8d82257d15e75536b448651826eaf758e2eb584 Merge pull request #5786 from MartinNowak/fix16027 fix Issue 16027 - Wrong result of double multiplication
Comment #4 by thomas.bockman — 2016-05-18T02:31:51Z
*** Issue 16038 has been marked as a duplicate of this issue. ***
Comment #5 by thomas.bockman — 2016-05-18T02:32:21Z
We need the fix for this in master, also.
Comment #6 by github-bugzilla — 2016-05-18T03:19:46Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/86b6999759d18f5c2467c31b19a682c02bed9173 fix Issue 16027 - Wrong result of double multiplication https://github.com/dlang/dmd/commit/f8d82257d15e75536b448651826eaf758e2eb584 Merge pull request #5786 from MartinNowak/fix16027