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: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to