1 |
commit: 7bd9679989239cba83bb0c632bd2f0909b03d1b8 |
2 |
Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Sep 12 23:20:12 2018 +0000 |
4 |
Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Sep 12 23:20:12 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=7bd96799 |
7 |
|
8 |
6/7/8 branches: add 101_all_x32-fix-eh-return-address.patch |
9 |
|
10 |
Pick upstream fix for x32 exception handler: """ |
11 |
x86: Always update EH return address in word_mode |
12 |
|
13 |
On x86, return address is always popped in word_mode. eh_return needs |
14 |
to put EH return address in word_mode on stack. |
15 |
""" |
16 |
|
17 |
Reported-by: camper |
18 |
Bug: https://bugs.gentoo.org/664016 |
19 |
Bug: https://gcc.gnu.org/PR87014 |
20 |
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org> |
21 |
|
22 |
.../gentoo/101_all_x32-fix-eh-return-address.patch | 37 ++++++++++++++++++++++ |
23 |
6.4.0/gentoo/README.history | 2 ++ |
24 |
.../gentoo/99_all_x32-fix-eh-return-address.patch | 37 ++++++++++++++++++++++ |
25 |
7.3.0/gentoo/README.history | 1 + |
26 |
.../gentoo/101_all_x32-fix-eh-return-address.patch | 37 ++++++++++++++++++++++ |
27 |
8.2.0/gentoo/README.history | 2 ++ |
28 |
6 files changed, 116 insertions(+) |
29 |
|
30 |
diff --git a/6.4.0/gentoo/101_all_x32-fix-eh-return-address.patch b/6.4.0/gentoo/101_all_x32-fix-eh-return-address.patch |
31 |
new file mode 100644 |
32 |
index 0000000..c74a087 |
33 |
--- /dev/null |
34 |
+++ b/6.4.0/gentoo/101_all_x32-fix-eh-return-address.patch |
35 |
@@ -0,0 +1,37 @@ |
36 |
+Bug: https://bugs.gentoo.org/664016 |
37 |
+ |
38 |
+From 2a8e2ab2e9e11b679616d80285296ac77ad0920f Mon Sep 17 00:00:00 2001 |
39 |
+From: hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4> |
40 |
+Date: Mon, 20 Aug 2018 19:14:04 +0000 |
41 |
+Subject: [PATCH] x86: Always update EH return address in word_mode |
42 |
+ |
43 |
+On x86, return address is always popped in word_mode. eh_return needs |
44 |
+to put EH return address in word_mode on stack. |
45 |
+ |
46 |
+gcc/ |
47 |
+ |
48 |
+ PR target/87014 |
49 |
+ * config/i386/i386.md (eh_return): Always update EH return |
50 |
+ address in word_mode. |
51 |
+ |
52 |
+gcc/testsuite/ |
53 |
+ |
54 |
+ PR target/87014 |
55 |
+ * g++.dg/torture/pr87014.C: New file. |
56 |
+ |
57 |
+ |
58 |
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263672 138bc75d-0d04-0410-961f-82ee72b054a4 |
59 |
+--- a/gcc/config/i386/i386.md |
60 |
++++ b/gcc/config/i386/i386.md |
61 |
+@@ -13612,7 +13612,10 @@ |
62 |
+ stack address we wish to restore. */ |
63 |
+ tmp = gen_rtx_PLUS (Pmode, arg_pointer_rtx, sa); |
64 |
+ tmp = plus_constant (Pmode, tmp, -UNITS_PER_WORD); |
65 |
+- tmp = gen_rtx_MEM (Pmode, tmp); |
66 |
++ /* Return address is always in word_mode. */ |
67 |
++ tmp = gen_rtx_MEM (word_mode, tmp); |
68 |
++ if (GET_MODE (ra) != word_mode) |
69 |
++ ra = convert_to_mode (word_mode, ra, 1); |
70 |
+ emit_move_insn (tmp, ra); |
71 |
+ |
72 |
+ emit_jump_insn (gen_eh_return_internal ()); |
73 |
|
74 |
diff --git a/6.4.0/gentoo/README.history b/6.4.0/gentoo/README.history |
75 |
index 2c676a4..2294b26 100644 |
76 |
--- a/6.4.0/gentoo/README.history |
77 |
+++ b/6.4.0/gentoo/README.history |
78 |
@@ -1,3 +1,5 @@ |
79 |
+1.7 TODO |
80 |
+ + 101_all_x32-fix-eh-return-address.patch |
81 |
1.6 18 Aug 2018 |
82 |
+ 100_all_isl-include.patch |
83 |
1.5 17 Aug 2018 |
84 |
|
85 |
diff --git a/7.3.0/gentoo/99_all_x32-fix-eh-return-address.patch b/7.3.0/gentoo/99_all_x32-fix-eh-return-address.patch |
86 |
new file mode 100644 |
87 |
index 0000000..c74a087 |
88 |
--- /dev/null |
89 |
+++ b/7.3.0/gentoo/99_all_x32-fix-eh-return-address.patch |
90 |
@@ -0,0 +1,37 @@ |
91 |
+Bug: https://bugs.gentoo.org/664016 |
92 |
+ |
93 |
+From 2a8e2ab2e9e11b679616d80285296ac77ad0920f Mon Sep 17 00:00:00 2001 |
94 |
+From: hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4> |
95 |
+Date: Mon, 20 Aug 2018 19:14:04 +0000 |
96 |
+Subject: [PATCH] x86: Always update EH return address in word_mode |
97 |
+ |
98 |
+On x86, return address is always popped in word_mode. eh_return needs |
99 |
+to put EH return address in word_mode on stack. |
100 |
+ |
101 |
+gcc/ |
102 |
+ |
103 |
+ PR target/87014 |
104 |
+ * config/i386/i386.md (eh_return): Always update EH return |
105 |
+ address in word_mode. |
106 |
+ |
107 |
+gcc/testsuite/ |
108 |
+ |
109 |
+ PR target/87014 |
110 |
+ * g++.dg/torture/pr87014.C: New file. |
111 |
+ |
112 |
+ |
113 |
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263672 138bc75d-0d04-0410-961f-82ee72b054a4 |
114 |
+--- a/gcc/config/i386/i386.md |
115 |
++++ b/gcc/config/i386/i386.md |
116 |
+@@ -13612,7 +13612,10 @@ |
117 |
+ stack address we wish to restore. */ |
118 |
+ tmp = gen_rtx_PLUS (Pmode, arg_pointer_rtx, sa); |
119 |
+ tmp = plus_constant (Pmode, tmp, -UNITS_PER_WORD); |
120 |
+- tmp = gen_rtx_MEM (Pmode, tmp); |
121 |
++ /* Return address is always in word_mode. */ |
122 |
++ tmp = gen_rtx_MEM (word_mode, tmp); |
123 |
++ if (GET_MODE (ra) != word_mode) |
124 |
++ ra = convert_to_mode (word_mode, ra, 1); |
125 |
+ emit_move_insn (tmp, ra); |
126 |
+ |
127 |
+ emit_jump_insn (gen_eh_return_internal ()); |
128 |
|
129 |
diff --git a/7.3.0/gentoo/README.history b/7.3.0/gentoo/README.history |
130 |
index 9eb4c76..7070e8f 100644 |
131 |
--- a/7.3.0/gentoo/README.history |
132 |
+++ b/7.3.0/gentoo/README.history |
133 |
@@ -1,5 +1,6 @@ |
134 |
1.6 TODO |
135 |
+ 98_all_msp430-partial-int.patch |
136 |
+ + 99_all_x32-fix-eh-return-address.patch |
137 |
1.6 18 Aug 2018 |
138 |
+ 97_all_isl-include.patch |
139 |
1.5 17 Aug 2018 |
140 |
|
141 |
diff --git a/8.2.0/gentoo/101_all_x32-fix-eh-return-address.patch b/8.2.0/gentoo/101_all_x32-fix-eh-return-address.patch |
142 |
new file mode 100644 |
143 |
index 0000000..c74a087 |
144 |
--- /dev/null |
145 |
+++ b/8.2.0/gentoo/101_all_x32-fix-eh-return-address.patch |
146 |
@@ -0,0 +1,37 @@ |
147 |
+Bug: https://bugs.gentoo.org/664016 |
148 |
+ |
149 |
+From 2a8e2ab2e9e11b679616d80285296ac77ad0920f Mon Sep 17 00:00:00 2001 |
150 |
+From: hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4> |
151 |
+Date: Mon, 20 Aug 2018 19:14:04 +0000 |
152 |
+Subject: [PATCH] x86: Always update EH return address in word_mode |
153 |
+ |
154 |
+On x86, return address is always popped in word_mode. eh_return needs |
155 |
+to put EH return address in word_mode on stack. |
156 |
+ |
157 |
+gcc/ |
158 |
+ |
159 |
+ PR target/87014 |
160 |
+ * config/i386/i386.md (eh_return): Always update EH return |
161 |
+ address in word_mode. |
162 |
+ |
163 |
+gcc/testsuite/ |
164 |
+ |
165 |
+ PR target/87014 |
166 |
+ * g++.dg/torture/pr87014.C: New file. |
167 |
+ |
168 |
+ |
169 |
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263672 138bc75d-0d04-0410-961f-82ee72b054a4 |
170 |
+--- a/gcc/config/i386/i386.md |
171 |
++++ b/gcc/config/i386/i386.md |
172 |
+@@ -13612,7 +13612,10 @@ |
173 |
+ stack address we wish to restore. */ |
174 |
+ tmp = gen_rtx_PLUS (Pmode, arg_pointer_rtx, sa); |
175 |
+ tmp = plus_constant (Pmode, tmp, -UNITS_PER_WORD); |
176 |
+- tmp = gen_rtx_MEM (Pmode, tmp); |
177 |
++ /* Return address is always in word_mode. */ |
178 |
++ tmp = gen_rtx_MEM (word_mode, tmp); |
179 |
++ if (GET_MODE (ra) != word_mode) |
180 |
++ ra = convert_to_mode (word_mode, ra, 1); |
181 |
+ emit_move_insn (tmp, ra); |
182 |
+ |
183 |
+ emit_jump_insn (gen_eh_return_internal ()); |
184 |
|
185 |
diff --git a/8.2.0/gentoo/README.history b/8.2.0/gentoo/README.history |
186 |
index 04f21ae..8daa563 100644 |
187 |
--- a/8.2.0/gentoo/README.history |
188 |
+++ b/8.2.0/gentoo/README.history |
189 |
@@ -1,3 +1,5 @@ |
190 |
+1.3 TODO |
191 |
+ + 101_all_x32-fix-eh-return-address.patch |
192 |
1.2 12 Aug 2018 |
193 |
- 100_all-isl-include.patch |
194 |
+ 100_all_isl-include.patch |