[llvm-bugs] [Bug 33834] New: [ms_abi] Big structures arguments are not passed correctly (x64)

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jul 18 04:32:17 PDT 2017


https://bugs.llvm.org/show_bug.cgi?id=33834

            Bug ID: 33834
           Summary: [ms_abi] Big structures arguments are not passed
                    correctly (x64)
           Product: clang
           Version: 3.9
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: piotr at codeweavers.com
                CC: llvm-bugs at lists.llvm.org

An example of function that will be called incorrectly:

typedef struct {
    int big[8];
} big;

extern void __attribute__((ms_abi)) call_func_with_struct_args(big a, big b,
big c, big d, big e);

...
big args[5];
memset(args, 0, sizeof(args));
call_func_with_struct_args(args[0], args[1], args[2], args[3], args[4]);

MSVC passes all structures indirectly (even for arguments passed on stack).
Clang passes first four arguments as pointers. Fifth argument is passed
incorrectly (this breaks some functionality in wine project).

-- 
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/20170718/c2cc4ea1/attachment.html>


More information about the llvm-bugs mailing list