D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 14203 - Return of floating point values from extern(C++) member functions does not match dmc
Summary: Return of floating point values from extern(C++) member functions does not ma...
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Windows
: P1 major
Assignee: No Owner
URL:
Keywords: backend, C++, pull, wrong-code
Depends on:
Blocks:
 
Reported: 2015-02-20 02:37 UTC by yebblies
Modified: 2020-09-03 07:14 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description yebblies 2015-02-20 02:37:29 UTC
struct C
{
    float func() { return 0; }
};

The C++ version of this code returns via the stack, but the D version returns in ST(0).  One of these is obviously wrong.

Same for double and real/long double, only on win32.

I don't know if this is a bug in dmd or dmc.  Anyone?
Comment 1 github-bugzilla 2015-02-20 05:49:57 UTC
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/c73f7fefb952adbf8f5bfc28d872222854926033
Add workaround for issue 14203

https://github.com/D-Programming-Language/dmd/commit/b1ace291ac3078b55f9895177fe13b3f537874d9
Merge pull request #4423 from yebblies/floatworkaround

[DDMD] Add workaround for issue 14203
Comment 4 github-bugzilla 2017-07-19 17:38:40 UTC
Commits pushed to dmd-cxx at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/c73f7fefb952adbf8f5bfc28d872222854926033
Add workaround for issue 14203

https://github.com/dlang/dmd/commit/b1ace291ac3078b55f9895177fe13b3f537874d9
Merge pull request #4423 from yebblies/floatworkaround
Comment 5 Dlang Bot 2020-09-03 05:47:42 UTC
@WalterBright created dlang/dmd pull request #11675 "fix Issue 14203 - Return of floating point values from extern(C++) me…" fixing this issue:

- fix Issue 14203 - Return of floating point values from extern(C++) member functions does not match dmc

https://github.com/dlang/dmd/pull/11675
Comment 6 Dlang Bot 2020-09-03 07:14:52 UTC
dlang/dmd pull request #11675 "fix Issue 14203 - Return of floating point values from extern(C++) me…" was merged into master:

- 20a2eb3264270d7f42fc71237e3f42331afe9ed3 by Walter Bright:
  fix Issue 14203 - Return of floating point values from extern(C++) member functions does not match dmc

https://github.com/dlang/dmd/pull/11675