https://bugs.llvm.org/show_bug.cgi?id=52465

            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: [email protected]
          Reporter: [email protected]
                CC: [email protected]

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.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to