Skip to content

llc generating 16-bit code when reading bitcode files #11278

@llvmbot

Description

@llvmbot
Bugzilla Link 10906
Resolution INVALID
Resolved on Sep 11, 2011 09:51
Version 2.9
OS Windows XP
Reporter LLVM Bugzilla Contributor
CC @asl

Extended Description

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillainvalidResolved as invalid, i.e. not a bugtools:llc

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions