[LLVMbugs] [Bug 20278] New: MS ABI: fastcall methods with struct return are broken

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Jul 9 18:42:08 PDT 2014


            Bug ID: 20278
           Summary: MS ABI: fastcall methods with struct return are broken
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: rnk at google.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

We have two register parameters and we are failing to account for the fact that
the sret parameter consumes one register slot.

This program fails to link and run together with MSVC:
struct SRet {
  int x;
  SRet(int x) : x(x) {}
struct A {
  virtual SRet __fastcall f(int);
#ifdef CONFIG_1
SRet A::f(int x) {
  return SRet(x);
int main() {
  A a;
  SRet x = a.f(42);
  return x.x;

It should exit 42.

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/20140710/9dc850f0/attachment.html>

More information about the llvm-bugs mailing list