[LLVMbugs] [Bug 19561] New: Assertion in Inst Combine: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Apr 25 10:43:00 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=19561

            Bug ID: 19561
           Summary: Assertion in Inst Combine: Assertion `isa<X>(Val) &&
                    "cast<Ty>() argument of incompatible type!"' failed
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: mcrosier at codeaurora.org
                CC: apazos at codeaurora.org, llvmbugs at cs.uiuc.edu,
                    mcrosier at codeaurora.org
    Classification: Unclassified

Given the following reduced test case:

$ more foo.i 

a;
fn1() {
  long double b;
  long double *c;
  c = 0;
  if (a)
    c = &b;
  0 ?: 0 ?: *c < 0;
}

I see the following assertion:
% clang-arm64-x -Os -std=c99 -pedantic -w -fmath-errno -c -std=iso9899:1999 -g
foo.i

clang-3.5: ../include/llvm/Support/Casting.h:223: typename std::enable_if<(!
llvm::is_simple_type<Y>::value), typename llvm::cast_retty<X, const
Y>::ret_type>::type llvm::cast(const Y&) [with X = llvm::PHINode; Y =
llvm::ilist_iterator<llvm::Instruction>; typename std::enable_if<(!
llvm::is_simple_type<Y>::value), typename llvm::cast_retty<X, const
Y>::ret_type>::type = llvm::PHINode*]: Assertion `isa<X>(Val) && "cast<Ty>()
argument of incompatible type!"' failed.
0  clang-3.5       0x0000000001685c49 llvm::sys::PrintStackTrace(_IO_FILE*) +
38
1  clang-3.5       0x0000000001685ec6
2  clang-3.5       0x0000000001685875
3  libpthread.so.0 0x00007eff0b9c48f0
4  libc.so.6       0x00007eff0aca2b25 gsignal + 53
5  libc.so.6       0x00007eff0aca6670 abort + 384
6  libc.so.6       0x00007eff0ac9b9f1 __assert_fail + 241
7  clang-3.5       0x0000000001481398
8  clang-3.5       0x000000000148099a
9  clang-3.5       0x00000000014297a9
10 clang-3.5       0x0000000001427dd1
11 clang-3.5       0x0000000001424ef3
12 clang-3.5       0x00000000014254ac
13 clang-3.5       0x000000000137752e
llvm::FPPassManager::runOnFunction(llvm::Function&) + 290
14 clang-3.5       0x000000000137769e
llvm::FPPassManager::runOnModule(llvm::Module&) + 84
15 clang-3.5       0x00000000013779f2
16 clang-3.5       0x000000000137809c
llvm::legacy::PassManagerImpl::run(llvm::Module&) + 244
17 clang-3.5       0x00000000013782a7
llvm::legacy::PassManager::run(llvm::Module&) + 39
18 clang-3.5       0x0000000001dc9523
19 clang-3.5       0x0000000001dc964b
clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions
const&, clang::TargetOptions const&, clang::LangOptions const&,
llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::raw_ostream*) + 127
20 clang-3.5       0x0000000001dc29de
21 clang-3.5       0x00000000026b65f2 clang::ParseAST(clang::Sema&, bool, bool)
+ 783
22 clang-3.5       0x0000000001840334 clang::ASTFrontendAction::ExecuteAction()
+ 322
23 clang-3.5       0x0000000001dc46a0 clang::CodeGenAction::ExecuteAction() +
1224
24 clang-3.5       0x000000000183fe69 clang::FrontendAction::Execute() + 139
25 clang-3.5       0x000000000181023c
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 720
26 clang-3.5       0x0000000001938540
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1077
27 clang-3.5       0x0000000000e243e1 cc1_main(char const**, char const**, char
const*, void*) + 641
28 clang-3.5       0x0000000000e1e183 main + 760
29 libc.so.6       0x00007eff0ac8dc4d __libc_start_main + 253
30 clang-3.5       0x0000000000e1b689
Stack dump:
0.      Program arguments: clang-3.5 -cc1 -triple arm64-none-linux-gnu
-emit-obj -disable-free -main-file-name foo.i -mrelocation-model static
-mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases
-fuse-init-array -target-cpu generic -target-feature +neon -target-abi aapcs
-target-cpu generic -g -coverage-file /home/mrosier/tmp/foo.o -resource-dir
/home/mrosier/llvm-community/install/bin/../lib/clang/3.5.0 -Os -pedantic -w
-std=iso9899:1999 -fdebug-compilation-dir /home/mrosier/tmp -ferror-limit 19
-fmessage-length 262 -mstackrealign -fno-signed-char -fobjc-runtime=gcc
-fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp
-o foo.o -x cpp-output foo.i 
1.      <eof> parser at end of file
2.      Per-module optimization passes
3.      Running pass 'Function Pass Manager' on module 'foo.i'.
4.      Running pass 'Combine redundant instructions' on function '@fn1'
clang-3.5: error: unable to execute command: Aborted
clang-3.5: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.5.0 
Target: arm64-none-linux-gnu
Thread model: posix
clang-3.5: note: diagnostic msg: PLEASE submit a bug report to
http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and
associated run script.
clang-3.5: note: diagnostic msg: Error generating preprocessed source(s) - no
preprocessable inputs.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140425/918cb586/attachment.html>


More information about the llvm-bugs mailing list