<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </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 --- - llc crashes with "LLVM ERROR: Invalid instruction" when -march=cpp is set"
   href="http://llvm.org/bugs/show_bug.cgi?id=17317">17317</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>llc crashes with "LLVM ERROR: Invalid instruction" when -march=cpp is set
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>tools
          </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>llc
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>ajost@synopsys.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=11258" name="attach_11258" title="Source code.">attachment 11258</a> <a href="attachment.cgi?id=11258&action=edit" title="Source code.">[details]</a></span>
Source code.

Using LLVM 3.3 built from the release repo.

I have a small toy project (250 LOC) with apparently several instances of this
bug.  I've introduced a macro at the top to highlight the variations.  

If BUGLEVEL is defined as 1, fewer than 50 LOC are active.  Clang can compile
the code to LLVM-IR, but llc fails if I specify -march=cpp.  llc succeeds
without that option (and the generated assembly appears to be correct).  lli
will accept the IR code and run the program correctly.

I found a workaround for the first bug, so at BUGLEVEL 2, some code is disabled
and more is activated.  There is apparently another instance of the same bug
somewhere else.

Finally, BUGLEVEL 3 activates the whole 250 LOC, which I hope would work if
this is fixed.

I compile with this command:

    clang -O1 -emit-llvm -c test.cpp -o test.bc -Wno-c++11-extensions
-std=c++11 -Wall

Playing with the optimization level appears to change things slightly, but I
can never eliminate the problem completely.</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>