Issue 16027 - Wrong result of double multiplication
Summary: Wrong result of double multiplication
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86_64 Linux
: P1 regression
Assignee: No Owner
URL: https://forum.dlang.org/post/tbismdhj...
Keywords:
: 16038 (view as issue list)
Depends on:
Blocks:
 
Reported: 2016-05-15 14:12 UTC by Marc Schütz
Modified: 2016-05-18 03:19 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Marc Schütz 2016-05-15 14:12:09 UTC
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
Comment 1 Temtaime 2016-05-15 18:31:01 UTC
Seems all the backend "improvements" lead to the regressions
Comment 2 Walter Bright 2016-05-15 19:44:38 UTC
https://github.com/dlang/dmd/pull/5781
Comment 3 github-bugzilla 2016-05-17 02:13:53 UTC
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 thomas.bockman 2016-05-18 02:31:51 UTC
*** Issue 16038 has been marked as a duplicate of this issue. ***
Comment 5 thomas.bockman 2016-05-18 02:32:21 UTC
We need the fix for this in master, also.
Comment 6 github-bugzilla 2016-05-18 03:19:46 UTC
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