[LLVMbugs] [Bug 22903] New: fastcc calling convention not workink on i386 32 bits

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Mar 14 01:43:13 PDT 2015


https://llvm.org/bugs/show_bug.cgi?id=22903

            Bug ID: 22903
           Summary: fastcc calling convention not workink on i386 32 bits
           Product: new-bugs
           Version: 3.6
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: raffalli at univ-savoie.fr
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

The following very simple file demonstrate the bug:

----------------------------------------------
define fastcc i32 @f(i32 %x) {
   %add = add i32 %x, 1
   ret i32 %add
}

define i32 @main(i32 %argc, i8** %argv) {
   %r = call i32 @f(i32 0)
   ret i32 %r
}
----------------------------------------------

on 64 bits machine:

$ llc bug.ll
$ as -c -o bug.o bug.s
$ gcc -o bug.exe bug.o
$ ./bug.exe 
$ echo $?
yields 1 as expected

forcing 32bits arch (no error, no warning)

$ llc -march=x86 bug.ll
$ as -march=i486 -32 -c -o bug.o bug.s
$ gcc -march=i486 -m32 -o bug.exe bug.o
$ ./bug.exe 
$ echo $?
yields more or less random values

-- 
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/20150314/36639799/attachment.html>


More information about the llvm-bugs mailing list