-
-
Notifications
You must be signed in to change notification settings - Fork 608
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Issue 23814 - [Codegen] Calling member function of extern(C++) cl… #15063
Conversation
|
Thanks for your pull request and interest in making D better, @naydef! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. Bugzilla references
Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + dmd#15063" |
|
As stated in the issue, I cannot reproduce this for neither 32 or 64 bit. 32 bit output: 00000000 <_ZN9MainClass5func4Ev>:
0: 55 push ebp
1: 8b ec mov ebp,esp
3: 83 ec 08 sub esp,0x8
6: e8 00 00 00 00 call b <_ZN9MainClass5func4Ev+0xb>
b: 58 pop eax
c: 05 02 00 00 00 add eax,0x2
11: 89 45 fc mov DWORD PTR [ebp-0x4],eax
14: 8b 4d fc mov ecx,DWORD PTR [ebp-0x4]
17: 8d 81 40 00 00 00 lea eax,[ecx+0x40]
1d: c9 leave
1e: c3 ret Does not use ebx. 64 bit output: 0000000000000000 <_ZN9MainClass5func4Ev>:
0: 48 8d 05 00 00 00 00 lea rax,[rip+0x0] # 7 <_ZN9MainClass5func4Ev+0x7>
7: c3 retDoes not use rbx. I don't think this issue is valid. |
|
I also replied in the issue report: I'm using DMD64 D Compiler v2.102.2 on Linux. Compiling with: "dmd app.d -m32" I see you check This issue has actually caused me trouble when interoperating with C++ code on Linux, it doesn't seem to exist on Windows. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- This needs a test (which can then be used to repro the issue @RazvanN7 )
- If the code is wrong, remove it, don't make the
ifalways false.
|
|
|
ping (Requested changes are applied) |
|
@RazvanN7 |
…ass with... ... multiple inheritance doesn't preserve the EBX register in some cases
|
Thanks for the ping, I've force pushed to restart the test suite and emailed Walter to request his review, since he wrote the backend. |
|
@dkorpel |
|
I can rebase again, but @RazvanN7 has access to buildkite directly |
|
Or merge despite the failure |
|
I restarted the buildkite testing pipeline. Adding the |
| assignaddrc(c1); | ||
| cdb.append(c1); | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"multiple inheritance doesn't preserve the EBX register in some cases"
Just removing all this code will break what it does. EBX register clobbering means it has to be saved/restored.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have much clue how to do that (not familiar with compiler backends).
Edit: I don't see what useful thing this code does, loading GOT in EBX and then it goes unused. So yea, clueless here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wrote a more explanatory comment in the bu
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... in the bug report
|
Merged in OpenD. |
|
Since @WalterBright opposes the current implementation I see no point in keeping this PR open. If anyone wants to try and fix the issue there is a link from the bug report to the this PR. |
|
@naydef Thanks for your work and the time you put into this. I'm sorry that this is not the outcome you desired, however, maybe this will prompt @WalterBright to fix this issue. |
|
Closing it was long overdue... |
…ass with multiple inheritance doesn't preserve the EBX register in some cases
Remade.
Also not much idea of what I'm doing.
Not sure how to test this.