[LLVMbugs] [Bug 21262] New: Clang passes arguments incorrectly for 64-bit big-endian MIPS

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Oct 13 10:46:39 PDT 2014


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

            Bug ID: 21262
           Summary: Clang passes arguments incorrectly for 64-bit
                    big-endian MIPS
           Product: clang
           Version: trunk
          Hardware: Other
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: csdavec at swan.ac.uk
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

The following simple test program demonstrates the issue:

extern int printf(const char *,...);

int main(void)
{
               
printf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,\n",
                                                                10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 22);
}

GCC passes each of the int arguments either in register (implicitly extended to
64 bits) or on the stack (stored using sd, explicitly extended).  Clang stores
them using sw at the start of the stack slot, meaning that when the callee
loads them and truncates them to 32 bits it only sees the padding value, which
is undefined (whatever is left on the stack previously.

-- 
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/20141013/8c06d135/attachment.html>


More information about the llvm-bugs mailing list