[llvm-commits] Bug in "call __chkstak" on 64 bit OS

Yatsina, Marina marina.yatsina at intel.com
Sun Feb 19 04:31:10 PST 2012


Hi,

I've found a bug in the way LLVM creates a call to __chkstk.

The assemble instruction created for this is:
call <imm32>
Where imm32 is the address of __chkstk. On 64 bit OS the address can 64 bits and <imm32> is not big enough to contain the full address.

The solution for 64 bits is to save the address to r11 and call r11:
mov r11, <imm64>
call r11

I've added a patch with the solution and a LIT test making sure we do not create "call __chkstk" instructions on 64 bit OS.

Please let me know if you want me to open a bug on this issue.

Thank you,
Marina.
---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120219/275f0809/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Win64CallCheckStackLLVMTrunk.patch
Type: application/octet-stream
Size: 6486 bytes
Desc: Win64CallCheckStackLLVMTrunk.patch
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120219/275f0809/attachment.obj>


More information about the llvm-commits mailing list