Skip to content
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 23418 - double argument is passed on stack, but assumed to … #14568

Merged
merged 1 commit into from
Oct 16, 2022

Conversation

WalterBright
Copy link
Member

…be in XMM0 register

I replaced the "check the generated asm" tests, because the "known good" assembler was wrong. Replaced it with a runtime check.

@dlang-bot
Copy link
Contributor

Thanks for your pull request, @WalterBright!

Bugzilla references

Auto-close Bugzilla Severity Description
23418 normal double argument is passed on stack, but assumed to be in XMM0 register

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + dmd#14568"

@WalterBright
Copy link
Member Author

blocking #14567

@WalterBright WalterBright added the Review:Blocking Other Work review and pulling should be a priority label Oct 16, 2022
@WalterBright
Copy link
Member Author

@RazvanN7 @dkorpel ping

Copy link
Contributor

@dkorpel dkorpel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm trying to grasp the issue. So all this time, double parameters on 32-bit Linux with -O were completely broken, because the caller and callee were not consistent about the ABI? Would the new runnable/cdcmp.d test fail on 32-bit Linux with before this fix?

@ibuclaw
Copy link
Member

ibuclaw commented Oct 16, 2022

Does this affect extern(C/C++) codegen? If so target stable.

@WalterBright
Copy link
Member Author

Would the new runnable/cdcmp.d test fail on 32-bit Linux with before this fix?

Yes. Oops.

@ibuclaw I'd rather not, as this problem is blocking my further work on master with XMM code gen.

So all this time, double parameters on 32-bit Linux with -O were completely broken, because the caller and callee were not consistent about the ABI?

Ironically, most of the time it worked because the XMM0 parameter was pushed onto the stack, and yet remained in XMM0.

The bug was possible on memory models that didn't pass floating point values in XMM registers. But for the bug to appear, a set of other conditions have to be met.

@WalterBright WalterBright merged commit 91bfd72 into dlang:master Oct 16, 2022
@WalterBright WalterBright deleted the fix23418 branch October 16, 2022 19:55
@ibuclaw
Copy link
Member

ibuclaw commented Oct 16, 2022

@WalterBright you can always merge stable into master immediately afterwards. In fact, I've got it pending on my release tasks, but I'm still waiting for you to reply to your emails w.r.t ftp.digitalmars.com access. :-)

@WalterBright
Copy link
Member Author

I thought Jan was doing that?

@ibuclaw
Copy link
Member

ibuclaw commented Oct 16, 2022

I thought Jan was doing that?

Seen no response from him so far. You are part of the wheel group though, so as a fallback admin, you can su up and add me to the group as well.

@WalterBright
Copy link
Member Author

Could you email me exactly what to do? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Review:Blocking Other Work review and pulling should be a priority Severity:Bug Fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants