<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 --- - small code triggers assert with un-constant-foldable extractvalue"
   href="http://llvm.org/bugs/show_bug.cgi?id=15417">15417</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>small code triggers assert with un-constant-foldable extractvalue
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>3.2
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </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>Core LLVM classes
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>flld0@greynode.net
          </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>The following code is a (contrived) example of a use of a constant extractvalue
which cannot be constant folded. It triggers an assert in code which can only
handle cases it can fold. Under similar circumstances, other constant
expression cases fall back to building unfolded constants. Perhaps extractvalue
should do something similar. 

@0 = global i8 extractvalue ([1 x i8] select (i1 ptrtoint (i32* @1 to i1), [1 x
i8] [ i8 1 ], [1 x i8] [ i8 2 ]), 0)
@1 = external global i32

Assertion failed: (FC && "ExtractValue constant expr couldn't be folded!"),
function getExtractValue, file Constants.cpp, line 1926

This case is contrived. I concocted it (and other cases like it which work for
other constant expressions) deliberately not to constant fold. As such it might
be considered lower priority, depending on how you prioritize such things. On
the other hand less contrived examples may exist.</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>