<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Assertion in Inst Combine: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed"
   href="http://llvm.org/bugs/show_bug.cgi?id=19561">19561</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Assertion in Inst Combine: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Scalar Optimizations
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>mcrosier@codeaurora.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>apazos@codeaurora.org, llvmbugs@cs.uiuc.edu, mcrosier@codeaurora.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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
<a href="http://llvm.org/bugs/">http://llvm.org/bugs/</a> 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.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>