<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 - globalopt results in assertion (Instructions.h:942)"
   href="https://bugs.llvm.org/show_bug.cgi?id=50027">50027</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>globalopt results in assertion (Instructions.h:942)
          </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=24768" name="attach_24768" title="crash-globalopt.ll">attachment 24768</a> <a href="attachment.cgi?id=24768&action=edit" title="crash-globalopt.ll">[details]</a></span>
crash-globalopt.ll

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

[1] <a href="https://godbolt.org/z/s5oar34Yn">https://godbolt.org/z/s5oar34Yn</a>


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 <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
--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
```</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>