[LLVMbugs] [Bug 3168] New: Assertion failure when using ocaml GC
bugzilla-daemon at cs.uiuc.edu
bugzilla-daemon at cs.uiuc.edu
Thu Dec 4 21:26:40 PST 2008
http://llvm.org/bugs/show_bug.cgi?id=3168
Summary: Assertion failure when using ocaml GC
Product: libraries
Version: trunk
Platform: PC
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: Common Code Generator Code
AssignedTo: unassignedbugs at nondot.org
ReportedBy: wesleypeck at gmail.com
CC: llvmbugs at cs.uiuc.edu
The LLVM code shown below causes an assertion failure:
declare ccc void @oread_runtime_casenotcovered()
declare void @llvm.gcroot(i8**,i8*)
define i32* @append() gc "ocaml"
{
entry:
switch i32 0, label %L2 [i32 0, label %L1]
L1:
%var8 = alloca i8*
call void @llvm.gcroot(i8** %var8,i8* null)
br label %L3
L2:
call ccc void @oread_runtime_casenotcovered()
unreachable
L3:
ret i32* null
}
Playing around with the code a bit, I have found that the assertion can be
eliminated by doing any of the following:
1) Using the shadow-stack GC instead of the ocaml GC
2) Using opt between llvm-as and llc
3) Moving the alloca instruction to right below the entry label
The assertion produced is the following:
Assertion failed: (isa<X>(Val) && "cast<Ty>() argument of incompatible type!"),
function cast, file
/Users/peckw/Projects/llvm/llvm/include/llvm/Support/Casting.h, line 199.
0 llc 0x00953d9c
_ZNSt8_Rb_treeIN4llvm3sys4PathES2_St9_IdentityIS2_ESt4lessIS2_ESaIS2_EE13insert_uniqueERKS2_
+ 7948
1 libSystem.B.dylib 0x926da09b _sigtramp + 43
2 ??? 0xffffffff 0x0 + 4294967295
3 libSystem.B.dylib 0x92752ec2 raise + 26
4 libSystem.B.dylib 0x9276247f abort + 73
5 libSystem.B.dylib 0x92754063 __assert_rtn + 101
6 llc 0x005f2c36
_ZN4llvm15CvtRndSatSDNodeD1Ev + 90918
7 llc 0x005f30f6
_ZN4llvm15CvtRndSatSDNodeD1Ev + 92134
8 llc 0x00620263
_ZN4llvm15CvtRndSatSDNodeD1Ev + 276819
9 llc 0x0062e0ac
_ZN4llvm4castINS_18DbgRegionStartInstENS_8CallInstEEENS_10cast_rettyIT_T0_E8ret_typeERKS5_
+ 29212
10 llc 0x0062f3a4
_ZN4llvm4castINS_18DbgRegionStartInstENS_8CallInstEEENS_10cast_rettyIT_T0_E8ret_typeERKS5_
+ 34068
11 llc 0x00630f43
_ZN4llvm4castINS_18DbgRegionStartInstENS_8CallInstEEENS_10cast_rettyIT_T0_E8ret_typeERKS5_
+ 41139
12 llc 0x008cf49f _ZN4llvm12FunctionPassD1Ev +
33983
13 llc 0x008cfa38 _ZN4llvm12FunctionPassD1Ev +
35416
14 llc 0x008cfbe6 _ZN4llvm12FunctionPassD1Ev +
35846
15 llc 0x000030a7 _mh_execute_header + 8359
16 llc 0x00001d36 _mh_execute_header + 3382
--
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