summaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2019-03-08 13:55:40 +0100
committerMartin Liska <marxin@gcc.gnu.org>2019-03-08 12:55:40 +0000
commitf62d3527db908646a518b1c1412210a3ae645d73 (patch)
tree16e103fca2fc710abd5a1175fc1eb25d30a96576 /gcc/config
parent37555926fe70c828675b5d3e165cb291b283a978 (diff)
downloadgcc-f62d3527db908646a518b1c1412210a3ae645d73.tar.gz
x86: Disable jump tables when retpolines are used (PR target/86952).
2019-03-08 Martin Liska <mliska@suse.cz> PR target/86952 * config/i386/i386.c (ix86_option_override_internal): Disable jump tables when retpolines are used. 2019-03-08 Martin Liska <mliska@suse.cz> PR target/86952 * gcc.target/i386/pr86952.c: New test. * gcc.target/i386/indirect-thunk-7.c: Use jump tables to match scanned pattern. * gcc.target/i386/indirect-thunk-inline-7.c: Likewise. From-SVN: r269492
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/i386/i386.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 2d6a993238b..319caeda7b5 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -4894,6 +4894,12 @@ ix86_option_override_internal (bool main_args_p,
opts->x_param_values,
opts_set->x_param_values);
+ /* PR86952: jump table usage with retpolines is slow.
+ The PR provides some numbers about the slowness. */
+ if (ix86_indirect_branch != indirect_branch_keep
+ && !opts_set->x_flag_jump_tables)
+ opts->x_flag_jump_tables = 0;
+
return true;
}