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

cranelift: Fix spillslot regression on big-endian platforms #2843

Merged
merged 1 commit into from
Apr 15, 2021
Merged

cranelift: Fix spillslot regression on big-endian platforms #2843

merged 1 commit into from
Apr 15, 2021

Conversation

uweigand
Copy link
Member

PR 2840 changed the store_spillslot routine to always store
integer registers in full word size to a spill slot. However,
the load_spillslot routine was not updated, which may causes
the contents to be reloaded in a different type. On big-endian
systems this will fetch wrong data.

Fixed by using the same type override in load_spillslot.

Copy link
Member

@cfallin cfallin left a comment

Choose a reason for hiding this comment

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

Thanks, LGTM!

@cfallin
Copy link
Member

cfallin commented Apr 15, 2021

Looks like the filetest added in the earlier change to the store side needs to be updated (just changing movslq -> movq should be enough I think).

@github-actions github-actions bot added cranelift Issues related to the Cranelift code generator cranelift:area:machinst Issues related to instruction selection and the new MachInst backend. labels Apr 15, 2021
PR 2840 changed the store_spillslot routine to always store
integer registers in full word size to a spill slot.  However,
the load_spillslot routine was not updated, which may causes
the contents to be reloaded in a different type.  On big-endian
systems this will fetch wrong data.

Fixed by using the same type override in load_spillslot.
@uweigand
Copy link
Member Author

Looks like the filetest added in the earlier change to the store side needs to be updated (just changing movslq -> movq should be enough I think).

Indeed, looks like this fixed it.

@cfallin cfallin merged commit 03077e0 into bytecodealliance:main Apr 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cranelift:area:machinst Issues related to instruction selection and the new MachInst backend. cranelift Issues related to the Cranelift code generator
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants