https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86952
--- Comment #19 from Martin Liška <marxin at gcc dot gnu.org> --- Ok, I updated the benchmark and push it here: https://github.com/marxin/microbenchmark-1 And I see following on my Haswell machine: $ ./test.py normal retpoline retpo+no-JT retpo+JT=20 retpo+JT=40 cases: 8: 0.34 (100%) 1.80 (529%) 0.39 (114%) 0.39 (115%) 0.39 (115%) cases: 16: 0.33 (100%) 1.77 (541%) 0.51 (156%) 0.51 (157%) 0.51 (157%) cases: 32: 1.01 (100%) 1.82 (179%) 0.57 ( 56%) 1.82 (179%) 0.54 ( 54%) cases: 64: 0.78 (100%) 1.76 (225%) 0.58 ( 74%) 1.76 (225%) 1.75 (224%) cases: 128: 0.34 (100%) 1.94 (577%) 0.64 (191%) 1.93 (574%) 1.93 (573%) cases: 256: 0.34 (100%) 1.94 (579%) 0.76 (225%) 1.95 (581%) 1.94 (580%) cases: 1024: 1.21 (100%) 2.00 (166%) 0.97 ( 80%) 2.00 (165%) 2.00 (166%) cases: 2048: 1.48 (100%) 2.03 (137%) 2.06 (139%) 2.01 (136%) 2.00 (135%) cases: 4096: 1.67 (100%) 2.09 (125%) 3.78 (226%) 2.10 (126%) 2.20 (132%) From the number I see recommend to disable jump tables with -mindirect-branch=*. Thoughts?