[PATCH] Allow EmitVAArg() to promote types and use this to fix some N32/N64 vararg issues for Mips.

Daniel Sanders daniel.sanders at imgtec.com
Wed Nov 19 02:19:20 PST 2014

Thanks, committed in r222339.

Comment at: lib/CodeGen/CGExprScalar.cpp:3318
@@ -3311,1 +3317,3 @@
+  return Val;
theraven wrote:
> I think the real fix here is to move the CreateLoad into each of the EmitVAArg() call, but this is a simpler change.
I agree. The load for the argument is also target specific so it belongs with the target specific code.

It shouldn't be difficult to move it but the obvious patch will affect all targets. If I manage to find some spare time, I'll take a look at making that change.

By the way, I'll have to try some small structures (<32-bit for O32, <64-bit for N32/N64) in varargs soon. It's occurred to me that they probably don't work for any big-endian ABI assuming they are defined the same way in varargs as they are for fixed args. If that turns out to be correct then moving the load into EmitVAArg() will be a prerequisite of fixing it since I'll need to shift the result of the load to the right.


More information about the cfe-commits mailing list