[llvm-bugs] [Bug 34646] New: LLVM does not correctly align __int128 parameters passed on the stack

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Sep 16 13:41:28 PDT 2017


            Bug ID: 34646
           Summary: LLVM does not correctly align __int128 parameters
                    passed on the stack
           Product: new-bugs
           Version: 5.0
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: js-llvm-bugzilla at webkeks.org
                CC: llvm-bugs at lists.llvm.org

Quoting from the x86_64 ABI:

Arguments of type __int128 offer the same operations as INTEGERs,
yet they do not fit into one general purpose register but require two
registers. For classification purposes __int128 is treated as if it
were implemented as:
typedef struct {
        long low, high;
} __int128;
with the exception that arguments of type __int128 that are
stored in memory must be aligned on a 16-byte boundary.

However, Clang does not align them on a 16-byte boundary.

This results in Clang using a different ABI than GCC and others, resulting in
incompatible code.

E.g. the following code will create a function with a different ABI when
compiled with Clang and GCC:

test(__int128 a, __int128 b, __int128 c, __int128 d)
        return a + b + c +d;

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/20170916/252689b9/attachment.html>

More information about the llvm-bugs mailing list