Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

Assertion `isa<X>(Val) && "cast_or_null<Ty>() argument of incompatible type!"' failed. #12578

Closed Quuxplusone closed 12 years ago

Quuxplusone commented 12 years ago
Bugzilla Link PR12472
Status RESOLVED DUPLICATE of bug 12470
Importance P enhancement
Reported by John Regehr (regehr@cs.utah.edu)
Reported on 2012-04-05 16:03:35 -0700
Last modified on 2012-04-05 20:05:46 -0700
Version trunk
Hardware PC Linux
CC chad.rosier@gmail.com, chandlerc@gmail.com, chenyang@cs.utah.edu, llvm-bugs@lists.llvm.org
Fixed by commit(s)
Attachments
Blocks
Blocked by
See also
[regehr@dyson r6]$ clang -O -c small.c
clang: /uusoc/exports/scratch/regehr/z/compiler-build/llvm-
r154095/include/llvm/Support/Casting.h:205: typename llvm::cast_retty<X,
Y*>::ret_type llvm::cast_or_null(Y*) [with X = llvm::BasicBlock, Y =
llvm::Value]: Assertion `isa<X>(Val) && "cast_or_null<Ty>() argument of
incompatible type!"' failed.
0  clang           0x0000000001e405cf
1  clang           0x0000000001e42552
2  libpthread.so.0 0x00007ffff7bcf8f0
3  libc.so.6       0x00007ffff6ebea75 gsignal + 53
4  libc.so.6       0x00007ffff6ec25c0 abort + 384
5  libc.so.6       0x00007ffff6eb7941 __assert_fail + 241
6  clang           0x0000000001b4a648 llvm::InlineFunction(llvm::CallSite,
llvm::InlineFunctionInfo&, bool) + 10808
7  clang           0x00000000012a825d
8  clang           0x00000000012a9b7f
llvm::Inliner::runOnSCC(llvm::CallGraphSCC&) + 3247
9  clang           0x0000000001b8fa0a
10 clang           0x0000000001ddc171
llvm::MPPassManager::runOnModule(llvm::Module&) + 497
11 clang           0x0000000001ddc2eb llvm::PassManagerImpl::run(llvm::Module&)
+ 171
12 clang           0x00000000007b69f1
clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions
const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::Module*,
clang::BackendAction, llvm::raw_ostream*) + 1457
13 clang           0x00000000007b4009
14 clang           0x0000000000913f71 clang::ParseAST(clang::Sema&, bool) + 465
15 clang           0x00000000007b2a14 clang::CodeGenAction::ExecuteAction() + 68
16 clang           0x000000000065ce51
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 321
17 clang           0x00000000006460b4
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1348
18 clang           0x000000000063bf80 cc1_main(char const**, char const**, char
const*, void*) + 944
19 clang           0x0000000000644eb9 main + 7241
20 libc.so.6       0x00007ffff6ea9c4d __libc_start_main + 253
21 clang           0x0000000000639a09
Stack dump:
0.  Program arguments: /uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-
r154095-install/bin/clang -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -
disable-free -main-file-name small.c -mrelocation-model static -masm-verbose -
mconstructor-aliases -munwind-tables -target-cpu x86-64 -momit-leaf-frame-
pointer -coverage-file small.o -resource-dir
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r154095-
install/bin/../lib/clang/3.1 -fmodule-cache-path /var/tmp/clang-module-cache -
internal-isystem /usr/local/include -internal-isystem
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r154095-
install/bin/../lib/clang/3.1/include -internal-externc-isystem /include -
internal-externc-isystem /usr/include -O2 -fdebug-compilation-dir
/home/regehr/z/reduce/r6 -ferror-limit 19 -fmessage-length 96 -mstackrealign -
fgnu-runtime -fobjc-runtime-has-arc -fobjc-runtime-has-weak -fobjc-fragile-abi -
fdiagnostics-show-option -fcolor-diagnostics -o small.o -x c small.c
1.  <eof> parser at end of file
2.  Per-module optimization passes
3.  Running pass 'CallGraph Pass Manager' on module 'small.c'.
clang: error: unable to execute command: Aborted
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang: note: diagnostic msg: Please submit a bug report to
http://llvm.org/bugs/ and include command line arguments and all diagnostic
information.
clang: note: diagnostic msg: Preprocessed source(s) and associated run
script(s) are located at:
clang: note: diagnostic msg: /tmp/small-J3iOR4.i
clang: note: diagnostic msg: /tmp/small-J3iOR4.sh

[regehr@dyson r6]$ cat small.c
int a;
short fn1 ();
void
fn2 () {
  fn1 (1);
}
short
fn1 (p1) {
  a = 0;
  for (; a != 1; a = 1)
    if (p1)
      for (;;) {
      }
  return 0;
}

[regehr@dyson r6]$ clang -v
clang version 3.1 (trunk 154095)
Target: x86_64-unknown-linux-gnu
Thread model: posix
Quuxplusone commented 12 years ago
Bisect points to:
http://llvm.org/viewvc/llvm-project?view=rev&revision=153572

Author: chandlerc
Date:   Wed Mar 28 03:38:27 2012 CDT (8 days, 12 hours ago)
Log Message:
Switch to WeakVHs in the value mapper, and aggressively prune dead basic
blocks in the function cloner. This removes the last case of trivially
dead code that I've been seeing in the wild getting inlined, analyzed,
re-inlined, optimized, only to be deleted. Nukes a FIXME from the
cleanup tests.
Quuxplusone commented 12 years ago

_This bug has been marked as a duplicate of bug 12470_