1 |
commit: bb00f570a7d3f1d0e4233f8d353fb9c56f3a55cc |
2 |
Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Sep 10 21:37:36 2020 +0000 |
4 |
Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Sep 10 21:37:36 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=bb00f570 |
7 |
|
8 |
10.2.0: fix TOPN counters when logged from shared library |
9 |
|
10 |
The change does not yet fix underlying problem of recursive inliner. |
11 |
|
12 |
Bug: https://gcc.gnu.org/PR96913 |
13 |
Bug: https://gcc.gnu.org/PR96394 |
14 |
Bug: https://bugs.gentoo.org/734006 |
15 |
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org> |
16 |
|
17 |
10.2.0/gentoo/38_all_gcov-TOPN-PR96913.patch | 42 ++++++++++++++++++++++++++++ |
18 |
10.2.0/gentoo/README.history | 1 + |
19 |
2 files changed, 43 insertions(+) |
20 |
|
21 |
diff --git a/10.2.0/gentoo/38_all_gcov-TOPN-PR96913.patch b/10.2.0/gentoo/38_all_gcov-TOPN-PR96913.patch |
22 |
new file mode 100644 |
23 |
index 0000000..5c301e4 |
24 |
--- /dev/null |
25 |
+++ b/10.2.0/gentoo/38_all_gcov-TOPN-PR96913.patch |
26 |
@@ -0,0 +1,42 @@ |
27 |
+https://gcc.gnu.org/PR96913 |
28 |
+https://gcc.gnu.org/PR96394 |
29 |
+https://bugs.gentoo.org/734006 |
30 |
+ |
31 |
+From ae887148e112e018bec0bab5bc15e53f2225037a Mon Sep 17 00:00:00 2001 |
32 |
+From: Sergei Trofimovich <siarheit@××××××.com> |
33 |
+Date: Sun, 6 Sep 2020 12:13:54 +0100 |
34 |
+Subject: [PATCH] gcov: fix TOPN streaming from shared libraries |
35 |
+ |
36 |
+Before the change gcc did not stream correctly TOPN counters |
37 |
+if counters belonged to a non-local shared object. |
38 |
+ |
39 |
+As a result zero-section optimization generated TOPN sections |
40 |
+in a form not recognizable by '__gcov_merge_topn'. |
41 |
+ |
42 |
+The problem happens because in a case of multiple shared objects |
43 |
+'__gcov_merge_topn' function is present in address space multiple |
44 |
+times (once per each object). |
45 |
+ |
46 |
+The fix is to never rely on function address and predicate on TOPN |
47 |
+counter types. |
48 |
+ |
49 |
+libgcc/ChangeLog: |
50 |
+ |
51 |
+ PR gcov-profile/96913 |
52 |
+ * libgcov-driver.c (write_one_data): Avoid function pointer |
53 |
+ comparison in TOP streaming decision. |
54 |
+--- |
55 |
+ libgcc/libgcov-driver.c | 7 ++++++- |
56 |
+ 1 file changed, 6 insertions(+), 1 deletion(-) |
57 |
+ |
58 |
+--- a/libgcc/libgcov-driver.c |
59 |
++++ b/libgcc/libgcov-driver.c |
60 |
+@@ -242,7 +242,7 @@ prune_counters (struct gcov_info *gi) |
61 |
+ if (gi->merge[j] == NULL) |
62 |
+ continue; |
63 |
+ |
64 |
+- if (gi->merge[j] == __gcov_merge_topn) |
65 |
++ if (j == GCOV_COUNTER_V_TOPN || j == GCOV_COUNTER_V_INDIR) |
66 |
+ { |
67 |
+ gcc_assert (!(ci->num % GCOV_TOPN_VALUES_COUNTERS)); |
68 |
+ for (unsigned k = 0; k < (ci->num / GCOV_TOPN_VALUES_COUNTERS); |
69 |
|
70 |
diff --git a/10.2.0/gentoo/README.history b/10.2.0/gentoo/README.history |
71 |
index 3fbcbfd..6d00c5a 100644 |
72 |
--- a/10.2.0/gentoo/README.history |
73 |
+++ b/10.2.0/gentoo/README.history |
74 |
@@ -1,6 +1,7 @@ |
75 |
3 TODO |
76 |
U 28_all_EXTRA_OPTIONS-fstack-clash-protection.patch |
77 |
+ 37_all_c-vector-init-PR96377.patch |
78 |
+ + 38_all_gcov-TOPN-PR96913.patch |
79 |
|
80 |
2 23 Aug 2020 |
81 |
+ 33_all_lto-O0-mix-ICE-ipa-PR96291.patch |