https://bugs.llvm.org/show_bug.cgi?id=43129
Bug ID: 43129
Summary: exhaustive switch with unreachable defaultdest should
get cleaned up
Product: libraries
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: Interprocedural Optimizations
Assignee: unassignedb...@nondot.org
Reporter: ndesaulni...@google.com
CC: llvm-bugs@lists.llvm.org, srhi...@google.com
Blocks: 4068
Created attachment 22437
--> https://bugs.llvm.org/attachment.cgi?id=22437&action=edit
x.c
Consider the following test case: https://godbolt.org/z/xLKkbK
There's a switch that LLVM deduces to be exhaustive. During SimplifyCFG, LLVM
transforms the default case to a label with an unreachable IR instruction.
This never gets removed, which gets lowered to jump to an empty basic block
(usually off the end of the function with no return). This isn't a bug per se,
but it leaves behind garbage in the object file which confuses the Linux
kernel's object file validator, objtool.
It seems this is only an issue when the case is exhaustive. Adding additional
cases will just get removed at some point by opt.
It seems like the comparison that would have been used for the default case can
at least be skipped.
Referenced Bugs:
https://bugs.llvm.org/show_bug.cgi?id=4068
[Bug 4068] [Meta] Compiling the Linux kernel with clang
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs