1 |
commit: b6c8ba65d3aeccf17fc8010370c22baf908da339 |
2 |
Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Jun 1 08:07:17 2019 +0000 |
4 |
Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Jun 1 08:07:17 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=b6c8ba65 |
7 |
|
8 |
7.4.0: backport PGO fix |
9 |
|
10 |
Bug: https://bugs.gentoo.org/677724 |
11 |
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org> |
12 |
|
13 |
7.4.0/gentoo/23_all-pgo.patch | 59 +++++++++++++++++++++++++++++++++++++++++++ |
14 |
7.4.0/gentoo/README.history | 3 +++ |
15 |
2 files changed, 62 insertions(+) |
16 |
|
17 |
diff --git a/7.4.0/gentoo/23_all-pgo.patch b/7.4.0/gentoo/23_all-pgo.patch |
18 |
new file mode 100644 |
19 |
index 0000000..b11c72f |
20 |
--- /dev/null |
21 |
+++ b/7.4.0/gentoo/23_all-pgo.patch |
22 |
@@ -0,0 +1,59 @@ |
23 |
+https://bugs.gentoo.org/677724 |
24 |
+ |
25 |
+From 332446ac24e5b37f441f7c9cb0b97fc36f9f0aa3 Mon Sep 17 00:00:00 2001 |
26 |
+From: hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> |
27 |
+Date: Sat, 15 Dec 2018 10:31:37 +0000 |
28 |
+Subject: [PATCH] * ipa.c (cgraph_build_static_cdtor_1): Add |
29 |
+ OPTIMIZATION and TARGET parameters. (cgraph_build_static_cdtor): |
30 |
+ Update. (build_cdtor): Use OPTIMIZATION and TARGET of the first real |
31 |
+ cdtor callsed. |
32 |
+ |
33 |
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@267168 138bc75d-0d04-0410-961f-82ee72b054a4 |
34 |
+--- |
35 |
+ gcc/ipa.c | 12 +++++++++--- |
36 |
+ |
37 |
+--- a/gcc/ipa.c |
38 |
++++ b/gcc/ipa.c |
39 |
+@@ -831,7 +831,9 @@ ipa_discover_variable_flags (void) |
40 |
+ be produced. */ |
41 |
+ |
42 |
+ static void |
43 |
+-cgraph_build_static_cdtor_1 (char which, tree body, int priority, bool final) |
44 |
++cgraph_build_static_cdtor_1 (char which, tree body, int priority, bool final, |
45 |
++ tree optimization, |
46 |
++ tree target) |
47 |
+ { |
48 |
+ static int counter = 0; |
49 |
+ char which_buf[16]; |
50 |
+@@ -862,6 +864,8 @@ cgraph_build_static_cdtor_1 (char which, tree body, int priority, bool final) |
51 |
+ |
52 |
+ TREE_STATIC (decl) = 1; |
53 |
+ TREE_USED (decl) = 1; |
54 |
++ DECL_FUNCTION_SPECIFIC_OPTIMIZATION (decl) = optimization; |
55 |
++ DECL_FUNCTION_SPECIFIC_TARGET (decl) = target; |
56 |
+ DECL_ARTIFICIAL (decl) = 1; |
57 |
+ DECL_IGNORED_P (decl) = 1; |
58 |
+ DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT (decl) = 1; |
59 |
+@@ -911,7 +915,7 @@ cgraph_build_static_cdtor_1 (char which, tree body, int priority, bool final) |
60 |
+ void |
61 |
+ cgraph_build_static_cdtor (char which, tree body, int priority) |
62 |
+ { |
63 |
+- cgraph_build_static_cdtor_1 (which, body, priority, false); |
64 |
++ cgraph_build_static_cdtor_1 (which, body, priority, false, NULL, NULL); |
65 |
+ } |
66 |
+ |
67 |
+ /* When target does not have ctors and dtors, we call all constructor |
68 |
+@@ -993,7 +997,9 @@ build_cdtor (bool ctor_p, const vec<tree> &cdtors) |
69 |
+ gcc_assert (body != NULL_TREE); |
70 |
+ /* Generate a function to call all the function of like |
71 |
+ priority. */ |
72 |
+- cgraph_build_static_cdtor_1 (ctor_p ? 'I' : 'D', body, priority, true); |
73 |
++ cgraph_build_static_cdtor_1 (ctor_p ? 'I' : 'D', body, priority, true, |
74 |
++ DECL_FUNCTION_SPECIFIC_OPTIMIZATION (cdtors[0]), |
75 |
++ DECL_FUNCTION_SPECIFIC_TARGET (cdtors[0])); |
76 |
+ } |
77 |
+ } |
78 |
+ |
79 |
+-- |
80 |
+2.20.1 |
81 |
+ |
82 |
|
83 |
diff --git a/7.4.0/gentoo/README.history b/7.4.0/gentoo/README.history |
84 |
index 54c6d3d..05000ee 100644 |
85 |
--- a/7.4.0/gentoo/README.history |
86 |
+++ b/7.4.0/gentoo/README.history |
87 |
@@ -1,3 +1,6 @@ |
88 |
+1.3 1 Jun 2019 |
89 |
+ + 23_all-pgo.patch |
90 |
+ |
91 |
1.2 2 Feb 2019 |
92 |
U 01_all_default-fortify-source.patch |
93 |
+ 21_all_kr-decl-PR88214.patch |