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

           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: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]


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

Reply via email to