[LLVMbugs] [Bug 2383] New: wrong code emitted for empty struct byval parameter

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Thu May 29 02:52:47 PDT 2008


http://llvm.org/bugs/show_bug.cgi?id=2383

           Summary: wrong code emitted for empty struct byval parameter
           Product: new-bugs
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: sharparrow1 at yahoo.com
                CC: llvmbugs at cs.uiuc.edu


define i32 @a({}* byval %x, i32 %y) nounwind  {
entry:
        ret i32 %y
}

emits the following:
a:
        movl    8(%esp), %eax
        ret

whereas the equivalent C code compiled with gcc or llvm-gcc:
struct S94 { struct __attribute__((aligned (16))){}a;};
int a(struct S94 x, int y) {return y;}

emits the following:

a:
        movl    4(%esp), %eax
        ret

I think the LLVM assembly should compile down to the same thing; I'm not
completely sure, though.


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list