[LLVMbugs] [Bug 10279] New: lli barfs with "pseudo instructions should be removed before code emission"

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Jul 5 03:35:17 PDT 2011


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

           Summary: lli barfs with "pseudo instructions should be removed
                    before code emission"
           Product: new-bugs
           Version: 2.9
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: srk31 at srcf.ucam.org
                CC: llvmbugs at cs.uiuc.edu


I'm getting the following strange error from lli.

$ lli
out/host/linux-x86/pr/sim/obj/EXECUTABLES/dalvikvm_intermediates/LINKED/dalvikvm.bc.bc
pseudo instructions should be removed before code emission
UNREACHABLE executed at X86CodeEmitter.cpp:720!
0  lli             0x0000000000e3b2ff
1  lli             0x0000000000e3bd63
2  libpthread.so.0 0x0000003b7f60f4a0
3  libc.so.6       0x0000003b7ea328f5 gsignal + 53
4  libc.so.6       0x0000003b7ea340d5 abort + 373
5  lli             0x0000000000e1e3ac
6  lli             0x000000000067f482
7  lli             0x00000000006809a5
8  lli             0x0000000000dadec7
llvm::FPPassManager::runOnFunction(llvm::Function&) + 567
9  lli             0x0000000000dadffb
llvm::FunctionPassManagerImpl::run(llvm::Function&) + 139
10 lli             0x0000000000dae169
llvm::FunctionPassManager::run(llvm::Function&) + 105
11 lli             0x00000000008f09be
llvm::JIT::jitTheFunction(llvm::Function*, llvm::MutexGuard const&) + 46
12 lli             0x00000000008f35ec
llvm::JIT::runJITOnFunctionUnlocked(llvm::Function*, llvm::MutexGuard const&) +
28
13 lli             0x00000000008f3870
llvm::JIT::getPointerToFunction(llvm::Function*) + 272
14 lli             0x00000000008f1fa4 llvm::JIT::runFunction(llvm::Function*,
std::__debug::vector<llvm::GenericValue, std::allocator<llvm::GenericValue> >
const&) + 52
15 lli             0x0000000000c7b42d
llvm::ExecutionEngine::runFunctionAsMain(llvm::Function*,
std::__debug::vector<std::string, std::allocator<std::string> > const&, char
const* const*) + 1757
16 lli             0x0000000000617dfc main + 1612
17 libc.so.6       0x0000003b7ea1ec5d __libc_start_main + 253
18 lli             0x000000000061f1ad
Stack dump:
0.      Program arguments: lli
out/host/linux-x86/pr/sim/obj/EXECUTABLES/dalvikvm_intermediates/LINKED/dalvikvm.bc.bc 
1.      Running pass 'X86 Machine Code Emitter' on function '@main'
Aborted (core dumped)

This is with a Release+Debug+Asserts+Checks build of the 2.9 release, on a FC13
x86-64 machine. 

You can probably reproduce with the following bitcode file:
<http://www.cs.ox.ac.uk/people/stephen.kell/private/llvm-bug-20110705/dalvikvm.bc.bc>.
(I was expecting it to need external bitcode libraries that I built alongside
it, but it gets at least as far as the bug without them. Maybe they're already
linked in -- I don't yet understand bitcode linkage enough to say.)

To investigate further, I hacked X86CodeEmitter.cpp as follows:

--- lib/Target/X86/X86CodeEmitter.cpp   2010-10-09 00:59:27.000000000 +0100
+++ lib/Target/X86/X86CodeEmitter-hacked.cpp    2011-07-04 16:10:44.000000000
+0100
@@ -715,6 +715,7 @@
     // base address.
     switch (Opcode) {
     default: 
+       dbgs() << MI;
       llvm_unreachable("pseudo instructions should be removed before code"
                        " emission");
       break;

which prints

DBG_VALUE 0, 0, !"needExtra"; dbg:Main.c:149

and the relevant bit of Main.c looks like this:

148    int optionCount, curOpt, i, argIdx;
149    int needExtra = JNI_FALSE;
150    int result = 1;


... i.e. nothing out of the ordinary. The disassembly looks normal too,
although I wouldn't really know.

Here's a (carefully snipped) log showing how make built the bitcode file:
<http://www.cs.ox.ac.uk/people/stephen.kell/private/llvm-bug-20110705/make-n-edited.log>

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