[llvm-bugs] [Bug 50029] 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!"

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Apr 19 11:56:24 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=50029

            Bug ID: 50029
           Summary: 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!"
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: loris.reiff at liblor.ch
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org

Created attachment 24769
  --> https://bugs.llvm.org/attachment.cgi?id=24769&action=edit
assertion-casting.ll

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


https://godbolt.org/z/xaEcfooTE


```
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 https://bugs.llvm.org/ 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
```

-- 
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/20210419/3e928bb2/attachment.html>


More information about the llvm-bugs mailing list