<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 - Assert dependent on how LLVM library is called"
   href="https://bugs.llvm.org/show_bug.cgi?id=45836">45836</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Assert dependent on how LLVM library is called
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>10.0
          </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>Backend: X86
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>david.jones@metrics.ca
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>craig.topper@gmail.com, llvm-bugs@lists.llvm.org, llvm-dev@redking.me.uk, spatel+llvm@rotateright.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=23459" name="attach_23459" title="Original, working, generator code">attachment 23459</a> <a href="attachment.cgi?id=23459&action=edit" title="Original, working, generator code">[details]</a></span>
Original, working, generator code

I recently upgraded a codebase from LLVM 7.0.1 to LLVM 10.0.0.

While tracking down an LLVM assert in the RISCV backend, I replaced the code I
used to generate object code with code cribbed almost verbatim from
<a href="https://llvm.org/docs/tutorial/MyFirstLanguageFrontend/LangImpl08.html">https://llvm.org/docs/tutorial/MyFirstLanguageFrontend/LangImpl08.html</a>.  My
previous code evolved from llc sources all the way back from the 3.3 days.

Unfortunately, my simplified code now yields an assert in the X86 backend!

ds_cg:
/scratch/user/djones/llvm10/llvm-10.0.0.src/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:898:
bool llvm::SelectionDAG::RemoveNodeFromCSEMaps(llvm::SDNode*): Assertion
`N->getOpcode() != ISD::DELETED_NODE && "DELETED_NODE in CSEMap!"' failed.

Manually invoking opt and llc on the IR code works fine.

Attachments:

wrap.orig: my original object generation code.  Works fine.

wrap.simple: code that yields this bug.

LMsbox.sir.ll: LLVM IR that causes my problem.</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>