Skip to content

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

Merged
cfallin merged 1 commit into
bytecodealliance:mainfrom
uweigand:spillslot-fix
Apr 15, 2021
Merged

cranelift: Fix spillslot regression on big-endian platforms#2843
cfallin merged 1 commit into
bytecodealliance:mainfrom
uweigand:spillslot-fix

Conversation

@uweigand
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

2 participants