https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86952
Bug ID: 86952 Summary: Avoid jump table for switch statement with -mindirect-branch=thunk Product: gcc Version: 9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: hjl.tools at gmail dot com CC: wei3.xiao at intel dot com Blocks: 84072 Target Milestone: --- Target: i386,x86-64 Why is GCC generating a jump table for a five-entry switch statement if retpolines are on? This has got to be a *huge* performance loss. The retpoline sequence is very, very slow, and branches aren't that slow. A five-entry switch is only three branches deep. Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84072 [Bug 84072] [meta-bug] -mindirect-branch=thunk issues