[llvm-commits] Patch for Win64 calling conventions

Michael Beck beck at mental.com
Fri Aug 28 07:31:58 PDT 2009


the following patches adds a workaround for Win64 calling conventions.
The problem is, that windows requires a 32 byte free zone above the
current frame as a back store for register parameters.
While this zone is allocated in newer versions, spilling with PUSH/POP
will spill into this zone, so spilled values gets overwritten when a
called function uses this area.
The patch simply uses store/load to the right spillslot.
This might be overkill if the current function is a leaf ...

The second small patch simply sets the hosttriple to "x86_64-pc-win32"
for 64bit builds and to "i686-pc-win32" for 32bit builds.
At least my cmake sets the hosttriple always to i686, causing the 32bit
code generator to be called instead of the 64bit one.

Moreover, the patch adds _M_X86 to the list of 64bit defines. This is
used in newer visual studios.

The path was done for 78186, but works fine with 80359.

best regards,

Michael Beck
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hosttripel.diff
Type: text/x-patch
Size: 437 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20090828/c534ef97/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: win64cc_fix.diff
Type: text/x-patch
Size: 2989 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20090828/c534ef97/attachment-0001.bin>

More information about the llvm-commits mailing list