[LLVMbugs] [Bug 10906] New: llc generating 16-bit code when reading bitcode files

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Sep 11 07:00:56 PDT 2011


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

           Summary: llc generating 16-bit code when reading bitcode files
           Product: tools
           Version: 2.9
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P
         Component: llc
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: roger83 at hotmail.co.uk
                CC: llvmbugs at cs.uiuc.edu


Using the test code from the demo page in file test.c:

--------------------
test.c
--------------------
#include <stdio.h>
#include <stdlib.h>

int factorial(int X) {
  if (X == 0) return 1;
  return X*factorial(X-1);
}

int main(int argc, char **argv) {
  printf("%d\n", factorial(atoi(argv[1])));
}

-------------------


This works fine:
> clang test.c -otest.exe
> test.exe 4
24

However, generating bytecode and then running llc on the result:
> clang test.c -otest.bc -emit-llvm -S
> llc test.bc -otest.exe
> test.exe
This causes the following error message as a pop-up window
Window Title: "16 bit MS-DOS Subsystem"
Text: "The NTVDM CUP has encountered an illegal instruction 
       CS:0fa3 IP:010a OP63 74 6f 72 69 
       Choose close to terminate the application"

Same thing happens when using clang -emit-llvm -c 
lli works fine however.

So I guess (with my limited knowledge in this area) that llc is not reading the
target information in the same way as lli, and generating 16 bit code.

I'm using the llvm and clang binaries for mingw32/x86 from the version 2.9 d/l
page.
Host: i386-pc-mingw32
Host CPU: athlon-mp

Hope this is useful.
Cheers

-- 
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