<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 - Casting.h:269: typename llvm::cast_retty<X, Y*>::ret_type llvm::cast(Y*) [with X = llvm::PHINode; Y = llvm::Instruction; typename llvm::cast_retty<X, Y*>::ret_type = llvm::PHINode*]: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!""
   href="https://bugs.llvm.org/show_bug.cgi?id=50029">50029</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Casting.h:269: typename llvm::cast_retty<X, Y*>::ret_type llvm::cast(Y*) [with X = llvm::PHINode; Y = llvm::Instruction; typename llvm::cast_retty<X, Y*>::ret_type = llvm::PHINode*]: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </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>enhancement
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>loris.reiff@liblor.ch
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=24769" name="attach_24769" title="assertion-casting.ll">attachment 24769</a> <a href="attachment.cgi?id=24769&action=edit" title="assertion-casting.ll">[details]</a></span>
assertion-casting.ll

How to reproduce: `opt -O2 assertion-casting.ll -o /dev/null`


<a href="https://godbolt.org/z/xaEcfooTE">https://godbolt.org/z/xaEcfooTE</a>


```
opt: /root/llvm-project/llvm/include/llvm/Support/Casting.h:269: typename
llvm::cast_retty<X, Y*>::ret_type llvm::cast(Y*) [with X = llvm::PHINode; Y =
llvm::Instruction; typename llvm::cast_retty<X, Y*>::ret_type =
llvm::PHINode*]: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible
type!"' failed.
PLEASE submit a bug report to <a href="https://bugs.llvm.org/">https://bugs.llvm.org/</a> and include the crash
backtrace.
Stack dump:
0.      Program arguments:
/opt/compiler-explorer/clang-assertions-trunk/bin/opt -o /app/output.s -S -O2
<source>
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH
or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
/opt/compiler-explorer/clang-assertions-trunk/bin/opt(_ZN4llvm3sys15PrintStackTraceERNS_11raw_ostreamEi+0x2c)[0x56362cee4b4c]
/opt/compiler-explorer/clang-assertions-trunk/bin/opt(_ZN4llvm3sys17RunSignalHandlersEv+0x34)[0x56362cee2a04]
/opt/compiler-explorer/clang-assertions-trunk/bin/opt(+0x2f56b73)[0x56362cee2b73]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x153c0)[0x7fd2d522d3c0]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0xcb)[0x7fd2d4cfd18b]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x12b)[0x7fd2d4cdc859]
/lib/x86_64-linux-gnu/libc.so.6(+0x25729)[0x7fd2d4cdc729]
/lib/x86_64-linux-gnu/libc.so.6(+0x36f36)[0x7fd2d4cedf36]
/opt/compiler-explorer/clang-assertions-trunk/bin/opt(+0x2877c29)[0x56362c803c29]
/opt/compiler-explorer/clang-assertions-trunk/bin/opt(+0x9ad1e7)[0x56362a9391e7]
/opt/compiler-explorer/clang-assertions-trunk/bin/opt(+0x2878e8c)[0x56362c804e8c]
/opt/compiler-explorer/clang-assertions-trunk/bin/opt(+0x287aa4b)[0x56362c806a4b]
/opt/compiler-explorer/clang-assertions-trunk/bin/opt(_ZN4llvm13GlobalOptPass3runERNS_6ModuleERNS_15AnalysisManagerIS1_JEEE+0xe5)[0x56362c8087d5]
/opt/compiler-explorer/clang-assertions-trunk/bin/opt(+0x31df7d1)[0x56362d16b7d1]
/opt/compiler-explorer/clang-assertions-trunk/bin/opt(_ZN4llvm11PassManagerINS_6ModuleENS_15AnalysisManagerIS1_JEEEJEE3runERS1_RS3_+0x4d3)[0x56362c6d2763]
/opt/compiler-explorer/clang-assertions-trunk/bin/opt(_ZN4llvm15runPassPipelineENS_9StringRefERNS_6ModuleEPNS_13TargetMachineEPNS_21TargetLibraryInfoImplEPNS_14ToolOutputFileES8_S8_S0_NS_8ArrayRefIS0_EENS_8opt_tool10OutputKindENSB_12VerifierKindEbbbbbb+0x23c4)[0x56362aa70df4]
/opt/compiler-explorer/clang-assertions-trunk/bin/opt(main+0x2614)[0x56362a98c314]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3)[0x7fd2d4cde0b3]
/opt/compiler-explorer/clang-assertions-trunk/bin/opt(_start+0x2a)[0x56362aa651ea]
Compiler returned: 139
```</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>