[llvm-bugs] [Bug 39046] New: SimplifyCFG.cpp fails to build lookup tables in many cases

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Sep 21 23:34:03 PDT 2018


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

            Bug ID: 39046
           Summary: SimplifyCFG.cpp fails to build lookup tables in many
                    cases
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: slandden at gmail.com
                CC: llvm-bugs at lists.llvm.org

https://godbolt.org/z/QuklOn

#include <stdio.h>
int switchexample(unsigned char num) {
   switch(num) {
   case 0:
        return 120;
   case 1:
        return 119;
   case 3:
        return 118;
   case 4:
        return 118;
   case 11:
        return 117;
   case 12:
        return 116;
   case 13:
        return 115;
   case 14:
        return 114;
   case 15:
        return 113;
   case 16:
        return 112;
   case 17:
        return 111;
   case 18:
        return 110;
   case 19:
        return 109;
   case 37: //change this to 36 and it will use a lookup table
        return 108;
   case 35:
        return 108;
   default:
        puts("hi");
        return 1;
   }
}

Noticed while working on 39013

-- 
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/20180922/85a03c4c/attachment.html>


More information about the llvm-bugs mailing list