[LLVMbugs] [Bug 7344] New: Clang assertion failure when casting void* to unsigned long
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Thu Jun 10 02:07:31 PDT 2010
http://llvm.org/bugs/show_bug.cgi?id=7344
Summary: Clang assertion failure when casting void* to unsigned
long
Product: clang
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P
Component: C++
AssignedTo: unassignedclangbugs at nondot.org
ReportedBy: u3950692 at anu.edu.au
CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com
I was trying to compile the DynInst project (dyninst.org) with clang. However,
it choked - I have reduced the offending file to the following code:
void serialize_annotatable_id( void*& id )
{
unsigned long l_id = (unsigned long&)id;
}
The error output from clang (downloaded from trunk and built in release mode
today, 10th of June 2010) is:
$ clang++ -v -o /dev/null ../src/serialize-bin-bug.C
clang version 2.0 (trunk 105783)
Target: i386-pc-linux-gnu
Thread model: posix
"/usr/local/bin/clang" -cc1 -triple i386-pc-linux-gnu -S -disable-free
-main-file-name serialize-bin-bug.C -mrelocation-model static -mdisable-fp-elim
-mconstructor-aliases -target-cpu pentium4 -v -resource-dir
/usr/local/lib/clang/2.0 -ferror-limit 19 -fmessage-length 172 -fexceptions
-fgnu-runtime -fdiagnostics-show-option -fcolor-diagnostics -o /tmp/cc-bUDkLI.s
-x c++ ../src/serialize-bin-bug.C
clang -cc1 version 2.0 based upon llvm 2.8svn hosted on i386-pc-linux-gnu
ignoring nonexistent directory "/usr/include/c++/4.4"
< skipped other nonexistent directory messages >
#include "..." search starts here:
#include <...> search starts here:
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/i686-pc-linux-gnu
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/backward
/usr/local/include
/usr/local/lib/clang/2.0/include
/usr/include
End of search list.
clang: Instructions.cpp:2649: llvm::BitCastInst::BitCastInst(llvm::Value*,
const llvm::Type*, const llvm::Twine&, llvm::Instruction*): Assertion
`castIsValid(getOpcode(), S, Ty) && "Illegal BitCast"' failed.
0 clang 0x08e9b068
Stack dump:
0. Program arguments: /usr/local/bin/clang -cc1 -triple i386-pc-linux-gnu
-S -disable-free -main-file-name serialize-bin-bug.C -mrelocation-model static
-mdisable-fp-elim -mconstructor-aliases -target-cpu pentium4 -v -resource-dir
/usr/local/lib/clang/2.0 -ferror-limit 19 -fmessage-length 172 -fexceptions
-fgnu-runtime -fdiagnostics-show-option -fcolor-diagnostics -o /tmp/cc-bUDkLI.s
-x c++ ../src/serialize-bin-bug.C
1. <eof> parser at end of file
2. ../src/serialize-bin-bug.C:1:6: LLVM IR generation of declaration
'serialize_annotatable_id'
3. ../src/serialize-bin-bug.C:1:6: Generating code for declaration
'serialize_annotatable_id'
4. ../src/serialize-bin-bug.C:2:1: LLVM IR generation of compound
statement ('{}')
clang: error: clang frontend command failed due to signal 6 (use -v to see
invocation)
Reproducable: Always
Expected Result: No assertion.
--
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