- 
                Notifications
    You must be signed in to change notification settings 
- Fork 5.2k
Fix struct ReturnKind on SysV AMD64. #116194
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
Changes from 1 commit
3784150
              5730cd0
              9a718cb
              1760969
              ae4fdfc
              c1c609e
              a5c9613
              dbd7587
              44fa203
              File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
|  | @@ -1299,6 +1299,15 @@ ReturnKind MethodDesc::ParseReturnKindFromSig(INDEBUG(bool supportStringConstruc | |
| regKinds[i] = RT_Scalar; | ||
| } | ||
| } | ||
|  | ||
| if (eeClass->GetEightByteClassification(0) == SystemVClassificationTypeSSE) | ||
| { | ||
| // Skip over SSE types since they do not consume integer registers. | ||
| // An obj/byref in the 2nd eight bytes will be in the first integer register. | ||
| regKinds[0] = regKinds[1]; | ||
| regKinds[1] = RT_Scalar; | ||
| } | ||
|          | ||
|  | ||
| ReturnKind structReturnKind = GetStructReturnKind(regKinds[0], regKinds[1]); | ||
| return structReturnKind; | ||
| } | ||
|  | ||
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 is the right fix for backport. In main, this path is unreachable in main - the whole method can be under
TARGET_X86ifdef and simplified to only handle a single register.@jakobbotsch How would you like to handle this?
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.
@zengandrew Thanks so much for filing the fix here. I have cherry-picked the commit from this PR directly into the two backports (#116206, #116208).
Given the testing it appears to be unnecessary for the 9.0 backport. However 9.0 still has the code around return kinds enabled for x64. That code was removed in #110799 which is not part of 9.0. The actual PRs that made it unnecessary are #95565 and #104336 that are part of 9.0. But, just to be safe, since the code is actually running during hijack, I think we should include it as well.
For main I think we should skip the change (mainly to avoid the misleading commit history, since this code is unused). And indeed we should clean this up (cc @VSadov if you want to do it).
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 have pushed a commit with the cleanup