[LLVMbugs] [Bug 4850] New: The execution of code generated for MIPS is failure

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Tue Sep 1 04:35:57 PDT 2009


           Summary: The execution of code generated for MIPS is failure
           Product: new-bugs
           Version: 2.6
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: miyo at wasamon.net
                CC: llvmbugs at cs.uiuc.edu

Created an attachment (id=3410)
 --> (http://llvm.org/bugs/attachment.cgi?id=3410)
tried source code, generated code by llvm, and the dump of execution

I compiled the program (swap0.c) included the attached archive
by using clang-cc and native gcc for MIPS32.
which is a simple program to swap arguments
But the execution was failure.

The process of compilation is the following:
 clang-cc swap0.c
 llvm-as swap0.ll
 llc -march=mips swap0.bc
 gcc -g swap0.s

I checked a dump result of execution on MIPS (dump.txt).
In the result, it seems that callee take the arguments by register
although caller passed the arguments by stack.

At the instruction at line 20 in caller,
                sw      $4, 0($sp)
callee stores one of the passed arguments into 0($sp)
under assuming that the values was passed by $4.
But, caller does not set the value to $4.
So, when the program load a value from0($sp),
the execution is failure.

It is succeeded executing of codes for x86 and Cell SPU
generated by same process.

Do I have to set some options for a compilation of MIPS program ?
Or, did I have mistakes in my compilation process?

Target processor is MIPS and Linux is running on it.

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