1 |
dirtyepic 12/09/29 05:01:09 |
2 |
|
3 |
Added: 03_all_java-nomulti.patch |
4 |
10_all_default-fortify-source.patch |
5 |
11_all_default-warn-format-security.patch |
6 |
12_all_default-warn-trampolines.patch |
7 |
15_all_libgfortran-Werror.patch |
8 |
15_all_libgomp-Werror.patch |
9 |
16_all_libgo-Werror-pr53679.patch |
10 |
25_all_alpha-mieee-default.patch |
11 |
26_all_alpha-asm-mcpu.patch |
12 |
29_all_arm_armv4t-default.patch 33_all_armhf.patch |
13 |
34_all_ia64_note.GNU-stack.patch |
14 |
38_all_sh_pr24836_all-archs.patch |
15 |
42_all_superh_default-multilib.patch |
16 |
49_all_gcc-4.7-x86-libitm-pr52695.patch |
17 |
50_all_libiberty-asprintf.patch |
18 |
51_all_libiberty-pic.patch |
19 |
52_all_netbsd-Bsymbolic.patch |
20 |
67_all_gcc-poison-system-directories.patch |
21 |
74_all_gcc47_cloog-dl.patch |
22 |
90_all_gcc-4.7-x32.patch 92_all_freebsd-pie.patch |
23 |
README.history |
24 |
Log: |
25 |
Initial 4.7.2 patchset based off latest 4.7.1 patchset. |
26 |
|
27 |
Revision Changes Path |
28 |
1.1 src/patchsets/gcc/4.7.2/gentoo/03_all_java-nomulti.patch |
29 |
|
30 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.2/gentoo/03_all_java-nomulti.patch?rev=1.1&view=markup |
31 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.2/gentoo/03_all_java-nomulti.patch?rev=1.1&content-type=text/plain |
32 |
|
33 |
Index: 03_all_java-nomulti.patch |
34 |
=================================================================== |
35 |
--- a/libjava/configure |
36 |
+++ b/libjava/configure |
37 |
@@ -1618,6 +1618,8 @@ Optional Features: |
38 |
default=yes |
39 |
--enable-java-maintainer-mode |
40 |
allow rebuilding of .class and .h files |
41 |
+ --enable-libjava-multilib |
42 |
+ build libjava as multilib |
43 |
--disable-dependency-tracking speeds up one-time build |
44 |
--enable-dependency-tracking do not reject slow dependency extractors |
45 |
--enable-maintainer-mode enable make rules and dependencies not useful |
46 |
@@ -3361,6 +3363,16 @@ else |
47 |
fi |
48 |
|
49 |
|
50 |
+# Check whether --enable-libjava-multilib was given. |
51 |
+if test "${enable_libjava_multilib+set}" = set; then |
52 |
+ enableval=$enable_libjava_multilib; |
53 |
+fi |
54 |
+ |
55 |
+if test "$enable_libjava_multilib" = no; then |
56 |
+ multilib=no |
57 |
+ ac_configure_args="$ac_configure_args --disable-multilib" |
58 |
+fi |
59 |
+ |
60 |
# It may not be safe to run linking tests in AC_PROG_CC/AC_PROG_CXX. |
61 |
|
62 |
|
63 |
--- a/libjava/configure.ac |
64 |
+++ b/libjava/configure.ac |
65 |
@@ -139,6 +139,13 @@ AC_ARG_ENABLE(java-maintainer-mode, |
66 |
[allow rebuilding of .class and .h files])) |
67 |
AM_CONDITIONAL(JAVA_MAINTAINER_MODE, test "$enable_java_maintainer_mode" = yes) |
68 |
|
69 |
+AC_ARG_ENABLE(libjava-multilib, |
70 |
+ AS_HELP_STRING([--enable-libjava-multilib], [build libjava as multilib])) |
71 |
+if test "$enable_libjava_multilib" = no; then |
72 |
+ multilib=no |
73 |
+ ac_configure_args="$ac_configure_args --disable-multilib" |
74 |
+fi |
75 |
+ |
76 |
# It may not be safe to run linking tests in AC_PROG_CC/AC_PROG_CXX. |
77 |
GCC_NO_EXECUTABLES |
78 |
|
79 |
|
80 |
|
81 |
|
82 |
1.1 src/patchsets/gcc/4.7.2/gentoo/10_all_default-fortify-source.patch |
83 |
|
84 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.2/gentoo/10_all_default-fortify-source.patch?rev=1.1&view=markup |
85 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.2/gentoo/10_all_default-fortify-source.patch?rev=1.1&content-type=text/plain |
86 |
|
87 |
Index: 10_all_default-fortify-source.patch |
88 |
=================================================================== |
89 |
Enable -D_FORTIFY_SOURCE=2 by default |
90 |
|
91 |
--- a/gcc/doc/invoke.texi |
92 |
+++ b/gcc/doc/invoke.texi |
93 |
@@ -5973,6 +5973,11 @@ also turns on the following optimization flags: |
94 |
Please note the warning under @option{-fgcse} about |
95 |
invoking @option{-O2} on programs that use computed gotos. |
96 |
|
97 |
+NOTE: In Gentoo, @option{-D_FORTIFY_SOURCE=2} is set by default, and is |
98 |
+activated when @option{-O} is set to 2 or higher. This enables additional |
99 |
+compile-time and run-time checks for several libc functions. To disable, |
100 |
+specify either @option{-U_FORTIFY_SOURCE} or @option{-D_FORTIFY_SOURCE=0}. |
101 |
+ |
102 |
@item -O3 |
103 |
@opindex O3 |
104 |
Optimize yet more. @option{-O3} turns on all optimizations specified |
105 |
--- a/gcc/c-family/c-cppbuiltin.c |
106 |
+++ b/gcc/c-family/c-cppbuiltin.c |
107 |
@@ -731,6 +731,9 @@ c_cpp_builtins (cpp_reader *pfile) |
108 |
builtin_define_with_value ("__REGISTER_PREFIX__", REGISTER_PREFIX, 0); |
109 |
builtin_define_with_value ("__USER_LABEL_PREFIX__", user_label_prefix, 0); |
110 |
|
111 |
+ /* Fortify Source enabled by default w/optimization. */ |
112 |
+ cpp_define (pfile, "_FORTIFY_SOURCE=((defined __OPTIMIZE__ && __OPTIMIZE__ > 0) ? 2 : 0)"); |
113 |
+ |
114 |
/* Misc. */ |
115 |
if (flag_gnu89_inline) |
116 |
cpp_define (pfile, "__GNUC_GNU_INLINE__"); |
117 |
|
118 |
|
119 |
|
120 |
1.1 src/patchsets/gcc/4.7.2/gentoo/11_all_default-warn-format-security.patch |
121 |
|
122 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.2/gentoo/11_all_default-warn-format-security.patch?rev=1.1&view=markup |
123 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.2/gentoo/11_all_default-warn-format-security.patch?rev=1.1&content-type=text/plain |
124 |
|
125 |
Index: 11_all_default-warn-format-security.patch |
126 |
=================================================================== |
127 |
Enable -Wformat and -Wformat-security by default. |
128 |
|
129 |
|
130 |
--- a/gcc/c-family/c-common.c |
131 |
+++ b/gcc/c-family/c-common.c |
132 |
@@ -201,7 +201,7 @@ int warn_unknown_pragmas; /* Tri state variable. */ |
133 |
/* Warn about format/argument anomalies in calls to formatted I/O functions |
134 |
(*printf, *scanf, strftime, strfmon, etc.). */ |
135 |
|
136 |
-int warn_format; |
137 |
+int warn_format = 1; |
138 |
|
139 |
/* C/ObjC language option variables. */ |
140 |
|
141 |
--- a/gcc/c-family/c.opt |
142 |
+++ b/gcc/c-family/c.opt |
143 |
@@ -384,7 +384,7 @@ C ObjC C++ ObjC++ Var(warn_format_contains_nul) Warning |
144 |
Warn about format strings that contain NUL bytes |
145 |
|
146 |
Wformat-security |
147 |
-C ObjC C++ ObjC++ Var(warn_format_security) Warning |
148 |
+C ObjC C++ ObjC++ Var(warn_format_security) Init(1) Warning |
149 |
Warn about possible security problems with format functions |
150 |
|
151 |
Wformat-y2k |
152 |
--- a/gcc/doc/invoke.texi |
153 |
+++ b/gcc/doc/invoke.texi |
154 |
@@ -3111,6 +3111,9 @@ aspects of format checking, the options @option{-Wformat-y2k}, |
155 |
@option{-Wformat-nonliteral}, @option{-Wformat-security}, and |
156 |
@option{-Wformat=2} are available, but are not included in @option{-Wall}. |
157 |
|
158 |
+In Gentoo this option is enabled by default for C, C++, ObjC, ObjC++. |
159 |
+To disable, use @option{-Wformat=0}. |
160 |
+ |
161 |
@item -Wformat-y2k |
162 |
@opindex Wformat-y2k |
163 |
@opindex Wno-format-y2k |
164 |
@@ -3164,6 +3167,11 @@ currently a subset of what @option{-Wformat-nonliteral} warns about, but |
165 |
in future warnings may be added to @option{-Wformat-security} that are not |
166 |
included in @option{-Wformat-nonliteral}.) |
167 |
|
168 |
+In Gentoo this option is enabled by default for C, C++, ObjC, ObjC++. |
169 |
+To disable, use @option{-Wno-format-security}, or disable all format warnings |
170 |
+with @option{-Wformat=0}. To make format security warnings fatal, specify |
171 |
+@option{-Werror=format-security}. |
172 |
+ |
173 |
@item -Wformat=2 |
174 |
@opindex Wformat=2 |
175 |
@opindex Wno-format=2 |
176 |
|
177 |
|
178 |
|
179 |
1.1 src/patchsets/gcc/4.7.2/gentoo/12_all_default-warn-trampolines.patch |
180 |
|
181 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.2/gentoo/12_all_default-warn-trampolines.patch?rev=1.1&view=markup |
182 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.2/gentoo/12_all_default-warn-trampolines.patch?rev=1.1&content-type=text/plain |
183 |
|
184 |
Index: 12_all_default-warn-trampolines.patch |
185 |
=================================================================== |
186 |
Enable -Wtrampolines by default. |
187 |
|
188 |
--- a/gcc/common.opt |
189 |
+++ b/gcc/common.opt |
190 |
@@ -639,7 +639,7 @@ Common Var(warn_system_headers) Warning |
191 |
Do not suppress warnings from system headers |
192 |
|
193 |
Wtrampolines |
194 |
-Common Var(warn_trampolines) Warning |
195 |
+Common Var(warn_trampolines) Init(1) Warning |
196 |
Warn whenever a trampoline is generated |
197 |
|
198 |
Wtype-limits |
199 |
--- a/gcc/doc/invoke.texi |
200 |
+++ b/gcc/doc/invoke.texi |
201 |
@@ -3878,6 +3878,8 @@ headers---for that, @option{-Wunknown-pragmas} must also be used. |
202 |
for most targets, it is made up of code and thus requires the stack |
203 |
to be made executable in order for the program to work properly. |
204 |
|
205 |
+ This warning is enabled by default in Gentoo. |
206 |
+ |
207 |
@item -Wfloat-equal |
208 |
@opindex Wfloat-equal |
209 |
@opindex Wno-float-equal |
210 |
|
211 |
|
212 |
|
213 |
1.1 src/patchsets/gcc/4.7.2/gentoo/15_all_libgfortran-Werror.patch |
214 |
|
215 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.2/gentoo/15_all_libgfortran-Werror.patch?rev=1.1&view=markup |
216 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.2/gentoo/15_all_libgfortran-Werror.patch?rev=1.1&content-type=text/plain |
217 |
|
218 |
Index: 15_all_libgfortran-Werror.patch |
219 |
=================================================================== |
220 |
libgfortran does not respect --disable-werror |
221 |
|
222 |
https://bugs.gentoo.org/433435 |
223 |
http://gcc.gnu.org/PR54724 |
224 |
|
225 |
--- a/libgfortran/configure |
226 |
+++ b/libgfortran/configure |
227 |
@@ -5551,7 +5551,7 @@ fi |
228 |
|
229 |
# Add -Wall -fno-repack-arrays -fno-underscoring if we are using GCC. |
230 |
if test "x$GCC" = "xyes"; then |
231 |
- AM_FCFLAGS="-I . -Wall -Werror -fimplicit-none -fno-repack-arrays -fno-underscoring" |
232 |
+ AM_FCFLAGS="-I . -Wall -fimplicit-none -fno-repack-arrays -fno-underscoring" |
233 |
## We like to use C99 routines when available. This makes sure that |
234 |
## __STDC_VERSION__ is set such that libc includes make them available. |
235 |
AM_CFLAGS="-std=gnu99 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wextra -Wwrite-strings" |
236 |
|
237 |
|
238 |
|
239 |
1.1 src/patchsets/gcc/4.7.2/gentoo/15_all_libgomp-Werror.patch |
240 |
|
241 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.2/gentoo/15_all_libgomp-Werror.patch?rev=1.1&view=markup |
242 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.2/gentoo/15_all_libgomp-Werror.patch?rev=1.1&content-type=text/plain |
243 |
|
244 |
Index: 15_all_libgomp-Werror.patch |
245 |
=================================================================== |
246 |
libgomp does not respect --disable-werror |
247 |
|
248 |
https://bugs.gentoo.org/229059 |
249 |
http://gcc.gnu.org/PR38436 |
250 |
|
251 |
--- a/libgomp/configure |
252 |
+++ b/libgomp/configure |
253 |
@@ -4284,7 +4284,7 @@ save_CFLAGS="$CFLAGS" |
254 |
|
255 |
# Add -Wall -Werror if we are using GCC. |
256 |
if test "x$GCC" = "xyes"; then |
257 |
- XCFLAGS="$XCFLAGS -Wall -Werror" |
258 |
+ XCFLAGS="$XCFLAGS -Wall" |
259 |
fi |
260 |
|
261 |
# Find other programs we need. |
262 |
|
263 |
|
264 |
|
265 |
1.1 src/patchsets/gcc/4.7.2/gentoo/16_all_libgo-Werror-pr53679.patch |
266 |
|
267 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.2/gentoo/16_all_libgo-Werror-pr53679.patch?rev=1.1&view=markup |
268 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.2/gentoo/16_all_libgo-Werror-pr53679.patch?rev=1.1&content-type=text/plain |
269 |
|
270 |
Index: 16_all_libgo-Werror-pr53679.patch |
271 |
=================================================================== |
272 |
libgo does not respect --disable-werror |
273 |
|
274 |
https://bugs.gentoo.org/423153 |
275 |
http://gcc.gnu.org/PR53679 |
276 |
|
277 |
--- a/libgo/configure |
278 |
+++ b/libgo/configure |
279 |
@@ -13384,7 +13384,7 @@ done |
280 |
WARN_FLAGS='-Wall -Wextra -Wwrite-strings -Wcast-qual' |
281 |
|
282 |
|
283 |
-WERROR="-Werror" |
284 |
+WERROR="" |
285 |
|
286 |
|
287 |
glibgo_toolexecdir=no |
288 |
|
289 |
|
290 |
|
291 |
1.1 src/patchsets/gcc/4.7.2/gentoo/25_all_alpha-mieee-default.patch |
292 |
|
293 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.2/gentoo/25_all_alpha-mieee-default.patch?rev=1.1&view=markup |
294 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.2/gentoo/25_all_alpha-mieee-default.patch?rev=1.1&content-type=text/plain |
295 |
|
296 |
Index: 25_all_alpha-mieee-default.patch |
297 |
=================================================================== |
298 |
Set the default behavior on alpha to use -mieee since the large majority of |
299 |
time we want this (bad/weird things can happen with packages built without |
300 |
it). |
301 |
|
302 |
To satisfy those people who may not want -mieee forced on them all the time, |
303 |
we also provide -mno-ieee. |
304 |
|
305 |
Patch by Mike Frysinger <vapier@g.o> |
306 |
|
307 |
--- a/gcc/config/alpha/alpha.h |
308 |
+++ b/gcc/config/alpha/alpha.h |
309 |
@@ -96,6 +96,8 @@ along with GCC; see the file COPYING3. If not see |
310 |
while (0) |
311 |
#endif |
312 |
|
313 |
+#define CPP_SPEC "%{!no-ieee:-mieee}" |
314 |
+ |
315 |
/* Run-time compilation parameters selecting different hardware subsets. */ |
316 |
|
317 |
/* Which processor to schedule for. The cpu attribute defines a list that |
318 |
--- a/gcc/config/alpha/alpha.opt |
319 |
+++ b/gcc/config/alpha/alpha.opt |
320 |
@@ -39,7 +39,7 @@ Target RejectNegative Mask(IEEE_CONFORMANT) |
321 |
Request IEEE-conformant math library routines (OSF/1) |
322 |
|
323 |
mieee |
324 |
-Target Report RejectNegative Mask(IEEE) |
325 |
+Target Report Mask(IEEE) |
326 |
Emit IEEE-conformant code, without inexact exceptions |
327 |
|
328 |
mieee-with-inexact |
329 |
|
330 |
|
331 |
|
332 |
1.1 src/patchsets/gcc/4.7.2/gentoo/26_all_alpha-asm-mcpu.patch |
333 |
|
334 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.2/gentoo/26_all_alpha-asm-mcpu.patch?rev=1.1&view=markup |
335 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.2/gentoo/26_all_alpha-asm-mcpu.patch?rev=1.1&content-type=text/plain |
336 |
|
337 |
Index: 26_all_alpha-asm-mcpu.patch |
338 |
=================================================================== |
339 |
https://bugs.gentoo.org/170146 |
340 |
http://gcc.gnu.org/ml/gcc-patches/2009-11/msg00403.html |
341 |
|
342 |
alpha: turn -mcpu=<cpu> into -m<cpu> for assembler all the time |
343 |
|
344 |
--- a/gcc/config/alpha/elf.h |
345 |
+++ b/gcc/config/alpha/elf.h |
346 |
@@ -46,7 +46,7 @@ along with GCC; see the file COPYING3. If not see |
347 |
#define CC1_SPEC "%{G*}" |
348 |
|
349 |
#undef ASM_SPEC |
350 |
-#define ASM_SPEC "%{G*} %{relax:-relax} %{!gstabs*:-no-mdebug}%{gstabs*:-mdebug}" |
351 |
+#define ASM_SPEC "%{G*} %{relax:-relax} %{!gstabs*:-no-mdebug}%{gstabs*:-mdebug} %{mcpu=*:-m%*}" |
352 |
|
353 |
#undef IDENT_ASM_OP |
354 |
#define IDENT_ASM_OP "\t.ident\t" |
355 |
|
356 |
|
357 |
|
358 |
1.1 src/patchsets/gcc/4.7.2/gentoo/29_all_arm_armv4t-default.patch |
359 |
|
360 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.2/gentoo/29_all_arm_armv4t-default.patch?rev=1.1&view=markup |
361 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.2/gentoo/29_all_arm_armv4t-default.patch?rev=1.1&content-type=text/plain |
362 |
|
363 |
Index: 29_all_arm_armv4t-default.patch |
364 |
=================================================================== |
365 |
gcc defaults to armv5t for all targets even armv4t |
366 |
|
367 |
http://sourceware.org/ml/crossgcc/2008-05/msg00009.html |
368 |
|
369 |
|
370 |
--- a/gcc/config/arm/linux-eabi.h |
371 |
+++ b/gcc/config/arm/linux-eabi.h |
372 |
@@ -45,7 +45,7 @@ |
373 |
The ARM10TDMI core is the default for armv5t, so set |
374 |
SUBTARGET_CPU_DEFAULT to achieve this. */ |
375 |
#undef SUBTARGET_CPU_DEFAULT |
376 |
-#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi |
377 |
+#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm9tdmi |
378 |
|
379 |
/* TARGET_BIG_ENDIAN_DEFAULT is set in |
380 |
config.gcc for big endian configurations. */ |
381 |
|
382 |
|
383 |
|
384 |
1.1 src/patchsets/gcc/4.7.2/gentoo/33_all_armhf.patch |
385 |
|
386 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.2/gentoo/33_all_armhf.patch?rev=1.1&view=markup |
387 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.2/gentoo/33_all_armhf.patch?rev=1.1&content-type=text/plain |
388 |
|
389 |
Index: 33_all_armhf.patch |
390 |
=================================================================== |
391 |
use new common path to the arm hard float linker |
392 |
|
393 |
change taken from upstream gcc |
394 |
|
395 |
--- a/gcc/config/arm/linux-eabi.h |
396 |
+++ b/gcc/config/arm/linux-eabi.h |
397 |
@@ -32,7 +32,8 @@ |
398 |
while (false) |
399 |
|
400 |
/* We default to a soft-float ABI so that binaries can run on all |
401 |
- target hardware. */ |
402 |
+ target hardware. If you override this to use the hard-float ABI then |
403 |
+ change the setting of GLIBC_DYNAMIC_LINKER_DEFAULT as well. */ |
404 |
#undef TARGET_DEFAULT_FLOAT_ABI |
405 |
#define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_SOFT |
406 |
|
407 |
@@ -59,10 +60,23 @@ |
408 |
#undef SUBTARGET_EXTRA_LINK_SPEC |
409 |
#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION |
410 |
|
411 |
-/* Use ld-linux.so.3 so that it will be possible to run "classic" |
412 |
- GNU/Linux binaries on an EABI system. */ |
413 |
+/* GNU/Linux on ARM currently supports three dynamic linkers: |
414 |
+ - ld-linux.so.2 - for the legacy ABI |
415 |
+ - ld-linux.so.3 - for the EABI-derived soft-float ABI |
416 |
+ - ld-linux-armhf.so.3 - for the EABI-derived hard-float ABI. |
417 |
+ All the dynamic linkers live in /lib. |
418 |
+ We default to soft-float, but this can be overridden by changing both |
419 |
+ GLIBC_DYNAMIC_LINKER_DEFAULT and TARGET_DEFAULT_FLOAT_ABI. */ |
420 |
+ |
421 |
#undef GLIBC_DYNAMIC_LINKER |
422 |
-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.3" |
423 |
+#define GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "/lib/ld-linux.so.3" |
424 |
+#define GLIBC_DYNAMIC_LINKER_HARD_FLOAT "/lib/ld-linux-armhf.so.3" |
425 |
+#define GLIBC_DYNAMIC_LINKER_DEFAULT GLIBC_DYNAMIC_LINKER_SOFT_FLOAT |
426 |
+ |
427 |
+#define GLIBC_DYNAMIC_LINKER \ |
428 |
+ "%{mfloat-abi=hard:" GLIBC_DYNAMIC_LINKER_HARD_FLOAT "} \ |
429 |
+ %{mfloat-abi=soft*:" GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "} \ |
430 |
+ %{!mfloat-abi=*:" GLIBC_DYNAMIC_LINKER_DEFAULT "}" |
431 |
|
432 |
/* At this point, bpabi.h will have clobbered LINK_SPEC. We want to |
433 |
use the GNU/Linux version, not the generic BPABI version. */ |
434 |
|
435 |
|
436 |
|
437 |
1.1 src/patchsets/gcc/4.7.2/gentoo/34_all_ia64_note.GNU-stack.patch |
438 |
|
439 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.2/gentoo/34_all_ia64_note.GNU-stack.patch?rev=1.1&view=markup |
440 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.2/gentoo/34_all_ia64_note.GNU-stack.patch?rev=1.1&content-type=text/plain |
441 |
|
442 |
Index: 34_all_ia64_note.GNU-stack.patch |
443 |
=================================================================== |
444 |
http://gcc.gnu.org/PR21098 |
445 |
|
446 |
|
447 |
2004-09-20 Jakub Jelinek <jakub@××××××.com> |
448 |
|
449 |
* config/rs6000/ppc-asm.h: Add .note.GNU-stack section also |
450 |
on ppc64-linux. |
451 |
|
452 |
* config/ia64/lib1funcs.asm: Add .note.GNU-stack section on |
453 |
ia64-linux. |
454 |
* config/ia64/crtbegin.asm: Likewise. |
455 |
* config/ia64/crtend.asm: Likewise. |
456 |
* config/ia64/crti.asm: Likewise. |
457 |
* config/ia64/crtn.asm: Likewise. |
458 |
|
459 |
2004-05-14 Jakub Jelinek <jakub@××××××.com> |
460 |
|
461 |
* config/ia64/linux.h (TARGET_ASM_FILE_END): Define. |
462 |
|
463 |
|
464 |
--- a/gcc/config/ia64/linux.h |
465 |
+++ b/gcc/config/ia64/linux.h |
466 |
@@ -24,6 +24,8 @@ a copy of the GCC Runtime Library Exception along with this program; |
467 |
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see |
468 |
<http://www.gnu.org/licenses/>. */ |
469 |
|
470 |
+#define TARGET_ASM_FILE_END file_end_indicate_exec_stack |
471 |
+ |
472 |
/* This is for -profile to use -lc_p instead of -lc. */ |
473 |
#undef CC1_SPEC |
474 |
#define CC1_SPEC "%{profile:-p} %{G*}" |
475 |
--- a/gcc/config/rs6000/ppc-asm.h |
476 |
+++ b/gcc/config/rs6000/ppc-asm.h |
477 |
@@ -352,7 +352,7 @@ GLUE(.L,name): \ |
478 |
#endif |
479 |
#endif |
480 |
|
481 |
-#if defined __linux__ && !defined __powerpc64__ |
482 |
+#if defined __linux__ |
483 |
.section .note.GNU-stack |
484 |
.previous |
485 |
#endif |
486 |
--- a/libgcc/config/ia64/crtbegin.S |
487 |
+++ b/libgcc/config/ia64/crtbegin.S |
488 |
@@ -252,3 +252,7 @@ __do_jv_register_classes: |
489 |
.weak __cxa_finalize |
490 |
#endif |
491 |
.weak _Jv_RegisterClasses |
492 |
+ |
493 |
+#ifdef __linux__ |
494 |
+.section .note.GNU-stack; .previous |
495 |
+#endif |
496 |
--- a/libgcc/config/ia64/crtend.S |
497 |
+++ b/libgcc/config/ia64/crtend.S |
498 |
@@ -119,3 +119,6 @@ __do_global_ctors_aux: |
499 |
|
500 |
br.ret.sptk.many rp |
501 |
.endp __do_global_ctors_aux |
502 |
+#ifdef __linux__ |
503 |
+.section .note.GNU-stack; .previous |
504 |
+#endif |
505 |
--- a/libgcc/config/ia64/crti.S |
506 |
+++ b/libgcc/config/ia64/crti.S |
507 |
@@ -49,5 +49,8 @@ _fini: |
508 |
.save rp, r33 |
509 |
mov r33 = b0 |
510 |
.body |
511 |
+#ifdef __linux__ |
512 |
+.section .note.GNU-stack; .previous |
513 |
+#endif |
514 |
|
515 |
# end of crti.S |
516 |
--- a/libgcc/config/ia64/crtn.S |
517 |
+++ b/libgcc/config/ia64/crtn.S |
518 |
@@ -39,5 +39,8 @@ |
519 |
.restore sp |
520 |
mov r12 = r35 |
521 |
br.ret.sptk.many b0 |
522 |
+#ifdef __linux__ |
523 |
+.section .note.GNU-stack; .previous |
524 |
+#endif |
525 |
|
526 |
# end of crtn.S |
527 |
--- a/libgcc/config/ia64/lib1funcs.S |
528 |
+++ b/libgcc/config/ia64/lib1funcs.S |
529 |
@@ -793,3 +793,6 @@ __floattitf: |
530 |
.endp __floattitf |
531 |
#endif |
532 |
#endif |
533 |
+#ifdef __linux__ |
534 |
+.section .note.GNU-stack; .previous |
535 |
+#endif |
536 |
|
537 |
|
538 |
|
539 |
1.1 src/patchsets/gcc/4.7.2/gentoo/38_all_sh_pr24836_all-archs.patch |
540 |
|
541 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.2/gentoo/38_all_sh_pr24836_all-archs.patch?rev=1.1&view=markup |
542 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.2/gentoo/38_all_sh_pr24836_all-archs.patch?rev=1.1&content-type=text/plain |
543 |
|
544 |
Index: 38_all_sh_pr24836_all-archs.patch |
545 |
=================================================================== |
546 |
gcc/configure doesn't handle all possible SH architectures |
547 |
|
548 |
http://gcc.gnu.org/PR24836 |
549 |
|
550 |
|
551 |
--- a/gcc/configure |
552 |
+++ b/gcc/configure |
553 |
@@ -22753,7 +22753,7 @@ foo: .long 25 |
554 |
tls_first_minor=14 |
555 |
tls_as_opt="-m64 -Aesame --fatal-warnings" |
556 |
;; |
557 |
- sh-*-* | sh[34]-*-*) |
558 |
+ sh-*-* | sh[34]*-*-*) |
559 |
conftest_s=' |
560 |
.section ".tdata","awT",@progbits |
561 |
foo: .long 25 |
562 |
--- a/gcc/configure.ac |
563 |
+++ b/gcc/configure.ac |
564 |
@@ -2924,7 +2924,7 @@ foo: .long 25 |
565 |
tls_first_minor=14 |
566 |
tls_as_opt="-m64 -Aesame --fatal-warnings" |
567 |
;; |
568 |
- sh-*-* | sh[34]-*-*) |
569 |
+ sh-*-* | sh[34]*-*-*) |
570 |
conftest_s=' |
571 |
.section ".tdata","awT",@progbits |
572 |
foo: .long 25 |
573 |
|
574 |
|
575 |
|
576 |
1.1 src/patchsets/gcc/4.7.2/gentoo/42_all_superh_default-multilib.patch |
577 |
|
578 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.2/gentoo/42_all_superh_default-multilib.patch?rev=1.1&view=markup |
579 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.2/gentoo/42_all_superh_default-multilib.patch?rev=1.1&content-type=text/plain |
580 |
|
581 |
Index: 42_all_superh_default-multilib.patch |
582 |
=================================================================== |
583 |
The gcc-3.x toolchains would contain all the targets by default. With gcc-4, |
584 |
you have to actually list out the multilibs you want or you will end up with |
585 |
just one when using targets like 'sh4-linux-gnu'. |
586 |
|
587 |
The resulting toolchain can't even build a kernel as the kernel needs to build |
588 |
with the nofpu flag to be sure that no fpu ops are generated. |
589 |
|
590 |
Here we restore the gcc-3.x behavior; the additional overhead of building all |
591 |
of these multilibs by default is negligible. |
592 |
|
593 |
https://bugs.gentoo.org/140205 |
594 |
https://bugs.gentoo.org/320251 |
595 |
|
596 |
--- a/gcc/config.gcc |
597 |
+++ b/gcc/config.gcc |
598 |
@@ -2455,7 +2455,7 @@ sh-*-symbianelf* | sh[12346l]*-*-symbianelf* | \ |
599 |
if test "$sh_multilibs" = "default" ; then |
600 |
case ${target} in |
601 |
sh64-superh-linux* | \ |
602 |
- sh[1234]*) sh_multilibs=${sh_cpu_target} ;; |
603 |
+ sh[1234]*) sh_multilibs=$(echo $(sed -n '/^[[:space:]]*case ${sh_multilib} in/,/)/{s:case ${sh_multilib} in::;s: | *:,:g;s:[\\)]::g;p}' ${srcdir}/config.gcc) | sed 's: ::g') ;; |
604 |
sh64* | sh5*) sh_multilibs=m5-32media,m5-32media-nofpu,m5-compact,m5-compact-nofpu,m5-64media,m5-64media-nofpu ;; |
605 |
sh-superh-*) sh_multilibs=m4,m4-single,m4-single-only,m4-nofpu ;; |
606 |
sh*-*-linux*) sh_multilibs=m1,m3e,m4 ;; |
607 |
|
608 |
|
609 |
|
610 |
1.1 src/patchsets/gcc/4.7.2/gentoo/49_all_gcc-4.7-x86-libitm-pr52695.patch |
611 |
|
612 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.2/gentoo/49_all_gcc-4.7-x86-libitm-pr52695.patch?rev=1.1&view=markup |
613 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.2/gentoo/49_all_gcc-4.7-x86-libitm-pr52695.patch?rev=1.1&content-type=text/plain |
614 |
|
615 |
Index: 49_all_gcc-4.7-x86-libitm-pr52695.patch |
616 |
=================================================================== |
617 |
http://gcc.gnu.org/PR52695 |
618 |
https://bugs.gentoo.org/421305 |
619 |
|
620 |
fix building on x86 systems |
621 |
|
622 |
--- a/libitm/config/x86/target.h |
623 |
+++ b/libitm/config/x86/target.h |
624 |
@@ -69,16 +69,4 @@ |
625 |
} // namespace GTM |
626 |
|
627 |
// We'll be using some of the cpu builtins, and their associated types. |
628 |
-#ifndef __cplusplus |
629 |
-/* ??? It's broken for C++. */ |
630 |
#include <x86intrin.h> |
631 |
-#else |
632 |
-# ifdef __SSE2__ |
633 |
-# include <emmintrin.h> |
634 |
-# elif defined(__SSE__) |
635 |
-# include <xmmintrin.h> |
636 |
-# endif |
637 |
-# ifdef __AVX__ |
638 |
-# include <immintrin.h> |
639 |
-# endif |
640 |
-#endif |
641 |
|
642 |
|
643 |
|
644 |
1.1 src/patchsets/gcc/4.7.2/gentoo/50_all_libiberty-asprintf.patch |
645 |
|
646 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.2/gentoo/50_all_libiberty-asprintf.patch?rev=1.1&view=markup |
647 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.2/gentoo/50_all_libiberty-asprintf.patch?rev=1.1&content-type=text/plain |
648 |
|
649 |
Index: 50_all_libiberty-asprintf.patch |
650 |
=================================================================== |
651 |
2008-07-25 Magnus Granberg <zorry@×××.nu> |
652 |
|
653 |
* include/libiberty.h (asprintf): Don't declare if defined as a macro |
654 |
|
655 |
--- a/include/libiberty.h |
656 |
+++ b/include/libiberty.h |
657 |
@@ -609,8 +609,11 @@ extern int pwait (int, int *, int); |
658 |
/* Like sprintf but provides a pointer to malloc'd storage, which must |
659 |
be freed by the caller. */ |
660 |
|
661 |
+/* asprintf may be declared as a macro by glibc with __USE_FORTIFY_LEVEL. */ |
662 |
+#ifndef asprintf |
663 |
extern int asprintf (char **, const char *, ...) ATTRIBUTE_PRINTF_2; |
664 |
#endif |
665 |
+#endif |
666 |
|
667 |
#if !HAVE_DECL_VASPRINTF |
668 |
/* Like vsprintf but provides a pointer to malloc'd storage, which |
669 |
|
670 |
|
671 |
|
672 |
1.1 src/patchsets/gcc/4.7.2/gentoo/51_all_libiberty-pic.patch |
673 |
|
674 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.2/gentoo/51_all_libiberty-pic.patch?rev=1.1&view=markup |
675 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.2/gentoo/51_all_libiberty-pic.patch?rev=1.1&content-type=text/plain |
676 |
|
677 |
Index: 51_all_libiberty-pic.patch |
678 |
=================================================================== |
679 |
--- a/libiberty/Makefile.in |
680 |
+++ b/libiberty/Makefile.in |
681 |
@@ -246,6 +246,7 @@ $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS) |
682 |
$(AR) $(AR_FLAGS) $(TARGETLIB) \ |
683 |
$(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \ |
684 |
$(RANLIB) $(TARGETLIB); \ |
685 |
+ cp $(TARGETLIB) ../ ; \ |
686 |
cd ..; \ |
687 |
else true; fi |
688 |
|
689 |
|
690 |
|
691 |
|
692 |
1.1 src/patchsets/gcc/4.7.2/gentoo/52_all_netbsd-Bsymbolic.patch |
693 |
|
694 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.2/gentoo/52_all_netbsd-Bsymbolic.patch?rev=1.1&view=markup |
695 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.2/gentoo/52_all_netbsd-Bsymbolic.patch?rev=1.1&content-type=text/plain |
696 |
|
697 |
Index: 52_all_netbsd-Bsymbolic.patch |
698 |
=================================================================== |
699 |
https://bugs.gentoo.org/122698 |
700 |
|
701 |
--- a/gcc/config/netbsd-elf.h |
702 |
+++ b/gcc/config/netbsd-elf.h |
703 |
@@ -70,6 +70,7 @@ along with GCC; see the file COPYING3. If not see |
704 |
#define NETBSD_LINK_SPEC_ELF \ |
705 |
"%{assert*} %{R*} %{rpath*} \ |
706 |
%{shared:-shared} \ |
707 |
+ %{symbolic:-Bsymbolic} \ |
708 |
%{!shared: \ |
709 |
-dc -dp \ |
710 |
%{!nostdlib: \ |
711 |
|
712 |
|
713 |
|
714 |
1.1 src/patchsets/gcc/4.7.2/gentoo/67_all_gcc-poison-system-directories.patch |
715 |
|
716 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.2/gentoo/67_all_gcc-poison-system-directories.patch?rev=1.1&view=markup |
717 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.2/gentoo/67_all_gcc-poison-system-directories.patch?rev=1.1&content-type=text/plain |
718 |
|
719 |
Index: 67_all_gcc-poison-system-directories.patch |
720 |
=================================================================== |
721 |
grabbed from openembedded |
722 |
|
723 |
Upstream-Status: Inappropriate [distribution: codesourcery] |
724 |
|
725 |
gcc/ |
726 |
2008-07-02 Joseph Myers <joseph@××××××××××××.com> |
727 |
* c-incpath.c: Include toplev.h. |
728 |
(merge_include_chains): Use warning instead of cpp_error for |
729 |
system directory poisoning diagnostic. |
730 |
* Makefile.in (c-incpath.o): Depend on toplev.h. |
731 |
* gcc.c (LINK_COMMAND_SPEC): Pass |
732 |
--error-poison-system-directories if |
733 |
-Werror=poison-system-directories. |
734 |
|
735 |
2007-06-13 Joseph Myers <joseph@××××××××××××.com> |
736 |
* common.opt (--Wno-poison-system-directories): New. |
737 |
* doc/invoke.texi (-Wno-poison-system-directories): Document. |
738 |
* c-incpath.c: Include flags.h. |
739 |
(merge_include_chains): Check flag_poison_system_directories. |
740 |
* gcc.c (LINK_COMMAND_SPEC): Pass --no-poison-system-directories |
741 |
to linker if -Wno-poison-system-directories. |
742 |
* Makefile.in (c-incpath.o): Depend on $(FLAGS_H). |
743 |
|
744 |
2007-03-20 Daniel Jacobowitz <dan@××××××××××××.com> |
745 |
Joseph Myers <joseph@××××××××××××.com> |
746 |
* configure.ac (--enable-poison-system-directories): New option. |
747 |
* configure, config.in: Regenerate. |
748 |
* c-incpath.c (merge_include_chains): If |
749 |
ENABLE_POISON_SYSTEM_DIRECTORIES defined, warn for use of |
750 |
/usr/include, /usr/local/include or /usr/X11R6/include. |
751 |
|
752 |
Index: gcc-4_7-branch/gcc/common.opt |
753 |
=================================================================== |
754 |
--- gcc-4_7-branch.orig/gcc/common.opt 2012-04-10 10:54:04.000000000 -0700 |
755 |
+++ gcc-4_7-branch/gcc/common.opt 2012-04-10 10:56:02.259442274 -0700 |
756 |
@@ -582,6 +582,10 @@ |
757 |
Common Var(warn_padded) Warning |
758 |
Warn when padding is required to align structure members |
759 |
|
760 |
+Wpoison-system-directories |
761 |
+Common Var(flag_poison_system_directories) Init(1) Warning |
762 |
+Warn for -I and -L options using system directories if cross compiling |
763 |
+ |
764 |
Wshadow |
765 |
Common Var(warn_shadow) Warning |
766 |
Warn when one local variable shadows another |
767 |
Index: gcc-4_7-branch/gcc/config.in |
768 |
=================================================================== |
769 |
--- gcc-4_7-branch.orig/gcc/config.in 2012-04-10 10:54:04.000000000 -0700 |
770 |
+++ gcc-4_7-branch/gcc/config.in 2012-04-10 10:56:02.259442274 -0700 |
771 |
@@ -144,6 +144,12 @@ |
772 |
#endif |
773 |
|
774 |
|
775 |
+/* Define to warn for use of native system header directories */ |
776 |
+#ifndef USED_FOR_TARGET |
777 |
+#undef ENABLE_POISON_SYSTEM_DIRECTORIES |
778 |
+#endif |
779 |
+ |
780 |
+ |
781 |
/* Define if you want all operations on RTL (the basic data structure of the |
782 |
optimizer and back end) to be checked for dynamic type safety at runtime. |
783 |
This is quite expensive. */ |
784 |
Index: gcc-4_7-branch/gcc/configure.ac |
785 |
=================================================================== |
786 |
--- gcc-4_7-branch.orig/gcc/configure.ac 2012-04-10 10:55:32.000000000 -0700 |
787 |
+++ gcc-4_7-branch/gcc/configure.ac 2012-04-10 10:56:02.259442274 -0700 |
788 |
@@ -4959,6 +4959,16 @@ |
789 |
[specify that runtime libraries should be |
790 |
installed in a compiler-specific directory])]) |
791 |
|
792 |
+AC_ARG_ENABLE([poison-system-directories], |
793 |
+ AS_HELP_STRING([--enable-poison-system-directories], |
794 |
+ [warn for use of native system header directories]),, |
795 |
+ [enable_poison_system_directories=no]) |
796 |
+if test "x${enable_poison_system_directories}" = "xyes"; then |
797 |
+ AC_DEFINE([ENABLE_POISON_SYSTEM_DIRECTORIES], |
798 |
+ [1], |
799 |
+ [Define to warn for use of native system header directories]) |
800 |
+fi |
801 |
+ |
802 |
# Substitute configuration variables |
803 |
AC_SUBST(subdirs) |
804 |
AC_SUBST(srcdir) |
805 |
Index: gcc-4_7-branch/gcc/doc/invoke.texi |
806 |
=================================================================== |
807 |
--- gcc-4_7-branch.orig/gcc/doc/invoke.texi 2012-04-10 10:54:04.000000000 -0700 |
808 |
+++ gcc-4_7-branch/gcc/doc/invoke.texi 2012-04-10 10:56:02.263442231 -0700 |
809 |
@@ -260,6 +260,7 @@ |
810 |
-Woverlength-strings -Wpacked -Wpacked-bitfield-compat -Wpadded @gol |
811 |
-Wparentheses -Wpedantic-ms-format -Wno-pedantic-ms-format @gol |
812 |
-Wpointer-arith -Wno-pointer-to-int-cast @gol |
813 |
+-Wno-poison-system-directories @gol |
814 |
-Wredundant-decls @gol |
815 |
-Wreturn-type -Wsequence-point -Wshadow @gol |
816 |
-Wsign-compare -Wsign-conversion -Wstack-protector @gol |
817 |
@@ -3878,6 +3879,14 @@ |
818 |
for most targets, it is made up of code and thus requires the stack |
819 |
to be made executable in order for the program to work properly. |
820 |
|
821 |
+@item -Wno-poison-system-directories |
822 |
+@opindex Wno-poison-system-directories |
823 |
+Do not warn for @option{-I} or @option{-L} options using system |
824 |
+directories such as @file{/usr/include} when cross compiling. This |
825 |
+option is intended for use in chroot environments when such |
826 |
+directories contain the correct headers and libraries for the target |
827 |
+system rather than the host. |
828 |
+ |
829 |
@item -Wfloat-equal |
830 |
@opindex Wfloat-equal |
831 |
@opindex Wno-float-equal |
832 |
Index: gcc-4_7-branch/gcc/gcc.c |
833 |
=================================================================== |
834 |
--- gcc-4_7-branch.orig/gcc/gcc.c 2012-04-10 10:54:04.000000000 -0700 |
835 |
+++ gcc-4_7-branch/gcc/gcc.c 2012-04-10 10:56:02.267442207 -0700 |
836 |
@@ -673,6 +673,8 @@ |
837 |
%{flto} %{flto=*} %l " LINK_PIE_SPEC \ |
838 |
"%X %{o*} %{e*} %{N} %{n} %{r}\ |
839 |
%{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!nostartfiles:%S}}\ |
840 |
+ %{Wno-poison-system-directories:--no-poison-system-directories}\ |
841 |
+ %{Werror=poison-system-directories:--error-poison-system-directories}\ |
842 |
%{static:} %{L*} %(mfwrap) %(link_libgcc) %o\ |
843 |
%{fopenmp|ftree-parallelize-loops=*:%:include(libgomp.spec)%(link_gomp)}\ |
844 |
%{fgnu-tm:%:include(libitm.spec)%(link_itm)}\ |
845 |
Index: gcc-4_7-branch/gcc/incpath.c |
846 |
=================================================================== |
847 |
--- gcc-4_7-branch.orig/gcc/incpath.c 2012-04-10 10:54:04.000000000 -0700 |
848 |
+++ gcc-4_7-branch/gcc/incpath.c 2012-04-10 10:56:02.267442207 -0700 |
849 |
@@ -361,6 +361,26 @@ |
850 |
} |
851 |
fprintf (stderr, _("End of search list.\n")); |
852 |
} |
853 |
+ |
854 |
+#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES |
855 |
+ if (flag_poison_system_directories) |
856 |
+ { |
857 |
+ struct cpp_dir *p; |
858 |
+ |
859 |
+ for (p = heads[QUOTE]; p; p = p->next) |
860 |
+ { |
861 |
+ if ((!strncmp (p->name, "/usr/include", 12)) |
862 |
+ || (!strncmp (p->name, "/usr/local/include", 18)) |
863 |
+ || (!strncmp (p->name, "/usr/X11R6/include", 18)) |
864 |
+ || (!strncmp (p->name, "/sw/include", 11)) |
865 |
+ || (!strncmp (p->name, "/opt/include", 12))) |
866 |
+ warning (OPT_Wpoison_system_directories, |
867 |
+ "include location \"%s\" is unsafe for " |
868 |
+ "cross-compilation", |
869 |
+ p->name); |
870 |
+ } |
871 |
+ } |
872 |
+#endif |
873 |
} |
874 |
|
875 |
/* Use given -I paths for #include "..." but not #include <...>, and |
876 |
Index: gcc-4_7-branch/gcc/Makefile.in |
877 |
=================================================================== |
878 |
--- gcc-4_7-branch.orig/gcc/Makefile.in 2012-04-10 10:54:05.000000000 -0700 |
879 |
+++ gcc-4_7-branch/gcc/Makefile.in 2012-04-10 10:56:02.267442207 -0700 |
880 |
@@ -2065,7 +2065,7 @@ |
881 |
|
882 |
incpath.o: incpath.c incpath.h $(CONFIG_H) $(SYSTEM_H) $(CPPLIB_H) \ |
883 |
intl.h prefix.h coretypes.h $(TM_H) cppdefault.h $(TARGET_H) \ |
884 |
- $(MACHMODE_H) |
885 |
+ $(MACHMODE_H) $(FLAGS_H) toplev.h |
886 |
|
887 |
CFLAGS-prefix.o += -DPREFIX=\"$(prefix)\" -DBASEVER=$(BASEVER_s) |
888 |
prefix.o: prefix.c $(CONFIG_H) $(SYSTEM_H) coretypes.h prefix.h \ |
889 |
Index: gcc-4_7-branch/gcc/configure |
890 |
=================================================================== |
891 |
--- gcc-4_7-branch.orig/gcc/configure 2012-04-10 10:55:32.000000000 -0700 |
892 |
+++ gcc-4_7-branch/gcc/configure 2012-04-10 10:56:12.183442720 -0700 |
893 |
@@ -914,6 +914,7 @@ |
894 |
with_system_zlib |
895 |
enable_maintainer_mode |
896 |
enable_version_specific_runtime_libs |
897 |
+enable_poison_system_directories |
898 |
enable_plugin |
899 |
enable_libquadmath_support |
900 |
with_linker_hash_style |
901 |
@@ -1627,6 +1628,8 @@ |
902 |
--enable-version-specific-runtime-libs |
903 |
specify that runtime libraries should be installed |
904 |
in a compiler-specific directory |
905 |
+ --enable-poison-system-directories |
906 |
+ warn for use of native system header directories |
907 |
--enable-plugin enable plugin support |
908 |
--disable-libquadmath-support |
909 |
disable libquadmath support for Fortran |
910 |
@@ -27075,6 +27078,19 @@ |
911 |
fi |
912 |
|
913 |
|
914 |
+# Check whether --enable-poison-system-directories was given. |
915 |
+if test "${enable_poison_system_directories+set}" = set; then : |
916 |
+ enableval=$enable_poison_system_directories; |
917 |
+else |
918 |
+ enable_poison_system_directories=no |
919 |
+fi |
920 |
+ |
921 |
+if test "x${enable_poison_system_directories}" = "xyes"; then |
922 |
+ |
923 |
+$as_echo "#define ENABLE_POISON_SYSTEM_DIRECTORIES 1" >>confdefs.h |
924 |
+ |
925 |
+fi |
926 |
+ |
927 |
# Substitute configuration variables |
928 |
|
929 |
|
930 |
|
931 |
|
932 |
|
933 |
1.1 src/patchsets/gcc/4.7.2/gentoo/74_all_gcc47_cloog-dl.patch |
934 |
|
935 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.2/gentoo/74_all_gcc47_cloog-dl.patch?rev=1.1&view=markup |
936 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.2/gentoo/74_all_gcc47_cloog-dl.patch?rev=1.1&content-type=text/plain |
937 |
|
938 |
Index: 74_all_gcc47_cloog-dl.patch |
939 |
=================================================================== |
940 |
2011-01-04 Jakub Jelinek <jakub@××××××.com> |
941 |
|
942 |
* Makefile.in (BACKENDLIBS): Link against -ldl instead of |
943 |
-lcloog -lppl. |
944 |
(graphite.o, graphite%.o): Force -O, remove -fkeep-inline-functions. |
945 |
(GRAPHITE_CLOOG_UTIL_H, GRAPHITE_POLY_H): New. |
946 |
(graphite*.o): Adjust dependencies. |
947 |
* graphite-cloog-compat.h: Include <dlfcn.h>. Reference libcloog and |
948 |
libppl symbols through pointers in cloog_pointers__ variable. |
949 |
* graphite.c (init_cloog_pointers): New function. |
950 |
(graphite_transform_loops): Call init_cloog_pointers. |
951 |
* graphite-clast-to-gimple.c (gcc_type_for_iv_of_clast_loop): Rename |
952 |
stmt_for argument to stmt_fora. |
953 |
* graphite-poly.h: Include graphite-cloog-util.h. |
954 |
|
955 |
2012-05-19 Ryan Hill <dirtyepic@g.o> |
956 |
|
957 |
* configure.ac (DL_LIB): Check how to dlopen. |
958 |
* configure: Regenerate. |
959 |
* Makefile.in (BACKENDLIBS): Use DL_LIB. |
960 |
|
961 |
|
962 |
--- a/gcc/Makefile.in |
963 |
+++ b/gcc/Makefile.in |
964 |
@@ -963,6 +963,8 @@ GCC_PLUGIN_H = gcc-plugin.h highlev-plugin-common.h $(CONFIG_H) $(SYSTEM_H) \ |
965 |
PLUGIN_H = plugin.h $(GCC_PLUGIN_H) |
966 |
PLUGIN_VERSION_H = plugin-version.h configargs.h |
967 |
LIBFUNCS_H = libfuncs.h $(HASHTAB_H) |
968 |
+GRAPHITE_CLOOG_UTIL_H = graphite-cloog-util.h graphite-cloog-compat.h |
969 |
+GRAPHITE_POLY_H = graphite-poly.h $(GRAPHITE_CLOOG_UTIL_H) |
970 |
|
971 |
# |
972 |
# Now figure out from those variables how to compile and link. |
973 |
@@ -1017,7 +1019,7 @@ BUILD_LIBDEPS= $(BUILD_LIBIBERTY) |
974 |
# and the system's installed libraries. |
975 |
LIBS = @LIBS@ libcommon.a $(CPPLIB) $(LIBINTL) $(LIBICONV) $(LIBIBERTY) \ |
976 |
$(LIBDECNUMBER) $(HOST_LIBS) |
977 |
-BACKENDLIBS = $(CLOOGLIBS) $(PPLLIBS) $(GMPLIBS) $(PLUGINLIBS) $(HOST_LIBS) \ |
978 |
+BACKENDLIBS = $(GMPLIBS) $(if $(CLOOGLIBS),@DL_LIB@) $(PLUGINLIBS) $(HOST_LIBS) \ |
979 |
$(ZLIB) |
980 |
# Any system libraries needed just for GNAT. |
981 |
SYSLIBS = @GNAT_LIBEXC@ |
982 |
@@ -2603,40 +2605,40 @@ sese.o : sese.c sese.h $(CONFIG_H) $(SYSTEM_H) coretypes.h tree-pretty-print.h \ |
983 |
$(TREE_FLOW_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) tree-pass.h value-prof.h |
984 |
graphite.o : graphite.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(DIAGNOSTIC_CORE_H) \ |
985 |
$(TREE_FLOW_H) $(TREE_DUMP_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) sese.h \ |
986 |
- $(DBGCNT_H) graphite-ppl.h graphite-poly.h graphite-scop-detection.h \ |
987 |
+ $(DBGCNT_H) graphite-ppl.h $(GRAPHITE_POLY_H) graphite-scop-detection.h \ |
988 |
graphite-clast-to-gimple.h graphite-sese-to-poly.h |
989 |
graphite-blocking.o : graphite-blocking.c $(CONFIG_H) $(SYSTEM_H) \ |
990 |
coretypes.h $(TREE_FLOW_H) $(TREE_DUMP_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) \ |
991 |
- sese.h graphite-ppl.h graphite-poly.h |
992 |
+ sese.h graphite-ppl.h $(GRAPHITE_POLY_H) |
993 |
graphite-clast-to-gimple.o : graphite-clast-to-gimple.c $(CONFIG_H) \ |
994 |
$(SYSTEM_H) coretypes.h $(DIAGNOSTIC_CORE_H) $(TREE_FLOW_H) $(TREE_DUMP_H) \ |
995 |
- $(CFGLOOP_H) $(TREE_DATA_REF_H) sese.h graphite-cloog-util.h \ |
996 |
- graphite-ppl.h graphite-poly.h graphite-clast-to-gimple.h \ |
997 |
+ $(CFGLOOP_H) $(TREE_DATA_REF_H) sese.h $(GRAPHITE_CLOOG_UTIL_H) \ |
998 |
+ graphite-ppl.h $(GRAPHITE_POLY_H) graphite-clast-to-gimple.h \ |
999 |
graphite-dependences.h graphite-cloog-compat.h |
1000 |
graphite-cloog-util.o : graphite-cloog-util.c $(CONFIG_H) $(SYSTEM_H) \ |
1001 |
- coretypes.h graphite-cloog-util.h graphite-cloog-compat.h |
1002 |
+ coretypes.h $(GRAPHITE_CLOOG_UTIL_H) graphite-cloog-compat.h |
1003 |
graphite-dependences.o : graphite-dependences.c $(CONFIG_H) $(SYSTEM_H) \ |
1004 |
coretypes.h $(TREE_FLOW_H) $(TREE_DUMP_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) \ |
1005 |
- sese.h graphite-ppl.h graphite-poly.h graphite-dependences.h \ |
1006 |
- graphite-cloog-util.h |
1007 |
+ sese.h graphite-ppl.h $(GRAPHITE_POLY_H) graphite-dependences.h \ |
1008 |
+ $(GRAPHITE_CLOOG_UTIL_H) |
1009 |
graphite-flattening.o : graphite-flattening.c $(CONFIG_H) $(SYSTEM_H) \ |
1010 |
coretypes.h $(TREE_FLOW_H) $(TREE_DUMP_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) \ |
1011 |
- sese.h graphite-ppl.h graphite-poly.h |
1012 |
+ sese.h graphite-ppl.h $(GRAPHITE_POLY_H) |
1013 |
graphite-interchange.o : graphite-interchange.c $(CONFIG_H) $(SYSTEM_H) \ |
1014 |
coretypes.h $(TREE_FLOW_H) $(TREE_DUMP_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) \ |
1015 |
- sese.h graphite-ppl.h graphite-poly.h |
1016 |
+ sese.h graphite-ppl.h $(GRAPHITE_POLY_H) |
1017 |
graphite-poly.o : graphite-poly.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ |
1018 |
$(DIAGNOSTIC_CORE_H) $(TREE_FLOW_H) $(TREE_DUMP_H) gimple-pretty-print.h \ |
1019 |
- $(CFGLOOP_H) $(TREE_DATA_REF_H) sese.h graphite-ppl.h graphite-poly.h \ |
1020 |
- graphite-dependences.h graphite-cloog-util.h |
1021 |
+ $(CFGLOOP_H) $(TREE_DATA_REF_H) sese.h graphite-ppl.h $(GRAPHITE_POLY_H) \ |
1022 |
+ graphite-dependences.h $(GRAPHITE_CLOOG_UTIL_H) |
1023 |
graphite-ppl.o : graphite-ppl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ |
1024 |
- graphite-cloog-util.h graphite-ppl.h |
1025 |
+ $(GRAPHITE_CLOOG_UTIL_H) graphite-ppl.h |
1026 |
graphite-scop-detection.o : graphite-scop-detection.c $(CONFIG_H) $(SYSTEM_H) \ |
1027 |
coretypes.h $(TREE_FLOW_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) $(TREE_PASS_H) \ |
1028 |
- sese.h graphite-ppl.h graphite-poly.h graphite-scop-detection.h |
1029 |
+ sese.h graphite-ppl.h $(GRAPHITE_POLY_H) graphite-scop-detection.h |
1030 |
graphite-sese-to-poly.o : graphite-sese-to-poly.c $(CONFIG_H) \ |
1031 |
$(SYSTEM_H) coretypes.h $(TREE_FLOW_H) $(TREE_DUMP_H) $(CFGLOOP_H) \ |
1032 |
- $(TREE_DATA_REF_H) domwalk.h sese.h graphite-ppl.h graphite-poly.h \ |
1033 |
+ $(TREE_DATA_REF_H) domwalk.h sese.h graphite-ppl.h $(GRAPHITE_POLY_H) \ |
1034 |
graphite-sese-to-poly.h |
1035 |
tree-vect-loop.o: tree-vect-loop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ |
1036 |
$(TM_H) $(GGC_H) $(TREE_H) $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) $(TREE_FLOW_H) \ |
1037 |
@@ -3455,6 +3457,15 @@ $(common_out_object_file): $(common_out_file) $(CONFIG_H) $(SYSTEM_H) \ |
1038 |
$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) \ |
1039 |
$< $(OUTPUT_OPTION) |
1040 |
|
1041 |
+graphite%.o : \ |
1042 |
+ ALL_CFLAGS := -O $(filter-out -fkeep-inline-functions, $(ALL_CFLAGS)) |
1043 |
+graphite.o : \ |
1044 |
+ ALL_CFLAGS := -O $(filter-out -fkeep-inline-functions, $(ALL_CFLAGS)) |
1045 |
+graphite%.o : \ |
1046 |
+ ALL_CXXFLAGS := -O $(filter-out -fkeep-inline-functions, $(ALL_CXXFLAGS)) |
1047 |
+graphite.o : \ |
1048 |
+ ALL_CXXFLAGS := -O $(filter-out -fkeep-inline-functions, $(ALL_CXXFLAGS)) |
1049 |
+ |
1050 |
# Build auxiliary files that support ecoff format. |
1051 |
mips-tfile: mips-tfile.o $(LIBDEPS) |
1052 |
$(LINKER) $(LINKERFLAGS) $(LDFLAGS) -o $@ \ |
1053 |
--- a/gcc/configure |
1054 |
+++ b/gcc/configure |
1055 |
@@ -602,6 +602,7 @@ ac_subst_vars='LTLIBOBJS |
1056 |
LIBOBJS |
1057 |
enable_plugin |
1058 |
pluginlibs |
1059 |
+DL_LIB |
1060 |
CLOOGINC |
1061 |
CLOOGLIBS |
1062 |
PPLINC |
1063 |
@@ -27236,6 +27237,7 @@ $as_echo "unable to check" >&6; } |
1064 |
fi |
1065 |
|
1066 |
# Check -ldl |
1067 |
+ DL_LIB= |
1068 |
saved_LIBS="$LIBS" |
1069 |
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5 |
1070 |
$as_echo_n "checking for library containing dlopen... " >&6; } |
1071 |
@@ -27295,7 +27297,9 @@ fi |
1072 |
|
1073 |
if test x"$ac_cv_search_dlopen" = x"-ldl"; then |
1074 |
pluginlibs="$pluginlibs -ldl" |
1075 |
+ DL_LIB=$ac_cv_search_dlopen |
1076 |
fi |
1077 |
+ |
1078 |
LIBS="$saved_LIBS" |
1079 |
|
1080 |
# Check that we can build shared objects with -fPIC -shared |
1081 |
--- a/gcc/configure.ac |
1082 |
+++ b/gcc/configure.ac |
1083 |
@@ -5109,11 +5109,14 @@ if test x"$enable_plugin" = x"yes"; then |
1084 |
fi |
1085 |
|
1086 |
# Check -ldl |
1087 |
+ DL_LIB= |
1088 |
saved_LIBS="$LIBS" |
1089 |
AC_SEARCH_LIBS([dlopen], [dl]) |
1090 |
if test x"$ac_cv_search_dlopen" = x"-ldl"; then |
1091 |
pluginlibs="$pluginlibs -ldl" |
1092 |
+ DL_LIB=$ac_cv_search_dlopen |
1093 |
fi |
1094 |
+ AC_SUBST(DL_LIB) |
1095 |
LIBS="$saved_LIBS" |
1096 |
|
1097 |
# Check that we can build shared objects with -fPIC -shared |
1098 |
--- a/gcc/graphite-clast-to-gimple.c |
1099 |
+++ b/gcc/graphite-clast-to-gimple.c |
1100 |
@@ -836,7 +836,7 @@ clast_get_body_of_loop (struct clast_stmt *stmt) |
1101 |
from STMT_FOR. */ |
1102 |
|
1103 |
static tree |
1104 |
-type_for_clast_for (struct clast_for *stmt_for, ivs_params_p ip) |
1105 |
+type_for_clast_for (struct clast_for *stmt_fora, ivs_params_p ip) |
1106 |
{ |
1107 |
mpz_t bound_one, bound_two; |
1108 |
tree lb_type, ub_type; |
1109 |
@@ -844,8 +844,8 @@ type_for_clast_for (struct clast_for *stmt_for, ivs_params_p ip) |
1110 |
mpz_init (bound_one); |
1111 |
mpz_init (bound_two); |
1112 |
|
1113 |
- lb_type = type_for_clast_expr (stmt_for->LB, ip, bound_one, bound_two); |
1114 |
- ub_type = type_for_clast_expr (stmt_for->UB, ip, bound_one, bound_two); |
1115 |
+ lb_type = type_for_clast_expr (stmt_fora->LB, ip, bound_one, bound_two); |
1116 |
+ ub_type = type_for_clast_expr (stmt_fora->UB, ip, bound_one, bound_two); |
1117 |
|
1118 |
mpz_clear (bound_one); |
1119 |
mpz_clear (bound_two); |
1120 |
--- a/gcc/graphite-cloog-compat.h |
1121 |
+++ b/gcc/graphite-cloog-compat.h |
1122 |
@@ -272,4 +272,279 @@ static inline int cloog_matrix_nrows (CloogMatrix * m) |
1123 |
return m->NbRows; |
1124 |
} |
1125 |
#endif /* CLOOG_ORG */ |
1126 |
+ |
1127 |
+#include <dlfcn.h> |
1128 |
+#if PPL_VERSION_MAJOR == 0 && PPL_VERSION_MINOR < 11 |
1129 |
+#define DYNSYMS_PPL11 |
1130 |
+#else |
1131 |
+#define DYNSYMS_PPL11 \ |
1132 |
+ DYNSYM (ppl_new_PIP_Problem_from_constraints); \ |
1133 |
+ DYNSYM (ppl_PIP_Problem_is_satisfiable); \ |
1134 |
+ DYNSYM (ppl_delete_PIP_Problem); |
1135 |
+#endif |
1136 |
+#define DYNSYMS \ |
1137 |
+ DYNSYM (cloog_block_alloc); \ |
1138 |
+ DYNSYM (cloog_block_list_free); \ |
1139 |
+ DYNSYM (cloog_block_list_malloc); \ |
1140 |
+ DYNSYM (cloog_clast_create); \ |
1141 |
+ DYNSYM (cloog_clast_free); \ |
1142 |
+ DYNSYM (cloog_domain_free); \ |
1143 |
+ DYNSYM (cloog_domain_matrix2domain); \ |
1144 |
+ DYNSYM (cloog_initialize); \ |
1145 |
+ DYNSYM (cloog_loop_malloc); \ |
1146 |
+ DYNSYM (cloog_matrix_alloc); \ |
1147 |
+ DYNSYM (cloog_matrix_copy); \ |
1148 |
+ DYNSYM (cloog_matrix_free); \ |
1149 |
+ DYNSYM (cloog_matrix_print); \ |
1150 |
+ DYNSYM (cloog_names_malloc); \ |
1151 |
+ DYNSYM (cloog_names_scalarize); \ |
1152 |
+ DYNSYM (cloog_options_free); \ |
1153 |
+ DYNSYM (cloog_options_malloc); \ |
1154 |
+ DYNSYM (cloog_program_dump_cloog); \ |
1155 |
+ DYNSYM (cloog_program_extract_scalars); \ |
1156 |
+ DYNSYM (cloog_program_free); \ |
1157 |
+ DYNSYM (cloog_program_generate); \ |
1158 |
+ DYNSYM (cloog_program_malloc); \ |
1159 |
+ DYNSYM (cloog_program_print); \ |
1160 |
+ DYNSYM (cloog_program_scatter); \ |
1161 |
+ DYNSYM (cloog_statement_alloc); \ |
1162 |
+ DYNSYM (cloog_domain_union); \ |
1163 |
+ DYNSYM (cloog_matrix_read); \ |
1164 |
+ DYNSYM (cloog_new_pol); \ |
1165 |
+ DYNSYM (cloog_vector_gcd); \ |
1166 |
+ DYNSYM (ppl_finalize); \ |
1167 |
+ DYNSYM (ppl_assign_Coefficient_from_mpz_t); \ |
1168 |
+ DYNSYM (ppl_assign_Linear_Expression_from_Linear_Expression); \ |
1169 |
+ DYNSYM (ppl_Coefficient_to_mpz_t); \ |
1170 |
+ DYNSYM (ppl_Constraint_coefficient); \ |
1171 |
+ DYNSYM (ppl_Constraint_inhomogeneous_term); \ |
1172 |
+ DYNSYM (ppl_Constraint_space_dimension); \ |
1173 |
+ DYNSYM (ppl_Constraint_System_begin); \ |
1174 |
+ DYNSYM (ppl_Constraint_System_const_iterator_dereference); \ |
1175 |
+ DYNSYM (ppl_Constraint_System_const_iterator_equal_test); \ |
1176 |
+ DYNSYM (ppl_Constraint_System_const_iterator_increment); \ |
1177 |
+ DYNSYM (ppl_Constraint_System_end); \ |
1178 |
+ DYNSYM (ppl_Constraint_System_insert_Constraint); \ |
1179 |
+ DYNSYM (ppl_Constraint_System_space_dimension); \ |
1180 |
+ DYNSYM (ppl_Constraint_type); \ |
1181 |
+ DYNSYM (ppl_delete_Coefficient); \ |
1182 |
+ DYNSYM (ppl_delete_Constraint); \ |
1183 |
+ DYNSYM (ppl_delete_Constraint_System_const_iterator); \ |
1184 |
+ DYNSYM (ppl_delete_Linear_Expression); \ |
1185 |
+ DYNSYM (ppl_delete_Pointset_Powerset_C_Polyhedron); \ |
1186 |
+ DYNSYM (ppl_delete_Pointset_Powerset_C_Polyhedron_iterator); \ |
1187 |
+ DYNSYM (ppl_delete_Polyhedron); \ |
1188 |
+ DYNSYM (ppl_Linear_Expression_add_to_coefficient); \ |
1189 |
+ DYNSYM (ppl_Linear_Expression_add_to_inhomogeneous); \ |
1190 |
+ DYNSYM (ppl_Linear_Expression_coefficient); \ |
1191 |
+ DYNSYM (ppl_Linear_Expression_inhomogeneous_term); \ |
1192 |
+ DYNSYM (ppl_Linear_Expression_space_dimension); \ |
1193 |
+ DYNSYM (ppl_new_Coefficient); \ |
1194 |
+ DYNSYM (ppl_new_Coefficient_from_mpz_t); \ |
1195 |
+ DYNSYM (ppl_new_Constraint); \ |
1196 |
+ DYNSYM (ppl_new_Constraint_System); \ |
1197 |
+ DYNSYM (ppl_new_Constraint_System_const_iterator); \ |
1198 |
+ DYNSYM (ppl_new_C_Polyhedron_from_C_Polyhedron); \ |
1199 |
+ DYNSYM (ppl_new_C_Polyhedron_from_space_dimension); \ |
1200 |
+ DYNSYM (ppl_new_C_Polyhedron_recycle_Constraint_System); \ |
1201 |
+ DYNSYM (ppl_new_Linear_Expression); \ |
1202 |
+ DYNSYM (ppl_new_Linear_Expression_from_Constraint); \ |
1203 |
+ DYNSYM (ppl_new_Linear_Expression_from_Linear_Expression); \ |
1204 |
+ DYNSYM (ppl_new_Linear_Expression_with_dimension); \ |
1205 |
+ DYNSYM (ppl_new_Pointset_Powerset_C_Polyhedron_from_C_Polyhedron); \ |
1206 |
+ DYNSYM (ppl_new_Pointset_Powerset_C_Polyhedron_from_Pointset_Powerset_C_Polyhedron); \ |
1207 |
+ DYNSYM (ppl_new_Pointset_Powerset_C_Polyhedron_from_space_dimension); \ |
1208 |
+ DYNSYM (ppl_new_Pointset_Powerset_C_Polyhedron_iterator); \ |
1209 |
+ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_add_constraint); \ |
1210 |
+ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_add_space_dimensions_and_embed); \ |
1211 |
+ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_difference_assign); \ |
1212 |
+ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_intersection_assign); \ |
1213 |
+ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_is_empty); \ |
1214 |
+ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_iterator_begin); \ |
1215 |
+ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_iterator_dereference); \ |
1216 |
+ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_iterator_end); \ |
1217 |
+ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_iterator_equal_test); \ |
1218 |
+ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_iterator_increment); \ |
1219 |
+ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_map_space_dimensions); \ |
1220 |
+ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_maximize); \ |
1221 |
+ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_minimize); \ |
1222 |
+ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_remove_space_dimensions); \ |
1223 |
+ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_size); \ |
1224 |
+ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_space_dimension); \ |
1225 |
+ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_upper_bound_assign); \ |
1226 |
+ DYNSYM (ppl_Polyhedron_add_constraint); \ |
1227 |
+ DYNSYM (ppl_Polyhedron_add_constraints); \ |
1228 |
+ DYNSYM (ppl_Polyhedron_add_space_dimensions_and_embed); \ |
1229 |
+ DYNSYM (ppl_Polyhedron_get_constraints); \ |
1230 |
+ DYNSYM (ppl_Polyhedron_map_space_dimensions); \ |
1231 |
+ DYNSYM (ppl_Polyhedron_remove_space_dimensions); \ |
1232 |
+ DYNSYM (ppl_Polyhedron_space_dimension); \ |
1233 |
+ DYNSYM (ppl_subtract_Linear_Expression_from_Linear_Expression); \ |
1234 |
+ DYNSYM (pprint); \ |
1235 |
+ DYNSYM (stmt_block); \ |
1236 |
+ DYNSYM (stmt_for); \ |
1237 |
+ DYNSYM (stmt_guard); \ |
1238 |
+ DYNSYM (stmt_root); \ |
1239 |
+ DYNSYM (stmt_user); \ |
1240 |
+ DYNSYM (stmt_ass); \ |
1241 |
+ DYNSYM (ppl_delete_Constraint_System); \ |
1242 |
+ DYNSYM (ppl_initialize); \ |
1243 |
+ DYNSYM (ppl_new_Constraint_System_from_Constraint); \ |
1244 |
+ DYNSYM (ppl_new_C_Polyhedron_from_Constraint_System); \ |
1245 |
+ DYNSYM (ppl_Polyhedron_affine_image); \ |
1246 |
+ DYNSYM (ppl_io_fprint_Pointset_Powerset_C_Polyhedron); \ |
1247 |
+ DYNSYMS_PPL11 |
1248 |
+extern struct cloog_pointers_s__ |
1249 |
+{ |
1250 |
+ bool inited; |
1251 |
+ void *h; |
1252 |
+#define DYNSYM(x) __typeof (x) *p_##x |
1253 |
+ DYNSYMS |
1254 |
+#undef DYNSYM |
1255 |
+} cloog_pointers__; |
1256 |
+ |
1257 |
+#define cloog_block_alloc (*cloog_pointers__.p_cloog_block_alloc) |
1258 |
+#define cloog_block_list_free (*cloog_pointers__.p_cloog_block_list_free) |
1259 |
+#define cloog_block_list_malloc (*cloog_pointers__.p_cloog_block_list_malloc) |
1260 |
+#define cloog_clast_create (*cloog_pointers__.p_cloog_clast_create) |
1261 |
+#define cloog_clast_free (*cloog_pointers__.p_cloog_clast_free) |
1262 |
+#define cloog_domain_free (*cloog_pointers__.p_cloog_domain_free) |
1263 |
+#define cloog_domain_matrix2domain (*cloog_pointers__.p_cloog_domain_matrix2domain) |
1264 |
+#define cloog_initialize (*cloog_pointers__.p_cloog_initialize) |
1265 |
+#ifndef CLOOG_ORG |
1266 |
+#undef cloog_loop_malloc |
1267 |
+#define cloog_loop_malloc(STATE) (*cloog_pointers__.p_cloog_loop_malloc) () |
1268 |
+#else |
1269 |
+#define cloog_loop_malloc (*cloog_pointers__.p_cloog_loop_malloc) |
1270 |
+#endif |
1271 |
+#define cloog_matrix_alloc (*cloog_pointers__.p_cloog_matrix_alloc) |
1272 |
+#define cloog_matrix_copy (*cloog_pointers__.p_cloog_matrix_copy) |
1273 |
+#define cloog_matrix_free (*cloog_pointers__.p_cloog_matrix_free) |
1274 |
+#define cloog_matrix_print (*cloog_pointers__.p_cloog_matrix_print) |
1275 |
+#define cloog_names_malloc (*cloog_pointers__.p_cloog_names_malloc) |
1276 |
+#define cloog_names_scalarize (*cloog_pointers__.p_cloog_names_scalarize) |
1277 |
+#define cloog_options_free (*cloog_pointers__.p_cloog_options_free) |
1278 |
+#ifndef CLOOG_ORG |
1279 |
+#undef cloog_options_malloc |
1280 |
+#define cloog_options_malloc(STATE) (*cloog_pointers__.p_cloog_options_malloc) () |
1281 |
+#undef cloog_program_dump_cloog |
1282 |
+#define cloog_program_dump_cloog(DUMPFILE, PROGRAM, SCATTERINGLIST) \ |
1283 |
+ (*cloog_pointers__.p_cloog_program_dump_cloog) (DUMPFILE, PROGRAM) |
1284 |
+#undef cloog_program_extract_scalars |
1285 |
+#define cloog_program_extract_scalars(PROG, SCATT, OPT) \ |
1286 |
+ (*cloog_pointers__.p_cloog_program_extract_scalars) (PROG, SCATT) |
1287 |
+#else |
1288 |
+#define cloog_options_malloc (*cloog_pointers__.p_cloog_options_malloc) |
1289 |
+#define cloog_program_dump_cloog (*cloog_pointers__.p_cloog_program_dump_cloog) |
1290 |
+#define cloog_program_extract_scalars (*cloog_pointers__.p_cloog_program_extract_scalars) |
1291 |
+#endif |
1292 |
+#define cloog_program_free (*cloog_pointers__.p_cloog_program_free) |
1293 |
+#define cloog_program_generate (*cloog_pointers__.p_cloog_program_generate) |
1294 |
+#define cloog_program_malloc (*cloog_pointers__.p_cloog_program_malloc) |
1295 |
+#define cloog_program_print (*cloog_pointers__.p_cloog_program_print) |
1296 |
+#ifndef CLOOG_ORG |
1297 |
+#undef cloog_program_scatter |
1298 |
+#define cloog_program_scatter(PROG, SCATT, OPT) \ |
1299 |
+ (*cloog_pointers__.p_cloog_program_scatter) (PROG, SCATT) |
1300 |
+#undef cloog_statement_alloc |
1301 |
+#define cloog_statement_alloc(STATE, INDEX) \ |
1302 |
+ (*cloog_pointers__.p_cloog_statement_alloc) (INDEX) |
1303 |
+#else |
1304 |
+#define cloog_program_scatter (*cloog_pointers__.p_cloog_program_scatter) |
1305 |
+#define cloog_statement_alloc (*cloog_pointers__.p_cloog_statement_alloc) |
1306 |
+#endif |
1307 |
+#define cloog_domain_union (*cloog_pointers__.p_cloog_domain_union) |
1308 |
+#define cloog_matrix_read (*cloog_pointers__.p_cloog_matrix_read) |
1309 |
+#define cloog_new_pol (*cloog_pointers__.p_cloog_new_pol) |
1310 |
+#define cloog_vector_gcd (*cloog_pointers__.p_cloog_vector_gcd) |
1311 |
+#define ppl_finalize (*cloog_pointers__.p_ppl_finalize) |
1312 |
+#define ppl_assign_Coefficient_from_mpz_t (*cloog_pointers__.p_ppl_assign_Coefficient_from_mpz_t) |
1313 |
+#define ppl_assign_Linear_Expression_from_Linear_Expression (*cloog_pointers__.p_ppl_assign_Linear_Expression_from_Linear_Expression) |
1314 |
+#define ppl_Coefficient_to_mpz_t (*cloog_pointers__.p_ppl_Coefficient_to_mpz_t) |
1315 |
+#define ppl_Constraint_coefficient (*cloog_pointers__.p_ppl_Constraint_coefficient) |
1316 |
+#define ppl_Constraint_inhomogeneous_term (*cloog_pointers__.p_ppl_Constraint_inhomogeneous_term) |
1317 |
+#define ppl_Constraint_space_dimension (*cloog_pointers__.p_ppl_Constraint_space_dimension) |
1318 |
+#define ppl_Constraint_System_begin (*cloog_pointers__.p_ppl_Constraint_System_begin) |
1319 |
+#define ppl_Constraint_System_const_iterator_dereference (*cloog_pointers__.p_ppl_Constraint_System_const_iterator_dereference) |
1320 |
+#define ppl_Constraint_System_const_iterator_equal_test (*cloog_pointers__.p_ppl_Constraint_System_const_iterator_equal_test) |
1321 |
+#define ppl_Constraint_System_const_iterator_increment (*cloog_pointers__.p_ppl_Constraint_System_const_iterator_increment) |
1322 |
+#define ppl_Constraint_System_end (*cloog_pointers__.p_ppl_Constraint_System_end) |
1323 |
+#define ppl_Constraint_System_insert_Constraint (*cloog_pointers__.p_ppl_Constraint_System_insert_Constraint) |
1324 |
+#define ppl_Constraint_System_space_dimension (*cloog_pointers__.p_ppl_Constraint_System_space_dimension) |
1325 |
+#define ppl_Constraint_type (*cloog_pointers__.p_ppl_Constraint_type) |
1326 |
+#define ppl_delete_Coefficient (*cloog_pointers__.p_ppl_delete_Coefficient) |
1327 |
+#define ppl_delete_Constraint (*cloog_pointers__.p_ppl_delete_Constraint) |
1328 |
+#define ppl_delete_Constraint_System_const_iterator (*cloog_pointers__.p_ppl_delete_Constraint_System_const_iterator) |
1329 |
+#define ppl_delete_Linear_Expression (*cloog_pointers__.p_ppl_delete_Linear_Expression) |
1330 |
+#define ppl_delete_Pointset_Powerset_C_Polyhedron (*cloog_pointers__.p_ppl_delete_Pointset_Powerset_C_Polyhedron) |
1331 |
+#define ppl_delete_Pointset_Powerset_C_Polyhedron_iterator (*cloog_pointers__.p_ppl_delete_Pointset_Powerset_C_Polyhedron_iterator) |
1332 |
+#define ppl_delete_Polyhedron (*cloog_pointers__.p_ppl_delete_Polyhedron) |
1333 |
+#define ppl_Linear_Expression_add_to_coefficient (*cloog_pointers__.p_ppl_Linear_Expression_add_to_coefficient) |
1334 |
+#define ppl_Linear_Expression_add_to_inhomogeneous (*cloog_pointers__.p_ppl_Linear_Expression_add_to_inhomogeneous) |
1335 |
+#define ppl_Linear_Expression_coefficient (*cloog_pointers__.p_ppl_Linear_Expression_coefficient) |
1336 |
+#define ppl_Linear_Expression_inhomogeneous_term (*cloog_pointers__.p_ppl_Linear_Expression_inhomogeneous_term) |
1337 |
+#define ppl_Linear_Expression_space_dimension (*cloog_pointers__.p_ppl_Linear_Expression_space_dimension) |
1338 |
+#define ppl_new_Coefficient (*cloog_pointers__.p_ppl_new_Coefficient) |
1339 |
+#define ppl_new_Coefficient_from_mpz_t (*cloog_pointers__.p_ppl_new_Coefficient_from_mpz_t) |
1340 |
+#define ppl_new_Constraint (*cloog_pointers__.p_ppl_new_Constraint) |
1341 |
+#define ppl_new_Constraint_System (*cloog_pointers__.p_ppl_new_Constraint_System) |
1342 |
+#define ppl_new_Constraint_System_const_iterator (*cloog_pointers__.p_ppl_new_Constraint_System_const_iterator) |
1343 |
+#define ppl_new_C_Polyhedron_from_C_Polyhedron (*cloog_pointers__.p_ppl_new_C_Polyhedron_from_C_Polyhedron) |
1344 |
+#define ppl_new_C_Polyhedron_from_space_dimension (*cloog_pointers__.p_ppl_new_C_Polyhedron_from_space_dimension) |
1345 |
+#define ppl_new_C_Polyhedron_recycle_Constraint_System (*cloog_pointers__.p_ppl_new_C_Polyhedron_recycle_Constraint_System) |
1346 |
+#define ppl_new_Linear_Expression (*cloog_pointers__.p_ppl_new_Linear_Expression) |
1347 |
+#define ppl_new_Linear_Expression_from_Constraint (*cloog_pointers__.p_ppl_new_Linear_Expression_from_Constraint) |
1348 |
+#define ppl_new_Linear_Expression_from_Linear_Expression (*cloog_pointers__.p_ppl_new_Linear_Expression_from_Linear_Expression) |
1349 |
+#define ppl_new_Linear_Expression_with_dimension (*cloog_pointers__.p_ppl_new_Linear_Expression_with_dimension) |
1350 |
+#define ppl_new_Pointset_Powerset_C_Polyhedron_from_C_Polyhedron (*cloog_pointers__.p_ppl_new_Pointset_Powerset_C_Polyhedron_from_C_Polyhedron) |
1351 |
+#define ppl_new_Pointset_Powerset_C_Polyhedron_from_Pointset_Powerset_C_Polyhedron (*cloog_pointers__.p_ppl_new_Pointset_Powerset_C_Polyhedron_from_Pointset_Powerset_C_Polyhedron) |
1352 |
+#define ppl_new_Pointset_Powerset_C_Polyhedron_from_space_dimension (*cloog_pointers__.p_ppl_new_Pointset_Powerset_C_Polyhedron_from_space_dimension) |
1353 |
+#define ppl_new_Pointset_Powerset_C_Polyhedron_iterator (*cloog_pointers__.p_ppl_new_Pointset_Powerset_C_Polyhedron_iterator) |
1354 |
+#define ppl_Pointset_Powerset_C_Polyhedron_add_constraint (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_add_constraint) |
1355 |
+#define ppl_Pointset_Powerset_C_Polyhedron_add_space_dimensions_and_embed (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_add_space_dimensions_and_embed) |
1356 |
+#define ppl_Pointset_Powerset_C_Polyhedron_difference_assign (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_difference_assign) |
1357 |
+#define ppl_Pointset_Powerset_C_Polyhedron_intersection_assign (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_intersection_assign) |
1358 |
+#define ppl_Pointset_Powerset_C_Polyhedron_is_empty (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_is_empty) |
1359 |
+#define ppl_Pointset_Powerset_C_Polyhedron_iterator_begin (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_iterator_begin) |
1360 |
+#define ppl_Pointset_Powerset_C_Polyhedron_iterator_dereference (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_iterator_dereference) |
1361 |
+#define ppl_Pointset_Powerset_C_Polyhedron_iterator_end (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_iterator_end) |
1362 |
+#define ppl_Pointset_Powerset_C_Polyhedron_iterator_equal_test (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_iterator_equal_test) |
1363 |
+#define ppl_Pointset_Powerset_C_Polyhedron_iterator_increment (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_iterator_increment) |
1364 |
+#define ppl_Pointset_Powerset_C_Polyhedron_map_space_dimensions (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_map_space_dimensions) |
1365 |
+#define ppl_Pointset_Powerset_C_Polyhedron_maximize (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_maximize) |
1366 |
+#define ppl_Pointset_Powerset_C_Polyhedron_minimize (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_minimize) |
1367 |
+#define ppl_Pointset_Powerset_C_Polyhedron_remove_space_dimensions (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_remove_space_dimensions) |
1368 |
+#define ppl_Pointset_Powerset_C_Polyhedron_size (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_size) |
1369 |
+#define ppl_Pointset_Powerset_C_Polyhedron_space_dimension (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_space_dimension) |
1370 |
+#define ppl_Pointset_Powerset_C_Polyhedron_upper_bound_assign (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_upper_bound_assign) |
1371 |
+#define ppl_Polyhedron_add_constraint (*cloog_pointers__.p_ppl_Polyhedron_add_constraint) |
1372 |
+#define ppl_Polyhedron_add_constraints (*cloog_pointers__.p_ppl_Polyhedron_add_constraints) |
1373 |
+#define ppl_Polyhedron_add_space_dimensions_and_embed (*cloog_pointers__.p_ppl_Polyhedron_add_space_dimensions_and_embed) |
1374 |
+#define ppl_Polyhedron_get_constraints (*cloog_pointers__.p_ppl_Polyhedron_get_constraints) |
1375 |
+#define ppl_Polyhedron_map_space_dimensions (*cloog_pointers__.p_ppl_Polyhedron_map_space_dimensions) |
1376 |
+#define ppl_Polyhedron_remove_space_dimensions (*cloog_pointers__.p_ppl_Polyhedron_remove_space_dimensions) |
1377 |
+#define ppl_Polyhedron_space_dimension (*cloog_pointers__.p_ppl_Polyhedron_space_dimension) |
1378 |
+#define ppl_subtract_Linear_Expression_from_Linear_Expression (*cloog_pointers__.p_ppl_subtract_Linear_Expression_from_Linear_Expression) |
1379 |
+#define pprint (*cloog_pointers__.p_pprint) |
1380 |
+#define stmt_block (*cloog_pointers__.p_stmt_block) |
1381 |
+#define stmt_for (*cloog_pointers__.p_stmt_for) |
1382 |
+#define stmt_guard (*cloog_pointers__.p_stmt_guard) |
1383 |
+#define stmt_root (*cloog_pointers__.p_stmt_root) |
1384 |
+#define stmt_user (*cloog_pointers__.p_stmt_user) |
1385 |
+#define stmt_ass (*cloog_pointers__.p_stmt_ass) |
1386 |
+#define ppl_delete_Constraint_System (*cloog_pointers__.p_ppl_delete_Constraint_System) |
1387 |
+#define ppl_initialize (*cloog_pointers__.p_ppl_initialize) |
1388 |
+#define ppl_new_Constraint_System_from_Constraint (*cloog_pointers__.p_ppl_new_Constraint_System_from_Constraint) |
1389 |
+#define ppl_new_C_Polyhedron_from_Constraint_System (*cloog_pointers__.p_ppl_new_C_Polyhedron_from_Constraint_System) |
1390 |
+#define ppl_Polyhedron_affine_image (*cloog_pointers__.p_ppl_Polyhedron_affine_image) |
1391 |
+#define ppl_io_fprint_Pointset_Powerset_C_Polyhedron (*cloog_pointers__.p_ppl_io_fprint_Pointset_Powerset_C_Polyhedron) |
1392 |
+#if !(PPL_VERSION_MAJOR == 0 && PPL_VERSION_MINOR < 11) |
1393 |
+#define ppl_new_PIP_Problem_from_constraints (*cloog_pointers__.p_ppl_new_PIP_Problem_from_constraints) |
1394 |
+#define ppl_PIP_Problem_is_satisfiable (*cloog_pointers__.p_ppl_PIP_Problem_is_satisfiable) |
1395 |
+#define ppl_delete_PIP_Problem (*cloog_pointers__.p_ppl_delete_PIP_Problem) |
1396 |
+#endif |
1397 |
+ |
1398 |
+#define cloog_finalize (*cloog_pointers__.p_ppl_finalize) |
1399 |
+ |
1400 |
+ |
1401 |
#endif /* GRAPHITE_CLOOG_COMPAT_H */ |
1402 |
--- a/gcc/graphite-poly.h |
1403 |
+++ b/gcc/graphite-poly.h |
1404 |
@@ -22,6 +22,8 @@ along with GCC; see the file COPYING3. If not see |
1405 |
#ifndef GCC_GRAPHITE_POLY_H |
1406 |
#define GCC_GRAPHITE_POLY_H |
1407 |
|
1408 |
+#include "graphite-cloog-util.h" |
1409 |
+ |
1410 |
typedef struct poly_dr *poly_dr_p; |
1411 |
DEF_VEC_P(poly_dr_p); |
1412 |
DEF_VEC_ALLOC_P (poly_dr_p, heap); |
1413 |
--- a/gcc/graphite.c |
1414 |
+++ b/gcc/graphite.c |
1415 |
@@ -56,6 +56,35 @@ along with GCC; see the file COPYING3. If not see |
1416 |
|
1417 |
CloogState *cloog_state; |
1418 |
|
1419 |
+__typeof (cloog_pointers__) cloog_pointers__; |
1420 |
+ |
1421 |
+static bool |
1422 |
+init_cloog_pointers (void) |
1423 |
+{ |
1424 |
+ void *h; |
1425 |
+ |
1426 |
+ if (cloog_pointers__.inited) |
1427 |
+ return cloog_pointers__.h != NULL; |
1428 |
+ h = dlopen ("libcloog.so.0", RTLD_LAZY); |
1429 |
+ cloog_pointers__.h = h; |
1430 |
+ if (h == NULL) |
1431 |
+ return false; |
1432 |
+#define DYNSYM(x) \ |
1433 |
+ do \ |
1434 |
+ { \ |
1435 |
+ union { __typeof (cloog_pointers__.p_##x) p; void *q; } u; \ |
1436 |
+ u.q = dlsym (h, #x); \ |
1437 |
+ if (u.q == NULL) \ |
1438 |
+ return false; \ |
1439 |
+ cloog_pointers__.p_##x = u.p; \ |
1440 |
+ } \ |
1441 |
+ while (0) |
1442 |
+ DYNSYMS |
1443 |
+#undef DYNSYM |
1444 |
+ return true; |
1445 |
+} |
1446 |
+ |
1447 |
+ |
1448 |
/* Print global statistics to FILE. */ |
1449 |
|
1450 |
static void |
1451 |
@@ -201,6 +230,12 @@ graphite_initialize (void) |
1452 |
return false; |
1453 |
} |
1454 |
|
1455 |
+ if (!init_cloog_pointers ()) |
1456 |
+ { |
1457 |
+ sorry ("Graphite loop optimizations cannot be used"); |
1458 |
+ return false; |
1459 |
+ } |
1460 |
+ |
1461 |
scev_reset (); |
1462 |
recompute_all_dominators (); |
1463 |
initialize_original_copy_tables (); |
1464 |
|
1465 |
|
1466 |
|
1467 |
1.1 src/patchsets/gcc/4.7.2/gentoo/90_all_gcc-4.7-x32.patch |
1468 |
|
1469 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.2/gentoo/90_all_gcc-4.7-x32.patch?rev=1.1&view=markup |
1470 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.2/gentoo/90_all_gcc-4.7-x32.patch?rev=1.1&content-type=text/plain |
1471 |
|
1472 |
Index: 90_all_gcc-4.7-x32.patch |
1473 |
=================================================================== |
1474 |
git diff -p 475e5d65b13bfb798ff1f2c45ab46619ab050283^..remotes/origin/hjl/x32/gcc-4_7-branch |
1475 |
|
1476 |
--- a/boehm-gc/configure |
1477 |
+++ b/boehm-gc/configure |
1478 |
@@ -6786,7 +6786,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) |
1479 |
LD="${LD-ld} -m elf_i386_fbsd" |
1480 |
;; |
1481 |
x86_64-*linux*) |
1482 |
- LD="${LD-ld} -m elf_i386" |
1483 |
+ case `/usr/bin/file conftest.o` in |
1484 |
+ *x86-64*) |
1485 |
+ LD="${LD-ld} -m elf32_x86_64" |
1486 |
+ ;; |
1487 |
+ *) |
1488 |
+ LD="${LD-ld} -m elf_i386" |
1489 |
+ ;; |
1490 |
+ esac |
1491 |
;; |
1492 |
ppc64-*linux*|powerpc64-*linux*) |
1493 |
LD="${LD-ld} -m elf32ppclinux" |
1494 |
--- a/boehm-gc/include/private/gcconfig.h |
1495 |
+++ b/boehm-gc/include/private/gcconfig.h |
1496 |
@@ -1974,8 +1974,13 @@ |
1497 |
|
1498 |
# ifdef X86_64 |
1499 |
# define MACH_TYPE "X86_64" |
1500 |
-# define ALIGNMENT 8 |
1501 |
-# define CPP_WORDSZ 64 |
1502 |
+# ifdef __ILP32__ |
1503 |
+# define ALIGNMENT 4 |
1504 |
+# define CPP_WORDSZ 32 |
1505 |
+# else |
1506 |
+# define ALIGNMENT 8 |
1507 |
+# define CPP_WORDSZ 64 |
1508 |
+# endif |
1509 |
# ifndef HBLKSIZE |
1510 |
# define HBLKSIZE 4096 |
1511 |
# endif |
1512 |
--- a/gcc/ada/gcc-interface/Makefile.in |
1513 |
+++ b/gcc/ada/gcc-interface/Makefile.in |
1514 |
@@ -349,6 +349,10 @@ GNATMAKE_OBJS = a-except.o ali.o ali-util.o aspects.o s-casuti.o alloc.o \ |
1515 |
ifeq ($(strip $(filter-out %x86_64, $(arch))),) |
1516 |
ifeq ($(strip $(MULTISUBDIR)),/32) |
1517 |
arch:=i686 |
1518 |
+ else |
1519 |
+ ifeq ($(strip $(MULTISUBDIR)),/x32) |
1520 |
+ arch:=x32 |
1521 |
+ endif |
1522 |
endif |
1523 |
endif |
1524 |
|
1525 |
@@ -2131,6 +2135,43 @@ ifeq ($(strip $(filter-out %x86_64 linux%,$(arch) $(osys))),) |
1526 |
LIBRARY_VERSION := $(LIB_VERSION) |
1527 |
endif |
1528 |
|
1529 |
+ifeq ($(strip $(filter-out %x32 linux%,$(arch) $(osys))),) |
1530 |
+ LIBGNAT_TARGET_PAIRS = \ |
1531 |
+ a-exetim.adb<a-exetim-posix.adb \ |
1532 |
+ a-exetim.ads<a-exetim-default.ads \ |
1533 |
+ a-intnam.ads<a-intnam-linux.ads \ |
1534 |
+ a-synbar.adb<a-synbar-posix.adb \ |
1535 |
+ a-synbar.ads<a-synbar-posix.ads \ |
1536 |
+ s-inmaop.adb<s-inmaop-posix.adb \ |
1537 |
+ s-intman.adb<s-intman-posix.adb \ |
1538 |
+ s-linux.ads<s-linux.ads \ |
1539 |
+ s-mudido.adb<s-mudido-affinity.adb \ |
1540 |
+ s-osinte.ads<s-osinte-linux.ads \ |
1541 |
+ s-osinte.adb<s-osinte-posix.adb \ |
1542 |
+ s-osprim.adb<s-osprim-posix.adb \ |
1543 |
+ s-taprop.adb<s-taprop-linux.adb \ |
1544 |
+ s-tasinf.ads<s-tasinf-linux.ads \ |
1545 |
+ s-tasinf.adb<s-tasinf-linux.adb \ |
1546 |
+ s-tpopsp.adb<s-tpopsp-tls.adb \ |
1547 |
+ s-taspri.ads<s-taspri-posix.ads \ |
1548 |
+ g-sercom.adb<g-sercom-linux.adb \ |
1549 |
+ $(ATOMICS_TARGET_PAIRS) \ |
1550 |
+ $(X86_64_TARGET_PAIRS) \ |
1551 |
+ system.ads<system-linux-x86.ads |
1552 |
+ |
1553 |
+ TOOLS_TARGET_PAIRS = \ |
1554 |
+ mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \ |
1555 |
+ indepsw.adb<indepsw-gnu.adb |
1556 |
+ |
1557 |
+ EXTRA_GNATRTL_NONTASKING_OBJS=g-sse.o g-ssvety.o |
1558 |
+ EXTRA_GNATRTL_TASKING_OBJS=s-linux.o a-exetim.o |
1559 |
+ EH_MECHANISM=-gcc |
1560 |
+ THREADSLIB=-lpthread -lrt |
1561 |
+ GNATLIB_SHARED=gnatlib-shared-dual |
1562 |
+ GMEM_LIB = gmemlib |
1563 |
+ LIBRARY_VERSION := $(LIB_VERSION) |
1564 |
+endif |
1565 |
+ |
1566 |
ifeq ($(strip $(filter-out darwin%,$(osys))),) |
1567 |
SO_OPTS = -shared-libgcc |
1568 |
LIBGNAT_TARGET_PAIRS = \ |
1569 |
--- a/gcc/ada/init.c |
1570 |
+++ b/gcc/ada/init.c |
1571 |
@@ -615,9 +615,13 @@ __gnat_adjust_context_for_raise (int signo ATTRIBUTE_UNUSED, void *ucontext) |
1572 |
if (signo == SIGSEGV && pc && *pc == 0x00240c83) |
1573 |
mcontext->gregs[REG_ESP] += 4096 + 4 * sizeof (unsigned long); |
1574 |
#elif defined (__x86_64__) |
1575 |
- unsigned long *pc = (unsigned long *)mcontext->gregs[REG_RIP]; |
1576 |
- /* The pattern is "orq $0x0,(%rsp)" for a probe in 64-bit mode. */ |
1577 |
- if (signo == SIGSEGV && pc && (*pc & 0xffffffffff) == 0x00240c8348) |
1578 |
+ unsigned long long *pc = (unsigned long long *)mcontext->gregs[REG_RIP]; |
1579 |
+ if (signo == SIGSEGV && pc |
1580 |
+ /* The pattern is "orq $0x0,(%rsp)" for a probe in 64-bit mode. */ |
1581 |
+ && ((*pc & 0xffffffffffLL) == 0x00240c8348LL |
1582 |
+ /* The pattern may also be "orl $0x0,(%esp)" for a probe in |
1583 |
+ x32 mode. */ |
1584 |
+ || (*pc & 0xffffffffLL) == 0x00240c83LL)) |
1585 |
mcontext->gregs[REG_RSP] += 4096 + 4 * sizeof (unsigned long); |
1586 |
#elif defined (__ia64__) |
1587 |
/* ??? The IA-64 unwinder doesn't compensate for signals. */ |
1588 |
--- a/gcc/ada/link.c |
1589 |
+++ b/gcc/ada/link.c |
1590 |
@@ -187,7 +187,11 @@ unsigned char __gnat_using_gnu_linker = 1; |
1591 |
const char *__gnat_object_library_extension = ".a"; |
1592 |
unsigned char __gnat_separate_run_path_options = 0; |
1593 |
#if defined (__x86_64) |
1594 |
+# if defined (__LP64__) |
1595 |
const char *__gnat_default_libgcc_subdir = "lib64"; |
1596 |
+# else |
1597 |
+const char *__gnat_default_libgcc_subdir = "libx32"; |
1598 |
+# endif |
1599 |
#else |
1600 |
const char *__gnat_default_libgcc_subdir = "lib"; |
1601 |
#endif |
1602 |
--- a/gcc/config.gcc |
1603 |
+++ b/gcc/config.gcc |
1604 |
@@ -486,6 +486,10 @@ fi |
1605 |
|
1606 |
case ${target} in |
1607 |
i[34567]86-*-*) |
1608 |
+ if test "x$with_abi" != x; then |
1609 |
+ echo "This target does not support --with-abi." |
1610 |
+ exit 1 |
1611 |
+ fi |
1612 |
if test "x$enable_cld" = xyes; then |
1613 |
tm_defines="${tm_defines} USE_IX86_CLD=1" |
1614 |
fi |
1615 |
@@ -495,7 +499,24 @@ i[34567]86-*-*) |
1616 |
tm_file="vxworks-dummy.h ${tm_file}" |
1617 |
;; |
1618 |
x86_64-*-*) |
1619 |
- tm_file="i386/biarch64.h ${tm_file}" |
1620 |
+ case ${with_abi} in |
1621 |
+ "") |
1622 |
+ if test "x$with_multilib_list" = xmx32; then |
1623 |
+ tm_file="i386/biarchx32.h ${tm_file}" |
1624 |
+ else |
1625 |
+ tm_file="i386/biarch64.h ${tm_file}" |
1626 |
+ fi |
1627 |
+ ;; |
1628 |
+ 64 | m64) |
1629 |
+ tm_file="i386/biarch64.h ${tm_file}" |
1630 |
+ ;; |
1631 |
+ x32 | mx32) |
1632 |
+ tm_file="i386/biarchx32.h ${tm_file}" |
1633 |
+ ;; |
1634 |
+ *) |
1635 |
+ echo "Unknown ABI used in --with-abi=$with_abi" |
1636 |
+ exit 1 |
1637 |
+ esac |
1638 |
if test "x$enable_cld" = xyes; then |
1639 |
tm_defines="${tm_defines} USE_IX86_CLD=1" |
1640 |
fi |
1641 |
@@ -3201,7 +3222,7 @@ case "${target}" in |
1642 |
;; |
1643 |
|
1644 |
i[34567]86-*-* | x86_64-*-*) |
1645 |
- supported_defaults="arch arch_32 arch_64 cpu cpu_32 cpu_64 tune tune_32 tune_64" |
1646 |
+ supported_defaults="abi arch arch_32 arch_64 cpu cpu_32 cpu_64 tune tune_32 tune_64" |
1647 |
for which in arch arch_32 arch_64 cpu cpu_32 cpu_64 tune tune_32 tune_64; do |
1648 |
eval "val=\$with_$which" |
1649 |
case ${val} in |
1650 |
--- a/gcc/config/arm/arm.opt |
1651 |
+++ b/gcc/config/arm/arm.opt |
1652 |
@@ -59,7 +59,7 @@ Target Report Mask(ABORT_NORETURN) |
1653 |
Generate a call to abort if a noreturn function returns |
1654 |
|
1655 |
mapcs |
1656 |
-Target RejectNegative Mask(APCS_FRAME) MaskExists Undocumented |
1657 |
+Target RejectNegative Mask(APCS_FRAME) Undocumented |
1658 |
|
1659 |
mapcs-float |
1660 |
Target Report Mask(APCS_FLOAT) |
1661 |
--- a/gcc/config/cris/linux.opt |
1662 |
+++ b/gcc/config/cris/linux.opt |
1663 |
@@ -23,7 +23,7 @@ mlinux |
1664 |
Target Report RejectNegative Undocumented |
1665 |
|
1666 |
mno-gotplt |
1667 |
-Target Report RejectNegative Mask(AVOID_GOTPLT) MaskExists |
1668 |
+Target Report RejectNegative Mask(AVOID_GOTPLT) |
1669 |
Together with -fpic and -fPIC, do not use GOTPLT references |
1670 |
|
1671 |
; There's a small added setup cost with using GOTPLT references |
1672 |
--- a/gcc/config/host-linux.c |
1673 |
+++ b/gcc/config/host-linux.c |
1674 |
@@ -68,8 +68,10 @@ |
1675 |
# define TRY_EMPTY_VM_SPACE 0x10000000000 |
1676 |
#elif defined(__ia64) |
1677 |
# define TRY_EMPTY_VM_SPACE 0x2000000100000000 |
1678 |
-#elif defined(__x86_64) |
1679 |
+#elif defined(__x86_64) && defined(__LP64__) |
1680 |
# define TRY_EMPTY_VM_SPACE 0x1000000000 |
1681 |
+#elif defined(__x86_64) |
1682 |
+# define TRY_EMPTY_VM_SPACE 0x60000000 |
1683 |
#elif defined(__i386) |
1684 |
# define TRY_EMPTY_VM_SPACE 0x60000000 |
1685 |
#elif defined(__powerpc__) |
1686 |
--- a/gcc/config/i386/biarch64.h |
1687 |
+++ b/gcc/config/i386/biarch64.h |
1688 |
@@ -25,5 +25,5 @@ a copy of the GCC Runtime Library Exception along with this program; |
1689 |
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see |
1690 |
<http://www.gnu.org/licenses/>. */ |
1691 |
|
1692 |
-#define TARGET_64BIT_DEFAULT OPTION_MASK_ISA_64BIT |
1693 |
+#define TARGET_64BIT_DEFAULT (OPTION_MASK_ISA_64BIT | OPTION_MASK_ABI_64) |
1694 |
#define TARGET_BI_ARCH 1 |
1695 |
--- /dev/null |
1696 |
+++ b/gcc/config/i386/biarchx32.h |
1697 |
@@ -0,0 +1,28 @@ |
1698 |
+/* Make configure files to produce biarch compiler defaulting to x32 mode. |
1699 |
+ This file must be included very first, while the OS specific file later |
1700 |
+ to overwrite otherwise wrong defaults. |
1701 |
+ Copyright (C) 2012 Free Software Foundation, Inc. |
1702 |
+ |
1703 |
+This file is part of GCC. |
1704 |
+ |
1705 |
+GCC is free software; you can redistribute it and/or modify |
1706 |
+it under the terms of the GNU General Public License as published by |
1707 |
+the Free Software Foundation; either version 3, or (at your option) |
1708 |
+any later version. |
1709 |
+ |
1710 |
+GCC is distributed in the hope that it will be useful, |
1711 |
+but WITHOUT ANY WARRANTY; without even the implied warranty of |
1712 |
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1713 |
+GNU General Public License for more details. |
1714 |
+ |
1715 |
+Under Section 7 of GPL version 3, you are granted additional |
1716 |
+permissions described in the GCC Runtime Library Exception, version |
1717 |
+3.1, as published by the Free Software Foundation. |
1718 |
+ |
1719 |
+You should have received a copy of the GNU General Public License and |
1720 |
+a copy of the GCC Runtime Library Exception along with this program; |
1721 |
+see the files COPYING3 and COPYING.RUNTIME respectively. If not, see |
1722 |
+<http://www.gnu.org/licenses/>. */ |
1723 |
+ |
1724 |
+#define TARGET_64BIT_DEFAULT (OPTION_MASK_ISA_64BIT | OPTION_MASK_ABI_X32) |
1725 |
+#define TARGET_BI_ARCH 2 |
1726 |
--- a/gcc/config/i386/constraints.md |
1727 |
+++ b/gcc/config/i386/constraints.md |
1728 |
@@ -18,7 +18,7 @@ |
1729 |
;; <http://www.gnu.org/licenses/>. |
1730 |
|
1731 |
;;; Unused letters: |
1732 |
-;;; B H T W |
1733 |
+;;; B H T |
1734 |
;;; h k v |
1735 |
|
1736 |
;; Integer register constraints. |
1737 |
@@ -193,6 +193,16 @@ |
1738 |
instructions)." |
1739 |
(match_operand 0 "x86_64_immediate_operand")) |
1740 |
|
1741 |
+;; We use W prefix to denote any number of |
1742 |
+;; constant-or-symbol-reference constraints |
1743 |
+ |
1744 |
+(define_constraint "Wz" |
1745 |
+ "32-bit unsigned integer constant, or a symbolic reference known |
1746 |
+ to fit that range (for zero-extending conversion operations that |
1747 |
+ require non-VOIDmode immediate operands)." |
1748 |
+ (and (match_operand 0 "x86_64_zext_immediate_operand") |
1749 |
+ (match_test "GET_MODE (op) != VOIDmode"))) |
1750 |
+ |
1751 |
(define_constraint "Z" |
1752 |
"32-bit unsigned integer constant, or a symbolic reference known |
1753 |
to fit that range (for immediate operands in zero-extending x86-64 |
1754 |
--- a/gcc/config/i386/gnu-user64.h |
1755 |
+++ b/gcc/config/i386/gnu-user64.h |
1756 |
@@ -58,8 +58,13 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see |
1757 |
|
1758 |
#if TARGET_64BIT_DEFAULT |
1759 |
#define SPEC_32 "m32" |
1760 |
+#if TARGET_BI_ARCH == 2 |
1761 |
+#define SPEC_64 "m64" |
1762 |
+#define SPEC_X32 "m32|m64:;" |
1763 |
+#else |
1764 |
#define SPEC_64 "m32|mx32:;" |
1765 |
#define SPEC_X32 "mx32" |
1766 |
+#endif |
1767 |
#else |
1768 |
#define SPEC_32 "m64|mx32:;" |
1769 |
#define SPEC_64 "m64" |
1770 |
@@ -95,7 +100,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see |
1771 |
%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s" |
1772 |
|
1773 |
#if TARGET_64BIT_DEFAULT |
1774 |
+#if TARGET_BI_ARCH == 2 |
1775 |
+#define MULTILIB_DEFAULTS { "mx32" } |
1776 |
+#else |
1777 |
#define MULTILIB_DEFAULTS { "m64" } |
1778 |
+#endif |
1779 |
#else |
1780 |
#define MULTILIB_DEFAULTS { "m32" } |
1781 |
#endif |
1782 |
--- a/gcc/config/i386/i386-opts.h |
1783 |
+++ b/gcc/config/i386/i386-opts.h |
1784 |
@@ -71,6 +71,11 @@ enum cmodel { |
1785 |
CM_LARGE_PIC /* No assumptions. */ |
1786 |
}; |
1787 |
|
1788 |
+enum pmode { |
1789 |
+ PMODE_SI, /* Pmode == SImode. */ |
1790 |
+ PMODE_DI /* Pmode == DImode. */ |
1791 |
+}; |
1792 |
+ |
1793 |
enum asm_dialect { |
1794 |
ASM_ATT, |
1795 |
ASM_INTEL |
1796 |
--- a/gcc/config/i386/i386.c |
1797 |
+++ b/gcc/config/i386/i386.c |
1798 |
@@ -2445,6 +2445,8 @@ static rtx (*ix86_gen_andsp) (rtx, rtx, rtx); |
1799 |
static rtx (*ix86_gen_allocate_stack_worker) (rtx, rtx); |
1800 |
static rtx (*ix86_gen_adjust_stack_and_probe) (rtx, rtx, rtx); |
1801 |
static rtx (*ix86_gen_probe_stack_range) (rtx, rtx, rtx); |
1802 |
+static rtx (*ix86_gen_tls_global_dynamic_64) (rtx, rtx, rtx); |
1803 |
+static rtx (*ix86_gen_tls_local_dynamic_base_64) (rtx, rtx); |
1804 |
|
1805 |
/* Preferred alignment for stack boundary in bits. */ |
1806 |
unsigned int ix86_preferred_stack_boundary; |
1807 |
@@ -2655,7 +2657,6 @@ ix86_target_string (HOST_WIDE_INT isa, int flags, const char *arch, |
1808 |
preceding options while match those first. */ |
1809 |
static struct ix86_target_opts isa_opts[] = |
1810 |
{ |
1811 |
- { "-m64", OPTION_MASK_ISA_64BIT }, |
1812 |
{ "-mfma4", OPTION_MASK_ISA_FMA4 }, |
1813 |
{ "-mfma", OPTION_MASK_ISA_FMA }, |
1814 |
{ "-mxop", OPTION_MASK_ISA_XOP }, |
1815 |
@@ -2727,6 +2728,7 @@ ix86_target_string (HOST_WIDE_INT isa, int flags, const char *arch, |
1816 |
size_t len; |
1817 |
size_t line_len; |
1818 |
size_t sep_len; |
1819 |
+ const char *abi; |
1820 |
|
1821 |
memset (opts, '\0', sizeof (opts)); |
1822 |
|
1823 |
@@ -2744,6 +2746,21 @@ ix86_target_string (HOST_WIDE_INT isa, int flags, const char *arch, |
1824 |
opts[num++][1] = tune; |
1825 |
} |
1826 |
|
1827 |
+ /* Add -m32/-m64/-mx32. */ |
1828 |
+ if ((isa & OPTION_MASK_ISA_64BIT) != 0) |
1829 |
+ { |
1830 |
+ if ((isa & OPTION_MASK_ABI_64) != 0) |
1831 |
+ abi = "-m64"; |
1832 |
+ else |
1833 |
+ abi = "-mx32"; |
1834 |
+ isa &= ~ (OPTION_MASK_ISA_64BIT |
1835 |
+ | OPTION_MASK_ABI_64 |
1836 |
+ | OPTION_MASK_ABI_X32); |
1837 |
+ } |
1838 |
+ else |
1839 |
+ abi = "-m32"; |
1840 |
+ opts[num++][0] = abi; |
1841 |
+ |
1842 |
/* Pick out the options in isa options. */ |
1843 |
for (i = 0; i < ARRAY_SIZE (isa_opts); i++) |
1844 |
{ |
1845 |
@@ -3090,6 +3107,46 @@ ix86_option_override_internal (bool main_args_p) |
1846 |
sw = "attribute"; |
1847 |
} |
1848 |
|
1849 |
+ /* Turn off both OPTION_MASK_ABI_64 and OPTION_MASK_ABI_X32 if |
1850 |
+ TARGET_64BIT_DEFAULT is true and TARGET_64BIT is false. */ |
1851 |
+ if (TARGET_64BIT_DEFAULT && !TARGET_64BIT) |
1852 |
+ ix86_isa_flags &= ~(OPTION_MASK_ABI_64 | OPTION_MASK_ABI_X32); |
1853 |
+#ifdef TARGET_BI_ARCH |
1854 |
+ else |
1855 |
+ { |
1856 |
+#if TARGET_BI_ARCH == 1 |
1857 |
+ /* When TARGET_BI_ARCH == 1, by default, OPTION_MASK_ABI_64 |
1858 |
+ is on and OPTION_MASK_ABI_X32 is off. We turn off |
1859 |
+ OPTION_MASK_ABI_64 if OPTION_MASK_ABI_X32 is turned on by |
1860 |
+ -mx32. */ |
1861 |
+ if (TARGET_X32) |
1862 |
+ ix86_isa_flags &= ~OPTION_MASK_ABI_64; |
1863 |
+#else |
1864 |
+ /* When TARGET_BI_ARCH == 2, by default, OPTION_MASK_ABI_X32 is |
1865 |
+ on and OPTION_MASK_ABI_64 is off. We turn off |
1866 |
+ OPTION_MASK_ABI_X32 if OPTION_MASK_ABI_64 is turned on by |
1867 |
+ -m64. */ |
1868 |
+ if (TARGET_LP64) |
1869 |
+ ix86_isa_flags &= ~OPTION_MASK_ABI_X32; |
1870 |
+#endif |
1871 |
+ } |
1872 |
+#endif |
1873 |
+ |
1874 |
+ if (TARGET_X32) |
1875 |
+ { |
1876 |
+ /* Always turn on OPTION_MASK_ISA_64BIT and turn off |
1877 |
+ OPTION_MASK_ABI_64 for TARGET_X32. */ |
1878 |
+ ix86_isa_flags |= OPTION_MASK_ISA_64BIT; |
1879 |
+ ix86_isa_flags &= ~OPTION_MASK_ABI_64; |
1880 |
+ } |
1881 |
+ else if (TARGET_LP64) |
1882 |
+ { |
1883 |
+ /* Always turn on OPTION_MASK_ISA_64BIT and turn off |
1884 |
+ OPTION_MASK_ABI_X32 for TARGET_LP64. */ |
1885 |
+ ix86_isa_flags |= OPTION_MASK_ISA_64BIT; |
1886 |
+ ix86_isa_flags &= ~OPTION_MASK_ABI_X32; |
1887 |
+ } |
1888 |
+ |
1889 |
#ifdef SUBTARGET_OVERRIDE_OPTIONS |
1890 |
SUBTARGET_OVERRIDE_OPTIONS; |
1891 |
#endif |
1892 |
@@ -3098,9 +3155,6 @@ ix86_option_override_internal (bool main_args_p) |
1893 |
SUBSUBTARGET_OVERRIDE_OPTIONS; |
1894 |
#endif |
1895 |
|
1896 |
- if (TARGET_X32) |
1897 |
- ix86_isa_flags |= OPTION_MASK_ISA_64BIT; |
1898 |
- |
1899 |
/* -fPIC is the default for x86_64. */ |
1900 |
if (TARGET_MACHO && TARGET_64BIT) |
1901 |
flag_pic = 2; |
1902 |
@@ -3169,6 +3223,17 @@ ix86_option_override_internal (bool main_args_p) |
1903 |
else |
1904 |
ix86_arch_specified = 1; |
1905 |
|
1906 |
+ if (global_options_set.x_ix86_pmode) |
1907 |
+ { |
1908 |
+ if ((TARGET_LP64 && ix86_pmode == PMODE_SI) |
1909 |
+ || (!TARGET_64BIT && ix86_pmode == PMODE_DI)) |
1910 |
+ error ("address mode %qs not supported in the %s bit mode", |
1911 |
+ TARGET_64BIT ? "short" : "long", |
1912 |
+ TARGET_64BIT ? "64" : "32"); |
1913 |
+ } |
1914 |
+ else |
1915 |
+ ix86_pmode = TARGET_LP64 ? PMODE_DI : PMODE_SI; |
1916 |
+ |
1917 |
if (!global_options_set.x_ix86_abi) |
1918 |
ix86_abi = DEFAULT_ABI; |
1919 |
|
1920 |
@@ -3743,11 +3808,33 @@ ix86_option_override_internal (bool main_args_p) |
1921 |
if (TARGET_64BIT) |
1922 |
{ |
1923 |
ix86_gen_leave = gen_leave_rex64; |
1924 |
+ if (Pmode == DImode) |
1925 |
+ { |
1926 |
+ ix86_gen_monitor = gen_sse3_monitor64_di; |
1927 |
+ ix86_gen_tls_global_dynamic_64 = gen_tls_global_dynamic_64_di; |
1928 |
+ ix86_gen_tls_local_dynamic_base_64 |
1929 |
+ = gen_tls_local_dynamic_base_64_di; |
1930 |
+ } |
1931 |
+ else |
1932 |
+ { |
1933 |
+ ix86_gen_monitor = gen_sse3_monitor64_si; |
1934 |
+ ix86_gen_tls_global_dynamic_64 = gen_tls_global_dynamic_64_si; |
1935 |
+ ix86_gen_tls_local_dynamic_base_64 |
1936 |
+ = gen_tls_local_dynamic_base_64_si; |
1937 |
+ } |
1938 |
+ } |
1939 |
+ else |
1940 |
+ { |
1941 |
+ ix86_gen_leave = gen_leave; |
1942 |
+ ix86_gen_monitor = gen_sse3_monitor; |
1943 |
+ } |
1944 |
+ |
1945 |
+ if (Pmode == DImode) |
1946 |
+ { |
1947 |
ix86_gen_add3 = gen_adddi3; |
1948 |
ix86_gen_sub3 = gen_subdi3; |
1949 |
ix86_gen_sub3_carry = gen_subdi3_carry; |
1950 |
ix86_gen_one_cmpl2 = gen_one_cmpldi2; |
1951 |
- ix86_gen_monitor = gen_sse3_monitor64; |
1952 |
ix86_gen_andsp = gen_anddi3; |
1953 |
ix86_gen_allocate_stack_worker = gen_allocate_stack_worker_probe_di; |
1954 |
ix86_gen_adjust_stack_and_probe = gen_adjust_stack_and_probedi; |
1955 |
@@ -3755,12 +3842,10 @@ ix86_option_override_internal (bool main_args_p) |
1956 |
} |
1957 |
else |
1958 |
{ |
1959 |
- ix86_gen_leave = gen_leave; |
1960 |
ix86_gen_add3 = gen_addsi3; |
1961 |
ix86_gen_sub3 = gen_subsi3; |
1962 |
ix86_gen_sub3_carry = gen_subsi3_carry; |
1963 |
ix86_gen_one_cmpl2 = gen_one_cmplsi2; |
1964 |
- ix86_gen_monitor = gen_sse3_monitor; |
1965 |
ix86_gen_andsp = gen_andsi3; |
1966 |
ix86_gen_allocate_stack_worker = gen_allocate_stack_worker_probe_si; |
1967 |
ix86_gen_adjust_stack_and_probe = gen_adjust_stack_and_probesi; |
1968 |
@@ -7220,8 +7305,8 @@ function_value_64 (enum machine_mode orig_mode, enum machine_mode mode, |
1969 |
} |
1970 |
else if (POINTER_TYPE_P (valtype)) |
1971 |
{ |
1972 |
- /* Pointers are always returned in Pmode. */ |
1973 |
- mode = Pmode; |
1974 |
+ /* Pointers are always returned in word_mode. */ |
1975 |
+ mode = word_mode; |
1976 |
} |
1977 |
|
1978 |
ret = construct_container (mode, orig_mode, valtype, 1, |
1979 |
@@ -7292,7 +7377,8 @@ ix86_function_value (const_tree valtype, const_tree fntype_or_decl, |
1980 |
return ix86_function_value_1 (valtype, fntype_or_decl, orig_mode, mode); |
1981 |
} |
1982 |
|
1983 |
-/* Pointer function arguments and return values are promoted to Pmode. */ |
1984 |
+/* Pointer function arguments and return values are promoted to |
1985 |
+ word_mode. */ |
1986 |
|
1987 |
static enum machine_mode |
1988 |
ix86_promote_function_mode (const_tree type, enum machine_mode mode, |
1989 |
@@ -7302,7 +7388,7 @@ ix86_promote_function_mode (const_tree type, enum machine_mode mode, |
1990 |
if (type != NULL_TREE && POINTER_TYPE_P (type)) |
1991 |
{ |
1992 |
*punsignedp = POINTERS_EXTEND_UNSIGNED; |
1993 |
- return Pmode; |
1994 |
+ return word_mode; |
1995 |
} |
1996 |
return default_promote_function_mode (type, mode, punsignedp, fntype, |
1997 |
for_return); |
1998 |
@@ -7580,12 +7666,13 @@ setup_incoming_varargs_64 (CUMULATIVE_ARGS *cum) |
1999 |
|
2000 |
for (i = cum->regno; i < max; i++) |
2001 |
{ |
2002 |
- mem = gen_rtx_MEM (Pmode, |
2003 |
+ mem = gen_rtx_MEM (word_mode, |
2004 |
plus_constant (save_area, i * UNITS_PER_WORD)); |
2005 |
MEM_NOTRAP_P (mem) = 1; |
2006 |
set_mem_alias_set (mem, set); |
2007 |
- emit_move_insn (mem, gen_rtx_REG (Pmode, |
2008 |
- x86_64_int_parameter_registers[i])); |
2009 |
+ emit_move_insn (mem, |
2010 |
+ gen_rtx_REG (word_mode, |
2011 |
+ x86_64_int_parameter_registers[i])); |
2012 |
} |
2013 |
|
2014 |
if (ix86_varargs_fpr_size) |
2015 |
@@ -8640,8 +8727,11 @@ gen_push (rtx arg) |
2016 |
m->fs.cfa_offset += UNITS_PER_WORD; |
2017 |
m->fs.sp_offset += UNITS_PER_WORD; |
2018 |
|
2019 |
+ if (REG_P (arg) && GET_MODE (arg) != word_mode) |
2020 |
+ arg = gen_rtx_REG (word_mode, REGNO (arg)); |
2021 |
+ |
2022 |
return gen_rtx_SET (VOIDmode, |
2023 |
- gen_rtx_MEM (Pmode, |
2024 |
+ gen_rtx_MEM (word_mode, |
2025 |
gen_rtx_PRE_DEC (Pmode, |
2026 |
stack_pointer_rtx)), |
2027 |
arg); |
2028 |
@@ -8652,9 +8742,12 @@ gen_push (rtx arg) |
2029 |
static rtx |
2030 |
gen_pop (rtx arg) |
2031 |
{ |
2032 |
+ if (REG_P (arg) && GET_MODE (arg) != word_mode) |
2033 |
+ arg = gen_rtx_REG (word_mode, REGNO (arg)); |
2034 |
+ |
2035 |
return gen_rtx_SET (VOIDmode, |
2036 |
arg, |
2037 |
- gen_rtx_MEM (Pmode, |
2038 |
+ gen_rtx_MEM (word_mode, |
2039 |
gen_rtx_POST_INC (Pmode, |
2040 |
stack_pointer_rtx))); |
2041 |
} |
2042 |
@@ -9121,7 +9214,7 @@ ix86_emit_save_regs (void) |
2043 |
for (regno = FIRST_PSEUDO_REGISTER - 1; regno-- > 0; ) |
2044 |
if (!SSE_REGNO_P (regno) && ix86_save_reg (regno, true)) |
2045 |
{ |
2046 |
- insn = emit_insn (gen_push (gen_rtx_REG (Pmode, regno))); |
2047 |
+ insn = emit_insn (gen_push (gen_rtx_REG (word_mode, regno))); |
2048 |
RTX_FRAME_RELATED_P (insn) = 1; |
2049 |
} |
2050 |
} |
2051 |
@@ -9201,7 +9294,7 @@ ix86_emit_save_regs_using_mov (HOST_WIDE_INT cfa_offset) |
2052 |
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++) |
2053 |
if (!SSE_REGNO_P (regno) && ix86_save_reg (regno, true)) |
2054 |
{ |
2055 |
- ix86_emit_save_reg_using_mov (Pmode, regno, cfa_offset); |
2056 |
+ ix86_emit_save_reg_using_mov (word_mode, regno, cfa_offset); |
2057 |
cfa_offset -= UNITS_PER_WORD; |
2058 |
} |
2059 |
} |
2060 |
@@ -9276,7 +9369,7 @@ pro_epilogue_adjust_stack (rtx dest, rtx src, rtx offset, |
2061 |
rtx insn; |
2062 |
bool add_frame_related_expr = false; |
2063 |
|
2064 |
- if (! TARGET_64BIT) |
2065 |
+ if (Pmode == SImode) |
2066 |
insn = gen_pro_epilogue_adjust_stack_si_add (dest, src, offset); |
2067 |
else if (x86_64_immediate_operand (offset, DImode)) |
2068 |
insn = gen_pro_epilogue_adjust_stack_di_add (dest, src, offset); |
2069 |
@@ -10138,7 +10231,7 @@ ix86_expand_prologue (void) |
2070 |
to implement macro RETURN_ADDR_RTX and intrinsic function |
2071 |
expand_builtin_return_addr etc. */ |
2072 |
t = plus_constant (crtl->drap_reg, -UNITS_PER_WORD); |
2073 |
- t = gen_frame_mem (Pmode, t); |
2074 |
+ t = gen_frame_mem (word_mode, t); |
2075 |
insn = emit_insn (gen_push (t)); |
2076 |
RTX_FRAME_RELATED_P (insn) = 1; |
2077 |
|
2078 |
@@ -10310,7 +10403,7 @@ ix86_expand_prologue (void) |
2079 |
emit_insn (ix86_gen_allocate_stack_worker (eax, eax)); |
2080 |
|
2081 |
/* Use the fact that AX still contains ALLOCATE. */ |
2082 |
- adjust_stack_insn = (TARGET_64BIT |
2083 |
+ adjust_stack_insn = (Pmode == DImode |
2084 |
? gen_pro_epilogue_adjust_stack_di_sub |
2085 |
: gen_pro_epilogue_adjust_stack_si_sub); |
2086 |
|
2087 |
@@ -10335,14 +10428,18 @@ ix86_expand_prologue (void) |
2088 |
if (r10_live && eax_live) |
2089 |
{ |
2090 |
t = choose_baseaddr (m->fs.sp_offset - allocate); |
2091 |
- emit_move_insn (r10, gen_frame_mem (Pmode, t)); |
2092 |
+ emit_move_insn (gen_rtx_REG (word_mode, R10_REG), |
2093 |
+ gen_frame_mem (word_mode, t)); |
2094 |
t = choose_baseaddr (m->fs.sp_offset - allocate - UNITS_PER_WORD); |
2095 |
- emit_move_insn (eax, gen_frame_mem (Pmode, t)); |
2096 |
+ emit_move_insn (gen_rtx_REG (word_mode, AX_REG), |
2097 |
+ gen_frame_mem (word_mode, t)); |
2098 |
} |
2099 |
else if (eax_live || r10_live) |
2100 |
{ |
2101 |
t = choose_baseaddr (m->fs.sp_offset - allocate); |
2102 |
- emit_move_insn ((eax_live ? eax : r10), gen_frame_mem (Pmode, t)); |
2103 |
+ emit_move_insn (gen_rtx_REG (word_mode, |
2104 |
+ (eax_live ? AX_REG : R10_REG)), |
2105 |
+ gen_frame_mem (word_mode, t)); |
2106 |
} |
2107 |
} |
2108 |
gcc_assert (m->fs.sp_offset == frame.stack_pointer_offset); |
2109 |
@@ -10512,7 +10609,7 @@ ix86_emit_restore_regs_using_pop (void) |
2110 |
|
2111 |
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++) |
2112 |
if (!SSE_REGNO_P (regno) && ix86_save_reg (regno, false)) |
2113 |
- ix86_emit_restore_reg_using_pop (gen_rtx_REG (Pmode, regno)); |
2114 |
+ ix86_emit_restore_reg_using_pop (gen_rtx_REG (word_mode, regno)); |
2115 |
} |
2116 |
|
2117 |
/* Emit code and notes for the LEAVE instruction. */ |
2118 |
@@ -10555,11 +10652,11 @@ ix86_emit_restore_regs_using_mov (HOST_WIDE_INT cfa_offset, |
2119 |
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++) |
2120 |
if (!SSE_REGNO_P (regno) && ix86_save_reg (regno, maybe_eh_return)) |
2121 |
{ |
2122 |
- rtx reg = gen_rtx_REG (Pmode, regno); |
2123 |
+ rtx reg = gen_rtx_REG (word_mode, regno); |
2124 |
rtx insn, mem; |
2125 |
|
2126 |
mem = choose_baseaddr (cfa_offset); |
2127 |
- mem = gen_frame_mem (Pmode, mem); |
2128 |
+ mem = gen_frame_mem (word_mode, mem); |
2129 |
insn = emit_move_insn (reg, mem); |
2130 |
|
2131 |
if (m->fs.cfa_reg == crtl->drap_reg && regno == REGNO (crtl->drap_reg)) |
2132 |
@@ -11164,8 +11261,8 @@ ix86_expand_split_stack_prologue (void) |
2133 |
{ |
2134 |
rtx rax; |
2135 |
|
2136 |
- rax = gen_rtx_REG (Pmode, AX_REG); |
2137 |
- emit_move_insn (rax, reg10); |
2138 |
+ rax = gen_rtx_REG (word_mode, AX_REG); |
2139 |
+ emit_move_insn (rax, gen_rtx_REG (word_mode, R10_REG)); |
2140 |
use_reg (&call_fusage, rax); |
2141 |
} |
2142 |
|
2143 |
@@ -11244,8 +11341,8 @@ ix86_expand_split_stack_prologue (void) |
2144 |
/* If we are in 64-bit mode and this function uses a static chain, |
2145 |
we saved %r10 in %rax before calling _morestack. */ |
2146 |
if (TARGET_64BIT && DECL_STATIC_CHAIN (cfun->decl)) |
2147 |
- emit_move_insn (gen_rtx_REG (Pmode, R10_REG), |
2148 |
- gen_rtx_REG (Pmode, AX_REG)); |
2149 |
+ emit_move_insn (gen_rtx_REG (word_mode, R10_REG), |
2150 |
+ gen_rtx_REG (word_mode, AX_REG)); |
2151 |
|
2152 |
/* If this function calls va_start, we need to store a pointer to |
2153 |
the arguments on the old stack, because they may not have been |
2154 |
@@ -11375,10 +11472,14 @@ ix86_decompose_address (rtx addr, struct ix86_address *out) |
2155 |
{ |
2156 |
addr = XEXP (addr, 0); |
2157 |
|
2158 |
- /* Strip subreg. */ |
2159 |
+ /* Adjust SUBREGs. */ |
2160 |
if (GET_CODE (addr) == SUBREG |
2161 |
&& GET_MODE (SUBREG_REG (addr)) == SImode) |
2162 |
addr = SUBREG_REG (addr); |
2163 |
+ else if (GET_MODE (addr) == DImode) |
2164 |
+ addr = gen_rtx_SUBREG (SImode, addr, 0); |
2165 |
+ else if (GET_MODE (addr) != VOIDmode) |
2166 |
+ return 0; |
2167 |
} |
2168 |
} |
2169 |
|
2170 |
@@ -11434,6 +11535,12 @@ ix86_decompose_address (rtx addr, struct ix86_address *out) |
2171 |
scale = 1 << scale; |
2172 |
break; |
2173 |
|
2174 |
+ case ZERO_EXTEND: |
2175 |
+ op = XEXP (op, 0); |
2176 |
+ if (GET_CODE (op) != UNSPEC) |
2177 |
+ return 0; |
2178 |
+ /* FALLTHRU */ |
2179 |
+ |
2180 |
case UNSPEC: |
2181 |
if (XINT (op, 1) == UNSPEC_TP |
2182 |
&& TARGET_TLS_DIRECT_SEG_REFS |
2183 |
@@ -11503,6 +11610,12 @@ ix86_decompose_address (rtx addr, struct ix86_address *out) |
2184 |
return 0; |
2185 |
} |
2186 |
|
2187 |
+/* Address override works only on the (%reg) part of %fs:(%reg). */ |
2188 |
+ if (seg != SEG_DEFAULT |
2189 |
+ && ((base && GET_MODE (base) != word_mode) |
2190 |
+ || (index && GET_MODE (index) != word_mode))) |
2191 |
+ return 0; |
2192 |
+ |
2193 |
/* Extract the integral value of scale. */ |
2194 |
if (scale_rtx) |
2195 |
{ |
2196 |
@@ -12455,15 +12568,20 @@ legitimize_pic_address (rtx orig, rtx reg) |
2197 |
/* Load the thread pointer. If TO_REG is true, force it into a register. */ |
2198 |
|
2199 |
static rtx |
2200 |
-get_thread_pointer (bool to_reg) |
2201 |
+get_thread_pointer (enum machine_mode tp_mode, bool to_reg) |
2202 |
{ |
2203 |
rtx tp = gen_rtx_UNSPEC (ptr_mode, gen_rtvec (1, const0_rtx), UNSPEC_TP); |
2204 |
|
2205 |
- if (GET_MODE (tp) != Pmode) |
2206 |
- tp = convert_to_mode (Pmode, tp, 1); |
2207 |
+ if (GET_MODE (tp) != tp_mode) |
2208 |
+ { |
2209 |
+ gcc_assert (GET_MODE (tp) == SImode); |
2210 |
+ gcc_assert (tp_mode == DImode); |
2211 |
+ |
2212 |
+ tp = gen_rtx_ZERO_EXTEND (tp_mode, tp); |
2213 |
+ } |
2214 |
|
2215 |
if (to_reg) |
2216 |
- tp = copy_addr_to_reg (tp); |
2217 |
+ tp = copy_to_mode_reg (tp_mode, tp); |
2218 |
|
2219 |
return tp; |
2220 |
} |
2221 |
@@ -12515,6 +12633,7 @@ legitimize_tls_address (rtx x, enum tls_model model, bool for_mov) |
2222 |
{ |
2223 |
rtx dest, base, off; |
2224 |
rtx pic = NULL_RTX, tp = NULL_RTX; |
2225 |
+ enum machine_mode tp_mode = Pmode; |
2226 |
int type; |
2227 |
|
2228 |
switch (model) |
2229 |
@@ -12540,7 +12659,7 @@ legitimize_tls_address (rtx x, enum tls_model model, bool for_mov) |
2230 |
else |
2231 |
emit_insn (gen_tls_dynamic_gnu2_32 (dest, x, pic)); |
2232 |
|
2233 |
- tp = get_thread_pointer (true); |
2234 |
+ tp = get_thread_pointer (Pmode, true); |
2235 |
dest = force_reg (Pmode, gen_rtx_PLUS (Pmode, tp, dest)); |
2236 |
|
2237 |
set_unique_reg_note (get_last_insn (), REG_EQUAL, x); |
2238 |
@@ -12554,7 +12673,8 @@ legitimize_tls_address (rtx x, enum tls_model model, bool for_mov) |
2239 |
rtx rax = gen_rtx_REG (Pmode, AX_REG), insns; |
2240 |
|
2241 |
start_sequence (); |
2242 |
- emit_call_insn (gen_tls_global_dynamic_64 (rax, x, caddr)); |
2243 |
+ emit_call_insn (ix86_gen_tls_global_dynamic_64 (rax, x, |
2244 |
+ caddr)); |
2245 |
insns = get_insns (); |
2246 |
end_sequence (); |
2247 |
|
2248 |
@@ -12589,7 +12709,7 @@ legitimize_tls_address (rtx x, enum tls_model model, bool for_mov) |
2249 |
else |
2250 |
emit_insn (gen_tls_dynamic_gnu2_32 (base, tmp, pic)); |
2251 |
|
2252 |
- tp = get_thread_pointer (true); |
2253 |
+ tp = get_thread_pointer (Pmode, true); |
2254 |
set_unique_reg_note (get_last_insn (), REG_EQUAL, |
2255 |
gen_rtx_MINUS (Pmode, tmp, tp)); |
2256 |
} |
2257 |
@@ -12602,7 +12722,8 @@ legitimize_tls_address (rtx x, enum tls_model model, bool for_mov) |
2258 |
rtx rax = gen_rtx_REG (Pmode, AX_REG), insns, eqv; |
2259 |
|
2260 |
start_sequence (); |
2261 |
- emit_call_insn (gen_tls_local_dynamic_base_64 (rax, caddr)); |
2262 |
+ emit_call_insn (ix86_gen_tls_local_dynamic_base_64 (rax, |
2263 |
+ caddr)); |
2264 |
insns = get_insns (); |
2265 |
end_sequence (); |
2266 |
|
2267 |
@@ -12645,6 +12766,9 @@ legitimize_tls_address (rtx x, enum tls_model model, bool for_mov) |
2268 |
return dest; |
2269 |
} |
2270 |
|
2271 |
+ /* Generate DImode references to avoid %fs:(%reg32) |
2272 |
+ problems and linker IE->LE relaxation bug. */ |
2273 |
+ tp_mode = DImode; |
2274 |
pic = NULL; |
2275 |
type = UNSPEC_GOTNTPOFF; |
2276 |
} |
2277 |
@@ -12667,22 +12791,23 @@ legitimize_tls_address (rtx x, enum tls_model model, bool for_mov) |
2278 |
type = UNSPEC_INDNTPOFF; |
2279 |
} |
2280 |
|
2281 |
- off = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, x), type); |
2282 |
- off = gen_rtx_CONST (Pmode, off); |
2283 |
+ off = gen_rtx_UNSPEC (tp_mode, gen_rtvec (1, x), type); |
2284 |
+ off = gen_rtx_CONST (tp_mode, off); |
2285 |
if (pic) |
2286 |
- off = gen_rtx_PLUS (Pmode, pic, off); |
2287 |
- off = gen_const_mem (Pmode, off); |
2288 |
+ off = gen_rtx_PLUS (tp_mode, pic, off); |
2289 |
+ off = gen_const_mem (tp_mode, off); |
2290 |
set_mem_alias_set (off, ix86_GOT_alias_set ()); |
2291 |
|
2292 |
if (TARGET_64BIT || TARGET_ANY_GNU_TLS) |
2293 |
{ |
2294 |
- base = get_thread_pointer (for_mov || !TARGET_TLS_DIRECT_SEG_REFS); |
2295 |
- off = force_reg (Pmode, off); |
2296 |
- return gen_rtx_PLUS (Pmode, base, off); |
2297 |
+ base = get_thread_pointer (tp_mode, |
2298 |
+ for_mov || !TARGET_TLS_DIRECT_SEG_REFS); |
2299 |
+ off = force_reg (tp_mode, off); |
2300 |
+ return gen_rtx_PLUS (tp_mode, base, off); |
2301 |
} |
2302 |
else |
2303 |
{ |
2304 |
- base = get_thread_pointer (true); |
2305 |
+ base = get_thread_pointer (Pmode, true); |
2306 |
dest = gen_reg_rtx (Pmode); |
2307 |
emit_insn (gen_subsi3 (dest, base, off)); |
2308 |
} |
2309 |
@@ -12696,12 +12821,13 @@ legitimize_tls_address (rtx x, enum tls_model model, bool for_mov) |
2310 |
|
2311 |
if (TARGET_64BIT || TARGET_ANY_GNU_TLS) |
2312 |
{ |
2313 |
- base = get_thread_pointer (for_mov || !TARGET_TLS_DIRECT_SEG_REFS); |
2314 |
+ base = get_thread_pointer (Pmode, |
2315 |
+ for_mov || !TARGET_TLS_DIRECT_SEG_REFS); |
2316 |
return gen_rtx_PLUS (Pmode, base, off); |
2317 |
} |
2318 |
else |
2319 |
{ |
2320 |
- base = get_thread_pointer (true); |
2321 |
+ base = get_thread_pointer (Pmode, true); |
2322 |
dest = gen_reg_rtx (Pmode); |
2323 |
emit_insn (gen_subsi3 (dest, base, off)); |
2324 |
} |
2325 |
@@ -13756,6 +13882,7 @@ get_some_local_dynamic_name (void) |
2326 |
Z -- likewise, with special suffixes for x87 instructions. |
2327 |
* -- print a star (in certain assembler syntax) |
2328 |
A -- print an absolute memory reference. |
2329 |
+ E -- print address with DImode register names if TARGET_64BIT. |
2330 |
w -- print the operand as if it's a "word" (HImode) even if it isn't. |
2331 |
s -- print a shift double count, followed by the assemblers argument |
2332 |
delimiter. |
2333 |
@@ -13780,6 +13907,7 @@ get_some_local_dynamic_name (void) |
2334 |
; -- print a semicolon (after prefixes due to bug in older gas). |
2335 |
~ -- print "i" if TARGET_AVX2, "f" otherwise. |
2336 |
@ -- print a segment register of thread base pointer load |
2337 |
+ ^ -- print addr32 prefix if TARGET_64BIT and Pmode != word_mode |
2338 |
*/ |
2339 |
|
2340 |
void |
2341 |
@@ -13831,7 +13959,14 @@ ix86_print_operand (FILE *file, rtx x, int code) |
2342 |
ix86_print_operand (file, x, 0); |
2343 |
return; |
2344 |
|
2345 |
+ case 'E': |
2346 |
+ /* Wrap address in an UNSPEC to declare special handling. */ |
2347 |
+ if (TARGET_64BIT) |
2348 |
+ x = gen_rtx_UNSPEC (DImode, gen_rtvec (1, x), UNSPEC_LEA_ADDR); |
2349 |
|
2350 |
+ output_address (x); |
2351 |
+ return; |
2352 |
+ |
2353 |
case 'L': |
2354 |
if (ASSEMBLER_DIALECT == ASM_ATT) |
2355 |
putc ('l', file); |
2356 |
@@ -14283,6 +14418,11 @@ ix86_print_operand (FILE *file, rtx x, int code) |
2357 |
putc (TARGET_AVX2 ? 'i' : 'f', file); |
2358 |
return; |
2359 |
|
2360 |
+ case '^': |
2361 |
+ if (TARGET_64BIT && Pmode != word_mode) |
2362 |
+ fputs ("addr32 ", file); |
2363 |
+ return; |
2364 |
+ |
2365 |
default: |
2366 |
output_operand_lossage ("invalid operand code '%c'", code); |
2367 |
} |
2368 |
@@ -14422,8 +14562,8 @@ ix86_print_operand (FILE *file, rtx x, int code) |
2369 |
static bool |
2370 |
ix86_print_operand_punct_valid_p (unsigned char code) |
2371 |
{ |
2372 |
- return (code == '@' || code == '*' || code == '+' |
2373 |
- || code == '&' || code == ';' || code == '~'); |
2374 |
+ return (code == '@' || code == '*' || code == '+' || code == '&' |
2375 |
+ || code == ';' || code == '~' || code == '^'); |
2376 |
} |
2377 |
|
2378 |
/* Print a memory operand whose address is ADDR. */ |
2379 |
@@ -14436,6 +14576,7 @@ ix86_print_operand_address (FILE *file, rtx addr) |
2380 |
int scale; |
2381 |
int ok; |
2382 |
bool vsib = false; |
2383 |
+ int code = 0; |
2384 |
|
2385 |
if (GET_CODE (addr) == UNSPEC && XINT (addr, 1) == UNSPEC_VSIBADDR) |
2386 |
{ |
2387 |
@@ -14446,6 +14587,12 @@ ix86_print_operand_address (FILE *file, rtx addr) |
2388 |
addr = XVECEXP (addr, 0, 0); |
2389 |
vsib = true; |
2390 |
} |
2391 |
+ else if (GET_CODE (addr) == UNSPEC && XINT (addr, 1) == UNSPEC_LEA_ADDR) |
2392 |
+ { |
2393 |
+ gcc_assert (TARGET_64BIT); |
2394 |
+ ok = ix86_decompose_address (XVECEXP (addr, 0, 0), &parts); |
2395 |
+ code = 'q'; |
2396 |
+ } |
2397 |
else |
2398 |
ok = ix86_decompose_address (addr, &parts); |
2399 |
|
2400 |
@@ -14516,15 +14663,15 @@ ix86_print_operand_address (FILE *file, rtx addr) |
2401 |
} |
2402 |
else |
2403 |
{ |
2404 |
- int code = 0; |
2405 |
- |
2406 |
- /* Print SImode registers for zero-extended addresses to force |
2407 |
- addr32 prefix. Otherwise print DImode registers to avoid it. */ |
2408 |
- if (TARGET_64BIT) |
2409 |
- code = ((GET_CODE (addr) == ZERO_EXTEND |
2410 |
- || GET_CODE (addr) == AND) |
2411 |
- ? 'l' |
2412 |
- : 'q'); |
2413 |
+ /* Print SImode register names for zero-extended |
2414 |
+ addresses to force addr32 prefix. */ |
2415 |
+ if (TARGET_64BIT |
2416 |
+ && (GET_CODE (addr) == ZERO_EXTEND |
2417 |
+ || GET_CODE (addr) == AND)) |
2418 |
+ { |
2419 |
+ gcc_assert (!code); |
2420 |
+ code = 'l'; |
2421 |
+ } |
2422 |
|
2423 |
if (ASSEMBLER_DIALECT == ASM_ATT) |
2424 |
{ |
2425 |
@@ -20299,7 +20446,7 @@ ix86_split_to_parts (rtx operand, rtx *parts, enum machine_mode mode) |
2426 |
gcc_assert (ok); |
2427 |
|
2428 |
operand = copy_rtx (operand); |
2429 |
- PUT_MODE (operand, Pmode); |
2430 |
+ PUT_MODE (operand, word_mode); |
2431 |
parts[0] = parts[1] = parts[2] = parts[3] = operand; |
2432 |
return size; |
2433 |
} |
2434 |
@@ -20452,7 +20599,7 @@ ix86_split_long_move (rtx operands[]) |
2435 |
if (push_operand (operands[0], VOIDmode)) |
2436 |
{ |
2437 |
operands[0] = copy_rtx (operands[0]); |
2438 |
- PUT_MODE (operands[0], Pmode); |
2439 |
+ PUT_MODE (operands[0], word_mode); |
2440 |
} |
2441 |
else |
2442 |
operands[0] = gen_lowpart (DImode, operands[0]); |
2443 |
@@ -21007,14 +21154,9 @@ ix86_adjust_counter (rtx countreg, HOST_WIDE_INT value) |
2444 |
rtx |
2445 |
ix86_zero_extend_to_Pmode (rtx exp) |
2446 |
{ |
2447 |
- rtx r; |
2448 |
- if (GET_MODE (exp) == VOIDmode) |
2449 |
- return force_reg (Pmode, exp); |
2450 |
- if (GET_MODE (exp) == Pmode) |
2451 |
- return copy_to_mode_reg (Pmode, exp); |
2452 |
- r = gen_reg_rtx (Pmode); |
2453 |
- emit_insn (gen_zero_extendsidi2 (r, exp)); |
2454 |
- return r; |
2455 |
+ if (GET_MODE (exp) != Pmode) |
2456 |
+ exp = convert_to_mode (Pmode, exp, 1); |
2457 |
+ return force_reg (Pmode, exp); |
2458 |
} |
2459 |
|
2460 |
/* Divide COUNTREG by SCALE. */ |
2461 |
@@ -22042,11 +22184,11 @@ ix86_expand_movmem (rtx dst, rtx src, rtx count_exp, rtx align_exp, |
2462 |
gcc_unreachable (); |
2463 |
case loop: |
2464 |
need_zero_guard = true; |
2465 |
- size_needed = GET_MODE_SIZE (Pmode); |
2466 |
+ size_needed = GET_MODE_SIZE (word_mode); |
2467 |
break; |
2468 |
case unrolled_loop: |
2469 |
need_zero_guard = true; |
2470 |
- size_needed = GET_MODE_SIZE (Pmode) * (TARGET_64BIT ? 4 : 2); |
2471 |
+ size_needed = GET_MODE_SIZE (word_mode) * (TARGET_64BIT ? 4 : 2); |
2472 |
break; |
2473 |
case rep_prefix_8_byte: |
2474 |
size_needed = 8; |
2475 |
@@ -22212,13 +22354,13 @@ ix86_expand_movmem (rtx dst, rtx src, rtx count_exp, rtx align_exp, |
2476 |
break; |
2477 |
case loop: |
2478 |
expand_set_or_movmem_via_loop (dst, src, destreg, srcreg, NULL, |
2479 |
- count_exp, Pmode, 1, expected_size); |
2480 |
+ count_exp, word_mode, 1, expected_size); |
2481 |
break; |
2482 |
case unrolled_loop: |
2483 |
/* Unroll only by factor of 2 in 32bit mode, since we don't have enough |
2484 |
registers for 4 temporaries anyway. */ |
2485 |
expand_set_or_movmem_via_loop (dst, src, destreg, srcreg, NULL, |
2486 |
- count_exp, Pmode, TARGET_64BIT ? 4 : 2, |
2487 |
+ count_exp, word_mode, TARGET_64BIT ? 4 : 2, |
2488 |
expected_size); |
2489 |
break; |
2490 |
case rep_prefix_8_byte: |
2491 |
@@ -22430,11 +22572,11 @@ ix86_expand_setmem (rtx dst, rtx count_exp, rtx val_exp, rtx align_exp, |
2492 |
gcc_unreachable (); |
2493 |
case loop: |
2494 |
need_zero_guard = true; |
2495 |
- size_needed = GET_MODE_SIZE (Pmode); |
2496 |
+ size_needed = GET_MODE_SIZE (word_mode); |
2497 |
break; |
2498 |
case unrolled_loop: |
2499 |
need_zero_guard = true; |
2500 |
- size_needed = GET_MODE_SIZE (Pmode) * 4; |
2501 |
+ size_needed = GET_MODE_SIZE (word_mode) * 4; |
2502 |
break; |
2503 |
case rep_prefix_8_byte: |
2504 |
size_needed = 8; |
2505 |
@@ -22605,11 +22747,11 @@ ix86_expand_setmem (rtx dst, rtx count_exp, rtx val_exp, rtx align_exp, |
2506 |
break; |
2507 |
case loop: |
2508 |
expand_set_or_movmem_via_loop (dst, NULL, destreg, NULL, promoted_val, |
2509 |
- count_exp, Pmode, 1, expected_size); |
2510 |
+ count_exp, word_mode, 1, expected_size); |
2511 |
break; |
2512 |
case unrolled_loop: |
2513 |
expand_set_or_movmem_via_loop (dst, NULL, destreg, NULL, promoted_val, |
2514 |
- count_exp, Pmode, 4, expected_size); |
2515 |
+ count_exp, word_mode, 4, expected_size); |
2516 |
break; |
2517 |
case rep_prefix_8_byte: |
2518 |
expand_setmem_via_rep_stos (dst, destreg, promoted_val, count_exp, |
2519 |
@@ -22972,13 +23114,13 @@ ix86_expand_call (rtx retval, rtx fnaddr, rtx callarg1, |
2520 |
&& !local_symbolic_operand (XEXP (fnaddr, 0), VOIDmode)) |
2521 |
fnaddr = gen_rtx_MEM (QImode, construct_plt_address (XEXP (fnaddr, 0))); |
2522 |
else if (sibcall |
2523 |
- ? !sibcall_insn_operand (XEXP (fnaddr, 0), Pmode) |
2524 |
- : !call_insn_operand (XEXP (fnaddr, 0), Pmode)) |
2525 |
+ ? !sibcall_insn_operand (XEXP (fnaddr, 0), word_mode) |
2526 |
+ : !call_insn_operand (XEXP (fnaddr, 0), word_mode)) |
2527 |
{ |
2528 |
fnaddr = XEXP (fnaddr, 0); |
2529 |
- if (GET_MODE (fnaddr) != Pmode) |
2530 |
- fnaddr = convert_to_mode (Pmode, fnaddr, 1); |
2531 |
- fnaddr = gen_rtx_MEM (QImode, copy_to_mode_reg (Pmode, fnaddr)); |
2532 |
+ if (GET_MODE (fnaddr) != word_mode) |
2533 |
+ fnaddr = convert_to_mode (word_mode, fnaddr, 1); |
2534 |
+ fnaddr = gen_rtx_MEM (QImode, copy_to_mode_reg (word_mode, fnaddr)); |
2535 |
} |
2536 |
|
2537 |
vec_len = 0; |
2538 |
@@ -24291,10 +24433,13 @@ ix86_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value) |
2539 |
/* Load the function address to r11. Try to load address using |
2540 |
the shorter movl instead of movabs. We may want to support |
2541 |
movq for kernel mode, but kernel does not use trampolines at |
2542 |
- the moment. */ |
2543 |
- if (x86_64_zext_immediate_operand (fnaddr, VOIDmode)) |
2544 |
+ the moment. FNADDR is a 32bit address and may not be in |
2545 |
+ DImode when ptr_mode == SImode. Always use movl in this |
2546 |
+ case. */ |
2547 |
+ if (ptr_mode == SImode |
2548 |
+ || x86_64_zext_immediate_operand (fnaddr, VOIDmode)) |
2549 |
{ |
2550 |
- fnaddr = copy_to_mode_reg (DImode, fnaddr); |
2551 |
+ fnaddr = copy_to_mode_reg (Pmode, fnaddr); |
2552 |
|
2553 |
mem = adjust_address (m_tramp, HImode, offset); |
2554 |
emit_move_insn (mem, gen_int_mode (0xbb41, HImode)); |
2555 |
@@ -24313,9 +24458,9 @@ ix86_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value) |
2556 |
offset += 10; |
2557 |
} |
2558 |
|
2559 |
- /* Load static chain using movabs to r10. Use the |
2560 |
- shorter movl instead of movabs for x32. */ |
2561 |
- if (TARGET_X32) |
2562 |
+ /* Load static chain using movabs to r10. Use the shorter movl |
2563 |
+ instead of movabs when ptr_mode == SImode. */ |
2564 |
+ if (ptr_mode == SImode) |
2565 |
{ |
2566 |
opcode = 0xba41; |
2567 |
size = 6; |
2568 |
@@ -31952,7 +32097,7 @@ x86_this_parameter (tree function) |
2569 |
parm_regs = x86_64_ms_abi_int_parameter_registers; |
2570 |
else |
2571 |
parm_regs = x86_64_int_parameter_registers; |
2572 |
- return gen_rtx_REG (DImode, parm_regs[aggr]); |
2573 |
+ return gen_rtx_REG (Pmode, parm_regs[aggr]); |
2574 |
} |
2575 |
|
2576 |
nregs = ix86_function_regparm (type, function); |
2577 |
--- a/gcc/config/i386/i386.h |
2578 |
+++ b/gcc/config/i386/i386.h |
2579 |
@@ -42,7 +42,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see |
2580 |
/* Redefines for option macros. */ |
2581 |
|
2582 |
#define TARGET_64BIT OPTION_ISA_64BIT |
2583 |
-#define TARGET_X32 OPTION_ISA_X32 |
2584 |
#define TARGET_MMX OPTION_ISA_MMX |
2585 |
#define TARGET_3DNOW OPTION_ISA_3DNOW |
2586 |
#define TARGET_3DNOW_A OPTION_ISA_3DNOW_A |
2587 |
@@ -76,7 +75,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see |
2588 |
#define TARGET_RDRND OPTION_ISA_RDRND |
2589 |
#define TARGET_F16C OPTION_ISA_F16C |
2590 |
|
2591 |
-#define TARGET_LP64 (TARGET_64BIT && !TARGET_X32) |
2592 |
+#define TARGET_LP64 OPTION_ABI_64 |
2593 |
+#define TARGET_X32 OPTION_ABI_X32 |
2594 |
|
2595 |
/* SSE4.1 defines round instructions */ |
2596 |
#define OPTION_MASK_ISA_ROUND OPTION_MASK_ISA_SSE4_1 |
2597 |
@@ -1760,7 +1760,7 @@ do { \ |
2598 |
/* Specify the machine mode that pointers have. |
2599 |
After generation of rtl, the compiler makes no further distinction |
2600 |
between pointers and any other objects of this machine mode. */ |
2601 |
-#define Pmode (TARGET_64BIT ? DImode : SImode) |
2602 |
+#define Pmode (ix86_pmode == PMODE_DI ? DImode : SImode) |
2603 |
|
2604 |
/* A C expression whose value is zero if pointers that need to be extended |
2605 |
from being `POINTER_SIZE' bits wide to `Pmode' are sign-extended and |
2606 |
--- a/gcc/config/i386/i386.md |
2607 |
+++ b/gcc/config/i386/i386.md |
2608 |
@@ -38,6 +38,7 @@ |
2609 |
;; Z -- likewise, with special suffixes for x87 instructions. |
2610 |
;; * -- print a star (in certain assembler syntax) |
2611 |
;; A -- print an absolute memory reference. |
2612 |
+;; E -- print address with DImode register names if TARGET_64BIT. |
2613 |
;; w -- print the operand as if it's a "word" (HImode) even if it isn't. |
2614 |
;; s -- print a shift double count, followed by the assemblers argument |
2615 |
;; delimiter. |
2616 |
@@ -60,7 +61,9 @@ |
2617 |
;; Y -- print condition for XOP pcom* instruction. |
2618 |
;; + -- print a branch hint as 'cs' or 'ds' prefix |
2619 |
;; ; -- print a semicolon (after prefixes due to bug in older gas). |
2620 |
+;; ~ -- print "i" if TARGET_AVX2, "f" otherwise. |
2621 |
;; @ -- print a segment register of thread base pointer load |
2622 |
+;; ^ -- print addr32 prefix if TARGET_64BIT and Pmode != word_mode |
2623 |
|
2624 |
(define_c_enum "unspec" [ |
2625 |
;; Relocation specifiers |
2626 |
@@ -109,6 +112,7 @@ |
2627 |
UNSPEC_MS_TO_SYSV_CALL |
2628 |
UNSPEC_CALL_NEEDS_VZEROUPPER |
2629 |
UNSPEC_PAUSE |
2630 |
+ UNSPEC_LEA_ADDR |
2631 |
|
2632 |
;; For SSE/MMX support: |
2633 |
UNSPEC_FIX_NOTRUNC |
2634 |
@@ -892,6 +896,11 @@ |
2635 |
;; pointer-sized quantities. Exactly one of the two alternatives will match. |
2636 |
(define_mode_iterator P [(SI "Pmode == SImode") (DI "Pmode == DImode")]) |
2637 |
|
2638 |
+;; This mode iterator allows :W to be used for patterns that operate on |
2639 |
+;; word_mode sized quantities. |
2640 |
+(define_mode_iterator W |
2641 |
+ [(SI "word_mode == SImode") (DI "word_mode == DImode")]) |
2642 |
+ |
2643 |
;; This mode iterator allows :PTR to be used for patterns that operate on |
2644 |
;; ptr_mode sized quantities. |
2645 |
(define_mode_iterator PTR |
2646 |
@@ -1700,8 +1709,8 @@ |
2647 |
(set_attr "mode" "SI")]) |
2648 |
|
2649 |
(define_insn "*push<mode>2_prologue" |
2650 |
- [(set (match_operand:P 0 "push_operand" "=<") |
2651 |
- (match_operand:P 1 "general_no_elim_operand" "r<i>*m")) |
2652 |
+ [(set (match_operand:W 0 "push_operand" "=<") |
2653 |
+ (match_operand:W 1 "general_no_elim_operand" "r<i>*m")) |
2654 |
(clobber (mem:BLK (scratch)))] |
2655 |
"" |
2656 |
"push{<imodesuffix>}\t%1" |
2657 |
@@ -1709,16 +1718,16 @@ |
2658 |
(set_attr "mode" "<MODE>")]) |
2659 |
|
2660 |
(define_insn "*pop<mode>1" |
2661 |
- [(set (match_operand:P 0 "nonimmediate_operand" "=r*m") |
2662 |
- (match_operand:P 1 "pop_operand" ">"))] |
2663 |
+ [(set (match_operand:W 0 "nonimmediate_operand" "=r*m") |
2664 |
+ (match_operand:W 1 "pop_operand" ">"))] |
2665 |
"" |
2666 |
"pop{<imodesuffix>}\t%0" |
2667 |
[(set_attr "type" "pop") |
2668 |
(set_attr "mode" "<MODE>")]) |
2669 |
|
2670 |
(define_insn "*pop<mode>1_epilogue" |
2671 |
- [(set (match_operand:P 0 "nonimmediate_operand" "=r*m") |
2672 |
- (match_operand:P 1 "pop_operand" ">")) |
2673 |
+ [(set (match_operand:W 0 "nonimmediate_operand" "=r*m") |
2674 |
+ (match_operand:W 1 "pop_operand" ">")) |
2675 |
(clobber (mem:BLK (scratch)))] |
2676 |
"" |
2677 |
"pop{<imodesuffix>}\t%0" |
2678 |
@@ -1958,7 +1967,7 @@ |
2679 |
return "#"; |
2680 |
|
2681 |
case TYPE_LEA: |
2682 |
- return "lea{q}\t{%a1, %0|%0, %a1}"; |
2683 |
+ return "lea{q}\t{%E1, %0|%0, %E1}"; |
2684 |
|
2685 |
default: |
2686 |
gcc_assert (!flag_pic || LEGITIMATE_PIC_OPERAND_P (operands[1])); |
2687 |
@@ -1967,7 +1976,7 @@ |
2688 |
else if (which_alternative == 2) |
2689 |
return "movabs{q}\t{%1, %0|%0, %1}"; |
2690 |
else if (ix86_use_lea_for_mov (insn, operands)) |
2691 |
- return "lea{q}\t{%a1, %0|%0, %a1}"; |
2692 |
+ return "lea{q}\t{%E1, %0|%0, %E1}"; |
2693 |
else |
2694 |
return "mov{q}\t{%1, %0|%0, %1}"; |
2695 |
} |
2696 |
@@ -2199,12 +2208,12 @@ |
2697 |
return "movd\t{%1, %0|%0, %1}"; |
2698 |
|
2699 |
case TYPE_LEA: |
2700 |
- return "lea{l}\t{%a1, %0|%0, %a1}"; |
2701 |
+ return "lea{l}\t{%E1, %0|%0, %E1}"; |
2702 |
|
2703 |
default: |
2704 |
gcc_assert (!flag_pic || LEGITIMATE_PIC_OPERAND_P (operands[1])); |
2705 |
if (ix86_use_lea_for_mov (insn, operands)) |
2706 |
- return "lea{l}\t{%a1, %0|%0, %a1}"; |
2707 |
+ return "lea{l}\t{%E1, %0|%0, %E1}"; |
2708 |
else |
2709 |
return "mov{l}\t{%1, %0|%0, %1}"; |
2710 |
} |
2711 |
@@ -3382,9 +3391,9 @@ |
2712 |
}) |
2713 |
|
2714 |
(define_insn "*zero_extendsidi2_rex64" |
2715 |
- [(set (match_operand:DI 0 "nonimmediate_operand" "=r,o,?*Ym,?*y,?*Yi,*x") |
2716 |
+ [(set (match_operand:DI 0 "nonimmediate_operand" "=r ,o,?*Ym,?*y,?*Yi,*x") |
2717 |
(zero_extend:DI |
2718 |
- (match_operand:SI 1 "nonimmediate_operand" "rm,0,r ,m ,r ,m")))] |
2719 |
+ (match_operand:SI 1 "x86_64_zext_general_operand" "rmWz,0,r ,m ,r ,m")))] |
2720 |
"TARGET_64BIT" |
2721 |
"@ |
2722 |
mov{l}\t{%1, %k0|%k0, %1} |
2723 |
@@ -5437,7 +5446,7 @@ |
2724 |
[(set (match_operand:SI 0 "register_operand" "=r") |
2725 |
(subreg:SI (match_operand:DI 1 "lea_address_operand" "p") 0))] |
2726 |
"TARGET_64BIT" |
2727 |
- "lea{l}\t{%a1, %0|%0, %a1}" |
2728 |
+ "lea{l}\t{%E1, %0|%0, %E1}" |
2729 |
"&& reload_completed && ix86_avoid_lea_for_addr (insn, operands)" |
2730 |
[(const_int 0)] |
2731 |
{ |
2732 |
@@ -5451,7 +5460,7 @@ |
2733 |
[(set (match_operand:SWI48 0 "register_operand" "=r") |
2734 |
(match_operand:SWI48 1 "lea_address_operand" "p"))] |
2735 |
"" |
2736 |
- "lea{<imodesuffix>}\t{%a1, %0|%0, %a1}" |
2737 |
+ "lea{<imodesuffix>}\t{%E1, %0|%0, %E1}" |
2738 |
"reload_completed && ix86_avoid_lea_for_addr (insn, operands)" |
2739 |
[(const_int 0)] |
2740 |
{ |
2741 |
@@ -5466,7 +5475,7 @@ |
2742 |
(zero_extend:DI |
2743 |
(subreg:SI (match_operand:DI 1 "lea_address_operand" "j") 0)))] |
2744 |
"TARGET_64BIT" |
2745 |
- "lea{l}\t{%a1, %k0|%k0, %a1}" |
2746 |
+ "lea{l}\t{%E1, %k0|%k0, %E1}" |
2747 |
[(set_attr "type" "lea") |
2748 |
(set_attr "mode" "SI")]) |
2749 |
|
2750 |
@@ -5475,7 +5484,7 @@ |
2751 |
(zero_extend:DI |
2752 |
(match_operand:SI 1 "lea_address_operand" "j")))] |
2753 |
"TARGET_64BIT" |
2754 |
- "lea{l}\t{%a1, %k0|%k0, %a1}" |
2755 |
+ "lea{l}\t{%E1, %k0|%k0, %E1}" |
2756 |
[(set_attr "type" "lea") |
2757 |
(set_attr "mode" "SI")]) |
2758 |
|
2759 |
@@ -5485,7 +5494,7 @@ |
2760 |
(subreg:DI (match_operand:SI 1 "lea_address_operand" "p") 0) |
2761 |
(match_operand:DI 2 "const_32bit_mask" "n")))] |
2762 |
"TARGET_64BIT" |
2763 |
- "lea{l}\t{%a1, %k0|%k0, %a1}" |
2764 |
+ "lea{l}\t{%E1, %k0|%k0, %E1}" |
2765 |
[(set_attr "type" "lea") |
2766 |
(set_attr "mode" "SI")]) |
2767 |
|
2768 |
@@ -5495,7 +5504,7 @@ |
2769 |
(match_operand:DI 1 "lea_address_operand" "p") |
2770 |
(match_operand:DI 2 "const_32bit_mask" "n")))] |
2771 |
"TARGET_64BIT" |
2772 |
- "lea{l}\t{%a1, %k0|%k0, %a1}" |
2773 |
+ "lea{l}\t{%E1, %k0|%k0, %E1}" |
2774 |
[(set_attr "type" "lea") |
2775 |
(set_attr "mode" "SI")]) |
2776 |
|
2777 |
@@ -11130,10 +11139,15 @@ |
2778 |
(set_attr "modrm" "0")]) |
2779 |
|
2780 |
(define_expand "indirect_jump" |
2781 |
- [(set (pc) (match_operand 0 "indirect_branch_operand" ""))]) |
2782 |
+ [(set (pc) (match_operand 0 "indirect_branch_operand" ""))] |
2783 |
+ "" |
2784 |
+{ |
2785 |
+ if (TARGET_X32) |
2786 |
+ operands[0] = convert_memory_address (word_mode, operands[0]); |
2787 |
+}) |
2788 |
|
2789 |
(define_insn "*indirect_jump" |
2790 |
- [(set (pc) (match_operand:P 0 "indirect_branch_operand" "rw"))] |
2791 |
+ [(set (pc) (match_operand:W 0 "indirect_branch_operand" "rw"))] |
2792 |
"" |
2793 |
"jmp\t%A0" |
2794 |
[(set_attr "type" "ibr") |
2795 |
@@ -11175,12 +11189,13 @@ |
2796 |
operands[0] = expand_simple_binop (Pmode, code, op0, op1, NULL_RTX, 0, |
2797 |
OPTAB_DIRECT); |
2798 |
} |
2799 |
- else if (TARGET_X32) |
2800 |
- operands[0] = convert_memory_address (Pmode, operands[0]); |
2801 |
+ |
2802 |
+ if (TARGET_X32) |
2803 |
+ operands[0] = convert_memory_address (word_mode, operands[0]); |
2804 |
}) |
2805 |
|
2806 |
(define_insn "*tablejump_1" |
2807 |
- [(set (pc) (match_operand:P 0 "indirect_branch_operand" "rw")) |
2808 |
+ [(set (pc) (match_operand:W 0 "indirect_branch_operand" "rw")) |
2809 |
(use (label_ref (match_operand 1 "" "")))] |
2810 |
"" |
2811 |
"jmp\t%A0" |
2812 |
@@ -11268,7 +11283,7 @@ |
2813 |
}) |
2814 |
|
2815 |
(define_insn_and_split "*call_vzeroupper" |
2816 |
- [(call (mem:QI (match_operand:P 0 "call_insn_operand" "<c>zw")) |
2817 |
+ [(call (mem:QI (match_operand:W 0 "call_insn_operand" "<c>zw")) |
2818 |
(match_operand 1 "" "")) |
2819 |
(unspec [(match_operand 2 "const_int_operand" "")] |
2820 |
UNSPEC_CALL_NEEDS_VZEROUPPER)] |
2821 |
@@ -11280,7 +11295,7 @@ |
2822 |
[(set_attr "type" "call")]) |
2823 |
|
2824 |
(define_insn "*call" |
2825 |
- [(call (mem:QI (match_operand:P 0 "call_insn_operand" "<c>zw")) |
2826 |
+ [(call (mem:QI (match_operand:W 0 "call_insn_operand" "<c>zw")) |
2827 |
(match_operand 1 "" ""))] |
2828 |
"!SIBLING_CALL_P (insn)" |
2829 |
"* return ix86_output_call_insn (insn, operands[0]);" |
2830 |
@@ -11332,7 +11347,7 @@ |
2831 |
[(set_attr "type" "call")]) |
2832 |
|
2833 |
(define_insn_and_split "*sibcall_vzeroupper" |
2834 |
- [(call (mem:QI (match_operand:P 0 "sibcall_insn_operand" "Uz")) |
2835 |
+ [(call (mem:QI (match_operand:W 0 "sibcall_insn_operand" "Uz")) |
2836 |
(match_operand 1 "" "")) |
2837 |
(unspec [(match_operand 2 "const_int_operand" "")] |
2838 |
UNSPEC_CALL_NEEDS_VZEROUPPER)] |
2839 |
@@ -11344,7 +11359,7 @@ |
2840 |
[(set_attr "type" "call")]) |
2841 |
|
2842 |
(define_insn "*sibcall" |
2843 |
- [(call (mem:QI (match_operand:P 0 "sibcall_insn_operand" "Uz")) |
2844 |
+ [(call (mem:QI (match_operand:W 0 "sibcall_insn_operand" "Uz")) |
2845 |
(match_operand 1 "" ""))] |
2846 |
"SIBLING_CALL_P (insn)" |
2847 |
"* return ix86_output_call_insn (insn, operands[0]);" |
2848 |
@@ -11441,7 +11456,7 @@ |
2849 |
|
2850 |
(define_insn_and_split "*call_value_vzeroupper" |
2851 |
[(set (match_operand 0 "" "") |
2852 |
- (call (mem:QI (match_operand:P 1 "call_insn_operand" "<c>zw")) |
2853 |
+ (call (mem:QI (match_operand:W 1 "call_insn_operand" "<c>zw")) |
2854 |
(match_operand 2 "" ""))) |
2855 |
(unspec [(match_operand 3 "const_int_operand" "")] |
2856 |
UNSPEC_CALL_NEEDS_VZEROUPPER)] |
2857 |
@@ -11454,7 +11469,7 @@ |
2858 |
|
2859 |
(define_insn "*call_value" |
2860 |
[(set (match_operand 0 "" "") |
2861 |
- (call (mem:QI (match_operand:P 1 "call_insn_operand" "<c>zw")) |
2862 |
+ (call (mem:QI (match_operand:W 1 "call_insn_operand" "<c>zw")) |
2863 |
(match_operand 2 "" "")))] |
2864 |
"!SIBLING_CALL_P (insn)" |
2865 |
"* return ix86_output_call_insn (insn, operands[1]);" |
2866 |
@@ -11462,7 +11477,7 @@ |
2867 |
|
2868 |
(define_insn_and_split "*sibcall_value_vzeroupper" |
2869 |
[(set (match_operand 0 "" "") |
2870 |
- (call (mem:QI (match_operand:P 1 "sibcall_insn_operand" "Uz")) |
2871 |
+ (call (mem:QI (match_operand:W 1 "sibcall_insn_operand" "Uz")) |
2872 |
(match_operand 2 "" ""))) |
2873 |
(unspec [(match_operand 3 "const_int_operand" "")] |
2874 |
UNSPEC_CALL_NEEDS_VZEROUPPER)] |
2875 |
@@ -11475,7 +11490,7 @@ |
2876 |
|
2877 |
(define_insn "*sibcall_value" |
2878 |
[(set (match_operand 0 "" "") |
2879 |
- (call (mem:QI (match_operand:P 1 "sibcall_insn_operand" "Uz")) |
2880 |
+ (call (mem:QI (match_operand:W 1 "sibcall_insn_operand" "Uz")) |
2881 |
(match_operand 2 "" "")))] |
2882 |
"SIBLING_CALL_P (insn)" |
2883 |
"* return ix86_output_call_insn (insn, operands[1]);" |
2884 |
@@ -12580,7 +12595,7 @@ |
2885 |
[(set (match_operand:SI 0 "register_operand" "=a") |
2886 |
(unspec:SI |
2887 |
[(match_operand:SI 1 "register_operand" "b") |
2888 |
- (match_operand:SI 2 "tls_symbolic_operand" "") |
2889 |
+ (match_operand 2 "tls_symbolic_operand" "") |
2890 |
(match_operand:SI 3 "constant_call_address_operand" "z")] |
2891 |
UNSPEC_TLS_GD)) |
2892 |
(clobber (match_scratch:SI 4 "=d")) |
2893 |
@@ -12589,7 +12604,7 @@ |
2894 |
"!TARGET_64BIT && TARGET_GNU_TLS" |
2895 |
{ |
2896 |
output_asm_insn |
2897 |
- ("lea{l}\t{%a2@tlsgd(,%1,1), %0|%0, %a2@tlsgd[%1*1]}", operands); |
2898 |
+ ("lea{l}\t{%E2@tlsgd(,%1,1), %0|%0, %E2@tlsgd[%1*1]}", operands); |
2899 |
if (TARGET_SUN_TLS) |
2900 |
#ifdef HAVE_AS_IX86_TLSGDPLT |
2901 |
return "call\t%a2@tlsgdplt"; |
2902 |
@@ -12605,26 +12620,26 @@ |
2903 |
[(parallel |
2904 |
[(set (match_operand:SI 0 "register_operand" "") |
2905 |
(unspec:SI [(match_operand:SI 2 "register_operand" "") |
2906 |
- (match_operand:SI 1 "tls_symbolic_operand" "") |
2907 |
+ (match_operand 1 "tls_symbolic_operand" "") |
2908 |
(match_operand:SI 3 "constant_call_address_operand" "")] |
2909 |
UNSPEC_TLS_GD)) |
2910 |
(clobber (match_scratch:SI 4 "")) |
2911 |
(clobber (match_scratch:SI 5 "")) |
2912 |
(clobber (reg:CC FLAGS_REG))])]) |
2913 |
|
2914 |
-(define_insn "*tls_global_dynamic_64" |
2915 |
- [(set (match_operand:DI 0 "register_operand" "=a") |
2916 |
- (call:DI |
2917 |
- (mem:QI (match_operand:DI 2 "constant_call_address_operand" "z")) |
2918 |
- (match_operand:DI 3 "" ""))) |
2919 |
- (unspec:DI [(match_operand 1 "tls_symbolic_operand" "")] |
2920 |
- UNSPEC_TLS_GD)] |
2921 |
+(define_insn "*tls_global_dynamic_64_<mode>" |
2922 |
+ [(set (match_operand:P 0 "register_operand" "=a") |
2923 |
+ (call:P |
2924 |
+ (mem:QI (match_operand:P 2 "constant_call_address_operand" "z")) |
2925 |
+ (match_operand:P 3 "" ""))) |
2926 |
+ (unspec:P [(match_operand 1 "tls_symbolic_operand" "")] |
2927 |
+ UNSPEC_TLS_GD)] |
2928 |
"TARGET_64BIT" |
2929 |
{ |
2930 |
if (!TARGET_X32) |
2931 |
fputs (ASM_BYTE "0x66\n", asm_out_file); |
2932 |
output_asm_insn |
2933 |
- ("lea{q}\t{%a1@tlsgd(%%rip), %%rdi|rdi, %a1@tlsgd[rip]}", operands); |
2934 |
+ ("lea{q}\t{%E1@tlsgd(%%rip), %%rdi|rdi, %E1@tlsgd[rip]}", operands); |
2935 |
fputs (ASM_SHORT "0x6666\n", asm_out_file); |
2936 |
fputs ("\trex64\n", asm_out_file); |
2937 |
if (TARGET_SUN_TLS) |
2938 |
@@ -12635,14 +12650,15 @@ |
2939 |
(set (attr "length") |
2940 |
(symbol_ref "TARGET_X32 ? 15 : 16"))]) |
2941 |
|
2942 |
-(define_expand "tls_global_dynamic_64" |
2943 |
+(define_expand "tls_global_dynamic_64_<mode>" |
2944 |
[(parallel |
2945 |
- [(set (match_operand:DI 0 "register_operand" "") |
2946 |
- (call:DI |
2947 |
- (mem:QI (match_operand:DI 2 "constant_call_address_operand" "")) |
2948 |
+ [(set (match_operand:P 0 "register_operand" "") |
2949 |
+ (call:P |
2950 |
+ (mem:QI (match_operand:P 2 "constant_call_address_operand" "")) |
2951 |
(const_int 0))) |
2952 |
- (unspec:DI [(match_operand 1 "tls_symbolic_operand" "")] |
2953 |
- UNSPEC_TLS_GD)])]) |
2954 |
+ (unspec:P [(match_operand 1 "tls_symbolic_operand" "")] |
2955 |
+ UNSPEC_TLS_GD)])] |
2956 |
+ "TARGET_64BIT") |
2957 |
|
2958 |
(define_insn "*tls_local_dynamic_base_32_gnu" |
2959 |
[(set (match_operand:SI 0 "register_operand" "=a") |
2960 |
@@ -12679,12 +12695,12 @@ |
2961 |
(clobber (match_scratch:SI 4 "")) |
2962 |
(clobber (reg:CC FLAGS_REG))])]) |
2963 |
|
2964 |
-(define_insn "*tls_local_dynamic_base_64" |
2965 |
- [(set (match_operand:DI 0 "register_operand" "=a") |
2966 |
- (call:DI |
2967 |
- (mem:QI (match_operand:DI 1 "constant_call_address_operand" "z")) |
2968 |
- (match_operand:DI 2 "" ""))) |
2969 |
- (unspec:DI [(const_int 0)] UNSPEC_TLS_LD_BASE)] |
2970 |
+(define_insn "*tls_local_dynamic_base_64_<mode>" |
2971 |
+ [(set (match_operand:P 0 "register_operand" "=a") |
2972 |
+ (call:P |
2973 |
+ (mem:QI (match_operand:P 1 "constant_call_address_operand" "z")) |
2974 |
+ (match_operand:P 2 "" ""))) |
2975 |
+ (unspec:P [(const_int 0)] UNSPEC_TLS_LD_BASE)] |
2976 |
"TARGET_64BIT" |
2977 |
{ |
2978 |
output_asm_insn |
2979 |
@@ -12696,13 +12712,14 @@ |
2980 |
[(set_attr "type" "multi") |
2981 |
(set_attr "length" "12")]) |
2982 |
|
2983 |
-(define_expand "tls_local_dynamic_base_64" |
2984 |
+(define_expand "tls_local_dynamic_base_64_<mode>" |
2985 |
[(parallel |
2986 |
- [(set (match_operand:DI 0 "register_operand" "") |
2987 |
- (call:DI |
2988 |
- (mem:QI (match_operand:DI 1 "constant_call_address_operand" "")) |
2989 |
+ [(set (match_operand:P 0 "register_operand" "") |
2990 |
+ (call:P |
2991 |
+ (mem:QI (match_operand:P 1 "constant_call_address_operand" "")) |
2992 |
(const_int 0))) |
2993 |
- (unspec:DI [(const_int 0)] UNSPEC_TLS_LD_BASE)])]) |
2994 |
+ (unspec:P [(const_int 0)] UNSPEC_TLS_LD_BASE)])] |
2995 |
+ "TARGET_64BIT") |
2996 |
|
2997 |
;; Local dynamic of a single variable is a lose. Show combine how |
2998 |
;; to convert that back to global dynamic. |
2999 |
@@ -12714,7 +12731,7 @@ |
3000 |
(match_operand:SI 2 "constant_call_address_operand" "z")] |
3001 |
UNSPEC_TLS_LD_BASE) |
3002 |
(const:SI (unspec:SI |
3003 |
- [(match_operand:SI 3 "tls_symbolic_operand" "")] |
3004 |
+ [(match_operand 3 "tls_symbolic_operand" "")] |
3005 |
UNSPEC_DTPOFF)))) |
3006 |
(clobber (match_scratch:SI 4 "=d")) |
3007 |
(clobber (match_scratch:SI 5 "=c")) |
3008 |
@@ -12812,7 +12829,7 @@ |
3009 |
(define_insn "tls_initial_exec_64_sun" |
3010 |
[(set (match_operand:DI 0 "register_operand" "=a") |
3011 |
(unspec:DI |
3012 |
- [(match_operand:DI 1 "tls_symbolic_operand" "")] |
3013 |
+ [(match_operand 1 "tls_symbolic_operand" "")] |
3014 |
UNSPEC_TLS_IE_SUN)) |
3015 |
(clobber (reg:CC FLAGS_REG))] |
3016 |
"TARGET_64BIT && TARGET_SUN_TLS" |
3017 |
@@ -12829,7 +12846,7 @@ |
3018 |
[(set (match_dup 3) |
3019 |
(plus:SI (match_operand:SI 2 "register_operand" "") |
3020 |
(const:SI |
3021 |
- (unspec:SI [(match_operand:SI 1 "tls_symbolic_operand" "")] |
3022 |
+ (unspec:SI [(match_operand 1 "tls_symbolic_operand" "")] |
3023 |
UNSPEC_TLSDESC)))) |
3024 |
(parallel |
3025 |
[(set (match_operand:SI 0 "register_operand" "") |
3026 |
@@ -12847,10 +12864,10 @@ |
3027 |
[(set (match_operand:SI 0 "register_operand" "=r") |
3028 |
(plus:SI (match_operand:SI 1 "register_operand" "b") |
3029 |
(const:SI |
3030 |
- (unspec:SI [(match_operand:SI 2 "tls_symbolic_operand" "")] |
3031 |
+ (unspec:SI [(match_operand 2 "tls_symbolic_operand" "")] |
3032 |
UNSPEC_TLSDESC))))] |
3033 |
"!TARGET_64BIT && TARGET_GNU2_TLS" |
3034 |
- "lea{l}\t{%a2@TLSDESC(%1), %0|%0, %a2@TLSDESC[%1]}" |
3035 |
+ "lea{l}\t{%E2@TLSDESC(%1), %0|%0, %E2@TLSDESC[%1]}" |
3036 |
[(set_attr "type" "lea") |
3037 |
(set_attr "mode" "SI") |
3038 |
(set_attr "length" "6") |
3039 |
@@ -12858,7 +12875,7 @@ |
3040 |
|
3041 |
(define_insn "*tls_dynamic_gnu2_call_32" |
3042 |
[(set (match_operand:SI 0 "register_operand" "=a") |
3043 |
- (unspec:SI [(match_operand:SI 1 "tls_symbolic_operand" "") |
3044 |
+ (unspec:SI [(match_operand 1 "tls_symbolic_operand" "") |
3045 |
(match_operand:SI 2 "register_operand" "0") |
3046 |
;; we have to make sure %ebx still points to the GOT |
3047 |
(match_operand:SI 3 "register_operand" "b") |
3048 |
@@ -12874,13 +12891,13 @@ |
3049 |
(define_insn_and_split "*tls_dynamic_gnu2_combine_32" |
3050 |
[(set (match_operand:SI 0 "register_operand" "=&a") |
3051 |
(plus:SI |
3052 |
- (unspec:SI [(match_operand:SI 3 "tls_modbase_operand" "") |
3053 |
+ (unspec:SI [(match_operand 3 "tls_modbase_operand" "") |
3054 |
(match_operand:SI 4 "" "") |
3055 |
(match_operand:SI 2 "register_operand" "b") |
3056 |
(reg:SI SP_REG)] |
3057 |
UNSPEC_TLSDESC) |
3058 |
(const:SI (unspec:SI |
3059 |
- [(match_operand:SI 1 "tls_symbolic_operand" "")] |
3060 |
+ [(match_operand 1 "tls_symbolic_operand" "")] |
3061 |
UNSPEC_DTPOFF)))) |
3062 |
(clobber (reg:CC FLAGS_REG))] |
3063 |
"!TARGET_64BIT && TARGET_GNU2_TLS" |
3064 |
@@ -12912,7 +12929,7 @@ |
3065 |
(unspec:DI [(match_operand 1 "tls_symbolic_operand" "")] |
3066 |
UNSPEC_TLSDESC))] |
3067 |
"TARGET_64BIT && TARGET_GNU2_TLS" |
3068 |
- "lea{q}\t{%a1@TLSDESC(%%rip), %0|%0, %a1@TLSDESC[rip]}" |
3069 |
+ "lea{q}\t{%E1@TLSDESC(%%rip), %0|%0, %E1@TLSDESC[rip]}" |
3070 |
[(set_attr "type" "lea") |
3071 |
(set_attr "mode" "DI") |
3072 |
(set_attr "length" "7") |
3073 |
@@ -12934,7 +12951,7 @@ |
3074 |
(define_insn_and_split "*tls_dynamic_gnu2_combine_64" |
3075 |
[(set (match_operand:DI 0 "register_operand" "=&a") |
3076 |
(plus:DI |
3077 |
- (unspec:DI [(match_operand:DI 2 "tls_modbase_operand" "") |
3078 |
+ (unspec:DI [(match_operand 2 "tls_modbase_operand" "") |
3079 |
(match_operand:DI 3 "" "") |
3080 |
(reg:DI SP_REG)] |
3081 |
UNSPEC_TLSDESC) |
3082 |
@@ -15733,17 +15750,17 @@ |
3083 |
"ix86_current_function_needs_cld = 1;") |
3084 |
|
3085 |
(define_insn "*strmovdi_rex_1" |
3086 |
- [(set (mem:DI (match_operand:DI 2 "register_operand" "0")) |
3087 |
- (mem:DI (match_operand:DI 3 "register_operand" "1"))) |
3088 |
- (set (match_operand:DI 0 "register_operand" "=D") |
3089 |
- (plus:DI (match_dup 2) |
3090 |
- (const_int 8))) |
3091 |
- (set (match_operand:DI 1 "register_operand" "=S") |
3092 |
- (plus:DI (match_dup 3) |
3093 |
- (const_int 8)))] |
3094 |
+ [(set (mem:DI (match_operand:P 2 "register_operand" "0")) |
3095 |
+ (mem:DI (match_operand:P 3 "register_operand" "1"))) |
3096 |
+ (set (match_operand:P 0 "register_operand" "=D") |
3097 |
+ (plus:P (match_dup 2) |
3098 |
+ (const_int 8))) |
3099 |
+ (set (match_operand:P 1 "register_operand" "=S") |
3100 |
+ (plus:P (match_dup 3) |
3101 |
+ (const_int 8)))] |
3102 |
"TARGET_64BIT |
3103 |
&& !(fixed_regs[SI_REG] || fixed_regs[DI_REG])" |
3104 |
- "movsq" |
3105 |
+ "%^movsq" |
3106 |
[(set_attr "type" "str") |
3107 |
(set_attr "memory" "both") |
3108 |
(set_attr "mode" "DI")]) |
3109 |
@@ -15758,7 +15775,7 @@ |
3110 |
(plus:P (match_dup 3) |
3111 |
(const_int 4)))] |
3112 |
"!(fixed_regs[SI_REG] || fixed_regs[DI_REG])" |
3113 |
- "movs{l|d}" |
3114 |
+ "%^movs{l|d}" |
3115 |
[(set_attr "type" "str") |
3116 |
(set_attr "memory" "both") |
3117 |
(set_attr "mode" "SI")]) |
3118 |
@@ -15773,7 +15790,7 @@ |
3119 |
(plus:P (match_dup 3) |
3120 |
(const_int 2)))] |
3121 |
"!(fixed_regs[SI_REG] || fixed_regs[DI_REG])" |
3122 |
- "movsw" |
3123 |
+ "%^movsw" |
3124 |
[(set_attr "type" "str") |
3125 |
(set_attr "memory" "both") |
3126 |
(set_attr "mode" "HI")]) |
3127 |
@@ -15788,7 +15805,7 @@ |
3128 |
(plus:P (match_dup 3) |
3129 |
(const_int 1)))] |
3130 |
"!(fixed_regs[SI_REG] || fixed_regs[DI_REG])" |
3131 |
- "movsb" |
3132 |
+ "%^movsb" |
3133 |
[(set_attr "type" "str") |
3134 |
(set_attr "memory" "both") |
3135 |
(set (attr "prefix_rex") |
3136 |
@@ -15811,20 +15828,20 @@ |
3137 |
"ix86_current_function_needs_cld = 1;") |
3138 |
|
3139 |
(define_insn "*rep_movdi_rex64" |
3140 |
- [(set (match_operand:DI 2 "register_operand" "=c") (const_int 0)) |
3141 |
- (set (match_operand:DI 0 "register_operand" "=D") |
3142 |
- (plus:DI (ashift:DI (match_operand:DI 5 "register_operand" "2") |
3143 |
- (const_int 3)) |
3144 |
- (match_operand:DI 3 "register_operand" "0"))) |
3145 |
- (set (match_operand:DI 1 "register_operand" "=S") |
3146 |
- (plus:DI (ashift:DI (match_dup 5) (const_int 3)) |
3147 |
- (match_operand:DI 4 "register_operand" "1"))) |
3148 |
+ [(set (match_operand:P 2 "register_operand" "=c") (const_int 0)) |
3149 |
+ (set (match_operand:P 0 "register_operand" "=D") |
3150 |
+ (plus:P (ashift:P (match_operand:P 5 "register_operand" "2") |
3151 |
+ (const_int 3)) |
3152 |
+ (match_operand:P 3 "register_operand" "0"))) |
3153 |
+ (set (match_operand:P 1 "register_operand" "=S") |
3154 |
+ (plus:P (ashift:P (match_dup 5) (const_int 3)) |
3155 |
+ (match_operand:P 4 "register_operand" "1"))) |
3156 |
(set (mem:BLK (match_dup 3)) |
3157 |
(mem:BLK (match_dup 4))) |
3158 |
(use (match_dup 5))] |
3159 |
"TARGET_64BIT |
3160 |
&& !(fixed_regs[CX_REG] || fixed_regs[SI_REG] || fixed_regs[DI_REG])" |
3161 |
- "rep{%;} movsq" |
3162 |
+ "%^rep{%;} movsq" |
3163 |
[(set_attr "type" "str") |
3164 |
(set_attr "prefix_rep" "1") |
3165 |
(set_attr "memory" "both") |
3166 |
@@ -15843,7 +15860,7 @@ |
3167 |
(mem:BLK (match_dup 4))) |
3168 |
(use (match_dup 5))] |
3169 |
"!(fixed_regs[CX_REG] || fixed_regs[SI_REG] || fixed_regs[DI_REG])" |
3170 |
- "rep{%;} movs{l|d}" |
3171 |
+ "%^rep{%;} movs{l|d}" |
3172 |
[(set_attr "type" "str") |
3173 |
(set_attr "prefix_rep" "1") |
3174 |
(set_attr "memory" "both") |
3175 |
@@ -15860,7 +15877,7 @@ |
3176 |
(mem:BLK (match_dup 4))) |
3177 |
(use (match_dup 5))] |
3178 |
"!(fixed_regs[CX_REG] || fixed_regs[SI_REG] || fixed_regs[DI_REG])" |
3179 |
- "rep{%;} movsb" |
3180 |
+ "%^rep{%;} movsb" |
3181 |
[(set_attr "type" "str") |
3182 |
(set_attr "prefix_rep" "1") |
3183 |
(set_attr "memory" "both") |
3184 |
@@ -15921,14 +15938,14 @@ |
3185 |
"ix86_current_function_needs_cld = 1;") |
3186 |
|
3187 |
(define_insn "*strsetdi_rex_1" |
3188 |
- [(set (mem:DI (match_operand:DI 1 "register_operand" "0")) |
3189 |
+ [(set (mem:DI (match_operand:P 1 "register_operand" "0")) |
3190 |
(match_operand:DI 2 "register_operand" "a")) |
3191 |
- (set (match_operand:DI 0 "register_operand" "=D") |
3192 |
- (plus:DI (match_dup 1) |
3193 |
- (const_int 8)))] |
3194 |
+ (set (match_operand:P 0 "register_operand" "=D") |
3195 |
+ (plus:P (match_dup 1) |
3196 |
+ (const_int 8)))] |
3197 |
"TARGET_64BIT |
3198 |
&& !(fixed_regs[AX_REG] || fixed_regs[DI_REG])" |
3199 |
- "stosq" |
3200 |
+ "%^stosq" |
3201 |
[(set_attr "type" "str") |
3202 |
(set_attr "memory" "store") |
3203 |
(set_attr "mode" "DI")]) |
3204 |
@@ -15940,7 +15957,7 @@ |
3205 |
(plus:P (match_dup 1) |
3206 |
(const_int 4)))] |
3207 |
"!(fixed_regs[AX_REG] || fixed_regs[DI_REG])" |
3208 |
- "stos{l|d}" |
3209 |
+ "%^stos{l|d}" |
3210 |
[(set_attr "type" "str") |
3211 |
(set_attr "memory" "store") |
3212 |
(set_attr "mode" "SI")]) |
3213 |
@@ -15952,7 +15969,7 @@ |
3214 |
(plus:P (match_dup 1) |
3215 |
(const_int 2)))] |
3216 |
"!(fixed_regs[AX_REG] || fixed_regs[DI_REG])" |
3217 |
- "stosw" |
3218 |
+ "%^stosw" |
3219 |
[(set_attr "type" "str") |
3220 |
(set_attr "memory" "store") |
3221 |
(set_attr "mode" "HI")]) |
3222 |
@@ -15964,7 +15981,7 @@ |
3223 |
(plus:P (match_dup 1) |
3224 |
(const_int 1)))] |
3225 |
"!(fixed_regs[AX_REG] || fixed_regs[DI_REG])" |
3226 |
- "stosb" |
3227 |
+ "%^stosb" |
3228 |
[(set_attr "type" "str") |
3229 |
(set_attr "memory" "store") |
3230 |
(set (attr "prefix_rex") |
3231 |
@@ -15985,18 +16002,18 @@ |
3232 |
"ix86_current_function_needs_cld = 1;") |
3233 |
|
3234 |
(define_insn "*rep_stosdi_rex64" |
3235 |
- [(set (match_operand:DI 1 "register_operand" "=c") (const_int 0)) |
3236 |
- (set (match_operand:DI 0 "register_operand" "=D") |
3237 |
- (plus:DI (ashift:DI (match_operand:DI 4 "register_operand" "1") |
3238 |
- (const_int 3)) |
3239 |
- (match_operand:DI 3 "register_operand" "0"))) |
3240 |
+ [(set (match_operand:P 1 "register_operand" "=c") (const_int 0)) |
3241 |
+ (set (match_operand:P 0 "register_operand" "=D") |
3242 |
+ (plus:P (ashift:P (match_operand:P 4 "register_operand" "1") |
3243 |
+ (const_int 3)) |
3244 |
+ (match_operand:P 3 "register_operand" "0"))) |
3245 |
(set (mem:BLK (match_dup 3)) |
3246 |
(const_int 0)) |
3247 |
(use (match_operand:DI 2 "register_operand" "a")) |
3248 |
(use (match_dup 4))] |
3249 |
"TARGET_64BIT |
3250 |
&& !(fixed_regs[AX_REG] || fixed_regs[CX_REG] || fixed_regs[DI_REG])" |
3251 |
- "rep{%;} stosq" |
3252 |
+ "%^rep{%;} stosq" |
3253 |
[(set_attr "type" "str") |
3254 |
(set_attr "prefix_rep" "1") |
3255 |
(set_attr "memory" "store") |
3256 |
@@ -16013,7 +16030,7 @@ |
3257 |
(use (match_operand:SI 2 "register_operand" "a")) |
3258 |
(use (match_dup 4))] |
3259 |
"!(fixed_regs[AX_REG] || fixed_regs[CX_REG] || fixed_regs[DI_REG])" |
3260 |
- "rep{%;} stos{l|d}" |
3261 |
+ "%^rep{%;} stos{l|d}" |
3262 |
[(set_attr "type" "str") |
3263 |
(set_attr "prefix_rep" "1") |
3264 |
(set_attr "memory" "store") |
3265 |
@@ -16029,7 +16046,7 @@ |
3266 |
(use (match_operand:QI 2 "register_operand" "a")) |
3267 |
(use (match_dup 4))] |
3268 |
"!(fixed_regs[AX_REG] || fixed_regs[CX_REG] || fixed_regs[DI_REG])" |
3269 |
- "rep{%;} stosb" |
3270 |
+ "%^rep{%;} stosb" |
3271 |
[(set_attr "type" "str") |
3272 |
(set_attr "prefix_rep" "1") |
3273 |
(set_attr "memory" "store") |
3274 |
@@ -16150,7 +16167,7 @@ |
3275 |
(clobber (match_operand:P 1 "register_operand" "=D")) |
3276 |
(clobber (match_operand:P 2 "register_operand" "=c"))] |
3277 |
"!(fixed_regs[CX_REG] || fixed_regs[SI_REG] || fixed_regs[DI_REG])" |
3278 |
- "repz{%;} cmpsb" |
3279 |
+ "%^repz{%;} cmpsb" |
3280 |
[(set_attr "type" "str") |
3281 |
(set_attr "mode" "QI") |
3282 |
(set (attr "prefix_rex") |
3283 |
@@ -16190,7 +16207,7 @@ |
3284 |
(clobber (match_operand:P 1 "register_operand" "=D")) |
3285 |
(clobber (match_operand:P 2 "register_operand" "=c"))] |
3286 |
"!(fixed_regs[CX_REG] || fixed_regs[SI_REG] || fixed_regs[DI_REG])" |
3287 |
- "repz{%;} cmpsb" |
3288 |
+ "%^repz{%;} cmpsb" |
3289 |
[(set_attr "type" "str") |
3290 |
(set_attr "mode" "QI") |
3291 |
(set (attr "prefix_rex") |
3292 |
@@ -16231,7 +16248,7 @@ |
3293 |
(clobber (match_operand:P 1 "register_operand" "=D")) |
3294 |
(clobber (reg:CC FLAGS_REG))] |
3295 |
"!(fixed_regs[AX_REG] || fixed_regs[CX_REG] || fixed_regs[DI_REG])" |
3296 |
- "repnz{%;} scasb" |
3297 |
+ "%^repnz{%;} scasb" |
3298 |
[(set_attr "type" "str") |
3299 |
(set_attr "mode" "QI") |
3300 |
(set (attr "prefix_rex") |
3301 |
@@ -16663,7 +16680,7 @@ |
3302 |
|
3303 |
default: |
3304 |
operands[2] = SET_SRC (XVECEXP (PATTERN (insn), 0, 0)); |
3305 |
- return "lea{<imodesuffix>}\t{%a2, %0|%0, %a2}"; |
3306 |
+ return "lea{<imodesuffix>}\t{%E2, %0|%0, %E2}"; |
3307 |
} |
3308 |
} |
3309 |
[(set (attr "type") |
3310 |
@@ -17391,131 +17408,131 @@ |
3311 |
;; alternative when no register is available later. |
3312 |
|
3313 |
(define_peephole2 |
3314 |
- [(match_scratch:P 1 "r") |
3315 |
+ [(match_scratch:W 1 "r") |
3316 |
(parallel [(set (reg:P SP_REG) |
3317 |
(plus:P (reg:P SP_REG) |
3318 |
(match_operand:P 0 "const_int_operand" ""))) |
3319 |
(clobber (reg:CC FLAGS_REG)) |
3320 |
(clobber (mem:BLK (scratch)))])] |
3321 |
"(TARGET_SINGLE_PUSH || optimize_insn_for_size_p ()) |
3322 |
- && INTVAL (operands[0]) == -GET_MODE_SIZE (Pmode)" |
3323 |
+ && INTVAL (operands[0]) == -GET_MODE_SIZE (word_mode)" |
3324 |
[(clobber (match_dup 1)) |
3325 |
- (parallel [(set (mem:P (pre_dec:P (reg:P SP_REG))) (match_dup 1)) |
3326 |
+ (parallel [(set (mem:W (pre_dec:P (reg:P SP_REG))) (match_dup 1)) |
3327 |
(clobber (mem:BLK (scratch)))])]) |
3328 |
|
3329 |
(define_peephole2 |
3330 |
- [(match_scratch:P 1 "r") |
3331 |
+ [(match_scratch:W 1 "r") |
3332 |
(parallel [(set (reg:P SP_REG) |
3333 |
(plus:P (reg:P SP_REG) |
3334 |
(match_operand:P 0 "const_int_operand" ""))) |
3335 |
(clobber (reg:CC FLAGS_REG)) |
3336 |
(clobber (mem:BLK (scratch)))])] |
3337 |
"(TARGET_DOUBLE_PUSH || optimize_insn_for_size_p ()) |
3338 |
- && INTVAL (operands[0]) == -2*GET_MODE_SIZE (Pmode)" |
3339 |
+ && INTVAL (operands[0]) == -2*GET_MODE_SIZE (word_mode)" |
3340 |
[(clobber (match_dup 1)) |
3341 |
- (set (mem:P (pre_dec:P (reg:P SP_REG))) (match_dup 1)) |
3342 |
- (parallel [(set (mem:P (pre_dec:P (reg:P SP_REG))) (match_dup 1)) |
3343 |
+ (set (mem:W (pre_dec:P (reg:P SP_REG))) (match_dup 1)) |
3344 |
+ (parallel [(set (mem:W (pre_dec:P (reg:P SP_REG))) (match_dup 1)) |
3345 |
(clobber (mem:BLK (scratch)))])]) |
3346 |
|
3347 |
;; Convert esp subtractions to push. |
3348 |
(define_peephole2 |
3349 |
- [(match_scratch:P 1 "r") |
3350 |
+ [(match_scratch:W 1 "r") |
3351 |
(parallel [(set (reg:P SP_REG) |
3352 |
(plus:P (reg:P SP_REG) |
3353 |
(match_operand:P 0 "const_int_operand" ""))) |
3354 |
(clobber (reg:CC FLAGS_REG))])] |
3355 |
"(TARGET_SINGLE_PUSH || optimize_insn_for_size_p ()) |
3356 |
- && INTVAL (operands[0]) == -GET_MODE_SIZE (Pmode)" |
3357 |
+ && INTVAL (operands[0]) == -GET_MODE_SIZE (word_mode)" |
3358 |
[(clobber (match_dup 1)) |
3359 |
- (set (mem:P (pre_dec:P (reg:P SP_REG))) (match_dup 1))]) |
3360 |
+ (set (mem:W (pre_dec:P (reg:P SP_REG))) (match_dup 1))]) |
3361 |
|
3362 |
(define_peephole2 |
3363 |
- [(match_scratch:P 1 "r") |
3364 |
+ [(match_scratch:W 1 "r") |
3365 |
(parallel [(set (reg:P SP_REG) |
3366 |
(plus:P (reg:P SP_REG) |
3367 |
(match_operand:P 0 "const_int_operand" ""))) |
3368 |
(clobber (reg:CC FLAGS_REG))])] |
3369 |
"(TARGET_DOUBLE_PUSH || optimize_insn_for_size_p ()) |
3370 |
- && INTVAL (operands[0]) == -2*GET_MODE_SIZE (Pmode)" |
3371 |
+ && INTVAL (operands[0]) == -2*GET_MODE_SIZE (word_mode)" |
3372 |
[(clobber (match_dup 1)) |
3373 |
- (set (mem:P (pre_dec:P (reg:P SP_REG))) (match_dup 1)) |
3374 |
- (set (mem:P (pre_dec:P (reg:P SP_REG))) (match_dup 1))]) |
3375 |
+ (set (mem:W (pre_dec:P (reg:P SP_REG))) (match_dup 1)) |
3376 |
+ (set (mem:W (pre_dec:P (reg:P SP_REG))) (match_dup 1))]) |
3377 |
|
3378 |
;; Convert epilogue deallocator to pop. |
3379 |
(define_peephole2 |
3380 |
- [(match_scratch:P 1 "r") |
3381 |
+ [(match_scratch:W 1 "r") |
3382 |
(parallel [(set (reg:P SP_REG) |
3383 |
(plus:P (reg:P SP_REG) |
3384 |
(match_operand:P 0 "const_int_operand" ""))) |
3385 |
(clobber (reg:CC FLAGS_REG)) |
3386 |
(clobber (mem:BLK (scratch)))])] |
3387 |
"(TARGET_SINGLE_POP || optimize_insn_for_size_p ()) |
3388 |
- && INTVAL (operands[0]) == GET_MODE_SIZE (Pmode)" |
3389 |
- [(parallel [(set (match_dup 1) (mem:P (post_inc:P (reg:P SP_REG)))) |
3390 |
+ && INTVAL (operands[0]) == GET_MODE_SIZE (word_mode)" |
3391 |
+ [(parallel [(set (match_dup 1) (mem:W (post_inc:P (reg:P SP_REG)))) |
3392 |
(clobber (mem:BLK (scratch)))])]) |
3393 |
|
3394 |
;; Two pops case is tricky, since pop causes dependency |
3395 |
;; on destination register. We use two registers if available. |
3396 |
(define_peephole2 |
3397 |
- [(match_scratch:P 1 "r") |
3398 |
- (match_scratch:P 2 "r") |
3399 |
+ [(match_scratch:W 1 "r") |
3400 |
+ (match_scratch:W 2 "r") |
3401 |
(parallel [(set (reg:P SP_REG) |
3402 |
(plus:P (reg:P SP_REG) |
3403 |
(match_operand:P 0 "const_int_operand" ""))) |
3404 |
(clobber (reg:CC FLAGS_REG)) |
3405 |
(clobber (mem:BLK (scratch)))])] |
3406 |
"(TARGET_DOUBLE_POP || optimize_insn_for_size_p ()) |
3407 |
- && INTVAL (operands[0]) == 2*GET_MODE_SIZE (Pmode)" |
3408 |
- [(parallel [(set (match_dup 1) (mem:P (post_inc:P (reg:P SP_REG)))) |
3409 |
+ && INTVAL (operands[0]) == 2*GET_MODE_SIZE (word_mode)" |
3410 |
+ [(parallel [(set (match_dup 1) (mem:W (post_inc:P (reg:P SP_REG)))) |
3411 |
(clobber (mem:BLK (scratch)))]) |
3412 |
- (set (match_dup 2) (mem:P (post_inc:P (reg:P SP_REG))))]) |
3413 |
+ (set (match_dup 2) (mem:W (post_inc:P (reg:P SP_REG))))]) |
3414 |
|
3415 |
(define_peephole2 |
3416 |
- [(match_scratch:P 1 "r") |
3417 |
+ [(match_scratch:W 1 "r") |
3418 |
(parallel [(set (reg:P SP_REG) |
3419 |
(plus:P (reg:P SP_REG) |
3420 |
(match_operand:P 0 "const_int_operand" ""))) |
3421 |
(clobber (reg:CC FLAGS_REG)) |
3422 |
(clobber (mem:BLK (scratch)))])] |
3423 |
"optimize_insn_for_size_p () |
3424 |
- && INTVAL (operands[0]) == 2*GET_MODE_SIZE (Pmode)" |
3425 |
- [(parallel [(set (match_dup 1) (mem:P (post_inc:P (reg:P SP_REG)))) |
3426 |
+ && INTVAL (operands[0]) == 2*GET_MODE_SIZE (word_mode)" |
3427 |
+ [(parallel [(set (match_dup 1) (mem:W (post_inc:P (reg:P SP_REG)))) |
3428 |
(clobber (mem:BLK (scratch)))]) |
3429 |
- (set (match_dup 1) (mem:P (post_inc:P (reg:P SP_REG))))]) |
3430 |
+ (set (match_dup 1) (mem:W (post_inc:P (reg:P SP_REG))))]) |
3431 |
|
3432 |
;; Convert esp additions to pop. |
3433 |
(define_peephole2 |
3434 |
- [(match_scratch:P 1 "r") |
3435 |
+ [(match_scratch:W 1 "r") |
3436 |
(parallel [(set (reg:P SP_REG) |
3437 |
(plus:P (reg:P SP_REG) |
3438 |
(match_operand:P 0 "const_int_operand" ""))) |
3439 |
(clobber (reg:CC FLAGS_REG))])] |
3440 |
- "INTVAL (operands[0]) == GET_MODE_SIZE (Pmode)" |
3441 |
- [(set (match_dup 1) (mem:P (post_inc:P (reg:P SP_REG))))]) |
3442 |
+ "INTVAL (operands[0]) == GET_MODE_SIZE (word_mode)" |
3443 |
+ [(set (match_dup 1) (mem:W (post_inc:P (reg:P SP_REG))))]) |
3444 |
|
3445 |
;; Two pops case is tricky, since pop causes dependency |
3446 |
;; on destination register. We use two registers if available. |
3447 |
(define_peephole2 |
3448 |
- [(match_scratch:P 1 "r") |
3449 |
- (match_scratch:P 2 "r") |
3450 |
+ [(match_scratch:W 1 "r") |
3451 |
+ (match_scratch:W 2 "r") |
3452 |
(parallel [(set (reg:P SP_REG) |
3453 |
(plus:P (reg:P SP_REG) |
3454 |
(match_operand:P 0 "const_int_operand" ""))) |
3455 |
(clobber (reg:CC FLAGS_REG))])] |
3456 |
- "INTVAL (operands[0]) == 2*GET_MODE_SIZE (Pmode)" |
3457 |
- [(set (match_dup 1) (mem:P (post_inc:P (reg:P SP_REG)))) |
3458 |
- (set (match_dup 2) (mem:P (post_inc:P (reg:P SP_REG))))]) |
3459 |
+ "INTVAL (operands[0]) == 2*GET_MODE_SIZE (word_mode)" |
3460 |
+ [(set (match_dup 1) (mem:W (post_inc:P (reg:P SP_REG)))) |
3461 |
+ (set (match_dup 2) (mem:W (post_inc:P (reg:P SP_REG))))]) |
3462 |
|
3463 |
(define_peephole2 |
3464 |
- [(match_scratch:P 1 "r") |
3465 |
+ [(match_scratch:W 1 "r") |
3466 |
(parallel [(set (reg:P SP_REG) |
3467 |
(plus:P (reg:P SP_REG) |
3468 |
(match_operand:P 0 "const_int_operand" ""))) |
3469 |
(clobber (reg:CC FLAGS_REG))])] |
3470 |
"optimize_insn_for_size_p () |
3471 |
- && INTVAL (operands[0]) == 2*GET_MODE_SIZE (Pmode)" |
3472 |
- [(set (match_dup 1) (mem:P (post_inc:P (reg:P SP_REG)))) |
3473 |
- (set (match_dup 1) (mem:P (post_inc:P (reg:P SP_REG))))]) |
3474 |
+ && INTVAL (operands[0]) == 2*GET_MODE_SIZE (word_mode)" |
3475 |
+ [(set (match_dup 1) (mem:W (post_inc:P (reg:P SP_REG)))) |
3476 |
+ (set (match_dup 1) (mem:W (post_inc:P (reg:P SP_REG))))]) |
3477 |
|
3478 |
;; Convert compares with 1 to shorter inc/dec operations when CF is not |
3479 |
;; required and register dies. Similarly for 128 to -128. |
3480 |
@@ -17626,7 +17643,7 @@ |
3481 |
;; leal (%edx,%eax,4), %eax |
3482 |
|
3483 |
(define_peephole2 |
3484 |
- [(match_scratch:P 5 "r") |
3485 |
+ [(match_scratch:W 5 "r") |
3486 |
(parallel [(set (match_operand 0 "register_operand" "") |
3487 |
(ashift (match_operand 1 "register_operand" "") |
3488 |
(match_operand 2 "const_int_operand" ""))) |
3489 |
@@ -17652,16 +17669,16 @@ |
3490 |
enum machine_mode op1mode = GET_MODE (operands[1]); |
3491 |
enum machine_mode mode = op1mode == DImode ? DImode : SImode; |
3492 |
int scale = 1 << INTVAL (operands[2]); |
3493 |
- rtx index = gen_lowpart (Pmode, operands[1]); |
3494 |
- rtx base = gen_lowpart (Pmode, operands[5]); |
3495 |
+ rtx index = gen_lowpart (word_mode, operands[1]); |
3496 |
+ rtx base = gen_lowpart (word_mode, operands[5]); |
3497 |
rtx dest = gen_lowpart (mode, operands[3]); |
3498 |
|
3499 |
- operands[1] = gen_rtx_PLUS (Pmode, base, |
3500 |
- gen_rtx_MULT (Pmode, index, GEN_INT (scale))); |
3501 |
+ operands[1] = gen_rtx_PLUS (word_mode, base, |
3502 |
+ gen_rtx_MULT (word_mode, index, GEN_INT (scale))); |
3503 |
operands[5] = base; |
3504 |
- if (mode != Pmode) |
3505 |
+ if (mode != word_mode) |
3506 |
operands[1] = gen_rtx_SUBREG (mode, operands[1], 0); |
3507 |
- if (op1mode != Pmode) |
3508 |
+ if (op1mode != word_mode) |
3509 |
operands[5] = gen_rtx_SUBREG (op1mode, operands[5], 0); |
3510 |
operands[0] = dest; |
3511 |
}) |
3512 |
@@ -18052,7 +18069,7 @@ |
3513 |
{ |
3514 |
rtx (*insn)(rtx); |
3515 |
|
3516 |
- insn = (TARGET_64BIT |
3517 |
+ insn = (Pmode == DImode |
3518 |
? gen_lwp_slwpcbdi |
3519 |
: gen_lwp_slwpcbsi); |
3520 |
|
3521 |
--- a/gcc/config/i386/i386.opt |
3522 |
+++ b/gcc/config/i386/i386.opt |
3523 |
@@ -159,6 +159,20 @@ Enum(cmodel) String(32) Value(CM_32) |
3524 |
EnumValue |
3525 |
Enum(cmodel) String(kernel) Value(CM_KERNEL) |
3526 |
|
3527 |
+maddress-mode= |
3528 |
+Target RejectNegative Joined Enum(pmode) Var(ix86_pmode) Init(PMODE_SI) |
3529 |
+Use given address mode |
3530 |
+ |
3531 |
+Enum |
3532 |
+Name(pmode) Type(enum pmode) |
3533 |
+Known address mode (for use with the -maddress-mode= option): |
3534 |
+ |
3535 |
+EnumValue |
3536 |
+Enum(pmode) String(short) Value(PMODE_SI) |
3537 |
+ |
3538 |
+EnumValue |
3539 |
+Enum(pmode) String(long) Value(PMODE_DI) |
3540 |
+ |
3541 |
mcpu= |
3542 |
Target RejectNegative Joined Undocumented Alias(mtune=) Warn(%<-mcpu=%> is deprecated; use %<-mtune=%> or %<-march=%> instead) |
3543 |
|
3544 |
@@ -204,7 +218,7 @@ EnumValue |
3545 |
Enum(fpmath_unit) String(both) Value({(enum fpmath_unit) (FPMATH_SSE | FPMATH_387)}) |
3546 |
|
3547 |
mhard-float |
3548 |
-Target RejectNegative Mask(80387) MaskExists Save |
3549 |
+Target RejectNegative Mask(80387) Save |
3550 |
Use hardware fp |
3551 |
|
3552 |
mieee-fp |
3553 |
@@ -411,11 +425,11 @@ Target RejectNegative Negative(m64) Report InverseMask(ISA_64BIT) Var(ix86_isa_f |
3554 |
Generate 32bit i386 code |
3555 |
|
3556 |
m64 |
3557 |
-Target RejectNegative Negative(mx32) Report Mask(ISA_64BIT) Var(ix86_isa_flags) Save |
3558 |
+Target RejectNegative Negative(mx32) Report Mask(ABI_64) Var(ix86_isa_flags) Save |
3559 |
Generate 64bit x86-64 code |
3560 |
|
3561 |
mx32 |
3562 |
-Target RejectNegative Negative(m32) Report Mask(ISA_X32) Var(ix86_isa_flags) Save |
3563 |
+Target RejectNegative Negative(m32) Report Mask(ABI_X32) Var(ix86_isa_flags) Save |
3564 |
Generate 32bit x86-64 code |
3565 |
|
3566 |
mmmx |
3567 |
@@ -455,11 +469,11 @@ Target Report Mask(ISA_SSE4_2) Var(ix86_isa_flags) Save |
3568 |
Support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1 and SSE4.2 built-in functions and code generation |
3569 |
|
3570 |
msse4 |
3571 |
-Target RejectNegative Report Mask(ISA_SSE4_2) MaskExists Var(ix86_isa_flags) Save |
3572 |
+Target RejectNegative Report Mask(ISA_SSE4_2) Var(ix86_isa_flags) Save |
3573 |
Support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1 and SSE4.2 built-in functions and code generation |
3574 |
|
3575 |
mno-sse4 |
3576 |
-Target RejectNegative Report InverseMask(ISA_SSE4_1) MaskExists Var(ix86_isa_flags) Save |
3577 |
+Target RejectNegative Report InverseMask(ISA_SSE4_1) Var(ix86_isa_flags) Save |
3578 |
Do not support SSE4.1 and SSE4.2 built-in functions and code generation |
3579 |
|
3580 |
msse5 |
3581 |
--- a/gcc/config/i386/predicates.md |
3582 |
+++ b/gcc/config/i386/predicates.md |
3583 |
@@ -1,5 +1,5 @@ |
3584 |
;; Predicate definitions for IA-32 and x86-64. |
3585 |
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 |
3586 |
+;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 |
3587 |
;; Free Software Foundation, Inc. |
3588 |
;; |
3589 |
;; This file is part of GCC. |
3590 |
@@ -341,6 +341,16 @@ |
3591 |
(match_operand 0 "general_operand"))) |
3592 |
|
3593 |
;; Return true if OP is general operand representable on x86_64 |
3594 |
+;; as zero extended constant. This predicate is used in zero-extending |
3595 |
+;; conversion operations that require non-VOIDmode immediate operands. |
3596 |
+(define_predicate "x86_64_zext_general_operand" |
3597 |
+ (if_then_else (match_test "TARGET_64BIT") |
3598 |
+ (ior (match_operand 0 "nonimmediate_operand") |
3599 |
+ (and (match_operand 0 "x86_64_zext_immediate_operand") |
3600 |
+ (match_test "GET_MODE (op) != VOIDmode"))) |
3601 |
+ (match_operand 0 "general_operand"))) |
3602 |
+ |
3603 |
+;; Return true if OP is general operand representable on x86_64 |
3604 |
;; as either sign extended or zero extended constant. |
3605 |
(define_predicate "x86_64_szext_general_operand" |
3606 |
(if_then_else (match_test "TARGET_64BIT") |
3607 |
@@ -483,11 +493,11 @@ |
3608 |
(match_operand 0 "local_symbolic_operand"))) |
3609 |
|
3610 |
;; Test for various thread-local symbols. |
3611 |
-(define_predicate "tls_symbolic_operand" |
3612 |
+(define_special_predicate "tls_symbolic_operand" |
3613 |
(and (match_code "symbol_ref") |
3614 |
(match_test "SYMBOL_REF_TLS_MODEL (op)"))) |
3615 |
|
3616 |
-(define_predicate "tls_modbase_operand" |
3617 |
+(define_special_predicate "tls_modbase_operand" |
3618 |
(and (match_code "symbol_ref") |
3619 |
(match_test "op == ix86_tls_module_base ()"))) |
3620 |
|
3621 |
@@ -558,20 +568,23 @@ |
3622 |
|
3623 |
;; Test for a valid operand for indirect branch. |
3624 |
(define_predicate "indirect_branch_operand" |
3625 |
- (if_then_else (match_test "TARGET_X32") |
3626 |
- (match_operand 0 "register_operand") |
3627 |
- (match_operand 0 "nonimmediate_operand"))) |
3628 |
+ (ior (match_operand 0 "register_operand") |
3629 |
+ (and (not (match_test "TARGET_X32")) |
3630 |
+ (match_operand 0 "memory_operand")))) |
3631 |
|
3632 |
;; Test for a valid operand for a call instruction. |
3633 |
-(define_predicate "call_insn_operand" |
3634 |
- (ior (match_operand 0 "constant_call_address_operand") |
3635 |
+;; Allow constant call address operands in Pmode only. |
3636 |
+(define_special_predicate "call_insn_operand" |
3637 |
+ (ior (match_test "constant_call_address_operand |
3638 |
+ (op, mode == VOIDmode ? mode : Pmode)") |
3639 |
(match_operand 0 "call_register_no_elim_operand") |
3640 |
(and (not (match_test "TARGET_X32")) |
3641 |
(match_operand 0 "memory_operand")))) |
3642 |
|
3643 |
;; Similarly, but for tail calls, in which we cannot allow memory references. |
3644 |
-(define_predicate "sibcall_insn_operand" |
3645 |
- (ior (match_operand 0 "constant_call_address_operand") |
3646 |
+(define_special_predicate "sibcall_insn_operand" |
3647 |
+ (ior (match_test "constant_call_address_operand |
3648 |
+ (op, mode == VOIDmode ? mode : Pmode)") |
3649 |
(match_operand 0 "register_no_elim_operand"))) |
3650 |
|
3651 |
;; Match exactly zero. |
3652 |
--- a/gcc/config/i386/sse.md |
3653 |
+++ b/gcc/config/i386/sse.md |
3654 |
@@ -8126,8 +8126,8 @@ |
3655 |
"monitor\t%0, %1, %2" |
3656 |
[(set_attr "length" "3")]) |
3657 |
|
3658 |
-(define_insn "sse3_monitor64" |
3659 |
- [(unspec_volatile [(match_operand:DI 0 "register_operand" "a") |
3660 |
+(define_insn "sse3_monitor64_<mode>" |
3661 |
+ [(unspec_volatile [(match_operand:P 0 "register_operand" "a") |
3662 |
(match_operand:SI 1 "register_operand" "c") |
3663 |
(match_operand:SI 2 "register_operand" "d")] |
3664 |
UNSPECV_MONITOR)] |
3665 |
--- a/gcc/config/m68k/m68k.opt |
3666 |
+++ b/gcc/config/m68k/m68k.opt |
3667 |
@@ -136,7 +136,7 @@ Target RejectNegative |
3668 |
Generate code for a Fido A |
3669 |
|
3670 |
mhard-float |
3671 |
-Target RejectNegative Mask(HARD_FLOAT) MaskExists |
3672 |
+Target RejectNegative Mask(HARD_FLOAT) |
3673 |
Generate code which uses hardware floating point instructions |
3674 |
|
3675 |
mid-shared-library |
3676 |
--- a/gcc/config/mep/mep.opt |
3677 |
+++ b/gcc/config/mep/mep.opt |
3678 |
@@ -55,7 +55,7 @@ Target Mask(COP) |
3679 |
Enable MeP Coprocessor |
3680 |
|
3681 |
mcop32 |
3682 |
-Target Mask(COP) MaskExists RejectNegative |
3683 |
+Target Mask(COP) RejectNegative |
3684 |
Enable MeP Coprocessor with 32-bit registers |
3685 |
|
3686 |
mcop64 |
3687 |
--- a/gcc/config/pa/pa-hpux.opt |
3688 |
+++ b/gcc/config/pa/pa-hpux.opt |
3689 |
@@ -23,7 +23,7 @@ Variable |
3690 |
int flag_pa_unix = TARGET_HPUX_11_31 ? 2003 : TARGET_HPUX_11_11 ? 1998 : TARGET_HPUX_10_10 ? 1995 : 1993 |
3691 |
|
3692 |
msio |
3693 |
-Target RejectNegative Mask(SIO) MaskExists |
3694 |
+Target RejectNegative Mask(SIO) |
3695 |
Generate cpp defines for server IO |
3696 |
|
3697 |
munix=93 |
3698 |
--- a/gcc/config/pa/pa64-hpux.opt |
3699 |
+++ b/gcc/config/pa/pa64-hpux.opt |
3700 |
@@ -19,7 +19,7 @@ |
3701 |
; <http://www.gnu.org/licenses/>. |
3702 |
|
3703 |
mgnu-ld |
3704 |
-Target RejectNegative Mask(GNU_LD) MaskExists |
3705 |
+Target RejectNegative Mask(GNU_LD) |
3706 |
Assume code will be linked by GNU ld |
3707 |
|
3708 |
mhp-ld |
3709 |
--- a/gcc/config/picochip/picochip.opt |
3710 |
+++ b/gcc/config/picochip/picochip.opt |
3711 |
@@ -43,4 +43,4 @@ Target Mask(INEFFICIENT_WARNINGS) |
3712 |
Generate warnings when inefficient code is known to be generated. |
3713 |
|
3714 |
minefficient |
3715 |
-Target Mask(INEFFICIENT_WARNINGS) MaskExists Undocumented |
3716 |
+Target Mask(INEFFICIENT_WARNINGS) Undocumented |
3717 |
--- a/gcc/config/rs6000/sysv4.opt |
3718 |
+++ b/gcc/config/rs6000/sysv4.opt |
3719 |
@@ -66,7 +66,7 @@ Target Report RejectNegative Mask(LITTLE_ENDIAN) |
3720 |
Produce little endian code |
3721 |
|
3722 |
mlittle |
3723 |
-Target Report RejectNegative Mask(LITTLE_ENDIAN) MaskExists |
3724 |
+Target Report RejectNegative Mask(LITTLE_ENDIAN) |
3725 |
Produce little endian code |
3726 |
|
3727 |
mbig-endian |
3728 |
--- a/gcc/config/sh/sh.opt |
3729 |
+++ b/gcc/config/sh/sh.opt |
3730 |
@@ -316,7 +316,7 @@ Target Report RejectNegative Mask(RELAX) |
3731 |
Shorten address references during linking |
3732 |
|
3733 |
mrenesas |
3734 |
-Target Mask(HITACHI) MaskExists |
3735 |
+Target Mask(HITACHI) |
3736 |
Follow Renesas (formerly Hitachi) / SuperH calling conventions |
3737 |
|
3738 |
msoft-atomic |
3739 |
--- a/gcc/config/sparc/long-double-switch.opt |
3740 |
+++ b/gcc/config/sparc/long-double-switch.opt |
3741 |
@@ -19,7 +19,7 @@ |
3742 |
; <http://www.gnu.org/licenses/>. |
3743 |
|
3744 |
mlong-double-128 |
3745 |
-Target Report RejectNegative Mask(LONG_DOUBLE_128) MaskExists |
3746 |
+Target Report RejectNegative Mask(LONG_DOUBLE_128) |
3747 |
Use 128-bit long double |
3748 |
|
3749 |
mlong-double-64 |
3750 |
--- a/gcc/config/sparc/sparc.opt |
3751 |
+++ b/gcc/config/sparc/sparc.opt |
3752 |
@@ -30,7 +30,7 @@ Target Report Mask(FPU) |
3753 |
Use hardware FP |
3754 |
|
3755 |
mhard-float |
3756 |
-Target RejectNegative Mask(FPU) MaskExists |
3757 |
+Target RejectNegative Mask(FPU) |
3758 |
Use hardware FP |
3759 |
|
3760 |
msoft-float |
3761 |
--- a/gcc/config/v850/v850.opt |
3762 |
+++ b/gcc/config/v850/v850.opt |
3763 |
@@ -102,7 +102,7 @@ Target RejectNegative Mask(V850E1) |
3764 |
Compile for the v850e1 processor |
3765 |
|
3766 |
mv850es |
3767 |
-Target RejectNegative Mask(V850E1) MaskExists |
3768 |
+Target RejectNegative Mask(V850E1) |
3769 |
Compile for the v850es variant of the v850e1 |
3770 |
|
3771 |
mv850e2 |
3772 |
--- a/gcc/config/vax/vax.opt |
3773 |
+++ b/gcc/config/vax/vax.opt |
3774 |
@@ -31,7 +31,7 @@ Target RejectNegative Mask(G_FLOAT) |
3775 |
Generate GFLOAT double precision code |
3776 |
|
3777 |
mg-float |
3778 |
-Target RejectNegative Mask(G_FLOAT) MaskExists |
3779 |
+Target RejectNegative Mask(G_FLOAT) |
3780 |
Generate GFLOAT double precision code |
3781 |
|
3782 |
mgnu |
3783 |
--- a/gcc/configure |
3784 |
+++ b/gcc/configure |
3785 |
@@ -13756,7 +13756,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) |
3786 |
LD="${LD-ld} -m elf_i386_fbsd" |
3787 |
;; |
3788 |
x86_64-*linux*) |
3789 |
- LD="${LD-ld} -m elf_i386" |
3790 |
+ case `/usr/bin/file conftest.o` in |
3791 |
+ *x86-64*) |
3792 |
+ LD="${LD-ld} -m elf32_x86_64" |
3793 |
+ ;; |
3794 |
+ *) |
3795 |
+ LD="${LD-ld} -m elf_i386" |
3796 |
+ ;; |
3797 |
+ esac |
3798 |
;; |
3799 |
ppc64-*linux*|powerpc64-*linux*) |
3800 |
LD="${LD-ld} -m elf32ppclinux" |
3801 |
--- a/gcc/doc/invoke.texi |
3802 |
+++ b/gcc/doc/invoke.texi |
3803 |
@@ -636,7 +636,7 @@ Objective-C and Objective-C++ Dialects}. |
3804 |
-mveclibabi=@var{type} -mvect8-ret-in-mem @gol |
3805 |
-mpc32 -mpc64 -mpc80 -mstackrealign @gol |
3806 |
-momit-leaf-frame-pointer -mno-red-zone -mno-tls-direct-seg-refs @gol |
3807 |
--mcmodel=@var{code-model} -mabi=@var{name} @gol |
3808 |
+-mcmodel=@var{code-model} -mabi=@var{name} -maddress-mode=@var{mode} @gol |
3809 |
-m32 -m64 -mx32 -mlarge-data-threshold=@var{num} @gol |
3810 |
-msse2avx -mfentry -m8bit-idiv @gol |
3811 |
-mavx256-split-unaligned-load -mavx256-split-unaligned-store} |
3812 |
@@ -13763,6 +13763,18 @@ be statically or dynamically linked. |
3813 |
@opindex mcmodel=large |
3814 |
Generate code for the large model: This model makes no assumptions |
3815 |
about addresses and sizes of sections. |
3816 |
+ |
3817 |
+@item -maddress-mode=long |
3818 |
+@opindex maddress-mode=long |
3819 |
+Generate code for long address mode. This is only supported for 64-bit |
3820 |
+and x32 environments. It is the default address mode for 64-bit |
3821 |
+environments. |
3822 |
+ |
3823 |
+@item -maddress-mode=short |
3824 |
+@opindex maddress-mode=short |
3825 |
+Generate code for short address mode. This is only supported for 32-bit |
3826 |
+and x32 environments. It is the default address mode for 32-bit and |
3827 |
+x32 environments. |
3828 |
@end table |
3829 |
|
3830 |
@node i386 and x86-64 Windows Options |
3831 |
--- a/gcc/doc/options.texi |
3832 |
+++ b/gcc/doc/options.texi |
3833 |
@@ -346,8 +346,6 @@ the value 1 when the option is active and 0 otherwise. If you use @code{Var} |
3834 |
to attach the option to a different variable, the associated macros are |
3835 |
called @code{OPTION_MASK_@var{name}} and @code{OPTION_@var{name}} respectively. |
3836 |
|
3837 |
-You can disable automatic bit allocation using @code{MaskExists}. |
3838 |
- |
3839 |
@item InverseMask(@var{othername}) |
3840 |
@itemx InverseMask(@var{othername}, @var{thisname}) |
3841 |
The option is the inverse of another option that has the |
3842 |
@@ -355,15 +353,6 @@ The option is the inverse of another option that has the |
3843 |
the options-processing script will declare a @code{TARGET_@var{thisname}} |
3844 |
macro that is 1 when the option is active and 0 otherwise. |
3845 |
|
3846 |
-@item MaskExists |
3847 |
-The mask specified by the @code{Mask} property already exists. |
3848 |
-No @code{MASK} or @code{TARGET} definitions should be added to |
3849 |
-@file{options.h} in response to this option record. |
3850 |
- |
3851 |
-The main purpose of this property is to support synonymous options. |
3852 |
-The first option should use @samp{Mask(@var{name})} and the others |
3853 |
-should use @samp{Mask(@var{name}) MaskExists}. |
3854 |
- |
3855 |
@item Enum(@var{name}) |
3856 |
The option's argument is a string from the set of strings associated |
3857 |
with the corresponding @samp{Enum} record. The string is checked and |
3858 |
--- a/gcc/dwarf2out.c |
3859 |
+++ b/gcc/dwarf2out.c |
3860 |
@@ -10178,7 +10178,9 @@ dbx_reg_number (const_rtx rtl) |
3861 |
} |
3862 |
#endif |
3863 |
|
3864 |
- return DBX_REGISTER_NUMBER (regno); |
3865 |
+ regno = DBX_REGISTER_NUMBER (regno); |
3866 |
+ gcc_assert (regno != INVALID_REGNUM); |
3867 |
+ return regno; |
3868 |
} |
3869 |
|
3870 |
/* Optionally add a DW_OP_piece term to a location description expression. |
3871 |
--- a/gcc/emit-rtl.c |
3872 |
+++ b/gcc/emit-rtl.c |
3873 |
@@ -964,6 +964,22 @@ void |
3874 |
set_reg_attrs_from_value (rtx reg, rtx x) |
3875 |
{ |
3876 |
int offset; |
3877 |
+ bool can_be_reg_pointer = true; |
3878 |
+ |
3879 |
+ /* Don't call mark_reg_pointer for incompatible pointer sign |
3880 |
+ extension. */ |
3881 |
+ while (GET_CODE (x) == SIGN_EXTEND |
3882 |
+ || GET_CODE (x) == ZERO_EXTEND |
3883 |
+ || GET_CODE (x) == TRUNCATE |
3884 |
+ || (GET_CODE (x) == SUBREG && subreg_lowpart_p (x))) |
3885 |
+ { |
3886 |
+#if defined(POINTERS_EXTEND_UNSIGNED) && !defined(HAVE_ptr_extend) |
3887 |
+ if ((GET_CODE (x) == SIGN_EXTEND && POINTERS_EXTEND_UNSIGNED) |
3888 |
+ || (GET_CODE (x) != SIGN_EXTEND && ! POINTERS_EXTEND_UNSIGNED)) |
3889 |
+ can_be_reg_pointer = false; |
3890 |
+#endif |
3891 |
+ x = XEXP (x, 0); |
3892 |
+ } |
3893 |
|
3894 |
/* Hard registers can be reused for multiple purposes within the same |
3895 |
function, so setting REG_ATTRS, REG_POINTER and REG_POINTER_ALIGN |
3896 |
@@ -977,14 +993,14 @@ set_reg_attrs_from_value (rtx reg, rtx x) |
3897 |
if (MEM_OFFSET_KNOWN_P (x)) |
3898 |
REG_ATTRS (reg) = get_reg_attrs (MEM_EXPR (x), |
3899 |
MEM_OFFSET (x) + offset); |
3900 |
- if (MEM_POINTER (x)) |
3901 |
+ if (can_be_reg_pointer && MEM_POINTER (x)) |
3902 |
mark_reg_pointer (reg, 0); |
3903 |
} |
3904 |
else if (REG_P (x)) |
3905 |
{ |
3906 |
if (REG_ATTRS (x)) |
3907 |
update_reg_offset (reg, x, offset); |
3908 |
- if (REG_POINTER (x)) |
3909 |
+ if (can_be_reg_pointer && REG_POINTER (x)) |
3910 |
mark_reg_pointer (reg, REGNO_POINTER_ALIGN (REGNO (x))); |
3911 |
} |
3912 |
} |
3913 |
--- a/gcc/opth-gen.awk |
3914 |
+++ b/gcc/opth-gen.awk |
3915 |
@@ -298,16 +298,25 @@ print ""; |
3916 |
|
3917 |
for (i = 0; i < n_opts; i++) { |
3918 |
name = opt_args("Mask", flags[i]) |
3919 |
- vname = var_name(flags[i]) |
3920 |
- mask = "MASK_" |
3921 |
- mask_1 = "1" |
3922 |
- if (vname != "") { |
3923 |
- mask = "OPTION_MASK_" |
3924 |
- if (host_wide_int[vname] == "yes") |
3925 |
- mask_1 = "HOST_WIDE_INT_1" |
3926 |
+ if (name == "") { |
3927 |
+ opt = opt_args("InverseMask", flags[i]) |
3928 |
+ if (opt ~ ",") |
3929 |
+ name = nth_arg(0, opt) |
3930 |
+ else |
3931 |
+ name = opt |
3932 |
} |
3933 |
- if (name != "" && !flag_set_p("MaskExists", flags[i])) |
3934 |
+ if (name != "" && mask_bits[name] == 0) { |
3935 |
+ mask_bits[name] = 1 |
3936 |
+ vname = var_name(flags[i]) |
3937 |
+ mask = "MASK_" |
3938 |
+ mask_1 = "1" |
3939 |
+ if (vname != "") { |
3940 |
+ mask = "OPTION_MASK_" |
3941 |
+ if (host_wide_int[vname] == "yes") |
3942 |
+ mask_1 = "HOST_WIDE_INT_1" |
3943 |
+ } |
3944 |
print "#define " mask name " (" mask_1 " << " masknum[vname]++ ")" |
3945 |
+ } |
3946 |
} |
3947 |
for (i = 0; i < n_extra_masks; i++) { |
3948 |
print "#define MASK_" extra_masks[i] " (1 << " masknum[""]++ ")" |
3949 |
@@ -330,17 +339,26 @@ print "" |
3950 |
|
3951 |
for (i = 0; i < n_opts; i++) { |
3952 |
name = opt_args("Mask", flags[i]) |
3953 |
- vname = var_name(flags[i]) |
3954 |
- macro = "OPTION_" |
3955 |
- mask = "OPTION_MASK_" |
3956 |
- if (vname == "") { |
3957 |
- vname = "target_flags" |
3958 |
- macro = "TARGET_" |
3959 |
- mask = "MASK_" |
3960 |
+ if (name == "") { |
3961 |
+ opt = opt_args("InverseMask", flags[i]) |
3962 |
+ if (opt ~ ",") |
3963 |
+ name = nth_arg(0, opt) |
3964 |
+ else |
3965 |
+ name = opt |
3966 |
} |
3967 |
- if (name != "" && !flag_set_p("MaskExists", flags[i])) |
3968 |
+ if (name != "" && mask_macros[name] == 0) { |
3969 |
+ mask_macros[name] = 1 |
3970 |
+ vname = var_name(flags[i]) |
3971 |
+ macro = "OPTION_" |
3972 |
+ mask = "OPTION_MASK_" |
3973 |
+ if (vname == "") { |
3974 |
+ vname = "target_flags" |
3975 |
+ macro = "TARGET_" |
3976 |
+ mask = "MASK_" |
3977 |
+ } |
3978 |
print "#define " macro name \ |
3979 |
" ((" vname " & " mask name ") != 0)" |
3980 |
+ } |
3981 |
} |
3982 |
for (i = 0; i < n_extra_masks; i++) { |
3983 |
print "#define TARGET_" extra_masks[i] \ |
3984 |
--- a/gcc/reginfo.c |
3985 |
+++ b/gcc/reginfo.c |
3986 |
@@ -1222,17 +1222,7 @@ reg_scan_mark_refs (rtx x, rtx insn) |
3987 |
/* If this is setting a register from a register or from a simple |
3988 |
conversion of a register, propagate REG_EXPR. */ |
3989 |
if (REG_P (dest) && !REG_ATTRS (dest)) |
3990 |
- { |
3991 |
- rtx src = SET_SRC (x); |
3992 |
- |
3993 |
- while (GET_CODE (src) == SIGN_EXTEND |
3994 |
- || GET_CODE (src) == ZERO_EXTEND |
3995 |
- || GET_CODE (src) == TRUNCATE |
3996 |
- || (GET_CODE (src) == SUBREG && subreg_lowpart_p (src))) |
3997 |
- src = XEXP (src, 0); |
3998 |
- |
3999 |
- set_reg_attrs_from_value (dest, src); |
4000 |
- } |
4001 |
+ set_reg_attrs_from_value (dest, SET_SRC (x)); |
4002 |
|
4003 |
/* ... fall through ... */ |
4004 |
|
4005 |
--- /dev/null |
4006 |
+++ b/gcc/testsuite/gcc.dg/torture/pr52530.c |
4007 |
@@ -0,0 +1,30 @@ |
4008 |
+/* { dg-do run } */ |
4009 |
+ |
4010 |
+extern void abort (void); |
4011 |
+ |
4012 |
+struct foo |
4013 |
+{ |
4014 |
+ int *f; |
4015 |
+ int i; |
4016 |
+}; |
4017 |
+ |
4018 |
+int baz; |
4019 |
+ |
4020 |
+void __attribute__ ((noinline)) |
4021 |
+bar (struct foo x) |
4022 |
+{ |
4023 |
+ *(x.f) = x.i; |
4024 |
+} |
4025 |
+ |
4026 |
+int |
4027 |
+main () |
4028 |
+{ |
4029 |
+ struct foo x = { &baz, 0xdeadbeef }; |
4030 |
+ |
4031 |
+ bar (x); |
4032 |
+ |
4033 |
+ if (baz != 0xdeadbeef) |
4034 |
+ abort (); |
4035 |
+ |
4036 |
+ return 0; |
4037 |
+} |
4038 |
--- a/gcc/testsuite/gcc.target/i386/pr52146.c |
4039 |
+++ b/gcc/testsuite/gcc.target/i386/pr52146.c |
4040 |
@@ -15,4 +15,4 @@ test2 (void) |
4041 |
*apic_tpr_addr = 0; |
4042 |
} |
4043 |
|
4044 |
-/* { dg-final { scan-assembler-not "-18874240" } } */ |
4045 |
+/* { dg-final { scan-assembler-not "\[,\\t \]+-18874240" } } */ |
4046 |
--- /dev/null |
4047 |
+++ b/gcc/testsuite/gcc.target/i386/pr52876.c |
4048 |
@@ -0,0 +1,25 @@ |
4049 |
+/* { dg-do run { target { x32 } } } */ |
4050 |
+/* { dg-options "-O2 -mx32 -maddress-mode=long" } */ |
4051 |
+ |
4052 |
+extern void abort (void); |
4053 |
+ |
4054 |
+long long li; |
4055 |
+ |
4056 |
+long long |
4057 |
+__attribute__ ((noinline)) |
4058 |
+testfunc (void* addr) |
4059 |
+{ |
4060 |
+ li = (long long)(int)addr; |
4061 |
+ li &= 0xffffffff; |
4062 |
+ return li; |
4063 |
+} |
4064 |
+ |
4065 |
+int main (void) |
4066 |
+{ |
4067 |
+ volatile long long rv_test; |
4068 |
+ rv_test = testfunc((void*)0x87651234); |
4069 |
+ if (rv_test != 0x87651234ULL) |
4070 |
+ abort (); |
4071 |
+ |
4072 |
+ return 0; |
4073 |
+} |
4074 |
--- /dev/null |
4075 |
+++ b/gcc/testsuite/gcc.target/i386/pr52882.c |
4076 |
@@ -0,0 +1,19 @@ |
4077 |
+/* { dg-do compile } */ |
4078 |
+/* { dg-options "-O" } */ |
4079 |
+ |
4080 |
+struct S1 { |
4081 |
+ int f0; |
4082 |
+ int f1; |
4083 |
+}; |
4084 |
+ |
4085 |
+int fn1 (); |
4086 |
+void fn2 (struct S1); |
4087 |
+ |
4088 |
+void |
4089 |
+fn3 () { |
4090 |
+ struct S1 a = { 1, 0 }; |
4091 |
+ if (fn1 ()) |
4092 |
+ fn2 (a); |
4093 |
+ for (; a.f1;) { |
4094 |
+ } |
4095 |
+} |
4096 |
--- /dev/null |
4097 |
+++ b/gcc/testsuite/gcc.target/i386/pr52883.c |
4098 |
@@ -0,0 +1,25 @@ |
4099 |
+/* { dg-do compile } */ |
4100 |
+/* { dg-options "-O" } */ |
4101 |
+ |
4102 |
+int a, b, d, e, f, i, j, k, l, m; |
4103 |
+unsigned c; |
4104 |
+int g[] = { }, h[0]; |
4105 |
+ |
4106 |
+int |
4107 |
+fn1 () { |
4108 |
+ return 0; |
4109 |
+} |
4110 |
+ |
4111 |
+void |
4112 |
+fn2 () { |
4113 |
+ c = 0; |
4114 |
+ e = 0; |
4115 |
+ for (;; e = 0) |
4116 |
+ if (f > j) { |
4117 |
+ k = fn1 (); |
4118 |
+ l = (d || k) * b; |
4119 |
+ m = l * a; |
4120 |
+ h[0] = m <= i; |
4121 |
+ } else |
4122 |
+ i = g[c]; |
4123 |
+} |
4124 |
--- a/libffi/configure |
4125 |
+++ b/libffi/configure |
4126 |
@@ -6282,7 +6282,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) |
4127 |
LD="${LD-ld} -m elf_i386_fbsd" |
4128 |
;; |
4129 |
x86_64-*linux*) |
4130 |
- LD="${LD-ld} -m elf_i386" |
4131 |
+ case `/usr/bin/file conftest.o` in |
4132 |
+ *x86-64*) |
4133 |
+ LD="${LD-ld} -m elf32_x86_64" |
4134 |
+ ;; |
4135 |
+ *) |
4136 |
+ LD="${LD-ld} -m elf_i386" |
4137 |
+ ;; |
4138 |
+ esac |
4139 |
;; |
4140 |
ppc64-*linux*|powerpc64-*linux*) |
4141 |
LD="${LD-ld} -m elf32ppclinux" |
4142 |
--- a/libffi/src/x86/ffi64.c |
4143 |
+++ b/libffi/src/x86/ffi64.c |
4144 |
@@ -426,7 +426,7 @@ ffi_call (ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) |
4145 |
/* If the return value is passed in memory, add the pointer as the |
4146 |
first integer argument. */ |
4147 |
if (ret_in_memory) |
4148 |
- reg_args->gpr[gprcount++] = (long) rvalue; |
4149 |
+ reg_args->gpr[gprcount++] = (unsigned long) rvalue; |
4150 |
|
4151 |
avn = cif->nargs; |
4152 |
arg_types = cif->arg_types; |
4153 |
@@ -501,9 +501,11 @@ ffi_prep_closure_loc (ffi_closure* closure, |
4154 |
tramp = (volatile unsigned short *) &closure->tramp[0]; |
4155 |
|
4156 |
tramp[0] = 0xbb49; /* mov <code>, %r11 */ |
4157 |
- *(void * volatile *) &tramp[1] = ffi_closure_unix64; |
4158 |
+ *((unsigned long long * volatile) &tramp[1]) |
4159 |
+ = (unsigned long) ffi_closure_unix64; |
4160 |
tramp[5] = 0xba49; /* mov <data>, %r10 */ |
4161 |
- *(void * volatile *) &tramp[6] = codeloc; |
4162 |
+ *((unsigned long long * volatile) &tramp[6]) |
4163 |
+ = (unsigned long) codeloc; |
4164 |
|
4165 |
/* Set the carry bit iff the function uses any sse registers. |
4166 |
This is clc or stc, together with the first byte of the jmp. */ |
4167 |
@@ -542,7 +544,7 @@ ffi_closure_unix64_inner(ffi_closure *closure, void *rvalue, |
4168 |
{ |
4169 |
/* The return value goes in memory. Arrange for the closure |
4170 |
return value to go directly back to the original caller. */ |
4171 |
- rvalue = (void *) reg_args->gpr[gprcount++]; |
4172 |
+ rvalue = (void *) (unsigned long) reg_args->gpr[gprcount++]; |
4173 |
/* We don't have to do anything in asm for the return. */ |
4174 |
ret = FFI_TYPE_VOID; |
4175 |
} |
4176 |
--- a/libffi/src/x86/ffitarget.h |
4177 |
+++ b/libffi/src/x86/ffitarget.h |
4178 |
@@ -53,9 +53,15 @@ typedef unsigned long long ffi_arg; |
4179 |
typedef long long ffi_sarg; |
4180 |
#endif |
4181 |
#else |
4182 |
+#if defined __x86_64__ && !defined __LP64__ |
4183 |
+#define FFI_SIZEOF_ARG 8 |
4184 |
+typedef unsigned long long ffi_arg; |
4185 |
+typedef long long ffi_sarg; |
4186 |
+#else |
4187 |
typedef unsigned long ffi_arg; |
4188 |
typedef signed long ffi_sarg; |
4189 |
#endif |
4190 |
+#endif |
4191 |
|
4192 |
typedef enum ffi_abi { |
4193 |
FFI_FIRST_ABI = 0, |
4194 |
--- a/libgcc/unwind-dw2.c |
4195 |
+++ b/libgcc/unwind-dw2.c |
4196 |
@@ -294,7 +294,8 @@ _Unwind_SetGRValue (struct _Unwind_Context *context, int index, |
4197 |
{ |
4198 |
index = DWARF_REG_TO_UNWIND_COLUMN (index); |
4199 |
gcc_assert (index < (int) sizeof(dwarf_reg_size_table)); |
4200 |
- gcc_assert (dwarf_reg_size_table[index] == sizeof (_Unwind_Context_Reg_Val)); |
4201 |
+ /* Return column size may be smaller than _Unwind_Context_Reg_Val. */ |
4202 |
+ gcc_assert (dwarf_reg_size_table[index] <= sizeof (_Unwind_Context_Reg_Val)); |
4203 |
|
4204 |
context->by_value[index] = 1; |
4205 |
context->reg[index] = _Unwind_Get_Unwind_Context_Reg_Val (val); |
4206 |
--- a/libgfortran/configure |
4207 |
+++ b/libgfortran/configure |
4208 |
@@ -8071,7 +8071,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) |
4209 |
LD="${LD-ld} -m elf_i386_fbsd" |
4210 |
;; |
4211 |
x86_64-*linux*) |
4212 |
- LD="${LD-ld} -m elf_i386" |
4213 |
+ case `/usr/bin/file conftest.o` in |
4214 |
+ *x86-64*) |
4215 |
+ LD="${LD-ld} -m elf32_x86_64" |
4216 |
+ ;; |
4217 |
+ *) |
4218 |
+ LD="${LD-ld} -m elf_i386" |
4219 |
+ ;; |
4220 |
+ esac |
4221 |
;; |
4222 |
ppc64-*linux*|powerpc64-*linux*) |
4223 |
LD="${LD-ld} -m elf32ppclinux" |
4224 |
--- a/libgomp/configure |
4225 |
+++ b/libgomp/configure |
4226 |
@@ -6596,7 +6596,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) |
4227 |
LD="${LD-ld} -m elf_i386_fbsd" |
4228 |
;; |
4229 |
x86_64-*linux*) |
4230 |
- LD="${LD-ld} -m elf_i386" |
4231 |
+ case `/usr/bin/file conftest.o` in |
4232 |
+ *x86-64*) |
4233 |
+ LD="${LD-ld} -m elf32_x86_64" |
4234 |
+ ;; |
4235 |
+ *) |
4236 |
+ LD="${LD-ld} -m elf_i386" |
4237 |
+ ;; |
4238 |
+ esac |
4239 |
;; |
4240 |
ppc64-*linux*|powerpc64-*linux*) |
4241 |
LD="${LD-ld} -m elf32ppclinux" |
4242 |
--- a/libgomp/configure.tgt |
4243 |
+++ b/libgomp/configure.tgt |
4244 |
@@ -59,7 +59,7 @@ if test $enable_linux_futex = yes; then |
4245 |
i[456]86-*-linux*) |
4246 |
config_path="linux/x86 linux posix" |
4247 |
case " ${CC} ${CFLAGS} " in |
4248 |
- *" -m64 "*) |
4249 |
+ *" -m64 "*|*" -mx32 "*) |
4250 |
;; |
4251 |
*) |
4252 |
if test -z "$with_arch"; then |
4253 |
--- a/libitm/configure |
4254 |
+++ b/libitm/configure |
4255 |
@@ -7285,7 +7285,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) |
4256 |
LD="${LD-ld} -m elf_i386_fbsd" |
4257 |
;; |
4258 |
x86_64-*linux*) |
4259 |
- LD="${LD-ld} -m elf_i386" |
4260 |
+ case `/usr/bin/file conftest.o` in |
4261 |
+ *x86-64*) |
4262 |
+ LD="${LD-ld} -m elf32_x86_64" |
4263 |
+ ;; |
4264 |
+ *) |
4265 |
+ LD="${LD-ld} -m elf_i386" |
4266 |
+ ;; |
4267 |
+ esac |
4268 |
;; |
4269 |
ppc64-*linux*|powerpc64-*linux*) |
4270 |
LD="${LD-ld} -m elf32ppclinux" |
4271 |
--- a/libitm/configure.tgt |
4272 |
+++ b/libitm/configure.tgt |
4273 |
@@ -53,7 +53,7 @@ case "${target_cpu}" in |
4274 |
|
4275 |
i[3456]86) |
4276 |
case " ${CC} ${CFLAGS} " in |
4277 |
- *" -m64 "*) |
4278 |
+ *" -m64 "*|*" -mx32 "*) |
4279 |
;; |
4280 |
*) |
4281 |
if test -z "$with_arch"; then |
4282 |
--- a/libjava/classpath/configure |
4283 |
+++ b/libjava/classpath/configure |
4284 |
@@ -7592,7 +7592,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) |
4285 |
LD="${LD-ld} -m elf_i386_fbsd" |
4286 |
;; |
4287 |
x86_64-*linux*) |
4288 |
- LD="${LD-ld} -m elf_i386" |
4289 |
+ case `/usr/bin/file conftest.o` in |
4290 |
+ *x86-64*) |
4291 |
+ LD="${LD-ld} -m elf32_x86_64" |
4292 |
+ ;; |
4293 |
+ *) |
4294 |
+ LD="${LD-ld} -m elf_i386" |
4295 |
+ ;; |
4296 |
+ esac |
4297 |
;; |
4298 |
ppc64-*linux*|powerpc64-*linux*) |
4299 |
LD="${LD-ld} -m elf32ppclinux" |
4300 |
--- a/libjava/configure |
4301 |
+++ b/libjava/configure |
4302 |
@@ -8843,7 +8843,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) |
4303 |
LD="${LD-ld} -m elf_i386_fbsd" |
4304 |
;; |
4305 |
x86_64-*linux*) |
4306 |
- LD="${LD-ld} -m elf_i386" |
4307 |
+ case `/usr/bin/file conftest.o` in |
4308 |
+ *x86-64*) |
4309 |
+ LD="${LD-ld} -m elf32_x86_64" |
4310 |
+ ;; |
4311 |
+ *) |
4312 |
+ LD="${LD-ld} -m elf_i386" |
4313 |
+ ;; |
4314 |
+ esac |
4315 |
;; |
4316 |
ppc64-*linux*|powerpc64-*linux*) |
4317 |
LD="${LD-ld} -m elf32ppclinux" |
4318 |
--- a/libmudflap/configure |
4319 |
+++ b/libmudflap/configure |
4320 |
@@ -6393,7 +6393,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) |
4321 |
LD="${LD-ld} -m elf_i386_fbsd" |
4322 |
;; |
4323 |
x86_64-*linux*) |
4324 |
- LD="${LD-ld} -m elf_i386" |
4325 |
+ case `/usr/bin/file conftest.o` in |
4326 |
+ *x86-64*) |
4327 |
+ LD="${LD-ld} -m elf32_x86_64" |
4328 |
+ ;; |
4329 |
+ *) |
4330 |
+ LD="${LD-ld} -m elf_i386" |
4331 |
+ ;; |
4332 |
+ esac |
4333 |
;; |
4334 |
ppc64-*linux*|powerpc64-*linux*) |
4335 |
LD="${LD-ld} -m elf32ppclinux" |
4336 |
--- a/libobjc/configure |
4337 |
+++ b/libobjc/configure |
4338 |
@@ -6079,7 +6079,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) |
4339 |
LD="${LD-ld} -m elf_i386_fbsd" |
4340 |
;; |
4341 |
x86_64-*linux*) |
4342 |
- LD="${LD-ld} -m elf_i386" |
4343 |
+ case `/usr/bin/file conftest.o` in |
4344 |
+ *x86-64*) |
4345 |
+ LD="${LD-ld} -m elf32_x86_64" |
4346 |
+ ;; |
4347 |
+ *) |
4348 |
+ LD="${LD-ld} -m elf_i386" |
4349 |
+ ;; |
4350 |
+ esac |
4351 |
;; |
4352 |
ppc64-*linux*|powerpc64-*linux*) |
4353 |
LD="${LD-ld} -m elf32ppclinux" |
4354 |
--- a/libquadmath/configure |
4355 |
+++ b/libquadmath/configure |
4356 |
@@ -6264,7 +6264,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) |
4357 |
LD="${LD-ld} -m elf_i386_fbsd" |
4358 |
;; |
4359 |
x86_64-*linux*) |
4360 |
- LD="${LD-ld} -m elf_i386" |
4361 |
+ case `/usr/bin/file conftest.o` in |
4362 |
+ *x86-64*) |
4363 |
+ LD="${LD-ld} -m elf32_x86_64" |
4364 |
+ ;; |
4365 |
+ *) |
4366 |
+ LD="${LD-ld} -m elf_i386" |
4367 |
+ ;; |
4368 |
+ esac |
4369 |
;; |
4370 |
ppc64-*linux*|powerpc64-*linux*) |
4371 |
LD="${LD-ld} -m elf32ppclinux" |
4372 |
--- a/libssp/configure |
4373 |
+++ b/libssp/configure |
4374 |
@@ -6401,7 +6401,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) |
4375 |
LD="${LD-ld} -m elf_i386_fbsd" |
4376 |
;; |
4377 |
x86_64-*linux*) |
4378 |
- LD="${LD-ld} -m elf_i386" |
4379 |
+ case `/usr/bin/file conftest.o` in |
4380 |
+ *x86-64*) |
4381 |
+ LD="${LD-ld} -m elf32_x86_64" |
4382 |
+ ;; |
4383 |
+ *) |
4384 |
+ LD="${LD-ld} -m elf_i386" |
4385 |
+ ;; |
4386 |
+ esac |
4387 |
;; |
4388 |
ppc64-*linux*|powerpc64-*linux*) |
4389 |
LD="${LD-ld} -m elf32ppclinux" |
4390 |
--- a/libstdc++-v3/configure |
4391 |
+++ b/libstdc++-v3/configure |
4392 |
@@ -7120,7 +7119,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) |
4393 |
LD="${LD-ld} -m elf_i386_fbsd" |
4394 |
;; |
4395 |
x86_64-*linux*) |
4396 |
- LD="${LD-ld} -m elf_i386" |
4397 |
+ case `/usr/bin/file conftest.o` in |
4398 |
+ *x86-64*) |
4399 |
+ LD="${LD-ld} -m elf32_x86_64" |
4400 |
+ ;; |
4401 |
+ *) |
4402 |
+ LD="${LD-ld} -m elf_i386" |
4403 |
+ ;; |
4404 |
+ esac |
4405 |
;; |
4406 |
ppc64-*linux*|powerpc64-*linux*) |
4407 |
LD="${LD-ld} -m elf32ppclinux" |
4408 |
--- a/libtool.m4 |
4409 |
+++ b/libtool.m4 |
4410 |
@@ -1232,7 +1232,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) |
4411 |
LD="${LD-ld} -m elf_i386_fbsd" |
4412 |
;; |
4413 |
x86_64-*linux*) |
4414 |
- LD="${LD-ld} -m elf_i386" |
4415 |
+ case `/usr/bin/file conftest.o` in |
4416 |
+ *x86-64*) |
4417 |
+ LD="${LD-ld} -m elf32_x86_64" |
4418 |
+ ;; |
4419 |
+ *) |
4420 |
+ LD="${LD-ld} -m elf_i386" |
4421 |
+ ;; |
4422 |
+ esac |
4423 |
;; |
4424 |
ppc64-*linux*|powerpc64-*linux*) |
4425 |
LD="${LD-ld} -m elf32ppclinux" |
4426 |
--- a/lto-plugin/configure |
4427 |
+++ b/lto-plugin/configure |
4428 |
@@ -6060,7 +6060,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) |
4429 |
LD="${LD-ld} -m elf_i386_fbsd" |
4430 |
;; |
4431 |
x86_64-*linux*) |
4432 |
- LD="${LD-ld} -m elf_i386" |
4433 |
+ case `/usr/bin/file conftest.o` in |
4434 |
+ *x86-64*) |
4435 |
+ LD="${LD-ld} -m elf32_x86_64" |
4436 |
+ ;; |
4437 |
+ *) |
4438 |
+ LD="${LD-ld} -m elf_i386" |
4439 |
+ ;; |
4440 |
+ esac |
4441 |
;; |
4442 |
ppc64-*linux*|powerpc64-*linux*) |
4443 |
LD="${LD-ld} -m elf32ppclinux" |
4444 |
--- a/zlib/configure |
4445 |
+++ b/zlib/configure |
4446 |
@@ -5869,7 +5869,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) |
4447 |
LD="${LD-ld} -m elf_i386_fbsd" |
4448 |
;; |
4449 |
x86_64-*linux*) |
4450 |
- LD="${LD-ld} -m elf_i386" |
4451 |
+ case `/usr/bin/file conftest.o` in |
4452 |
+ *x86-64*) |
4453 |
+ LD="${LD-ld} -m elf32_x86_64" |
4454 |
+ ;; |
4455 |
+ *) |
4456 |
+ LD="${LD-ld} -m elf_i386" |
4457 |
+ ;; |
4458 |
+ esac |
4459 |
;; |
4460 |
ppc64-*linux*|powerpc64-*linux*) |
4461 |
LD="${LD-ld} -m elf32ppclinux" |
4462 |
|
4463 |
|
4464 |
|
4465 |
1.1 src/patchsets/gcc/4.7.2/gentoo/92_all_freebsd-pie.patch |
4466 |
|
4467 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.2/gentoo/92_all_freebsd-pie.patch?rev=1.1&view=markup |
4468 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.2/gentoo/92_all_freebsd-pie.patch?rev=1.1&content-type=text/plain |
4469 |
|
4470 |
Index: 92_all_freebsd-pie.patch |
4471 |
=================================================================== |
4472 |
https://bugs.gentoo.org/415185 |
4473 |
http://gcc.gnu.org/ml/gcc-patches/2012-05/msg00555.html |
4474 |
|
4475 |
From: Alexis Ballier <aballier@g.o> |
4476 |
To: gcc-patches@×××××××.org |
4477 |
Cc: Alexis Ballier <aballier@g.o> |
4478 |
Date: Tue, 8 May 2012 09:53:43 -0400 |
4479 |
Subject: [PATCH] gcc/config/freebsd-spec.h: Fix building PIE executables. Link them with crt{begin,end}S.o and Scrt1.o which are PIC instead of crt{begin,end}.o and crt1.o which are not. Spec synced from gnu-user.h. |
4480 |
|
4481 |
gcc/config/i386/freebsd.h: Likewise. |
4482 |
--- |
4483 |
gcc/config/freebsd-spec.h | 9 +++------ |
4484 |
gcc/config/i386/freebsd.h | 9 +++------ |
4485 |
2 files changed, 6 insertions(+), 12 deletions(-) |
4486 |
|
4487 |
diff --git a/gcc/config/freebsd-spec.h b/gcc/config/freebsd-spec.h |
4488 |
index 770a3d1..2808582 100644 |
4489 |
--- a/gcc/config/freebsd-spec.h |
4490 |
+++ b/gcc/config/freebsd-spec.h |
4491 |
@@ -64,11 +64,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see |
4492 |
before entering `main'. */ |
4493 |
|
4494 |
#define FBSD_STARTFILE_SPEC \ |
4495 |
- "%{!shared: \ |
4496 |
- %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \ |
4497 |
- %{!p:%{profile:gcrt1.o%s} \ |
4498 |
- %{!profile:crt1.o%s}}}} \ |
4499 |
- crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}" |
4500 |
+ "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \ |
4501 |
+ crti.o%s %{shared|pie:crtbeginS.o%s;:crtbegin.o%s}" |
4502 |
|
4503 |
/* Provide a ENDFILE_SPEC appropriate for FreeBSD. Here we tack on |
4504 |
the magical crtend.o file (see crtstuff.c) which provides part of |
4505 |
@@ -77,7 +74,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see |
4506 |
`crtn.o'. */ |
4507 |
|
4508 |
#define FBSD_ENDFILE_SPEC \ |
4509 |
- "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s" |
4510 |
+ "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s" |
4511 |
|
4512 |
/* Provide a LIB_SPEC appropriate for FreeBSD as configured and as |
4513 |
required by the user-land thread model. Before __FreeBSD_version |
4514 |
diff --git a/gcc/config/i386/freebsd.h b/gcc/config/i386/freebsd.h |
4515 |
index 649274d..dd69e43 100644 |
4516 |
--- a/gcc/config/i386/freebsd.h |
4517 |
+++ b/gcc/config/i386/freebsd.h |
4518 |
@@ -67,11 +67,8 @@ along with GCC; see the file COPYING3. If not see |
4519 |
|
4520 |
#undef STARTFILE_SPEC |
4521 |
#define STARTFILE_SPEC \ |
4522 |
- "%{!shared: \ |
4523 |
- %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \ |
4524 |
- %{!p:%{profile:gcrt1.o%s} \ |
4525 |
- %{!profile:crt1.o%s}}}} \ |
4526 |
- crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}" |
4527 |
+ "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \ |
4528 |
+ crti.o%s %{shared|pie:crtbeginS.o%s;:crtbegin.o%s}" |
4529 |
|
4530 |
/* Provide a ENDFILE_SPEC appropriate for FreeBSD. Here we tack on |
4531 |
the magical crtend.o file (see crtstuff.c) which provides part of |
4532 |
@@ -81,7 +78,7 @@ along with GCC; see the file COPYING3. If not see |
4533 |
|
4534 |
#undef ENDFILE_SPEC |
4535 |
#define ENDFILE_SPEC \ |
4536 |
- "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s" |
4537 |
+ "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s" |
4538 |
|
4539 |
/* Provide a LINK_SPEC appropriate for FreeBSD. Here we provide support |
4540 |
for the special GCC options -static and -shared, which allow us to |
4541 |
-- |
4542 |
1.7.8.6 |
4543 |
|
4544 |
|
4545 |
|
4546 |
1.1 src/patchsets/gcc/4.7.2/gentoo/README.history |
4547 |
|
4548 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.2/gentoo/README.history?rev=1.1&view=markup |
4549 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.2/gentoo/README.history?rev=1.1&content-type=text/plain |
4550 |
|
4551 |
Index: README.history |
4552 |
=================================================================== |
4553 |
1.0 (pending) |
4554 |
+ 03_all_java-nomulti.patch |
4555 |
+ 10_all_default-fortify-source.patch |
4556 |
+ 11_all_default-warn-format-security.patch |
4557 |
+ 12_all_default-warn-trampolines.patch |
4558 |
+ 15_all_libgfortran-Werror.patch |
4559 |
+ 15_all_libgomp-Werror.patch |
4560 |
+ 16_all_libgo-Werror-pr53679.patch |
4561 |
+ 25_all_alpha-mieee-default.patch |
4562 |
+ 26_all_alpha-asm-mcpu.patch |
4563 |
+ 29_all_arm_armv4t-default.patch |
4564 |
+ 33_all_armhf.patch |
4565 |
+ 34_all_ia64_note.GNU-stack.patch |
4566 |
+ 38_all_sh_pr24836_all-archs.patch |
4567 |
+ 42_all_superh_default-multilib.patch |
4568 |
+ 49_all_gcc-4.7-x86-libitm-pr52695.patch |
4569 |
+ 50_all_libiberty-asprintf.patch |
4570 |
+ 51_all_libiberty-pic.patch |
4571 |
+ 52_all_netbsd-Bsymbolic.patch |
4572 |
+ 67_all_gcc-poison-system-directories.patch |
4573 |
+ 74_all_gcc47_cloog-dl.patch |
4574 |
+ 90_all_gcc-4.7-x32.patch |
4575 |
+ 92_all_freebsd-pie.patch |