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

            Bug ID: 42642
           Summary: std::nullptr_t in aggregates does not follow ABI
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected], [email protected],
                    [email protected]

When you create a trivial aggregate containing std::nullptr_t, it does not get
passed through RDI/RSI, but gets classified as a memory arg

E.g.:


struct MyVar1 {
    int x = 3;
    std::nullptr_t n = nullptr;
};

void Foo(MyVar1 x);

void CallMyVar1() {
    MyVar1 m;
    Foo(m);  // Sets up stack frame and passes as pointer / MEMORY
}


GCC does this correct. 

More elaborate examples: https://gcc.godbolt.org/z/IxLudk

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to