<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 - LowerSwich pass asserts on 128-bit switch case value"
   href="https://bugs.llvm.org/show_bug.cgi?id=52465">52465</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>LowerSwich pass asserts on 128-bit switch case value
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>13.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>normal
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>Transformation Utilities
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>axel.cohen@eshard.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=25434" name="attach_25434" title="Assert backtrace">attachment 25434</a> <a href="attachment.cgi?id=25434&action=edit" title="Assert backtrace">[details]</a></span>
Assert backtrace

When a switch case with a 128-bit value is present in the IR, the LowerSwitch
pass triggers the following assert (backtrace attached):

int64_t llvm::APInt::getSExtValue() const: Assertion `getMinSignedBits() <= 64
&& "Too many bits for int64_t"' failed.

This behavior was observed applying the pass on IR generated by the Rust
compiler, but to simplify reproduction, i've attached a simple C code (and its
IR code) which reproduce the issue as well.

The bitcode is generated with:
clang -O0 -Xclang -disable-O0-optnone -emit-llvm -c switch.c -o switch.bc

The LowerSwitch pass is applied with:
opt -lowerswitch switch.bc -o out.bc</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>