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/tbismdhjzvytyxrihzil@forum.dlang.org
Seems all the backend "improvements" lead to the regressions
https://github.com/dlang/dmd/pull/5781
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
*** Issue 16038 has been marked as a duplicate of this issue. ***
We need the fix for this in master, also.
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