Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Alexander_Naumov:SLE-12:Update
cross-hppa-gcc48-icecream-backend
gcc48-backport-pr86952-jump-tables.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File gcc48-backport-pr86952-jump-tables.patch of Package cross-hppa-gcc48-icecream-backend
From c3aaec679c56a079c7faf66500db039c358516cc Mon Sep 17 00:00:00 2001 From: marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4> Date: Fri, 8 Mar 2019 12:55:40 +0000 Subject: [PATCH] Backport r269492 gcc/ChangeLog: 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. gcc/testsuite/ChangeLog: 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. --- gcc/config/i386/i386.c | 6 +++++ .../gcc.target/i386/indirect-thunk-7.c | 2 +- .../gcc.target/i386/indirect-thunk-extern-7.c | 2 +- .../gcc.target/i386/indirect-thunk-inline-7.c | 2 +- gcc/testsuite/gcc.target/i386/pr86952.c | 23 +++++++++++++++++++ 5 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 gcc/testsuite/gcc.target/i386/pr86952.c diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index ed1f81fd7b0..afa7feb670d 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -3856,6 +3856,12 @@ ix86_option_override_internal (bool main_args_p) if (main_args_p) target_option_default_node = target_option_current_node = build_target_option_node (); + + /* PR86952: jump table usage with retpolines is slow. + The PR provides some numbers about the slowness. */ + if (ix86_indirect_branch != indirect_branch_keep + && !global_options_set.x_flag_jump_tables) + flag_jump_tables = 0; } /* Implement the TARGET_OPTION_OVERRIDE hook. */ diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-7.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-7.c index 17c2d0faf88..cc5b831114d 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-7.c +++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-7.c @@ -1,5 +1,5 @@ /* { 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); diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-7.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-7.c index aece9383697..47a36c9bdb6 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-7.c +++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-7.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-extern -fno-pic" } */ +/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-extern -fno-pic -fjump-tables" } */ void func0 (void); void func1 (void); diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-7.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-7.c index c67066cf197..61eac23fd31 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-7.c +++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-7.c @@ -1,5 +1,5 @@ /* { 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); diff --git a/gcc/testsuite/gcc.target/i386/pr86952.c b/gcc/testsuite/gcc.target/i386/pr86952.c new file mode 100644 index 00000000000..004e167add0 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr86952.c @@ -0,0 +1,23 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -mindirect-branch=thunk" } */ + +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-assembler-not "jmp\[ \t\]\\*" } } */ -- 2.21.0
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor