[llvm-bugs] [Bug 50027] New: globalopt results in assertion (Instructions.h:942)

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Apr 19 09:09:58 PDT 2021


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

            Bug ID: 50027
           Summary: globalopt results in assertion (Instructions.h:942)
           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 24768
  --> https://bugs.llvm.org/attachment.cgi?id=24768&action=edit
crash-globalopt.ll

The attached snippet [1] results in an assertion fail (or crash if assertions
are disabled).

[1] https://godbolt.org/z/s5oar34Yn


How to reproduce locally: opt -globalopt crash-globalopt.ll -o /dev/null

Log:
```
opt: /root/llvm-project/llvm/include/llvm/IR/Instructions.h:942: static
llvm::GetElementPtrInst* llvm::GetElementPtrInst::Create(llvm::Type*,
llvm::Value*, llvm::ArrayRef<llvm::Value*>, const llvm::Twine&,
llvm::Instruction*): Assertion `PointeeType ==
cast<PointerType>(Ptr->getType()->getScalarType())->getElementType()' 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
--globalopt <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)[0x55a8c978db4c]
/opt/compiler-explorer/clang-assertions-trunk/bin/opt(_ZN4llvm3sys17RunSignalHandlersEv+0x34)[0x55a8c978ba04]
/opt/compiler-explorer/clang-assertions-trunk/bin/opt(+0x2f56b73)[0x55a8c978bb73]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x153c0)[0x7f86b9a1d3c0]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0xcb)[0x7f86b94ed18b]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x12b)[0x7f86b94cc859]
/lib/x86_64-linux-gnu/libc.so.6(+0x25729)[0x7f86b94cc729]
/lib/x86_64-linux-gnu/libc.so.6(+0x36f36)[0x7f86b94ddf36]
/opt/compiler-explorer/clang-assertions-trunk/bin/opt(+0x10b61e9)[0x55a8c78eb1e9]
/opt/compiler-explorer/clang-assertions-trunk/bin/opt(+0x28779a4)[0x55a8c90ac9a4]
/opt/compiler-explorer/clang-assertions-trunk/bin/opt(+0x9ad1e7)[0x55a8c71e21e7]
/opt/compiler-explorer/clang-assertions-trunk/bin/opt(+0x2878e8c)[0x55a8c90ade8c]
/opt/compiler-explorer/clang-assertions-trunk/bin/opt(+0x287aa4b)[0x55a8c90afa4b]
/opt/compiler-explorer/clang-assertions-trunk/bin/opt(_ZN4llvm13GlobalOptPass3runERNS_6ModuleERNS_15AnalysisManagerIS1_JEEE+0xe5)[0x55a8c90b17d5]
/opt/compiler-explorer/clang-assertions-trunk/bin/opt(+0x31df7d1)[0x55a8c9a147d1]
/opt/compiler-explorer/clang-assertions-trunk/bin/opt(_ZN4llvm11PassManagerINS_6ModuleENS_15AnalysisManagerIS1_JEEEJEE3runERS1_RS3_+0x4d3)[0x55a8c8f7b763]
/opt/compiler-explorer/clang-assertions-trunk/bin/opt(_ZN4llvm15runPassPipelineENS_9StringRefERNS_6ModuleEPNS_13TargetMachineEPNS_21TargetLibraryInfoImplEPNS_14ToolOutputFileES8_S8_S0_NS_8ArrayRefIS0_EENS_8opt_tool10OutputKindENSB_12VerifierKindEbbbbbb+0x23c4)[0x55a8c7319df4]
/opt/compiler-explorer/clang-assertions-trunk/bin/opt(main+0x2614)[0x55a8c7235314]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3)[0x7f86b94ce0b3]
/opt/compiler-explorer/clang-assertions-trunk/bin/opt(_start+0x2a)[0x55a8c730e1ea]
Compiler returned: 139

Compiler Explorer uses cookies and other related techs to serve you
```

-- 
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/0decf583/attachment.html>


More information about the llvm-bugs mailing list