[LLVMbugs] [Bug 3858] New: interpreter doesn't suppose first-class aggregates

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Sat Mar 21 11:26:52 PDT 2009


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

           Summary: interpreter doesn't suppose first-class aggregates
           Product: libraries
           Version: trunk
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Interpreter
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: nicholas at mxc.ca
                CC: llvmbugs at cs.uiuc.edu


The interpreter can't handle first class aggregates, such as in this example:

  @foo = global [5 x i8] c"12345"
  define i32 @main() {
    store [5 x i8] c"abcde", [5 x i8]* @foo
    ret i32 0
  }

The crash is caused when trying to convert the aggregate into a GenericValue.
Here's the full stack trace:

$ gdb llvm-commit/Debug/bin/lli
(gdb) run --force-interpreter test.bc 
ERROR: Constant unimplemented for type: [5 x i8]
[New Thread 0xf7c116d0 (LWP 30996)]

Program received signal SIGABRT, Aborted.
[Switching to Thread 0xf7c116d0 (LWP 30996)]
0xffffe425 in __kernel_vsyscall ()
(gdb) bt
#0  0xffffe425 in __kernel_vsyscall ()
#1  0xf7c3e640 in *__GI_raise (sig=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#2  0xf7c40008 in *__GI_abort () at abort.c:88
#3  0x083f4e1d in llvm::ExecutionEngine::getConstantValue (this=0x8b82d18, 
    C=0x8b820bc) at ExecutionEngine.cpp:702
#4  0x083e3844 in llvm::Interpreter::getOperandValue (this=0x8b82d18, 
    V=0x8b820bc, SF=@0x8b83310) at Execution.cpp:1294
#5  0x083e52c8 in llvm::Interpreter::visitStoreInst (this=0x8b82d18, 
    I=@0x8b82528) at Execution.cpp:842
#6  0x083efa0a in llvm::InstVisitor<llvm::Interpreter, void>::visitStore (
    this=0x8b82d18, I=@0x8b82528)
    at /home/nicholas/llvm-commit/include/llvm/Instruction.def:132
#7  0x083f01d2 in llvm::InstVisitor<llvm::Interpreter, void>::visit (
    this=0x8b82d18, I=@0x8b82528)
    at /home/nicholas/llvm-commit/include/llvm/Instruction.def:132
#8  0x083e88a3 in llvm::Interpreter::run (this=0x8b82d18) at Execution.cpp:1357
#9  0x083ea2a3 in llvm::Interpreter::runFunction (this=0x8b82d18, F=0x8b81620, 
    ArgValues=@0xff8056a0) at Interpreter.cpp:100
#10 0x083f5e1f in llvm::ExecutionEngine::runFunctionAsMain (this=0x8b82d18, 
    Fn=0x8b81620, argv=@0x8b7b684, envp=0xff8058a4) at ExecutionEngine.cpp:376
#11 0x08048f08 in main (argc=3, argv=0xff805894, envp=0xff8058a4)
    at lli.cpp:179
(gdb) up 5
#5  0x083e52c8 in llvm::Interpreter::visitStoreInst (this=0x8b82d18, 
    I=@0x8b82528) at Execution.cpp:842
842       GenericValue Val = getOperandValue(I.getOperand(0), SF);
(gdb) p I.getOperand(0)->dump()
[5 x i8] c"abcde"
$1 = void
(gdb)


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