[PATCH] D12346: x32. Fixes a bug in how struct va_list is initialized in x32

João Porto via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 8 09:14:35 PDT 2015


jpp added a comment.

In http://reviews.llvm.org/D12346#236986, @hjl.tools wrote:

> You missed:
>
>   static SDValue LowerVACOPY(SDValue Op, const X86Subtarget *Subtarget,
>                              SelectionDAG &DAG) {
>     // X86-64 va_list is a struct { i32, i32, i8*, i8* }, except on Windows,
>     // where a va_list is still an i8*.
>     assert(Subtarget->is64Bit() && "This code only handles 64-bit va_copy!");
>     if (Subtarget->isCallingConvWin64(
>           DAG.getMachineFunction().getFunction()->getCallingConv()))
>       // Probably a Win64 va_copy.
>       return DAG.expandVACopy(Op.getNode());
>  
>     SDValue Chain = Op.getOperand(0);
>     SDValue DstPtr = Op.getOperand(1);
>     SDValue SrcPtr = Op.getOperand(2);
>     const Value *DstSV = cast<SrcValueSDNode>(Op.getOperand(3))->getValue();
>     const Value *SrcSV = cast<SrcValueSDNode>(Op.getOperand(4))->getValue();
>     SDLoc DL(Op);
>  
>     return DAG.getMemcpy(Chain, DL, DstPtr, SrcPtr,
>                          DAG.getIntPtrConstant(24, DL), 8, /*isVolatile*/false,
>                                                               ^^^ It should be 16 for x32.
>                          false, false,
>                          MachinePointerInfo(DstSV), MachinePointerInfo(SrcSV));
>  
>


I am trying to get x32 to work one piece at a time, with small, self-contained patches. I don't mind fixing LowerVACOPY here, but I would rather do it in a separate CL, changing the appropriate tests. My ultimate goal is to have all/most x86 tests enable for x32. Let me know.


http://reviews.llvm.org/D12346





More information about the llvm-commits mailing list