[llvm-bugs] [Bug 52465] New: LowerSwich pass asserts on 128-bit switch case value

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Nov 10 01:21:27 PST 2021


            Bug ID: 52465
           Summary: LowerSwich pass asserts on 128-bit switch case value
           Product: libraries
           Version: 13.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Transformation Utilities
          Assignee: unassignedbugs at nondot.org
          Reporter: axel.cohen at eshard.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 25434
  --> https://bugs.llvm.org/attachment.cgi?id=25434&action=edit
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

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20211110/bd8e2d42/attachment.html>

More information about the llvm-bugs mailing list