[LLVMbugs] [Bug 19909] New: va_arg fails with __int128

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat May 31 15:58:27 PDT 2014


            Bug ID: 19909
           Summary: va_arg fails with __int128
           Product: new-bugs
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: nenad at intrepid.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 12583
  --> http://llvm.org/bugs/attachment.cgi?id=12583&action=edit
Demonstrate __int128 va_arg failure

The attached example fails on Clang/LLVM trunk (or 3.4 or Apple 3.4) and passes
when compiled with gcc 4.8.2.  The code simple tries to pass multiple __int128
after two ints and a pointer.  I debugged it a bit and it seems that the
"overflow_arg_area" pointer in va_list is wrong by 8 bytes, which might
indicate some alignment problem. 

I also checked how __int128 is passed to the function.  It seems that Clang is
capable of splitting the __int128 where lower part is passed in a register and
upper part on the stack.  GCC does not split __int128 if it does not have 2
registers available.  This might explain the wrong 8 bytes offset for the
"overflow_arg_area" as va_start does not adjust for the split register.

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140531/178eee50/attachment.html>

More information about the llvm-bugs mailing list