Page MenuHomePhabricator

[X86] Fix stack probing on x32 (PR41477)

Authored by nikic on Apr 19 2019, 11:51 AM.



Fix for On the x32 ABI with stack probing a dynamic alloca will result in a WIN_ALLOCA_32 with a 32-bit size. The current implementation tries to copy it into RAX, resulting in a physreg copy error. Fix this by copying to EAX instead.

Diff Detail

Event Timeline

nikic created this revision.Apr 19 2019, 11:51 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 19 2019, 11:51 AM
efriedma added inline comments.

Are you sure this subtraction is using the right opcode?


Also the subtraction here.


subq is the wrong opcode; should be using subl.

nikic updated this revision to Diff 195899.Apr 19 2019, 12:54 PM

Fix more registers/opcodes.

nikic marked 3 inline comments as done.Apr 19 2019, 1:00 PM

Thanks @efriedma. I've added test cases that exercise all three codepaths now and fixed the subtract regs/ops.

This revision is now accepted and ready to land.Apr 19 2019, 1:36 PM
nikic closed this revision.Apr 20 2019, 3:18 AM

Committed in rL358807, forgot the Differential Revision tag...