[Bug target/86952] Avoid jump table for switch statement with -mindirect-branch=thunk
hjl.tools at gmail dot com
gcc-bugzilla@gcc.gnu.org
Fri Nov 23 15:17:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86952
H.J. Lu <hjl.tools at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2018-11-23
Ever confirmed|0 |1
--- Comment #7 from H.J. Lu <hjl.tools at gmail dot com> ---
Please try retpoline-table branch at
https://github.com/hjl-tools/microbenchmark
I got
[hjl@gnu-cfl-1 microbenchmark]$ make
gcc -g -I. -O2 -mindirect-branch=thunk -c -o test.o test.c
gcc -g -I. -O2 -mindirect-branch=thunk -fno-jump-tables -c -o
switch-no-table.o switch-no-table.c
gcc -g -I. -O2 -mindirect-branch=thunk -c -o switch.o switch.c
gcc -o test test.o switch-no-table.o switch.o
./test
no jump table: 189484
jump table : 333016
[hjl@gnu-cfl-1 microbenchmark]$
More information about the Gcc-bugs
mailing list