[LLVMdev] [cfe-dev] x86_64-pc-win32 ABI var arg code gen bug? Is the bitcode correct? Or is it the code gen?

Andrew Fish afish at apple.com
Tue May 17 12:26:23 PDT 2011


On May 17, 2011, at 6:28 AM, NAKAMURA Takumi wrote:

> Andrew,
> 
> That is not a clang issue.
> 
> I think, in practice, {rcx, rdx, r8, r9} might not need to be spilled
> to "home area" in that case,
> because va_arg would not touch former 4 args.
> Lemme know if you had issues.
> 

I'm seeing a code gen issue with x86_64-pc-win32-darwin for this test case. So I was looking at the assembly for code gen and ABI issues. I agree that for this test case the spill is code that could optimized out. 

It looks like my bug was related to the sizeof (va_list) being incorrect for my triple, probably was set to struct __va_list_tag and not char*.  I tried a local fix, but I think this fix was broken. I noticed that the top of tree has fixed the issue. 

Thank you for the quick response, it was helpful for me to fully understand what is going on.

Thanks,

Andrew





More information about the llvm-dev mailing list