[LLVMbugs] [Bug 2940] New: Assertion fails in getLowBitsSet when optimizing
bugzilla-daemon at cs.uiuc.edu
bugzilla-daemon at cs.uiuc.edu
Thu Oct 23 13:32:42 PDT 2008
http://llvm.org/bugs/show_bug.cgi?id=2940
Summary: Assertion fails in getLowBitsSet when optimizing
Product: libraries
Version: trunk
Platform: Macintosh
OS/Version: MacOS X
Status: NEW
Severity: normal
Priority: P2
Component: Transformation Utilities
AssignedTo: unassignedbugs at nondot.org
ReportedBy: wesleypeck at gmail.com
CC: llvmbugs at cs.uiuc.edu
The LLVM bitcode optimizer fails with an assertion error inside of
getLowBitsSet. The problems seems to arise from the "ptrtoint" line and the ret
that follows. The program compiles and executes without problem when
optimization is not performed.
The original .ll file is as follows (this is the exact file contents):
define i8* @id(i8* %x) gc "ocaml"
{
entry:
ret i8* %x
}
define i32 @tstid() gc "ocaml"
{
entry:
%var0 = inttoptr i32 1 to i8*
%var1 = tail call i8* @id(i8* %var0)
%var2 = ptrtoint i8* %var1 to i32
ret i32 %var2
}
define i32 @main() gc "ocaml"
{
entry:
%var0 = tail call i32 @tstid()
ret i32 %var0
}
The commands used to compile and optimize the file were:
llvm-as tyvars.ll
opt -f -o=tyvars.bc.opt.bc -std-compile-opts tyvars.bc
The command "opt --version" returns:
Low Level Virtual Machine (http://llvm.org/):
llvm version 2.4svn
Optimized build with assertions.
The error message printed out follows:
===============================================================================
Assertion failed: (loBitsSet <= numBits && "Too many bits to set!"), function
getLowBitsSet, file
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_llvm-devel/work/llvm-53722/include/llvm/ADT/APInt.h,
line 416.
0 opt 0x003ae37c
_ZNSt8_Rb_treeIN4llvm3sys4PathES2_St9_IdentityIS2_ESt4lessIS2_ESaIS2_EE13insert_uniqueERKS2_
+ 7948
1 libSystem.B.dylib 0x92fc709b _sigtramp + 43
2 ??? 0xffffffff 0x0 + 4294967295
3 libSystem.B.dylib 0x9303fec2 raise + 26
4 libSystem.B.dylib 0x9304f47f abort + 73
5 libSystem.B.dylib 0x93041063 __assert_rtn + 101
6 opt 0x0022d3b4
_ZN4llvm15callDefaultCtorIN183_GLOBAL__N__opt_local_var_macports_build__opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_llvm_devel_work_llvm_53722_lib_Analysis_CFGPrinter.cpp_00000000_FBA5535913CFGOnlyViewerEEEPNS_4PassEv
+ 10948
7 opt 0x0022dba5
_ZN4llvm15callDefaultCtorIN183_GLOBAL__N__opt_local_var_macports_build__opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_llvm_devel_work_llvm_53722_lib_Analysis_CFGPrinter.cpp_00000000_FBA5535913CFGOnlyViewerEEEPNS_4PassEv
+ 12981
8 opt 0x000e71e2
_ZNSt8_Rb_treeIjSt4pairIKjPN4llvm5ValueEESt10_Select1stIS5_ESt4lessIjESaIS5_EE8_M_eraseEPSt13_Rb_tree_nodeIS5_E
+ 336226
9 opt 0x000f33ca
_ZNSt8_Rb_treeIjSt4pairIKjPN4llvm5ValueEESt10_Select1stIS5_ESt4lessIjESaIS5_EE8_M_eraseEPSt13_Rb_tree_nodeIS5_E
+ 385866
10 opt 0x000f4d5c
_ZNSt8_Rb_treeIjSt4pairIKjPN4llvm5ValueEESt10_Select1stIS5_ESt4lessIjESaIS5_EE8_M_eraseEPSt13_Rb_tree_nodeIS5_E
+ 392412
11 opt 0x0033bce6 _ZN4llvm12FunctionPassD1Ev +
25590
12 opt 0x0033c15a _ZN4llvm12FunctionPassD1Ev +
26730
13 opt 0x0033c781 _ZN4llvm12FunctionPassD1Ev +
28305
14 opt 0x0033cb94 _ZN4llvm12FunctionPassD1Ev +
29348
15 opt 0x0033cc0b _ZN4llvm12FunctionPassD1Ev +
29467
16 opt 0x00008b12
_ZN4llvm12scc_iteratorIPNS_8FunctionENS_11GraphTraitsIS2_EEED1Ev + 4514
17 opt 0x00001cd6 _mh_execute_header + 3286
/bin/sh: line 1: 6817 Abort trap opt -f -o=tyvars.bc.opt.bc
-std-compile-opts tyvars.bc
===============================================================================
--
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