+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 Jan Hubicka <hubicka@ucw.cz>
PR go/63560
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;
}
+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.
+
2019-03-08 Jakub Jelinek <jakub@redhat.com>
PR c++/89585
/* { dg-do compile } */
-/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk -fno-pic" } */
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk -fno-pic -fjump-tables" } */
void func0 (void);
void func1 (void);
/* { dg-do compile } */
-/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-inline -fno-pic" } */
+/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-inline -fno-pic -fjump-tables" } */
void func0 (void);
void func1 (void);
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2 -mindirect-branch=thunk -fdump-tree-switchlower1" } */
+
+int global;
+
+int
+foo (int x)
+{
+ switch (x & 7)
+ {
+ case 0: ; return 1722;
+ case 1: global += 1; return 1060;
+ case 2: ; return 1990;
+ case 3: ; return 1242;
+ case 4: ; return 1466;
+ case 5: ; return 894;
+ case 6: ; return 570;
+ case 7: ; return 572;
+ default: return 0;
+ }
+}
+
+/* { dg-final { scan-tree-dump ";; GIMPLE switch case clusters: 1 2 3 4 5 6 7" "switchlower1" } } */