Gentoo Archives: gentoo-commits

From: Sergei Trofimovich <slyfox@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/gcc-patches:master commit in: 8.3.0/gentoo/
Date: Thu, 04 Apr 2019 07:03:23
Message-Id: 1554361223.8f536c47fddf4a9fe15b969b888f4dbd22c1f82a.slyfox@gentoo
1 commit: 8f536c47fddf4a9fe15b969b888f4dbd22c1f82a
2 Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
3 AuthorDate: Thu Apr 4 07:00:23 2019 +0000
4 Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
5 CommitDate: Thu Apr 4 07:00:23 2019 +0000
6 URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=8f536c47
7
8 8.3.0: backport retpoline/jumptable optimization on i386
9
10 Reported-by: Thomas Deutschmann
11 Bug: https://gcc.gnu.org/PR86952
12 Bug: https://bugs.gentoo.org/682218
13 Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>
14
15 .../28_all_i386_retpoline-and-jumptable.patch | 64 ++++++++++++++++++++++
16 8.3.0/gentoo/README.history | 1 +
17 2 files changed, 65 insertions(+)
18
19 diff --git a/8.3.0/gentoo/28_all_i386_retpoline-and-jumptable.patch b/8.3.0/gentoo/28_all_i386_retpoline-and-jumptable.patch
20 new file mode 100644
21 index 0000000..64e9528
22 --- /dev/null
23 +++ b/8.3.0/gentoo/28_all_i386_retpoline-and-jumptable.patch
24 @@ -0,0 +1,64 @@
25 +https://gcc.gnu.org/PR86952
26 +https://bugs.gentoo.org/682218
27 +
28 +From 4fa11b10fc05a132b68b6df198706a97c3f4d61e Mon Sep 17 00:00:00 2001
29 +From: marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>
30 +Date: Mon, 11 Mar 2019 09:38:06 +0000
31 +Subject: [PATCH] Backport r269492
32 +
33 +2019-03-11 Martin Liska <mliska@××××.cz>
34 +
35 + Backport from mainline
36 + 2019-03-08 Martin Liska <mliska@××××.cz>
37 +
38 + PR target/86952
39 + * config/i386/i386.c (ix86_option_override_internal): Disable
40 + jump tables when retpolines are used.
41 +2019-03-11 Martin Liska <mliska@××××.cz>
42 +
43 + Backport from mainline
44 + 2019-03-08 Martin Liska <mliska@××××.cz>
45 +
46 + PR target/86952
47 + * gcc.target/i386/indirect-thunk-7.c: Use jump tables to match
48 + scanned pattern.
49 + * gcc.target/i386/indirect-thunk-inline-7.c: Likewise.
50 +
51 +
52 +git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-8-branch@269572 138bc75d-0d04-0410-961f-82ee72b054a4
53 +--- a/gcc/config/i386/i386.c
54 ++++ b/gcc/config/i386/i386.c
55 +@@ -4958,6 +4958,12 @@ ix86_option_override_internal (bool main_args_p,
56 + opts->x_param_values,
57 + opts_set->x_param_values);
58 +
59 ++ /* PR86952: jump table usage with retpolines is slow.
60 ++ The PR provides some numbers about the slowness. */
61 ++ if (ix86_indirect_branch != indirect_branch_keep
62 ++ && !opts_set->x_flag_jump_tables)
63 ++ opts->x_flag_jump_tables = 0;
64 ++
65 + return true;
66 + }
67 +
68 +--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-7.c
69 ++++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-7.c
70 +@@ -1,5 +1,5 @@
71 + /* { dg-do compile } */
72 +-/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk -fno-pic" } */
73 ++/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk -fno-pic -fjump-tables" } */
74 +
75 + void func0 (void);
76 + void func1 (void);
77 +--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-7.c
78 ++++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-7.c
79 +@@ -1,5 +1,5 @@
80 + /* { dg-do compile } */
81 +-/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-inline -fno-pic" } */
82 ++/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-inline -fno-pic -fjump-tables" } */
83 +
84 + void func0 (void);
85 + void func1 (void);
86 +--
87 +2.21.0
88 +
89
90 diff --git a/8.3.0/gentoo/README.history b/8.3.0/gentoo/README.history
91 index 1a755db..2e14fb3 100644
92 --- a/8.3.0/gentoo/README.history
93 +++ b/8.3.0/gentoo/README.history
94 @@ -1,6 +1,7 @@
95 1.1 TODO
96 + 26_all_overridable_native.patch
97 + 27_all_flto-make-all.patch
98 + + 28_all_i386_retpoline-and-jumptable.patch
99
100 1.0 22 Feb 2019
101 + 01_all_default-fortify-source.patch