[llvm-bugs] [Bug 28593] New: Itanium non-virtual value parameter calling conventions incorrect for non-trivially move-able types.

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Jul 17 21:18:38 PDT 2016


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

            Bug ID: 28593
           Summary: Itanium non-virtual value parameter calling
                    conventions incorrect for non-trivially move-able
                    types.
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: eric at efcs.ca
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

3.1.1[value.parameters] of the Itanium spec states:

> In the special case where the parameter type has a non-trivial copy 
> constructor or destructor, the caller must allocate space for a temporary 
> copy, and pass the resulting copy by reference

Currently clang only considers copy constructors and not move constructors when
deciding on the calling convention, Meaning types with non-trivial move
constructors are not passed in allocated space.

GCC 

For example:

struct Foo {
  Foo() {}
  Foo(Foo const&) = default;
  Foo(Foo&&);
};

int foo(Foo);
void bar() { foo(Foo{}); }
// generates the assembly:
// bar(): jmp foo

Possibly related to https://llvm.org/bugs/show_bug.cgi?id=20799

-- 
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/20160718/1ff9a223/attachment-0001.html>


More information about the llvm-bugs mailing list