[LLVMbugs] [Bug 1629] New: lli with -force-interpreter will cause assertion when having static class object in function
bugzilla-daemon at cs.uiuc.edu
bugzilla-daemon at cs.uiuc.edu
Thu Aug 30 01:47:37 PDT 2007
http://llvm.org/bugs/show_bug.cgi?id=1629
Summary: lli with -force-interpreter will cause assertion when
having static class object in function
Product: libraries
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: Interpreter
AssignedTo: unassignedbugs at nondot.org
ReportedBy: zhousheng00 at gmail.com
CC: zhousheng00 at gmail.com, llvmbugs at cs.uiuc.edu
The following piece of code causes lli to crash when -force-interpreter is
set.For Jit, it's okay.
class X {
unsigned v;
public:
X(int val) : v(val) {}
};
int main() {
static X a(0);
return 0;
}
Assertion info:
lli: /developer/home2/zsth/projects/commit/llvm/lib/Support/APInt.cpp:101:
llvm::APInt::APInt(const llvm::APInt&): Assertion `BitWidth <=
IntegerType::MAX_INT_BITS && "bitwidth too large"' failed.
The .ll file :
; ModuleID = '<stdin>'
target datalayout =
"e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
target triple = "i686-pc-linux-gnu"
%struct.X = type { i32 }
@_ZGVZ4mainE1a = internal global i64 0, align 8 ; <i64*> [#uses=3]
define i32 @main() {
entry:
%tmp2 = load i8* bitcast (i64* @_ZGVZ4mainE1a to i8*), align 8
; <i8> [#uses=1]
%tmp3 = icmp eq i8 %tmp2, 0 ; <i1> [#uses=1]
br i1 %tmp3, label %cond_true, label %UnifiedReturnBlock
cond_true: ; preds = %entry
%tmp5 = tail call i32 @__cxa_guard_acquire( i64* @_ZGVZ4mainE1a )
; <i32> [#uses=1]
%tmp6 = icmp eq i32 %tmp5, 0 ; <i1> [#uses=1]
br i1 %tmp6, label %UnifiedReturnBlock, label %cond_true10
cond_true10: ; preds = %cond_true
tail call void @__cxa_guard_release( i64* @_ZGVZ4mainE1a )
ret i32 0
UnifiedReturnBlock: ; preds = %cond_true, %entry
ret i32 0
}
declare i32 @__cxa_guard_acquire(i64*)
declare void @__cxa_guard_release(i64*)
--
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