[PATCH] Make variable argument intrinsics behave correctly in a Win64 CC function.
Eli Friedman
eli.friedman at gmail.com
Mon Sep 9 19:36:59 PDT 2013
================
Comment at: lib/Target/X86/X86ISelLowering.cpp:10848
@@ +10847,3 @@
+ // The Win64 ABI uses char* instead of a structure.
+ return DAG.expandVAArg(Op.getNode());
+
----------------
Checking DAG.getMachineFunction().getFunction()->getCallingConv() is fine for va_start, but it isn't correct for va_arg or va_copy: a function using the Win64 calling convention can pass its va_list to a function using the AMD calling convention, or vice versa. And even if nobody writes code like that, the optimizer could potentially introduce such constructs.
http://llvm-reviews.chandlerc.com/D1622
More information about the llvm-commits
mailing list