[LLVMbugs] [Bug 6279] New: insertvalue instruction / " Instruction not interpretable yet!" / lli crash

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Thu Feb 11 13:40:45 PST 2010


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

           Summary: insertvalue instruction / "Instruction not interpretable
                    yet!" / lli crash
           Product: tools
           Version: trunk
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: normal
          Priority: P2
         Component: lli
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: mattp223 at renzelmann.com
                CC: llvmbugs at cs.uiuc.edu


System:
- x86-64
- GCC 4.2.4
- LLVM-GCC / LLVM both built via SVN, updated today

===========================================
Low Level Virtual Machine (http://llvm.org/):
  llvm version 2.7svn
  Optimized build with assertions.
  Built Feb 11 2010 (14:28:44).
  Host: x86_64-unknown-linux-gnu
  Host CPU: penryn

  Registered Targets:
    x86    - 32-bit X86: Pentium-Pro and above
    x86-64 - 64-bit X86: EM64T and AMD64

===========================================
// Example source code.  Call this main.c.

struct st {
    unsigned long buf;
    int len;
};

struct st test (void);

int main (int a, char **v) {
    test ();
}

struct st test (void) {
    struct st ret;
    ret.buf = 0;
    ret.len = 0;
    return ret;
}
===========================================
Compile it via:
llvm-gcc -c -emit-llvm main.c -o main.o
===========================================
Execute it like this:
lli -force-interpreter main.o
===========================================
The result:

  %mrv4 = insertvalue %0 undef, i64 %mrv, 0       ; <%0> [#uses=1]Instruction
not interpretable yet!
UNREACHABLE executed at Interpreter.h:178!
0  lli             0x0000000000c54ddf
1  lli             0x0000000000c55650
2  libpthread.so.0 0x00002b1f369918e0
3  libc.so.6       0x00002b1f375885cb gsignal + 59
4  libc.so.6       0x00002b1f37589a90 abort + 272
5  lli             0x0000000000c36252 llvm::llvm_unreachable_internal(char
const*, char const*, unsigned int) + 370
6  lli             0x00000000008da2f0 llvm::InstVisitor<llvm::Interpreter,
void>::visit(llvm::Instruction&) + 112
7  lli             0x00000000008d85e2 llvm::Interpreter::run() + 66
8  lli             0x00000000008c7e45
llvm::Interpreter::runFunction(llvm::Function*, std::vector<llvm::GenericValue,
std::allocator<llvm::GenericValue> > const&) + 261
9  lli             0x00000000008fb9b1
llvm::ExecutionEngine::runFunctionAsMain(llvm::Function*,
std::vector<std::string, std::allocator<std::string> > const&, char const*
const*) + 1153
10 lli             0x0000000000507ef6 main + 1942
11 libc.so.6       0x00002b1f375759d4 __libc_start_main + 244
12 lli             0x0000000000506249
Stack dump:
0.      Program arguments: lli -force-interpreter main.o 
Aborted

===========================================
Here is the disassembly of the end of the test function for reference:
return:                                           ; preds = %entry
  %retval1 = bitcast %struct.st* %retval to %0*   ; <%0*> [#uses=2]
  %mrv_gep = getelementptr %0* %retval1, i32 0, i32 0 ; <i64*> [#uses=1]
  %mrv = load i64* %mrv_gep                       ; <i64> [#uses=1]
  %mrv_gep2 = getelementptr %0* %retval1, i32 0, i32 1 ; <i64*> [#uses=1]
  %mrv3 = load i64* %mrv_gep2                     ; <i64> [#uses=1]
  %mrv4 = insertvalue %0 undef, i64 %mrv, 0       ; <%0> [#uses=1]
  %mrv5 = insertvalue %0 %mrv4, i64 %mrv3, 1      ; <%0> [#uses=1]
  ret %0 %mrv5
===========================================
For comparison, executing the following command on the same LLVM bitcode does
not result in a crash:

lli main.o

The JIT compiler appears to be unaffected.
===========================================

The root issue seems to be the irritating problems associated with returning
structures by value.  Please let me know if I can provide any additional
information.

Thanks and regards,
Matt


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