<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 - Segfault in SelectionDAG::LegalizeTypes when compiling optimized IR."
   href="https://bugs.llvm.org/show_bug.cgi?id=45049">45049</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Segfault in SelectionDAG::LegalizeTypes when compiling optimized IR.
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </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>normal
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>Common Code Generator Code
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>rspringer@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=23181" name="attach_23181" title="Stack dump for the failure.">attachment 23181</a> <a href="attachment.cgi?id=23181&action=edit" title="Stack dump for the failure.">[details]</a></span>
Stack dump for the failure.

Apologies that I don't have a smaller reproducer; I've tried for ~a day to
reduce it without success.

Steps to reproduce:
1. Build (a recent?) llvm
2: Run:
  llc sample.unopt.ll
  -- The program compiles successfully.
3. Next run:
  llc sample.opt.ll

A segfault similar to that attached will be generated.

Regarding the IR: I added a lame main() to force llc/lli/etc. to accept the IR;
the crash still happens if compiling the IR as a library function.

Sorry I don't have more investigation results to report - I just didn't manage
to get too far yet (chasing down a lot of red herrings).

The offending IR will be attached immediately.</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>