-
-
Notifications
You must be signed in to change notification settings - Fork 267
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 Win64 ABI wrt. passing structs > 64 bit #756
Conversation
// rewritten as integers | ||
return (t->ty == Tstruct || t->ty == Tsarray) && !canRewriteAsInt(t); | ||
// FIXME: LLVM doesn't seem to support ByVal on Win64 yet | ||
//return isPassedWithByvalSemantics(t); |
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.
Is there a reason to not call isPassedWithByvalSemantics()
? The sole effect is that the byval
attribute is set (which has no effect because the argument is rewritten). The other ABI implementations use the same approach.
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.
No particular reason, I just wasn't sure whether byval
would really be ignored if the argument is rewritten.
Now we're down to 63 errors in druntime/phobos (release and debug) on Win64:
I.e., this fixes 15-20 errors. :) |
Fix Win64 ABI wrt. passing structs > 64 bit
Thanks! |
Did you build with assertions enabled? |
Yes I did, getting the same problem now. It's due to the byval attribute, see the outdated line diff comments. Simply returning false in passByVal() works. |
Hmm ok first I thought it's cause of the llvm update but returning false makes the assertions go away indeed. |
Hotfix: #757 |
@Trass3r Note that you'll run into ldc-developers/druntime@2c2c8ca#commitcomment-8248875 as well. Simply remove the INTRINSICS_FROM_302 version guard for the moment. |
Do you also get empty "application error" message boxes with the crashing unittests? |
Hmm, I get the normal app-crashed Windows dialog on segfault (with the option to close or debug it) and 2-3 message boxes from the MSVCRT ("abort() called" iirc). Is that what you mean? |
With the former assertions in ldc I get the usual close or debug dialog. But the test runner crashes suddenly (?) only produce a messagebox with title Application Error, an icon, no description and no text on the ok button. Maybe some /MT weirdness. |
Good guess, I've seen some warnings about /MT overriding /MTd or something like that. I guess your weird dialog should be the MSVCRT dialog about abort(). |
Yeah one problem was I modified the CXX flags for static C runtime, but not the C flags. |
Also see #758 |
This fixes #754.