1 |
vapier 15/12/05 21:12:19 |
2 |
|
3 |
Added: 05_all_gcc-spec-env.patch 09_all_default-ssp.patch |
4 |
10_all_default-fortify-source.patch |
5 |
11_all_default-warn-format-security.patch |
6 |
12_all_default-warn-trampolines.patch |
7 |
20_all_msgfmt-libstdc++-link.patch |
8 |
25_all_alpha-mieee-default.patch |
9 |
26_all_alpha-asm-mcpu.patch |
10 |
29_all_arm_armv4t-default.patch |
11 |
34_all_ia64_note.GNU-stack.patch |
12 |
34_all_libjava-classpath-locale-sort.patch |
13 |
38_all_sh_pr24836_all-archs.patch |
14 |
42_all_superh_default-multilib.patch |
15 |
50_all_libiberty-asprintf.patch |
16 |
51_all_libiberty-pic.patch |
17 |
52_all_netbsd-Bsymbolic.patch |
18 |
53_all_libitm-no-fortify-source.patch |
19 |
67_all_gcc-poison-system-directories.patch |
20 |
70_all_gcc-5-pr546752.patch |
21 |
74_all_gcc5_isl-dl.patch 77_all_gcc-5-pr65958.patch |
22 |
85_all_gcc5-aarch64-pr65689.patch |
23 |
90_all_pr55930-dependency-tracking.patch |
24 |
README.history |
25 |
Log: |
26 |
initial 5.3.0 patchset based on last 5.2.0 patchset |
27 |
|
28 |
Revision Changes Path |
29 |
1.1 src/patchsets/gcc/5.3.0/gentoo/05_all_gcc-spec-env.patch |
30 |
|
31 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/5.3.0/gentoo/05_all_gcc-spec-env.patch?rev=1.1&view=markup |
32 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/5.3.0/gentoo/05_all_gcc-spec-env.patch?rev=1.1&content-type=text/plain |
33 |
|
34 |
Index: 05_all_gcc-spec-env.patch |
35 |
=================================================================== |
36 |
2013-08-22 Magnus Granberg <zorry@g.o> |
37 |
|
38 |
* gcc/gcc.c (main): Add support for external spec file via the GCC_SPECS env var |
39 |
and move the process of the user specifed specs. |
40 |
|
41 |
This allows us to easily control pie/ssp defaults with gcc-config profiles. |
42 |
Original patch by Rob Holland |
43 |
Extended to support multiple entries separated by ':' by Kevin F. Quinn |
44 |
Modified to use getenv instead of poisoned GET_ENVIRONMENT by Ryan Hill |
45 |
Modified to process the GCC_SPECS env var befor DRIVER_SELF_SPECS by Magnus Granberg |
46 |
|
47 |
--- a/gcc/gcc.c |
48 |
+++ b/gcc/gcc.c |
49 |
@@ -6427,6 +6428,48 @@ main (int argc, char **argv) |
50 |
do_option_spec (option_default_specs[i].name, |
51 |
option_default_specs[i].spec); |
52 |
|
53 |
+#if !(defined (__MSDOS__) || defined (OS2) || defined (VMS) || defined (WIN32)) |
54 |
+ /* Add specs listed in GCC_SPECS. Note; in the process of separating |
55 |
+ * each spec listed, the string is overwritten at token boundaries |
56 |
+ * (':') with '\0', an effect of strtok_r(). |
57 |
+ */ |
58 |
+ specs_file = getenv ("GCC_SPECS"); |
59 |
+ if (specs_file && (strlen(specs_file) > 0)) |
60 |
+ { |
61 |
+ char *spec, *saveptr; |
62 |
+ for (spec=strtok_r(specs_file,":",&saveptr); |
63 |
+ spec!=NULL; |
64 |
+ spec=strtok_r(NULL,":",&saveptr)) |
65 |
+ { |
66 |
+ struct user_specs *user = (struct user_specs *) |
67 |
+ xmalloc (sizeof (struct user_specs)); |
68 |
+ user->next = (struct user_specs *) 0; |
69 |
+ user->filename = spec; |
70 |
+ if (user_specs_tail) |
71 |
+ user_specs_tail->next = user; |
72 |
+ else |
73 |
+ user_specs_head = user; |
74 |
+ user_specs_tail = user; |
75 |
+ } |
76 |
+ } |
77 |
+#endif |
78 |
+ /* Process any user specified specs in the order given on the command |
79 |
+ * line. */ |
80 |
+ for (struct user_specs *uptr = user_specs_head; uptr; uptr = uptr->next) |
81 |
+ { |
82 |
+ char *filename = find_a_file (&startfile_prefixes, uptr->filename, |
83 |
+ R_OK, true); |
84 |
+ read_specs (filename ? filename : uptr->filename, false, true); |
85 |
+ } |
86 |
+ /* Process any user self specs. */ |
87 |
+ { |
88 |
+ struct spec_list *sl; |
89 |
+ for (sl = specs; sl; sl = sl->next) |
90 |
+ if (sl->name_len == sizeof "self_spec" - 1 |
91 |
+ && !strcmp (sl->name, "self_spec")) |
92 |
+ do_self_spec (*sl->ptr_spec); |
93 |
+ } |
94 |
+ |
95 |
/* Process DRIVER_SELF_SPECS, adding any new options to the end |
96 |
of the command line. */ |
97 |
|
98 |
@@ -6535,24 +6578,6 @@ main (int argc, char **argv) |
99 |
PREFIX_PRIORITY_LAST, 0, 1); |
100 |
} |
101 |
|
102 |
- /* Process any user specified specs in the order given on the command |
103 |
- line. */ |
104 |
- for (struct user_specs *uptr = user_specs_head; uptr; uptr = uptr->next) |
105 |
- { |
106 |
- char *filename = find_a_file (&startfile_prefixes, uptr->filename, |
107 |
- R_OK, true); |
108 |
- read_specs (filename ? filename : uptr->filename, false, true); |
109 |
- } |
110 |
- |
111 |
- /* Process any user self specs. */ |
112 |
- { |
113 |
- struct spec_list *sl; |
114 |
- for (sl = specs; sl; sl = sl->next) |
115 |
- if (sl->name_len == sizeof "self_spec" - 1 |
116 |
- && !strcmp (sl->name, "self_spec")) |
117 |
- do_self_spec (*sl->ptr_spec); |
118 |
- } |
119 |
- |
120 |
if (compare_debug) |
121 |
{ |
122 |
enum save_temps save; |
123 |
|
124 |
|
125 |
|
126 |
1.1 src/patchsets/gcc/5.3.0/gentoo/09_all_default-ssp.patch |
127 |
|
128 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/5.3.0/gentoo/09_all_default-ssp.patch?rev=1.1&view=markup |
129 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/5.3.0/gentoo/09_all_default-ssp.patch?rev=1.1&content-type=text/plain |
130 |
|
131 |
Index: 09_all_default-ssp.patch |
132 |
=================================================================== |
133 |
2014-04-27 Magnus Granberg <zorry@g.o> |
134 |
|
135 |
Patch orig: Debian/Ubuntu |
136 |
# 484714 |
137 |
We Add -fstack-protector-strong as default and change |
138 |
ssp-buffer-size |
139 |
|
140 |
--- a/configure.ac |
141 |
+++ b/configure.ac |
142 |
@@ -3238,6 +3238,9 @@ case $build in |
143 |
esac ;; |
144 |
esac |
145 |
|
146 |
+# Needed when we build with -fstack-protector as default. |
147 |
+stage1_cflags="$stage1_cflags -fno-stack-protector" |
148 |
+ |
149 |
AC_SUBST(stage1_cflags) |
150 |
|
151 |
# Enable --enable-checking in stage1 of the compiler. |
152 |
--- a/configure |
153 |
+++ b/configure |
154 |
@@ -14453,7 +14453,8 @@ case $build in |
155 |
esac ;; |
156 |
esac |
157 |
|
158 |
- |
159 |
+# Needed when we build with -fstack-protector as default. |
160 |
+stage1_cflags="$stage1_cflags -fno-stack-protector" |
161 |
|
162 |
# Enable --enable-checking in stage1 of the compiler. |
163 |
# Check whether --enable-stage1-checking was given. |
164 |
--- a/Makefile.in |
165 |
+++ b/Makefile.in |
166 |
@@ -362,7 +362,7 @@ BUILD_PREFIX_1 = @BUILD_PREFIX_1@ |
167 |
|
168 |
# Flags to pass to stage2 and later makes. They are defined |
169 |
# here so that they can be overridden by Makefile fragments. |
170 |
-BOOT_CFLAGS= -g -O2 |
171 |
+BOOT_CFLAGS= -g -O2 -fno-stack-protector |
172 |
BOOT_LDFLAGS= |
173 |
BOOT_ADAFLAGS= -gnatpg |
174 |
|
175 |
@@ -408,9 +408,9 @@ GNATMAKE = @GNATMAKE@ |
176 |
|
177 |
CFLAGS = @CFLAGS@ |
178 |
LDFLAGS = @LDFLAGS@ |
179 |
-LIBCFLAGS = $(CFLAGS) |
180 |
+LIBCFLAGS = $(CFLAGS) -fno-stack-protector |
181 |
CXXFLAGS = @CXXFLAGS@ |
182 |
-LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates |
183 |
+LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates -fno-stack-protector |
184 |
GOCFLAGS = $(CFLAGS) |
185 |
|
186 |
TFLAGS = |
187 |
--- a/gcc/doc/invoke.texi |
188 |
+++ b/gcc/doc/invoke.texi |
189 |
@@ -9239,6 +9251,11 @@ Like @option{-fstack-protector} but incl |
190 |
be protected --- those that have local array definitions, or have |
191 |
references to local frame addresses. |
192 |
|
193 |
+NOTE: In Gentoo GCC 4.9.0 and later versions this option is enabled by default |
194 |
+for C, C++, ObjC, and ObjC++ if none of the options @option{-fno-stack-protector}, |
195 |
+@option{-nostdlib}, @option{-ffreestanding}, @option{-fstack-protector}, |
196 |
+@option{-fstack-protector-strong}, or @option{-fstack-protector-all} are found. |
197 |
+ |
198 |
@item -fstack-protector-explicit |
199 |
@opindex fstack-protector-explicit |
200 |
Like @option{-fstack-protector} but only protects those functions which |
201 |
@@ -9461,6 +9465,9 @@ |
202 |
The minimum size of buffers (i.e.@: arrays) that receive stack smashing |
203 |
protection when @option{-fstack-protection} is used. |
204 |
|
205 |
+NOTE: In Gentoo this is change from "8" to "4", to increase |
206 |
+the number of functions protected by the stack protector. |
207 |
+ |
208 |
@item min-size-for-stack-sharing |
209 |
The minimum size of variables taking part in stack slot sharing when not |
210 |
optimizing. The default value is 32. |
211 |
--- a/gcc/cp/lang-specs.h |
212 |
+++ b/gcc/cp/lang-specs.h |
213 |
@@ -46,7 +46,7 @@ along with GCC; see the file COPYING3. If not see |
214 |
%(cpp_options) %2 -o %{save-temps*:%b.ii} %{!save-temps*:%g.ii} \n}\ |
215 |
cc1plus %{save-temps*|no-integrated-cpp:-fpreprocessed %{save-temps*:%b.ii} %{!save-temps*:%g.ii}}\ |
216 |
%{!save-temps*:%{!no-integrated-cpp:%(cpp_unique_options)}}\ |
217 |
- %(cc1_options) %2\ |
218 |
+ %(cc1_options) %(ssp_default) %2\ |
219 |
%{!fsyntax-only:%{!fdump-ada-spec*:-o %g.s %{!o*:--output-pch=%i.gch}\ |
220 |
%W{o*:--output-pch=%*}}%V}}}}", |
221 |
CPLUSPLUS_CPP_SPEC, 0, 0}, |
222 |
@@ -57,11 +57,11 @@ along with GCC; see the file COPYING3. If not see |
223 |
%(cpp_options) %2 -o %{save-temps*:%b.ii} %{!save-temps*:%g.ii} \n}\ |
224 |
cc1plus %{save-temps*|no-integrated-cpp:-fpreprocessed %{save-temps*:%b.ii} %{!save-temps*:%g.ii}}\ |
225 |
%{!save-temps*:%{!no-integrated-cpp:%(cpp_unique_options)}}\ |
226 |
- %(cc1_options) %2\ |
227 |
+ %(cc1_options) %(ssp_default) %2\ |
228 |
%{!fsyntax-only:%(invoke_as)}}}}", |
229 |
CPLUSPLUS_CPP_SPEC, 0, 0}, |
230 |
{".ii", "@c++-cpp-output", 0, 0, 0}, |
231 |
{"@c++-cpp-output", |
232 |
"%{!M:%{!MM:%{!E:\ |
233 |
- cc1plus -fpreprocessed %i %(cc1_options) %2\ |
234 |
+ cc1plus -fpreprocessed %i %(cc1_options) %(ssp_default) %2\ |
235 |
%{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, |
236 |
--- a/gcc/gcc.c |
237 |
+++ b/gcc/gcc.c |
238 |
@@ -651,6 +651,19 @@ proper position among the other output files. */ |
239 |
#define LINK_GCC_C_SEQUENCE_SPEC "%G %L %G" |
240 |
#endif |
241 |
|
242 |
+#ifndef SSP_DEFAULT_SPEC |
243 |
+#if defined ( TARGET_LIBC_PROVIDES_SSP ) && defined ( EFAULT_SSP ) |
244 |
+#define SSP_DEFAULT_SPEC "%{fno-stack-protector|fstack-protector| \ |
245 |
+ fstack-protector-strong|fstack-protector-all| \ |
246 |
+ ffreestanding|nostdlib:;:-fstack-protector-strong}" |
247 |
+/* Add -fno-stack-protector for the use of gcc-specs-ssp. */ |
248 |
+#define CC1_SSP_DEFAULT_SPEC "%{!fno-stack-protector:}" |
249 |
+#else |
250 |
+#define SSP_DEFAULT_SPEC "" |
251 |
+#define CC1_SSP_DEFAULT_SPEC "" |
252 |
+#endif |
253 |
+#endif |
254 |
+ |
255 |
#ifndef LINK_SSP_SPEC |
256 |
#ifdef TARGET_LIBC_PROVIDES_SSP |
257 |
#define LINK_SSP_SPEC "%{fstack-protector:}" |
258 |
@@ -771,7 +781,7 @@ proper position among the other output f |
259 |
|
260 |
static const char *asm_debug = ASM_DEBUG_SPEC; |
261 |
static const char *cpp_spec = CPP_SPEC; |
262 |
-static const char *cc1_spec = CC1_SPEC; |
263 |
+static const char *cc1_spec = CC1_SPEC CC1_SSP_DEFAULT_SPEC; |
264 |
static const char *cc1plus_spec = CC1PLUS_SPEC; |
265 |
static const char *link_gcc_c_sequence_spec = LINK_GCC_C_SEQUENCE_SPEC; |
266 |
static const char *link_ssp_spec = LINK_SSP_SPEC; |
267 |
@@ -777,6 +785,8 @@ static const char *cc1_spec = CC1_SPEC; |
268 |
static const char *cc1plus_spec = CC1PLUS_SPEC; |
269 |
static const char *link_gcc_c_sequence_spec = LINK_GCC_C_SEQUENCE_SPEC; |
270 |
static const char *link_ssp_spec = LINK_SSP_SPEC; |
271 |
+static const char *ssp_default_spec = SSP_DEFAULT_SPEC; |
272 |
+static const char *cc1_ssp_default_spec = CC1_SSP_DEFAULT_SPEC; |
273 |
static const char *asm_spec = ASM_SPEC; |
274 |
static const char *asm_final_spec = ASM_FINAL_SPEC; |
275 |
static const char *link_spec = LINK_SPEC; |
276 |
@@ -835,7 +844,7 @@ static const char *cpp_unique_options = |
277 |
static const char *cpp_options = |
278 |
"%(cpp_unique_options) %1 %{m*} %{std*&ansi&trigraphs} %{W*&pedantic*} %{w}\ |
279 |
%{f*} %{g*:%{!g0:%{g*} %{!fno-working-directory:-fworking-directory}}} %{O*}\ |
280 |
- %{undef} %{save-temps*:-fpch-preprocess}"; |
281 |
+ %{undef} %{save-temps*:-fpch-preprocess} %(ssp_default)"; |
282 |
|
283 |
/* This contains cpp options which are not passed when the preprocessor |
284 |
output will be used by another program. */ |
285 |
@@ -1015,9 +1024,9 @@ static const struct compiler default_compilers[] = |
286 |
%{save-temps*|traditional-cpp|no-integrated-cpp:%(trad_capable_cpp) \ |
287 |
%(cpp_options) -o %{save-temps*:%b.i} %{!save-temps*:%g.i} \n\ |
288 |
cc1 -fpreprocessed %{save-temps*:%b.i} %{!save-temps*:%g.i} \ |
289 |
- %(cc1_options)}\ |
290 |
+ %(cc1_options) %(ssp_default)}\ |
291 |
%{!save-temps*:%{!traditional-cpp:%{!no-integrated-cpp:\ |
292 |
- cc1 %(cpp_unique_options) %(cc1_options)}}}\ |
293 |
+ cc1 %(cpp_unique_options) %(cc1_options) %(ssp_default)}}}\ |
294 |
%{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 1}, |
295 |
{"-", |
296 |
"%{!E:%e-E or -x required when input is from standard input}\ |
297 |
@@ -1040,7 +1049,7 @@ static const struct compiler default_compilers[] = |
298 |
%W{o*:--output-pch=%*}}%V}}}}}}", 0, 0, 0}, |
299 |
{".i", "@cpp-output", 0, 0, 0}, |
300 |
{"@cpp-output", |
301 |
- "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %(cc1_options) %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, |
302 |
+ "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %(cc1_options) %(ssp_default) %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, |
303 |
{".s", "@assembler", 0, 0, 0}, |
304 |
{"@assembler", |
305 |
"%{!M:%{!MM:%{!E:%{!S:as %(asm_debug) %(asm_options) %i %A }}}}", 0, 0, 0}, |
306 |
@@ -1267,6 +1276,8 @@ static struct spec_list static_specs[] = |
307 |
INIT_STATIC_SPEC ("cc1plus", &cc1plus_spec), |
308 |
INIT_STATIC_SPEC ("link_gcc_c_sequence", &link_gcc_c_sequence_spec), |
309 |
INIT_STATIC_SPEC ("link_ssp", &link_ssp_spec), |
310 |
+ INIT_STATIC_SPEC ("ssp_default", &ssp_default_spec), |
311 |
+ INIT_STATIC_SPEC ("cc1_ssp_default", &cc1_ssp_default_spec), |
312 |
INIT_STATIC_SPEC ("endfile", &endfile_spec), |
313 |
INIT_STATIC_SPEC ("link", &link_spec), |
314 |
INIT_STATIC_SPEC ("lib", &lib_spec), |
315 |
--- a/gcc/objc/lang-specs.h |
316 |
+++ b/gcc/objc/lang-specs.h |
317 |
@@ -29,9 +29,9 @@ along with GCC; see the file COPYING3. If not see |
318 |
%{traditional|traditional-cpp:\ |
319 |
%eGNU Objective C no longer supports traditional compilation}\ |
320 |
%{save-temps*|no-integrated-cpp:cc1obj -E %(cpp_options) -o %{save-temps*:%b.mi} %{!save-temps*:%g.mi} \n\ |
321 |
- cc1obj -fpreprocessed %{save-temps*:%b.mi} %{!save-temps*:%g.mi} %(cc1_options) %{print-objc-runtime-info} %{gen-decls}}\ |
322 |
+ cc1obj -fpreprocessed %{save-temps*:%b.mi} %{!save-temps*:%g.mi} %(cc1_options) %(ssp_default) %{print-objc-runtime-info} %{gen-decls}}\ |
323 |
%{!save-temps*:%{!no-integrated-cpp:\ |
324 |
- cc1obj %(cpp_unique_options) %(cc1_options) %{print-objc-runtime-info} %{gen-decls}}}\ |
325 |
+ cc1obj %(cpp_unique_options) %(cc1_options) %(ssp_default) %{print-objc-runtime-info} %{gen-decls}}}\ |
326 |
%{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, |
327 |
{"@objective-c-header", |
328 |
"%{E|M|MM:cc1obj -E %{traditional|traditional-cpp:-traditional-cpp}\ |
329 |
@@ -40,18 +40,18 @@ along with GCC; see the file COPYING3. If not see |
330 |
%{traditional|traditional-cpp:\ |
331 |
%eGNU Objective C no longer supports traditional compilation}\ |
332 |
%{save-temps*|no-integrated-cpp:cc1obj -E %(cpp_options) -o %{save-temps*:%b.mi} %{!save-temps*:%g.mi} \n\ |
333 |
- cc1obj -fpreprocessed %b.mi %(cc1_options) %{print-objc-runtime-info} %{gen-decls}\ |
334 |
+ cc1obj -fpreprocessed %b.mi %(cc1_options) %(ssp_default) %{print-objc-runtime-info} %{gen-decls}\ |
335 |
-o %g.s %{!o*:--output-pch=%i.gch}\ |
336 |
%W{o*:--output-pch=%*}%V}\ |
337 |
%{!save-temps*:%{!no-integrated-cpp:\ |
338 |
- cc1obj %(cpp_unique_options) %(cc1_options) %{print-objc-runtime-info} %{gen-decls}\ |
339 |
+ cc1obj %(cpp_unique_options) %(cc1_options) %(ssp_default) %{print-objc-runtime-info} %{gen-decls}\ |
340 |
-o %g.s %{!o*:--output-pch=%i.gch}\ |
341 |
%W{o*:--output-pch=%*}%V}}}}}", 0, 0, 0}, |
342 |
{".mi", "@objective-c-cpp-output", 0, 0, 0}, |
343 |
{"@objective-c-cpp-output", |
344 |
- "%{!M:%{!MM:%{!E:cc1obj -fpreprocessed %i %(cc1_options) %{print-objc-runtime-info} %{gen-decls}\ |
345 |
+ "%{!M:%{!MM:%{!E:cc1obj -fpreprocessed %i %(cc1_options) %(ssp_default) %{print-objc-runtime-info} %{gen-decls}\ |
346 |
%{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, |
347 |
{"@objc-cpp-output", |
348 |
"%nobjc-cpp-output is deprecated; please use objective-c-cpp-output instead\n\ |
349 |
- %{!M:%{!MM:%{!E:cc1obj -fpreprocessed %i %(cc1_options) %{print-objc-runtime-info} %{gen-decls}\ |
350 |
+ %{!M:%{!MM:%{!E:cc1obj -fpreprocessed %i %(cc1_options) %(ssp_default) %{print-objc-runtime-info} %{gen-decls}\ |
351 |
%{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, |
352 |
--- a/gcc/objcp/lang-specs.h |
353 |
+++ b/gcc/objcp/lang-specs.h |
354 |
@@ -36,7 +36,7 @@ along with GCC; see the file COPYING3. If not see |
355 |
%(cpp_options) %2 -o %{save-temps*:%b.mii} %{!save-temps*:%g.mii} \n}\ |
356 |
cc1objplus %{save-temps*|no-integrated-cpp:-fpreprocessed %{save-temps*:%b.mii} %{!save-temps*:%g.mii}}\ |
357 |
%{!save-temps*:%{!no-integrated-cpp:%(cpp_unique_options)}}\ |
358 |
- %(cc1_options) %2\ |
359 |
+ %(cc1_options) %(ssp_default) %2\ |
360 |
-o %g.s %{!o*:--output-pch=%i.gch} %W{o*:--output-pch=%*}%V}}}", |
361 |
CPLUSPLUS_CPP_SPEC, 0, 0}, |
362 |
{"@objective-c++", |
363 |
@@ -46,16 +46,16 @@ along with GCC; see the file COPYING3. If not see |
364 |
%(cpp_options) %2 -o %{save-temps*:%b.mii} %{!save-temps*:%g.mii} \n}\ |
365 |
cc1objplus %{save-temps*|no-integrated-cpp:-fpreprocessed %{save-temps*:%b.mii} %{!save-temps*:%g.mii}}\ |
366 |
%{!save-temps*:%{!no-integrated-cpp:%(cpp_unique_options)}}\ |
367 |
- %(cc1_options) %2\ |
368 |
+ %(cc1_options) %(ssp_default) %2\ |
369 |
%{!fsyntax-only:%(invoke_as)}}}}", |
370 |
CPLUSPLUS_CPP_SPEC, 0, 0}, |
371 |
{".mii", "@objective-c++-cpp-output", 0, 0, 0}, |
372 |
{"@objective-c++-cpp-output", |
373 |
"%{!M:%{!MM:%{!E:\ |
374 |
- cc1objplus -fpreprocessed %i %(cc1_options) %2\ |
375 |
+ cc1objplus -fpreprocessed %i %(cc1_options) %(ssp_default) %2\ |
376 |
%{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, |
377 |
{"@objc++-cpp-output", |
378 |
"%nobjc++-cpp-output is deprecated; please use objective-c++-cpp-output instead\n\ |
379 |
%{!M:%{!MM:%{!E:\ |
380 |
- cc1objplus -fpreprocessed %i %(cc1_options) %2\ |
381 |
+ cc1objplus -fpreprocessed %i %(cc1_options) %(ssp_default) %2\ |
382 |
%{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, |
383 |
--- a/gcc/params.def |
384 |
+++ b/gcc/params.def |
385 |
@@ -662,7 +662,7 @@ DEFPARAM (PARAM_INTEGER_SHARE_LIMIT, |
386 |
DEFPARAM (PARAM_SSP_BUFFER_SIZE, |
387 |
"ssp-buffer-size", |
388 |
"The lower bound for a buffer to be considered for stack smashing protection", |
389 |
- 8, 1, 0) |
390 |
+ 4, 1, 0) |
391 |
|
392 |
/* When we thread through a block we have to make copies of the |
393 |
statements within the block. Clearly for large blocks the code |
394 |
|
395 |
|
396 |
|
397 |
1.1 src/patchsets/gcc/5.3.0/gentoo/10_all_default-fortify-source.patch |
398 |
|
399 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/5.3.0/gentoo/10_all_default-fortify-source.patch?rev=1.1&view=markup |
400 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/5.3.0/gentoo/10_all_default-fortify-source.patch?rev=1.1&content-type=text/plain |
401 |
|
402 |
Index: 10_all_default-fortify-source.patch |
403 |
=================================================================== |
404 |
Enable -D_FORTIFY_SOURCE=2 by default. |
405 |
|
406 |
|
407 |
--- a/gcc/c-family/c-cppbuiltin.c |
408 |
+++ b/gcc/c-family/c-cppbuiltin.c |
409 |
@@ -951,6 +951,9 @@ c_cpp_builtins (cpp_reader *pfile) |
410 |
builtin_define_with_value ("__REGISTER_PREFIX__", REGISTER_PREFIX, 0); |
411 |
builtin_define_with_value ("__USER_LABEL_PREFIX__", user_label_prefix, 0); |
412 |
|
413 |
+ /* Fortify Source enabled by default w/optimization. */ |
414 |
+ cpp_define (pfile, "_FORTIFY_SOURCE=((defined __OPTIMIZE__ && __OPTIMIZE__ > 0) ? 2 : 0)"); |
415 |
+ |
416 |
/* Misc. */ |
417 |
if (flag_gnu89_inline) |
418 |
cpp_define (pfile, "__GNUC_GNU_INLINE__"); |
419 |
--- a/gcc/doc/gcc.info |
420 |
+++ b/gcc/doc/gcc.info |
421 |
@@ -6255,6 +6255,11 @@ |
422 |
Please note the warning under `-fgcse' about invoking `-O2' on |
423 |
programs that use computed gotos. |
424 |
|
425 |
+ NOTE: In Gentoo, `-D_FORTIFY_SOURCE=2' is set by default, and is |
426 |
+ activated when `-O' is set to 2 or higher. This enables additional |
427 |
+ compile-time and run-time checks for several libc functions. To disable, |
428 |
+ specify either `-U_FORTIFY_SOURCE' or `-D_FORTIFY_SOURCE=0'. |
429 |
+ |
430 |
`-O3' |
431 |
Optimize yet more. `-O3' turns on all optimizations specified by |
432 |
`-O2' and also turns on the `-finline-functions', |
433 |
|
434 |
|
435 |
|
436 |
1.1 src/patchsets/gcc/5.3.0/gentoo/11_all_default-warn-format-security.patch |
437 |
|
438 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/5.3.0/gentoo/11_all_default-warn-format-security.patch?rev=1.1&view=markup |
439 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/5.3.0/gentoo/11_all_default-warn-format-security.patch?rev=1.1&content-type=text/plain |
440 |
|
441 |
Index: 11_all_default-warn-format-security.patch |
442 |
=================================================================== |
443 |
Enable -Wformat and -Wformat-security by default. |
444 |
|
445 |
|
446 |
--- a/gcc/c-family/c.opt |
447 |
+++ b/gcc/c-family/c.opt |
448 |
@@ -412,7 +412,7 @@ C ObjC C++ ObjC++ Var(warn_format_nonliteral) Warning LangEnabledBy(C ObjC C++ O |
449 |
Warn about format strings that are not literals |
450 |
|
451 |
Wformat-security |
452 |
-C ObjC C++ ObjC++ Var(warn_format_security) Warning LangEnabledBy(C ObjC C++ ObjC++,Wformat=, warn_format >= 2, 0) |
453 |
+C ObjC C++ ObjC++ Var(warn_format_security) Init(1) Warning LangEnabledBy(C ObjC C++ ObjC++,Wformat=, warn_format >= 2, 0) |
454 |
Warn about possible security problems with format functions |
455 |
|
456 |
Wformat-signedness |
457 |
@@ -424,7 +424,7 @@ C ObjC C++ ObjC++ Var(warn_format_zero_length) Warning LangEnabledBy(C ObjC C++ |
458 |
Warn about zero-length formats |
459 |
|
460 |
Wformat= |
461 |
-C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_format) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall, 1, 0) |
462 |
+C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_format) Init(1) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall, 1, 0) |
463 |
Warn about printf/scanf/strftime/strfmon format string anomalies |
464 |
|
465 |
Wignored-qualifiers |
466 |
--- a/gcc/doc/gcc.info |
467 |
+++ b/gcc/doc/gcc.info |
468 |
@@ -3451,6 +3451,8 @@ |
469 |
`-Wno-format-extra-args', and `-Wno-format-zero-length'. |
470 |
`-Wformat' is enabled by `-Wall'. |
471 |
|
472 |
+ This option is enabled by default in Gentoo. |
473 |
+ |
474 |
`-Wno-format-contains-nul' |
475 |
If `-Wformat' is specified, do not warn about format strings |
476 |
that contain NUL bytes. |
477 |
@@ -3496,6 +3498,8 @@ compiler warns that an unrecognized option is present. |
478 |
requires an unsigned argument and the argument is signed and |
479 |
vice versa. |
480 |
|
481 |
+ This option is enabled by default in Gentoo. |
482 |
+ |
483 |
`-Wformat-y2k' |
484 |
If `-Wformat' is specified, also warn about `strftime' |
485 |
formats that may yield only a two-digit year. |
486 |
|
487 |
|
488 |
|
489 |
1.1 src/patchsets/gcc/5.3.0/gentoo/12_all_default-warn-trampolines.patch |
490 |
|
491 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/5.3.0/gentoo/12_all_default-warn-trampolines.patch?rev=1.1&view=markup |
492 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/5.3.0/gentoo/12_all_default-warn-trampolines.patch?rev=1.1&content-type=text/plain |
493 |
|
494 |
Index: 12_all_default-warn-trampolines.patch |
495 |
=================================================================== |
496 |
Enable -Wtrampolines by default. |
497 |
|
498 |
|
499 |
--- a/gcc/common.opt |
500 |
+++ b/gcc/common.opt |
501 |
@@ -648,7 +648,7 @@ Common Var(warn_system_headers) Warning |
502 |
Do not suppress warnings from system headers |
503 |
|
504 |
Wtrampolines |
505 |
-Common Var(warn_trampolines) Warning |
506 |
+Common Var(warn_trampolines) Init(1) Warning |
507 |
Warn whenever a trampoline is generated |
508 |
|
509 |
Wtype-limits |
510 |
--- a/gcc/doc/gcc.info |
511 |
+++ b/gcc/doc/gcc.info |
512 |
@@ -4021,6 +4021,8 @@ compiler warns that an unrecognized option is present. |
513 |
and thus requires the stack to be made executable in order for the |
514 |
program to work properly. |
515 |
|
516 |
+ This warning is enabled by default in Gentoo. |
517 |
+ |
518 |
`-Wfloat-equal' |
519 |
Warn if floating-point values are used in equality comparisons. |
520 |
|
521 |
|
522 |
|
523 |
|
524 |
1.1 src/patchsets/gcc/5.3.0/gentoo/20_all_msgfmt-libstdc++-link.patch |
525 |
|
526 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/5.3.0/gentoo/20_all_msgfmt-libstdc++-link.patch?rev=1.1&view=markup |
527 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/5.3.0/gentoo/20_all_msgfmt-libstdc++-link.patch?rev=1.1&content-type=text/plain |
528 |
|
529 |
Index: 20_all_msgfmt-libstdc++-link.patch |
530 |
=================================================================== |
531 |
Ensure that msgfmt doesn't encounter problems during gcc bootstrapping. |
532 |
|
533 |
Solves error messages like the following: |
534 |
|
535 |
msgfmt: /var/tmp/portage/sys-devel/gcc-4.1.2/work/build/./gcc/libgcc_s.so.1: version `GCC_4.2.0' not found (required by /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/libstdc++.so.6) |
536 |
|
537 |
The libgcc_s.so used during build doesn't satisfy the needs of the |
538 |
libstdc++.so that msgfmt is linked against. On the other hand, msgfmt |
539 |
is used as a stand-alone application here, and what library it uses |
540 |
behind the scenes is of no concern to the gcc build process. |
541 |
Therefore, simply invoking it "as usual", i.e. without any special |
542 |
library path, will make it work as expected here. |
543 |
|
544 |
2011-09-19 Martin von Gagern |
545 |
|
546 |
References: |
547 |
https://bugs.gentoo.org/372377 |
548 |
https://bugs.gentoo.org/295480 |
549 |
|
550 |
--- gcc-4.1.2.orig/libstdc++-v3/po/Makefile.am |
551 |
+++ gcc-4.1.2/libstdc++-v3/po/Makefile.am |
552 |
@@ -39,6 +39,7 @@ MSGFMT = msgfmt |
553 |
EXTRA_DIST = string_literals.cc POTFILES.in $(PACKAGE).pot $(LOCALE_IN) |
554 |
|
555 |
.po.mo: |
556 |
+ env --unset=LD_LIBRARY_PATH \ |
557 |
$(MSGFMT) -o $@ $< |
558 |
|
559 |
all-local: all-local-$(USE_NLS) |
560 |
--- gcc-4.1.2.orig/libstdc++-v3/po/Makefile.in |
561 |
+++ gcc-4.1.2/libstdc++-v3/po/Makefile.in |
562 |
@@ -419,6 +419,7 @@ uninstall-am: uninstall-info-am |
563 |
|
564 |
|
565 |
.po.mo: |
566 |
+ env --unset=LD_LIBRARY_PATH \ |
567 |
$(MSGFMT) -o $@ $< |
568 |
|
569 |
all-local: all-local-$(USE_NLS) |
570 |
|
571 |
|
572 |
|
573 |
1.1 src/patchsets/gcc/5.3.0/gentoo/25_all_alpha-mieee-default.patch |
574 |
|
575 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/5.3.0/gentoo/25_all_alpha-mieee-default.patch?rev=1.1&view=markup |
576 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/5.3.0/gentoo/25_all_alpha-mieee-default.patch?rev=1.1&content-type=text/plain |
577 |
|
578 |
Index: 25_all_alpha-mieee-default.patch |
579 |
=================================================================== |
580 |
Set the default behavior on alpha to use -mieee since the large majority of |
581 |
time we want this (bad/weird things can happen with packages built without |
582 |
it). |
583 |
|
584 |
To satisfy those people who may not want -mieee forced on them all the time, |
585 |
we also provide -mno-ieee. |
586 |
|
587 |
Patch by Mike Frysinger <vapier@g.o> |
588 |
|
589 |
Note: upstream doesn't want to take this due to long standing behavior, and |
590 |
because it'd make behavior across OS's inconsistent: |
591 |
https://gcc.gnu.org/ml/gcc-patches/2003-07/msg02144.html |
592 |
|
593 |
This makes sense for upstream, but Gentoo is more concerned about packages |
594 |
behaving the same across arches under Linux. |
595 |
|
596 |
--- a/gcc/config/alpha/alpha.h |
597 |
+++ b/gcc/config/alpha/alpha.h |
598 |
@@ -96,6 +96,8 @@ along with GCC; see the file COPYING3. If not see |
599 |
while (0) |
600 |
#endif |
601 |
|
602 |
+#define CPP_SPEC "%{!no-ieee:-mieee}" |
603 |
+ |
604 |
/* Run-time compilation parameters selecting different hardware subsets. */ |
605 |
|
606 |
/* Which processor to schedule for. The cpu attribute defines a list that |
607 |
--- a/gcc/config/alpha/alpha.opt |
608 |
+++ b/gcc/config/alpha/alpha.opt |
609 |
@@ -39,7 +39,7 @@ Target RejectNegative Mask(IEEE_CONFORMANT) |
610 |
Request IEEE-conformant math library routines (OSF/1) |
611 |
|
612 |
mieee |
613 |
-Target Report RejectNegative Mask(IEEE) |
614 |
+Target Report Mask(IEEE) |
615 |
Emit IEEE-conformant code, without inexact exceptions |
616 |
|
617 |
mieee-with-inexact |
618 |
|
619 |
|
620 |
|
621 |
1.1 src/patchsets/gcc/5.3.0/gentoo/26_all_alpha-asm-mcpu.patch |
622 |
|
623 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/5.3.0/gentoo/26_all_alpha-asm-mcpu.patch?rev=1.1&view=markup |
624 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/5.3.0/gentoo/26_all_alpha-asm-mcpu.patch?rev=1.1&content-type=text/plain |
625 |
|
626 |
Index: 26_all_alpha-asm-mcpu.patch |
627 |
=================================================================== |
628 |
https://bugs.gentoo.org/170146 |
629 |
http://gcc.gnu.org/ml/gcc-patches/2009-11/msg00403.html |
630 |
https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=223888 |
631 |
|
632 |
alpha: turn -mcpu=<cpu> into -m<cpu> for assembler all the time |
633 |
|
634 |
--- a/gcc/config/alpha/elf.h |
635 |
+++ b/gcc/config/alpha/elf.h |
636 |
@@ -46,7 +46,7 @@ along with GCC; see the file COPYING3. If not see |
637 |
#define CC1_SPEC "%{G*}" |
638 |
|
639 |
#undef ASM_SPEC |
640 |
-#define ASM_SPEC "%{G*} %{relax:-relax} %{!gstabs*:-no-mdebug}%{gstabs*:-mdebug}" |
641 |
+#define ASM_SPEC "%{G*} %{relax:-relax} %{!gstabs*:-no-mdebug}%{gstabs*:-mdebug} %{mcpu=*:-m%*}" |
642 |
|
643 |
#undef IDENT_ASM_OP |
644 |
#define IDENT_ASM_OP "\t.ident\t" |
645 |
|
646 |
|
647 |
|
648 |
1.1 src/patchsets/gcc/5.3.0/gentoo/29_all_arm_armv4t-default.patch |
649 |
|
650 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/5.3.0/gentoo/29_all_arm_armv4t-default.patch?rev=1.1&view=markup |
651 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/5.3.0/gentoo/29_all_arm_armv4t-default.patch?rev=1.1&content-type=text/plain |
652 |
|
653 |
Index: 29_all_arm_armv4t-default.patch |
654 |
=================================================================== |
655 |
gcc defaults to armv5t for all targets even armv4t |
656 |
|
657 |
http://sourceware.org/ml/crossgcc/2008-05/msg00009.html |
658 |
|
659 |
|
660 |
--- a/gcc/config/arm/linux-eabi.h |
661 |
+++ b/gcc/config/arm/linux-eabi.h |
662 |
@@ -45,7 +45,7 @@ |
663 |
The ARM10TDMI core is the default for armv5t, so set |
664 |
SUBTARGET_CPU_DEFAULT to achieve this. */ |
665 |
#undef SUBTARGET_CPU_DEFAULT |
666 |
-#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi |
667 |
+#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm9tdmi |
668 |
|
669 |
/* TARGET_BIG_ENDIAN_DEFAULT is set in |
670 |
config.gcc for big endian configurations. */ |
671 |
|
672 |
|
673 |
|
674 |
1.1 src/patchsets/gcc/5.3.0/gentoo/34_all_ia64_note.GNU-stack.patch |
675 |
|
676 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/5.3.0/gentoo/34_all_ia64_note.GNU-stack.patch?rev=1.1&view=markup |
677 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/5.3.0/gentoo/34_all_ia64_note.GNU-stack.patch?rev=1.1&content-type=text/plain |
678 |
|
679 |
Index: 34_all_ia64_note.GNU-stack.patch |
680 |
=================================================================== |
681 |
http://gcc.gnu.org/PR21098 |
682 |
|
683 |
|
684 |
2004-09-20 Jakub Jelinek <jakub@××××××.com> |
685 |
|
686 |
* config/rs6000/ppc-asm.h: Add .note.GNU-stack section also |
687 |
on ppc64-linux. |
688 |
|
689 |
* config/ia64/lib1funcs.asm: Add .note.GNU-stack section on |
690 |
ia64-linux. |
691 |
* config/ia64/crtbegin.asm: Likewise. |
692 |
* config/ia64/crtend.asm: Likewise. |
693 |
* config/ia64/crti.asm: Likewise. |
694 |
* config/ia64/crtn.asm: Likewise. |
695 |
|
696 |
2004-05-14 Jakub Jelinek <jakub@××××××.com> |
697 |
|
698 |
* config/ia64/linux.h (TARGET_ASM_FILE_END): Define. |
699 |
|
700 |
|
701 |
--- a/gcc/config/ia64/linux.h |
702 |
+++ b/gcc/config/ia64/linux.h |
703 |
@@ -24,6 +24,8 @@ a copy of the GCC Runtime Library Exception along with this program; |
704 |
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see |
705 |
<http://www.gnu.org/licenses/>. */ |
706 |
|
707 |
+#define TARGET_ASM_FILE_END file_end_indicate_exec_stack |
708 |
+ |
709 |
/* This is for -profile to use -lc_p instead of -lc. */ |
710 |
#undef CC1_SPEC |
711 |
#define CC1_SPEC "%{profile:-p} %{G*}" |
712 |
--- a/gcc/config/rs6000/ppc-asm.h |
713 |
+++ b/gcc/config/rs6000/ppc-asm.h |
714 |
@@ -352,7 +352,7 @@ GLUE(.L,name): \ |
715 |
#endif |
716 |
#endif |
717 |
|
718 |
-#if defined __linux__ && !defined __powerpc64__ |
719 |
+#if defined __linux__ |
720 |
.section .note.GNU-stack |
721 |
.previous |
722 |
#endif |
723 |
--- a/libgcc/config/ia64/crtbegin.S |
724 |
+++ b/libgcc/config/ia64/crtbegin.S |
725 |
@@ -252,3 +252,7 @@ __do_jv_register_classes: |
726 |
.weak __cxa_finalize |
727 |
#endif |
728 |
.weak _Jv_RegisterClasses |
729 |
+ |
730 |
+#ifdef __linux__ |
731 |
+.section .note.GNU-stack; .previous |
732 |
+#endif |
733 |
--- a/libgcc/config/ia64/crtend.S |
734 |
+++ b/libgcc/config/ia64/crtend.S |
735 |
@@ -119,3 +119,6 @@ __do_global_ctors_aux: |
736 |
|
737 |
br.ret.sptk.many rp |
738 |
.endp __do_global_ctors_aux |
739 |
+#ifdef __linux__ |
740 |
+.section .note.GNU-stack; .previous |
741 |
+#endif |
742 |
--- a/libgcc/config/ia64/crti.S |
743 |
+++ b/libgcc/config/ia64/crti.S |
744 |
@@ -49,5 +49,8 @@ _fini: |
745 |
.save rp, r33 |
746 |
mov r33 = b0 |
747 |
.body |
748 |
+#ifdef __linux__ |
749 |
+.section .note.GNU-stack; .previous |
750 |
+#endif |
751 |
|
752 |
# end of crti.S |
753 |
--- a/libgcc/config/ia64/crtn.S |
754 |
+++ b/libgcc/config/ia64/crtn.S |
755 |
@@ -39,5 +39,8 @@ |
756 |
.restore sp |
757 |
mov r12 = r35 |
758 |
br.ret.sptk.many b0 |
759 |
+#ifdef __linux__ |
760 |
+.section .note.GNU-stack; .previous |
761 |
+#endif |
762 |
|
763 |
# end of crtn.S |
764 |
--- a/libgcc/config/ia64/lib1funcs.S |
765 |
+++ b/libgcc/config/ia64/lib1funcs.S |
766 |
@@ -793,3 +793,6 @@ __floattitf: |
767 |
.endp __floattitf |
768 |
#endif |
769 |
#endif |
770 |
+#ifdef __linux__ |
771 |
+.section .note.GNU-stack; .previous |
772 |
+#endif |
773 |
|
774 |
|
775 |
|
776 |
1.1 src/patchsets/gcc/5.3.0/gentoo/34_all_libjava-classpath-locale-sort.patch |
777 |
|
778 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/5.3.0/gentoo/34_all_libjava-classpath-locale-sort.patch?rev=1.1&view=markup |
779 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/5.3.0/gentoo/34_all_libjava-classpath-locale-sort.patch?rev=1.1&content-type=text/plain |
780 |
|
781 |
Index: 34_all_libjava-classpath-locale-sort.patch |
782 |
=================================================================== |
783 |
From 3a52cf750bd9da06cffa7d642f1e74e77bfd8a8c Mon Sep 17 00:00:00 2001 |
784 |
From: vapier <vapier@138bc75d-0d04-0410-961f-82ee72b054a4> |
785 |
Date: Mon, 26 Oct 2015 18:32:41 +0000 |
786 |
Subject: [PATCH] libjava: fix locale handling when sorting JNI methods |
787 |
MIME-Version: 1.0 |
788 |
Content-Type: text/plain; charset=UTF-8 |
789 |
Content-Transfer-Encoding: 8bit |
790 |
|
791 |
When building under LANG=cs_CZ.UTF-8, the JNI method check fails: |
792 |
|
793 |
/bin/bash ../../scripts/check_jni_methods.sh |
794 |
Found a problem with the JNI methods declared and implemented. |
795 |
(<) missing in implementation, (>) missing in header files |
796 |
> Java_gnu_java_awt_peer_gtk_GtkClipboard_advertiseContent |
797 |
> Java_gnu_java_awt_peer_gtk_GtkClipboard_initNativeState |
798 |
... lots more ... |
799 |
|
800 |
While the sed commands are run under LC_ALL=C, the two sort commands are |
801 |
not, and they end up producing unexpected output (for the test). Once we |
802 |
run both under LC_ALL=C, the check passes. While we're here, we can also |
803 |
combine latter the `sort|uniq` into `sort -u` to match the earlier code. |
804 |
|
805 |
URL: https://bugs.gentoo.org/563710 |
806 |
Reported-by: Miroslav Å ulc <fordfrog@g.o> |
807 |
|
808 |
|
809 |
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229388 138bc75d-0d04-0410-961f-82ee72b054a4 |
810 |
--- |
811 |
libjava/classpath/ChangeLog | 5 +++++ |
812 |
libjava/classpath/scripts/check_jni_methods.sh.in | 4 ++-- |
813 |
2 files changed, 7 insertions(+), 2 deletions(-) |
814 |
|
815 |
diff --git a/libjava/classpath/scripts/check_jni_methods.sh.in b/libjava/classpath/scripts/check_jni_methods.sh.in |
816 |
index facf34b..fb9d104 100644 |
817 |
--- a/libjava/classpath/scripts/check_jni_methods.sh.in |
818 |
+++ b/libjava/classpath/scripts/check_jni_methods.sh.in |
819 |
@@ -14,7 +14,7 @@ grep -h '^JNIEXPORT .* Java_' @abs_top_srcdir@/include/*.h | \ |
820 |
LC_ALL=C sed -e 's,.*JNICALL \(Java_[a-z_A-Z0-9]*\).*$,\1,' > $TMPFILE |
821 |
grep -h '^JNIEXPORT .* Java_' @abs_top_builddir@/include/*.h | \ |
822 |
LC_ALL=C sed -e 's,.*JNICALL \(Java_[a-z_A-Z0-9]*\).*$,\1,' >> $TMPFILE |
823 |
-sort -u $TMPFILE > $TMPFILE4 |
824 |
+LC_ALL=C sort -u $TMPFILE > $TMPFILE4 |
825 |
mv $TMPFILE4 $TMPFILE |
826 |
|
827 |
# Find all methods in the JNI C source files. |
828 |
@@ -31,7 +31,7 @@ find @abs_top_srcdir@/native/jni -name \*.cpp | \ |
829 |
cut -f4 -d\ | \ |
830 |
LC_ALL=C sed -e 's,^\JNIEXPORT .* JNICALL \(Java_[a-z_A-Z0-9]*\).*$,\1,' >> $TMPFILE2 |
831 |
mv $TMPFILE2 $TMPFILE3 |
832 |
-sort $TMPFILE3 | uniq > $TMPFILE2 |
833 |
+LC_ALL=C sort -u $TMPFILE3 > $TMPFILE2 |
834 |
rm $TMPFILE3 |
835 |
|
836 |
# Write temporary ignore file. |
837 |
-- |
838 |
2.5.2 |
839 |
|
840 |
|
841 |
|
842 |
|
843 |
1.1 src/patchsets/gcc/5.3.0/gentoo/38_all_sh_pr24836_all-archs.patch |
844 |
|
845 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/5.3.0/gentoo/38_all_sh_pr24836_all-archs.patch?rev=1.1&view=markup |
846 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/5.3.0/gentoo/38_all_sh_pr24836_all-archs.patch?rev=1.1&content-type=text/plain |
847 |
|
848 |
Index: 38_all_sh_pr24836_all-archs.patch |
849 |
=================================================================== |
850 |
gcc/configure doesn't handle all possible SH architectures |
851 |
|
852 |
http://gcc.gnu.org/PR24836 |
853 |
|
854 |
|
855 |
--- a/gcc/configure.ac |
856 |
+++ b/gcc/configure.ac |
857 |
@@ -2924,7 +2924,7 @@ foo: .long 25 |
858 |
tls_first_minor=14 |
859 |
tls_as_opt="-m64 -Aesame --fatal-warnings" |
860 |
;; |
861 |
- sh-*-* | sh[34]-*-*) |
862 |
+ sh-*-* | sh[34]*-*-*) |
863 |
conftest_s=' |
864 |
.section ".tdata","awT",@progbits |
865 |
foo: .long 25 |
866 |
--- a/gcc/configure |
867 |
+++ b/gcc/configure |
868 |
@@ -22753,7 +22753,7 @@ foo: .long 25 |
869 |
tls_first_minor=14 |
870 |
tls_as_opt="-m64 -Aesame --fatal-warnings" |
871 |
;; |
872 |
- sh-*-* | sh[34]-*-*) |
873 |
+ sh-*-* | sh[34]*-*-*) |
874 |
conftest_s=' |
875 |
.section ".tdata","awT",@progbits |
876 |
foo: .long 25 |
877 |
|
878 |
|
879 |
|
880 |
1.1 src/patchsets/gcc/5.3.0/gentoo/42_all_superh_default-multilib.patch |
881 |
|
882 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/5.3.0/gentoo/42_all_superh_default-multilib.patch?rev=1.1&view=markup |
883 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/5.3.0/gentoo/42_all_superh_default-multilib.patch?rev=1.1&content-type=text/plain |
884 |
|
885 |
Index: 42_all_superh_default-multilib.patch |
886 |
=================================================================== |
887 |
The gcc-3.x toolchains would contain all the targets by default. With gcc-4, |
888 |
you have to actually list out the multilibs you want or you will end up with |
889 |
just one when using targets like 'sh4-linux-gnu'. |
890 |
|
891 |
The resulting toolchain can't even build a kernel as the kernel needs to build |
892 |
with the nofpu flag to be sure that no fpu ops are generated. |
893 |
|
894 |
Here we restore the gcc-3.x behavior; the additional overhead of building all |
895 |
of these multilibs by default is negligible. |
896 |
|
897 |
https://bugs.gentoo.org/140205 |
898 |
https://bugs.gentoo.org/320251 |
899 |
|
900 |
--- a/gcc/config.gcc |
901 |
+++ b/gcc/config.gcc |
902 |
@@ -2455,7 +2455,7 @@ sh-*-symbianelf* | sh[12346l]*-*-symbianelf* | \ |
903 |
if test "$sh_multilibs" = "default" ; then |
904 |
case ${target} in |
905 |
sh64-superh-linux* | \ |
906 |
- sh[1234]*) sh_multilibs=${sh_cpu_target} ;; |
907 |
+ 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') ;; |
908 |
sh64* | sh5*) sh_multilibs=m5-32media,m5-32media-nofpu,m5-compact,m5-compact-nofpu,m5-64media,m5-64media-nofpu ;; |
909 |
sh-superh-*) sh_multilibs=m4,m4-single,m4-single-only,m4-nofpu ;; |
910 |
sh*-*-linux*) sh_multilibs=m1,m3e,m4 ;; |
911 |
|
912 |
|
913 |
|
914 |
1.1 src/patchsets/gcc/5.3.0/gentoo/50_all_libiberty-asprintf.patch |
915 |
|
916 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/5.3.0/gentoo/50_all_libiberty-asprintf.patch?rev=1.1&view=markup |
917 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/5.3.0/gentoo/50_all_libiberty-asprintf.patch?rev=1.1&content-type=text/plain |
918 |
|
919 |
Index: 50_all_libiberty-asprintf.patch |
920 |
=================================================================== |
921 |
2008-07-25 Magnus Granberg <zorry@×××.nu> |
922 |
|
923 |
* include/libiberty.h (asprintf): Don't declare if defined as a macro |
924 |
|
925 |
--- a/include/libiberty.h |
926 |
+++ b/include/libiberty.h |
927 |
@@ -609,8 +609,11 @@ extern int pwait (int, int *, int); |
928 |
/* Like sprintf but provides a pointer to malloc'd storage, which must |
929 |
be freed by the caller. */ |
930 |
|
931 |
+/* asprintf may be declared as a macro by glibc with __USE_FORTIFY_LEVEL. */ |
932 |
+#ifndef asprintf |
933 |
extern int asprintf (char **, const char *, ...) ATTRIBUTE_PRINTF_2; |
934 |
#endif |
935 |
+#endif |
936 |
|
937 |
#if !HAVE_DECL_VASPRINTF |
938 |
/* Like vsprintf but provides a pointer to malloc'd storage, which |
939 |
|
940 |
|
941 |
|
942 |
1.1 src/patchsets/gcc/5.3.0/gentoo/51_all_libiberty-pic.patch |
943 |
|
944 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/5.3.0/gentoo/51_all_libiberty-pic.patch?rev=1.1&view=markup |
945 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/5.3.0/gentoo/51_all_libiberty-pic.patch?rev=1.1&content-type=text/plain |
946 |
|
947 |
Index: 51_all_libiberty-pic.patch |
948 |
=================================================================== |
949 |
--- a/libiberty/Makefile.in |
950 |
+++ b/libiberty/Makefile.in |
951 |
@@ -246,6 +246,7 @@ $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS) |
952 |
$(AR) $(AR_FLAGS) $(TARGETLIB) \ |
953 |
$(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \ |
954 |
$(RANLIB) $(TARGETLIB); \ |
955 |
+ cp $(TARGETLIB) ../ ; \ |
956 |
cd ..; \ |
957 |
else true; fi |
958 |
|
959 |
|
960 |
|
961 |
|
962 |
1.1 src/patchsets/gcc/5.3.0/gentoo/52_all_netbsd-Bsymbolic.patch |
963 |
|
964 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/5.3.0/gentoo/52_all_netbsd-Bsymbolic.patch?rev=1.1&view=markup |
965 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/5.3.0/gentoo/52_all_netbsd-Bsymbolic.patch?rev=1.1&content-type=text/plain |
966 |
|
967 |
Index: 52_all_netbsd-Bsymbolic.patch |
968 |
=================================================================== |
969 |
https://bugs.gentoo.org/122698 |
970 |
https://gcc.gnu.org/ml/gcc-patches/2015-05/msg02854.html |
971 |
|
972 |
--- a/gcc/config/netbsd-elf.h |
973 |
+++ b/gcc/config/netbsd-elf.h |
974 |
@@ -70,6 +70,7 @@ along with GCC; see the file COPYING3. If not see |
975 |
#define NETBSD_LINK_SPEC_ELF \ |
976 |
"%{assert*} %{R*} %{rpath*} \ |
977 |
%{shared:-shared} \ |
978 |
+ %{symbolic:-Bsymbolic} \ |
979 |
%{!shared: \ |
980 |
-dc -dp \ |
981 |
%{!nostdlib: \ |
982 |
|
983 |
|
984 |
|
985 |
1.1 src/patchsets/gcc/5.3.0/gentoo/53_all_libitm-no-fortify-source.patch |
986 |
|
987 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/5.3.0/gentoo/53_all_libitm-no-fortify-source.patch?rev=1.1&view=markup |
988 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/5.3.0/gentoo/53_all_libitm-no-fortify-source.patch?rev=1.1&content-type=text/plain |
989 |
|
990 |
Index: 53_all_libitm-no-fortify-source.patch |
991 |
=================================================================== |
992 |
https://bugs.gentoo.org/508852 |
993 |
https://gcc.gnu.org/PR61164 |
994 |
|
995 |
2014-04-27 Magnus Granberg <zorry@g.o> |
996 |
|
997 |
#508852 |
998 |
* libitm/configure.tgt: Disable FORTIFY |
999 |
|
1000 |
--- a/libitm/configure.tgt |
1001 |
+++ b/libitm/configure.tgt |
1002 |
@@ -43,6 +43,16 @@ if test "$gcc_cv_have_tls" = yes ; then |
1003 |
esac |
1004 |
fi |
1005 |
|
1006 |
+# FIXME: error: inlining failed in call to always_inline |
1007 |
+# ‘int vfprintf(FILE*, const char*, __va_list_tag*)’ |
1008 |
+# : function body can be overwritten at link time |
1009 |
+# Disable Fortify in libitm for now. #508852 |
1010 |
+case "${target}" in |
1011 |
+ *-*-linux*) |
1012 |
+ XCFLAGS="${XCFLAGS} -U_FORTIFY_SOURCE" |
1013 |
+ ;; |
1014 |
+esac |
1015 |
+ |
1016 |
# Map the target cpu to an ARCH sub-directory. At the same time, |
1017 |
# work out any special compilation flags as necessary. |
1018 |
case "${target_cpu}" in |
1019 |
|
1020 |
|
1021 |
|
1022 |
1.1 src/patchsets/gcc/5.3.0/gentoo/67_all_gcc-poison-system-directories.patch |
1023 |
|
1024 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/5.3.0/gentoo/67_all_gcc-poison-system-directories.patch?rev=1.1&view=markup |
1025 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/5.3.0/gentoo/67_all_gcc-poison-system-directories.patch?rev=1.1&content-type=text/plain |
1026 |
|
1027 |
Index: 67_all_gcc-poison-system-directories.patch |
1028 |
=================================================================== |
1029 |
http://cgit.openembedded.org/openembedded-core/tree/meta/recipes-devtools/gcc/gcc-4.9/0016-gcc-poison-system-directories.patch |
1030 |
|
1031 |
From: Khem Raj <raj.khem@×××××.com> |
1032 |
Date: Fri, 29 Mar 2013 08:59:00 +0400 |
1033 |
Subject: [PATCH 16/35] gcc: poison-system-directories |
1034 |
|
1035 |
Signed-off-by: Khem Raj <raj.khem@×××××.com> |
1036 |
|
1037 |
Upstream-Status: Inappropriate [distribution: codesourcery] |
1038 |
--- |
1039 |
gcc/Makefile.in | 2 +- |
1040 |
gcc/common.opt | 4 ++++ |
1041 |
gcc/config.in | 6 ++++++ |
1042 |
gcc/configure | 20 ++++++++++++++++++-- |
1043 |
gcc/configure.ac | 10 ++++++++++ |
1044 |
gcc/doc/invoke.texi | 9 +++++++++ |
1045 |
gcc/gcc.c | 2 ++ |
1046 |
gcc/incpath.c | 19 +++++++++++++++++++ |
1047 |
8 files changed, 69 insertions(+), 3 deletions(-) |
1048 |
|
1049 |
--- a/gcc/common.opt |
1050 |
+++ b/gcc/common.opt |
1051 |
@@ -603,6 +603,10 @@ Wpedantic |
1052 |
Common Var(pedantic) Init(0) Warning |
1053 |
Issue warnings needed for strict compliance to the standard |
1054 |
|
1055 |
+Wpoison-system-directories |
1056 |
+Common Var(flag_poison_system_directories) Init(1) Warning |
1057 |
+Warn for -I and -L options using system directories if cross compiling |
1058 |
+ |
1059 |
Wreturn-local-addr |
1060 |
Common Var(warn_return_local_addr) Init(1) Warning |
1061 |
Warn about returning a pointer/reference to a local or temporary variable. |
1062 |
--- a/gcc/configure.ac |
1063 |
+++ b/gcc/configure.ac |
1064 |
@@ -5366,6 +5366,16 @@ AC_ARG_ENABLE(version-specific-runtime-l |
1065 |
[specify that runtime libraries should be |
1066 |
installed in a compiler-specific directory])]) |
1067 |
|
1068 |
+AC_ARG_ENABLE([poison-system-directories], |
1069 |
+ AS_HELP_STRING([--enable-poison-system-directories], |
1070 |
+ [warn for use of native system header directories]),, |
1071 |
+ [enable_poison_system_directories=no]) |
1072 |
+if test "x${enable_poison_system_directories}" = "xyes"; then |
1073 |
+ AC_DEFINE([ENABLE_POISON_SYSTEM_DIRECTORIES], |
1074 |
+ [1], |
1075 |
+ [Define to warn for use of native system header directories]) |
1076 |
+fi |
1077 |
+ |
1078 |
# Substitute configuration variables |
1079 |
AC_SUBST(subdirs) |
1080 |
AC_SUBST(srcdir) |
1081 |
--- a/gcc/configure |
1082 |
+++ b/gcc/configure |
1083 |
@@ -928,6 +928,7 @@ with_system_zlib |
1084 |
enable_maintainer_mode |
1085 |
enable_link_mutex |
1086 |
enable_version_specific_runtime_libs |
1087 |
+enable_poison_system_directories |
1088 |
enable_plugin |
1089 |
enable_host_shared |
1090 |
enable_libquadmath_support |
1091 |
@@ -1648,6 +1649,8 @@ Optional Features: |
1092 |
--enable-version-specific-runtime-libs |
1093 |
specify that runtime libraries should be installed |
1094 |
in a compiler-specific directory |
1095 |
+ --enable-poison-system-directories |
1096 |
+ warn for use of native system header directories |
1097 |
--enable-plugin enable plugin support |
1098 |
--enable-host-shared build host code as shared libraries |
1099 |
--disable-libquadmath-support |
1100 |
@@ -27702,6 +27705,19 @@ if test "${enable_version_specific_runti |
1101 |
fi |
1102 |
|
1103 |
|
1104 |
+# Check whether --enable-poison-system-directories was given. |
1105 |
+if test "${enable_poison_system_directories+set}" = set; then : |
1106 |
+ enableval=$enable_poison_system_directories; |
1107 |
+else |
1108 |
+ enable_poison_system_directories=no |
1109 |
+fi |
1110 |
+ |
1111 |
+if test "x${enable_poison_system_directories}" = "xyes"; then |
1112 |
+ |
1113 |
+$as_echo "#define ENABLE_POISON_SYSTEM_DIRECTORIES 1" >>confdefs.h |
1114 |
+ |
1115 |
+fi |
1116 |
+ |
1117 |
# Substitute configuration variables |
1118 |
|
1119 |
|
1120 |
--- a/gcc/config.in |
1121 |
+++ b/gcc/config.in |
1122 |
@@ -138,6 +138,12 @@ |
1123 |
#endif |
1124 |
|
1125 |
|
1126 |
+/* Define to warn for use of native system header directories */ |
1127 |
+#ifndef USED_FOR_TARGET |
1128 |
+#undef ENABLE_POISON_SYSTEM_DIRECTORIES |
1129 |
+#endif |
1130 |
+ |
1131 |
+ |
1132 |
/* Define if you want all operations on RTL (the basic data structure of the |
1133 |
optimizer and back end) to be checked for dynamic type safety at runtime. |
1134 |
This is quite expensive. */ |
1135 |
--- a/gcc/gcc.c |
1136 |
+++ b/gcc/gcc.c |
1137 |
@@ -764,6 +764,8 @@ proper position among the other output f |
1138 |
"%{fuse-ld=*:-fuse-ld=%*} " LINK_COMPRESS_DEBUG_SPEC \ |
1139 |
"%X %{o*} %{e*} %{N} %{n} %{r}\ |
1140 |
%{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!nostartfiles:%S}} " VTABLE_VERIFICATION_SPEC " \ |
1141 |
+ %{Wno-poison-system-directories:--no-poison-system-directories}\ |
1142 |
+ %{Werror=poison-system-directories:--error-poison-system-directories}\ |
1143 |
%{static:} %{L*} %(mfwrap) %(link_libgcc) " SANITIZER_EARLY_SPEC " %o\ |
1144 |
" CHKP_SPEC " \ |
1145 |
%{fopenacc|fopenmp|ftree-parallelize-loops=*:%:include(libgomp.spec)%(link_gomp)}\ |
1146 |
--- a/gcc/incpath.c |
1147 |
+++ b/gcc/incpath.c |
1148 |
@@ -28,6 +28,7 @@ |
1149 |
#include "intl.h" |
1150 |
#include "incpath.h" |
1151 |
#include "cppdefault.h" |
1152 |
+#include "diagnostic-core.h" |
1153 |
|
1154 |
/* Microsoft Windows does not natively support inodes. |
1155 |
VMS has non-numeric inodes. */ |
1156 |
@@ -382,6 +383,24 @@ merge_include_chains (const char *sysroo |
1157 |
} |
1158 |
fprintf (stderr, _("End of search list.\n")); |
1159 |
} |
1160 |
+ |
1161 |
+#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES |
1162 |
+ if (flag_poison_system_directories) |
1163 |
+ { |
1164 |
+ struct cpp_dir *p; |
1165 |
+ |
1166 |
+ for (p = heads[QUOTE]; p; p = p->next) |
1167 |
+ { |
1168 |
+ if ((!strncmp (p->name, "/usr/include", 12)) |
1169 |
+ || (!strncmp (p->name, "/usr/local/include", 18)) |
1170 |
+ || (!strncmp (p->name, "/usr/X11R6/include", 18))) |
1171 |
+ warning (OPT_Wpoison_system_directories, |
1172 |
+ "include location \"%s\" is unsafe for " |
1173 |
+ "cross-compilation", |
1174 |
+ p->name); |
1175 |
+ } |
1176 |
+ } |
1177 |
+#endif |
1178 |
} |
1179 |
|
1180 |
/* Use given -I paths for #include "..." but not #include <...>, and |
1181 |
--- a/gcc/doc/gcc.info |
1182 |
+++ b/gcc/doc/gcc.info |
1183 |
@@ -558,6 +558,7 @@ _Warning Options_ |
1184 |
-Woverlength-strings -Wpacked -Wpacked-bitfield-compat -Wpadded |
1185 |
-Wparentheses -Wpedantic-ms-format -Wno-pedantic-ms-format |
1186 |
-Wpointer-arith -Wno-pointer-to-int-cast |
1187 |
+ -Wno-poison-system-directories |
1188 |
-Wredundant-decls -Wno-return-local-addr |
1189 |
-Wreturn-type -Wsequence-point -Wshadow -Wno-shadow-ivar |
1190 |
-Wshift-count-negative -Wshift-count-overflow |
1191 |
@@ -4010,6 +4011,13 @@ compiler warns that an unrecognized option is present. |
1192 |
unknown pragmas in system headers--for that, `-Wunknown-pragmas' |
1193 |
must also be used. |
1194 |
|
1195 |
+`-Wno-poison-system-directories' |
1196 |
+ Do not warn for @option{-I} or @option{-L} options using system |
1197 |
+ directories such as @file{/usr/include} when cross compiling. This |
1198 |
+ option is intended for use in chroot environments when such |
1199 |
+ directories contain the correct headers and libraries for the target |
1200 |
+ system rather than the host. |
1201 |
+ |
1202 |
`-Wtrampolines' |
1203 |
Warn about trampolines generated for pointers to nested functions. |
1204 |
A trampoline is a small piece of data or code that is created at |
1205 |
|
1206 |
|
1207 |
|
1208 |
1.1 src/patchsets/gcc/5.3.0/gentoo/70_all_gcc-5-pr546752.patch |
1209 |
|
1210 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/5.3.0/gentoo/70_all_gcc-5-pr546752.patch?rev=1.1&view=markup |
1211 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/5.3.0/gentoo/70_all_gcc-5-pr546752.patch?rev=1.1&content-type=text/plain |
1212 |
|
1213 |
Index: 70_all_gcc-5-pr546752.patch |
1214 |
=================================================================== |
1215 |
https://gcc.gnu.org/PR61929 |
1216 |
https://bugs.gentoo.org/546752 |
1217 |
|
1218 |
From fc25c6708493bdbf4809f733bc0e68a4ca117ae1 Mon Sep 17 00:00:00 2001 |
1219 |
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4> |
1220 |
Date: Fri, 17 Jul 2015 16:34:21 +0000 |
1221 |
Subject: [PATCH] [graphite] fix pr61929 |
1222 |
|
1223 |
This fixes bootstrap of GCC with BOOT_CFLAGS="-g -O2 -fgraphite-identity |
1224 |
-floop-nest-optimize -floop-block -floop-interchange -floop-strip-mine". It |
1225 |
passes regstrap on amd64-linux. A previous change |
1226 |
(https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=213816), replaced |
1227 |
isl_int with isl_val because isl_int would be deprecated. Since isl_val has |
1228 |
stricter checks, it exposed the bug. In the test case (isl_set_max_val) would |
1229 |
return infinity which would remain unchecked. We now check if the value |
1230 |
returned is an integer or not, and bail out if it isn't. The other problem was |
1231 |
that we were allowing all kinds of data-refs in a scop. Now we discard a scop |
1232 |
if it has any date-ref other than (ARRAY_REF, MEM_REF, COMPONENT_REF). |
1233 |
|
1234 |
PR middle-end/61929 |
1235 |
* graphite-dependences.c (add_pdr_constraints): Renamed |
1236 |
pdr->extent to pdr->subscript_sizes. |
1237 |
* graphite-interchange.c (build_linearized_memory_access): Add |
1238 |
back all gcc_assert's that the "isl_int to isl_val conversion" |
1239 |
patch has removed. Refactored. |
1240 |
(pdr_stride_in_loop): Renamed pdr->extent to pdr->subscript_sizes. |
1241 |
* graphite-poly.c (new_poly_dr): Same. |
1242 |
(free_poly_dr): Same. |
1243 |
* graphite-poly.h (struct poly_dr): Same. |
1244 |
* graphite-scop-detection.c (stmt_has_simple_data_refs_p): Ignore |
1245 |
all data references other than ARRAY_REF, MEM_REF, and COMPONENT_REF. |
1246 |
* graphite-scop-detection.h: Fix space. |
1247 |
* graphite-sese-to-poly.c (build_pbb_scattering_polyhedrons): Add |
1248 |
back all gcc_assert's removed by a previous patch. |
1249 |
(wrap): Remove the_isl_ctx global variable that the same patch has |
1250 |
added. |
1251 |
(build_loop_iteration_domains): Same. |
1252 |
(add_param_constraints): Same. |
1253 |
(pdr_add_data_dimensions): Same. Refactored. |
1254 |
(build_poly_dr): Renamed extent to subscript_sizes. |
1255 |
|
1256 |
testsuite/ |
1257 |
PR middle-end/61929 |
1258 |
* gcc.dg/graphite/pr61929.c: New. |
1259 |
|
1260 |
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@225942 138bc75d-0d04-0410-961f-82ee72b054a4 |
1261 |
--- |
1262 |
gcc/ChangeLog | 25 +++++++++++++++ |
1263 |
gcc/graphite-dependences.c | 4 +-- |
1264 |
gcc/graphite-interchange.c | 55 +++++++++++++++++---------------- |
1265 |
gcc/graphite-poly.c | 6 ++-- |
1266 |
gcc/graphite-poly.h | 2 +- |
1267 |
gcc/graphite-scop-detection.c | 22 +++++++++---- |
1268 |
gcc/graphite-scop-detection.h | 2 +- |
1269 |
gcc/graphite-sese-to-poly.c | 54 ++++++++++++++++---------------- |
1270 |
gcc/testsuite/ChangeLog | 6 ++++ |
1271 |
gcc/testsuite/gcc.dg/graphite/pr61929.c | 19 ++++++++++++ |
1272 |
10 files changed, 128 insertions(+), 67 deletions(-) |
1273 |
create mode 100644 gcc/testsuite/gcc.dg/graphite/pr61929.c |
1274 |
|
1275 |
diff --git a/gcc/graphite-dependences.c b/gcc/graphite-dependences.c |
1276 |
index 50fe73e..af18ecb 100644 |
1277 |
--- a/gcc/graphite-dependences.c |
1278 |
+++ b/gcc/graphite-dependences.c |
1279 |
@@ -88,13 +88,13 @@ constrain_domain (isl_map *map, isl_set *s) |
1280 |
return isl_map_intersect_domain (map, s); |
1281 |
} |
1282 |
|
1283 |
-/* Constrain pdr->accesses with pdr->extent and pbb->domain. */ |
1284 |
+/* Constrain pdr->accesses with pdr->subscript_sizes and pbb->domain. */ |
1285 |
|
1286 |
static isl_map * |
1287 |
add_pdr_constraints (poly_dr_p pdr, poly_bb_p pbb) |
1288 |
{ |
1289 |
isl_map *x = isl_map_intersect_range (isl_map_copy (pdr->accesses), |
1290 |
- isl_set_copy (pdr->extent)); |
1291 |
+ isl_set_copy (pdr->subscript_sizes)); |
1292 |
x = constrain_domain (x, isl_set_copy (pbb->domain)); |
1293 |
return x; |
1294 |
} |
1295 |
diff --git a/gcc/graphite-interchange.c b/gcc/graphite-interchange.c |
1296 |
index aee51a8..03c2c63 100644 |
1297 |
--- a/gcc/graphite-interchange.c |
1298 |
+++ b/gcc/graphite-interchange.c |
1299 |
@@ -79,37 +79,40 @@ extern "C" { |
1300 |
static isl_constraint * |
1301 |
build_linearized_memory_access (isl_map *map, poly_dr_p pdr) |
1302 |
{ |
1303 |
- isl_constraint *res; |
1304 |
isl_local_space *ls = isl_local_space_from_space (isl_map_get_space (map)); |
1305 |
- unsigned offset, nsubs; |
1306 |
- int i; |
1307 |
- isl_ctx *ctx; |
1308 |
+ isl_constraint *res = isl_equality_alloc (ls); |
1309 |
+ isl_val *size = isl_val_int_from_ui (isl_map_get_ctx (map), 1); |
1310 |
|
1311 |
- isl_val *size, *subsize, *size1; |
1312 |
- |
1313 |
- res = isl_equality_alloc (ls); |
1314 |
- ctx = isl_local_space_get_ctx (ls); |
1315 |
- size = isl_val_int_from_ui (ctx, 1); |
1316 |
- |
1317 |
- nsubs = isl_set_dim (pdr->extent, isl_dim_set); |
1318 |
+ unsigned nsubs = isl_set_dim (pdr->subscript_sizes, isl_dim_set); |
1319 |
/* -1 for the already included L dimension. */ |
1320 |
- offset = isl_map_dim (map, isl_dim_out) - 1 - nsubs; |
1321 |
+ unsigned offset = isl_map_dim (map, isl_dim_out) - 1 - nsubs; |
1322 |
res = isl_constraint_set_coefficient_si (res, isl_dim_out, offset + nsubs, -1); |
1323 |
- /* Go through all subscripts from last to first. First dimension |
1324 |
+ /* Go through all subscripts from last to first. The dimension "i=0" |
1325 |
is the alias set, ignore it. */ |
1326 |
- for (i = nsubs - 1; i >= 1; i--) |
1327 |
+ for (int i = nsubs - 1; i >= 1; i--) |
1328 |
{ |
1329 |
- isl_space *dc; |
1330 |
- isl_aff *aff; |
1331 |
- |
1332 |
- size1 = isl_val_copy (size); |
1333 |
- res = isl_constraint_set_coefficient_val (res, isl_dim_out, offset + i, size); |
1334 |
- dc = isl_set_get_space (pdr->extent); |
1335 |
- aff = isl_aff_zero_on_domain (isl_local_space_from_space (dc)); |
1336 |
- aff = isl_aff_set_coefficient_si (aff, isl_dim_in, i, 1); |
1337 |
- subsize = isl_set_max_val (pdr->extent, aff); |
1338 |
- isl_aff_free (aff); |
1339 |
- size = isl_val_mul (size1, subsize); |
1340 |
+ isl_aff *extract_dim; |
1341 |
+ res = isl_constraint_set_coefficient_val (res, isl_dim_out, offset + i, |
1342 |
+ isl_val_copy (size)); |
1343 |
+ isl_space *dc = isl_set_get_space (pdr->subscript_sizes); |
1344 |
+ extract_dim = isl_aff_zero_on_domain (isl_local_space_from_space (dc)); |
1345 |
+ extract_dim = isl_aff_set_coefficient_si (extract_dim, isl_dim_in, i, 1); |
1346 |
+ isl_val *max = isl_set_max_val (pdr->subscript_sizes, extract_dim); |
1347 |
+ isl_aff_free (extract_dim); |
1348 |
+ |
1349 |
+ /* The result is NULL in case of an error, the optimal value in case there |
1350 |
+ is one, negative infinity or infinity if the problem is unbounded and |
1351 |
+ NaN if the problem is empty. */ |
1352 |
+ gcc_assert (max); |
1353 |
+ |
1354 |
+ /* When one of the dimensions cannot be computed, we cannot build the size |
1355 |
+ of the array for any outer dimensions. */ |
1356 |
+ if (!isl_val_is_int (max)) |
1357 |
+ { |
1358 |
+ isl_val_free (max); |
1359 |
+ break; |
1360 |
+ } |
1361 |
+ size = isl_val_mul (size, max); |
1362 |
} |
1363 |
|
1364 |
isl_val_free (size); |
1365 |
@@ -176,7 +179,7 @@ pdr_stride_in_loop (mpz_t stride, graphite_dim_t depth, poly_dr_p pdr) |
1366 |
|
1367 |
/* pdr->accesses: [P1..nb_param,I1..nb_domain]->[a,S1..nb_subscript] |
1368 |
??? [P] not used for PDRs? |
1369 |
- pdr->extent: [a,S1..nb_subscript] |
1370 |
+ pdr->subscript_sizes: [a,S1..nb_subscript] |
1371 |
pbb->domain: [P1..nb_param,I1..nb_domain] |
1372 |
pbb->transformed: [P1..nb_param,I1..nb_domain]->[T1..Tnb_sctr] |
1373 |
[T] includes local vars (currently unused) |
1374 |
diff --git a/gcc/graphite-poly.c b/gcc/graphite-poly.c |
1375 |
index bcd08d8..2eff5a5a 100644 |
1376 |
--- a/gcc/graphite-poly.c |
1377 |
+++ b/gcc/graphite-poly.c |
1378 |
@@ -270,7 +270,7 @@ apply_poly_transforms (scop_p scop) |
1379 |
void |
1380 |
new_poly_dr (poly_bb_p pbb, int dr_base_object_set, |
1381 |
enum poly_dr_type type, void *cdr, graphite_dim_t nb_subscripts, |
1382 |
- isl_map *acc, isl_set *extent) |
1383 |
+ isl_map *acc, isl_set *subscript_sizes) |
1384 |
{ |
1385 |
static int id = 0; |
1386 |
poly_dr_p pdr = XNEW (struct poly_dr); |
1387 |
@@ -280,7 +280,7 @@ new_poly_dr (poly_bb_p pbb, int dr_base_object_set, |
1388 |
PDR_NB_REFS (pdr) = 1; |
1389 |
PDR_PBB (pdr) = pbb; |
1390 |
pdr->accesses = acc; |
1391 |
- pdr->extent = extent; |
1392 |
+ pdr->subscript_sizes = subscript_sizes; |
1393 |
PDR_TYPE (pdr) = type; |
1394 |
PDR_CDR (pdr) = cdr; |
1395 |
PDR_NB_SUBSCRIPTS (pdr) = nb_subscripts; |
1396 |
@@ -293,7 +293,7 @@ void |
1397 |
free_poly_dr (poly_dr_p pdr) |
1398 |
{ |
1399 |
isl_map_free (pdr->accesses); |
1400 |
- isl_set_free (pdr->extent); |
1401 |
+ isl_set_free (pdr->subscript_sizes); |
1402 |
XDELETE (pdr); |
1403 |
} |
1404 |
|
1405 |
diff --git a/gcc/graphite-poly.h b/gcc/graphite-poly.h |
1406 |
index 7ffd18e..82e1217 100644 |
1407 |
--- a/gcc/graphite-poly.h |
1408 |
+++ b/gcc/graphite-poly.h |
1409 |
@@ -177,7 +177,7 @@ struct poly_dr |
1410 |
|
1411 |
In the example, the vector "R C O I L P" is "7 7 3 2 0 1". */ |
1412 |
isl_map *accesses; |
1413 |
- isl_set *extent; |
1414 |
+ isl_set *subscript_sizes; |
1415 |
|
1416 |
/* Data reference's base object set number, we must assure 2 pdrs are in the |
1417 |
same base object set before dependency checking. */ |
1418 |
diff --git a/gcc/graphite-scop-detection.c b/gcc/graphite-scop-detection.c |
1419 |
index 4fb4e02..28de4ab 100644 |
1420 |
--- a/gcc/graphite-scop-detection.c |
1421 |
+++ b/gcc/graphite-scop-detection.c |
1422 |
@@ -289,7 +289,6 @@ stmt_has_simple_data_refs_p (loop_p outermost_loop ATTRIBUTE_UNUSED, |
1423 |
gimple stmt) |
1424 |
{ |
1425 |
data_reference_p dr; |
1426 |
- unsigned i; |
1427 |
int j; |
1428 |
bool res = true; |
1429 |
vec<data_reference_p> drs = vNULL; |
1430 |
@@ -302,18 +301,29 @@ stmt_has_simple_data_refs_p (loop_p outermost_loop ATTRIBUTE_UNUSED, |
1431 |
stmt, &drs); |
1432 |
|
1433 |
FOR_EACH_VEC_ELT (drs, j, dr) |
1434 |
- for (i = 0; i < DR_NUM_DIMENSIONS (dr); i++) |
1435 |
- if (!graphite_can_represent_scev (DR_ACCESS_FN (dr, i))) |
1436 |
+ { |
1437 |
+ int nb_subscripts = DR_NUM_DIMENSIONS (dr); |
1438 |
+ tree ref = DR_REF (dr); |
1439 |
+ |
1440 |
+ for (int i = nb_subscripts - 1; i >= 0; i--) |
1441 |
{ |
1442 |
- res = false; |
1443 |
- goto done; |
1444 |
+ if (!graphite_can_represent_scev (DR_ACCESS_FN (dr, i)) |
1445 |
+ || (TREE_CODE (ref) != ARRAY_REF |
1446 |
+ && TREE_CODE (ref) != MEM_REF |
1447 |
+ && TREE_CODE (ref) != COMPONENT_REF)) |
1448 |
+ { |
1449 |
+ free_data_refs (drs); |
1450 |
+ return false; |
1451 |
+ } |
1452 |
+ |
1453 |
+ ref = TREE_OPERAND (ref, 0); |
1454 |
} |
1455 |
+ } |
1456 |
|
1457 |
free_data_refs (drs); |
1458 |
drs.create (0); |
1459 |
} |
1460 |
|
1461 |
- done: |
1462 |
free_data_refs (drs); |
1463 |
return res; |
1464 |
} |
1465 |
diff --git a/gcc/graphite-scop-detection.h b/gcc/graphite-scop-detection.h |
1466 |
index 8e794c3..4511796 100644 |
1467 |
--- a/gcc/graphite-scop-detection.h |
1468 |
+++ b/gcc/graphite-scop-detection.h |
1469 |
@@ -23,7 +23,7 @@ along with GCC; see the file COPYING3. If not see |
1470 |
#define GCC_GRAPHITE_SCOP_DETECTION_H |
1471 |
|
1472 |
extern void build_scops (vec<scop_p> *); |
1473 |
-extern void dot_all_scops (vec<scop_p> ); |
1474 |
+extern void dot_all_scops (vec<scop_p>); |
1475 |
extern void dot_scop (scop_p); |
1476 |
|
1477 |
#endif /* GCC_GRAPHITE_SCOP_DETECTION_H */ |
1478 |
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c |
1479 |
index aaecab4..1e234fe 100644 |
1480 |
--- a/gcc/graphite-sese-to-poly.c |
1481 |
+++ b/gcc/graphite-sese-to-poly.c |
1482 |
@@ -497,6 +497,7 @@ build_pbb_scattering_polyhedrons (isl_aff *static_sched, |
1483 |
(isl_local_space_from_space (isl_map_get_space (pbb->schedule))); |
1484 |
|
1485 |
val = isl_aff_get_coefficient_val (static_sched, isl_dim_in, i / 2); |
1486 |
+ gcc_assert (val && isl_val_is_int (val)); |
1487 |
|
1488 |
val = isl_val_neg (val); |
1489 |
c = isl_constraint_set_constant_val (c, val); |
1490 |
@@ -719,14 +720,12 @@ extract_affine_int (tree e, __isl_take isl_space *space) |
1491 |
|
1492 |
/* Compute pwaff mod 2^width. */ |
1493 |
|
1494 |
-extern isl_ctx *the_isl_ctx; |
1495 |
- |
1496 |
static isl_pw_aff * |
1497 |
wrap (isl_pw_aff *pwaff, unsigned width) |
1498 |
{ |
1499 |
isl_val *mod; |
1500 |
|
1501 |
- mod = isl_val_int_from_ui(the_isl_ctx, width); |
1502 |
+ mod = isl_val_int_from_ui (isl_pw_aff_get_ctx (pwaff), width); |
1503 |
mod = isl_val_2exp (mod); |
1504 |
pwaff = isl_pw_aff_mod_val (pwaff, mod); |
1505 |
|
1506 |
@@ -1012,7 +1011,7 @@ build_loop_iteration_domains (scop_p scop, struct loop *loop, |
1507 |
(isl_local_space_from_space (isl_space_copy (space))); |
1508 |
c = isl_constraint_set_coefficient_si (c, isl_dim_set, pos, -1); |
1509 |
tree_int_to_gmp (nb_iters, g); |
1510 |
- v = isl_val_int_from_gmp (the_isl_ctx, g); |
1511 |
+ v = isl_val_int_from_gmp (scop->ctx, g); |
1512 |
c = isl_constraint_set_constant_val (c, v); |
1513 |
inner = isl_set_add_constraint (inner, c); |
1514 |
} |
1515 |
@@ -1067,7 +1066,7 @@ build_loop_iteration_domains (scop_p scop, struct loop *loop, |
1516 |
c = isl_inequality_alloc |
1517 |
(isl_local_space_from_space (isl_space_copy (space))); |
1518 |
c = isl_constraint_set_coefficient_si (c, isl_dim_set, pos, -1); |
1519 |
- v = isl_val_int_from_gmp (the_isl_ctx, g); |
1520 |
+ v = isl_val_int_from_gmp (scop->ctx, g); |
1521 |
mpz_clear (g); |
1522 |
c = isl_constraint_set_constant_val (c, v); |
1523 |
inner = isl_set_add_constraint (inner, c); |
1524 |
@@ -1335,7 +1334,7 @@ add_param_constraints (scop_p scop, graphite_dim_t p) |
1525 |
c = isl_inequality_alloc (isl_local_space_from_space (space)); |
1526 |
mpz_init (g); |
1527 |
tree_int_to_gmp (lb, g); |
1528 |
- v = isl_val_int_from_gmp (the_isl_ctx, g); |
1529 |
+ v = isl_val_int_from_gmp (scop->ctx, g); |
1530 |
v = isl_val_neg (v); |
1531 |
mpz_clear (g); |
1532 |
c = isl_constraint_set_constant_val (c, v); |
1533 |
@@ -1355,7 +1354,7 @@ add_param_constraints (scop_p scop, graphite_dim_t p) |
1534 |
|
1535 |
mpz_init (g); |
1536 |
tree_int_to_gmp (ub, g); |
1537 |
- v = isl_val_int_from_gmp (the_isl_ctx, g); |
1538 |
+ v = isl_val_int_from_gmp (scop->ctx, g); |
1539 |
mpz_clear (g); |
1540 |
c = isl_constraint_set_constant_val (c, v); |
1541 |
c = isl_constraint_set_coefficient_si (c, isl_dim_param, p, -1); |
1542 |
@@ -1491,20 +1490,19 @@ pdr_add_memory_accesses (isl_map *acc, data_reference_p dr, poly_bb_p pbb) |
1543 |
domain. */ |
1544 |
|
1545 |
static isl_set * |
1546 |
-pdr_add_data_dimensions (isl_set *extent, scop_p scop, data_reference_p dr) |
1547 |
+pdr_add_data_dimensions (isl_set *subscript_sizes, scop_p scop, |
1548 |
+ data_reference_p dr) |
1549 |
{ |
1550 |
tree ref = DR_REF (dr); |
1551 |
- int i, nb_subscripts = DR_NUM_DIMENSIONS (dr); |
1552 |
|
1553 |
- for (i = nb_subscripts - 1; i >= 0; i--, ref = TREE_OPERAND (ref, 0)) |
1554 |
+ int nb_subscripts = DR_NUM_DIMENSIONS (dr); |
1555 |
+ for (int i = nb_subscripts - 1; i >= 0; i--, ref = TREE_OPERAND (ref, 0)) |
1556 |
{ |
1557 |
- tree low, high; |
1558 |
- |
1559 |
if (TREE_CODE (ref) != ARRAY_REF) |
1560 |
- break; |
1561 |
+ return subscript_sizes; |
1562 |
|
1563 |
- low = array_ref_low_bound (ref); |
1564 |
- high = array_ref_up_bound (ref); |
1565 |
+ tree low = array_ref_low_bound (ref); |
1566 |
+ tree high = array_ref_up_bound (ref); |
1567 |
|
1568 |
/* XXX The PPL code dealt separately with |
1569 |
subscript - low >= 0 and high - subscript >= 0 in case one of |
1570 |
@@ -1522,10 +1520,10 @@ pdr_add_data_dimensions (isl_set *extent, scop_p scop, data_reference_p dr) |
1571 |
isl_aff *aff; |
1572 |
isl_set *univ, *lbs, *ubs; |
1573 |
isl_pw_aff *index; |
1574 |
- isl_space *space; |
1575 |
isl_set *valid; |
1576 |
- isl_pw_aff *lb = extract_affine_int (low, isl_set_get_space (extent)); |
1577 |
- isl_pw_aff *ub = extract_affine_int (high, isl_set_get_space (extent)); |
1578 |
+ isl_space *space = isl_set_get_space (subscript_sizes); |
1579 |
+ isl_pw_aff *lb = extract_affine_int (low, isl_space_copy (space)); |
1580 |
+ isl_pw_aff *ub = extract_affine_int (high, isl_space_copy (space)); |
1581 |
|
1582 |
/* high >= 0 */ |
1583 |
valid = isl_pw_aff_nonneg_set (isl_pw_aff_copy (ub)); |
1584 |
@@ -1533,25 +1531,24 @@ pdr_add_data_dimensions (isl_set *extent, scop_p scop, data_reference_p dr) |
1585 |
isl_set_dim (valid, isl_dim_set)); |
1586 |
scop->context = isl_set_intersect (scop->context, valid); |
1587 |
|
1588 |
- space = isl_set_get_space (extent); |
1589 |
aff = isl_aff_zero_on_domain (isl_local_space_from_space (space)); |
1590 |
aff = isl_aff_add_coefficient_si (aff, isl_dim_in, i + 1, 1); |
1591 |
univ = isl_set_universe (isl_space_domain (isl_aff_get_space (aff))); |
1592 |
index = isl_pw_aff_alloc (univ, aff); |
1593 |
|
1594 |
- id = isl_set_get_tuple_id (extent); |
1595 |
+ id = isl_set_get_tuple_id (subscript_sizes); |
1596 |
lb = isl_pw_aff_set_tuple_id (lb, isl_dim_in, isl_id_copy (id)); |
1597 |
ub = isl_pw_aff_set_tuple_id (ub, isl_dim_in, id); |
1598 |
|
1599 |
/* low <= sub_i <= high */ |
1600 |
lbs = isl_pw_aff_ge_set (isl_pw_aff_copy (index), lb); |
1601 |
ubs = isl_pw_aff_le_set (index, ub); |
1602 |
- extent = isl_set_intersect (extent, lbs); |
1603 |
- extent = isl_set_intersect (extent, ubs); |
1604 |
+ subscript_sizes = isl_set_intersect (subscript_sizes, lbs); |
1605 |
+ subscript_sizes = isl_set_intersect (subscript_sizes, ubs); |
1606 |
} |
1607 |
} |
1608 |
|
1609 |
- return extent; |
1610 |
+ return subscript_sizes; |
1611 |
} |
1612 |
|
1613 |
/* Build data accesses for DR in PBB. */ |
1614 |
@@ -1561,7 +1558,7 @@ build_poly_dr (data_reference_p dr, poly_bb_p pbb) |
1615 |
{ |
1616 |
int dr_base_object_set; |
1617 |
isl_map *acc; |
1618 |
- isl_set *extent; |
1619 |
+ isl_set *subscript_sizes; |
1620 |
scop_p scop = PBB_SCOP (pbb); |
1621 |
|
1622 |
{ |
1623 |
@@ -1588,9 +1585,10 @@ build_poly_dr (data_reference_p dr, poly_bb_p pbb) |
1624 |
alias_set_num = *(bap->alias_set); |
1625 |
|
1626 |
space = isl_space_set_tuple_id (space, isl_dim_set, id); |
1627 |
- extent = isl_set_nat_universe (space); |
1628 |
- extent = isl_set_fix_si (extent, isl_dim_set, 0, alias_set_num); |
1629 |
- extent = pdr_add_data_dimensions (extent, scop, dr); |
1630 |
+ subscript_sizes = isl_set_nat_universe (space); |
1631 |
+ subscript_sizes = isl_set_fix_si (subscript_sizes, isl_dim_set, 0, |
1632 |
+ alias_set_num); |
1633 |
+ subscript_sizes = pdr_add_data_dimensions (subscript_sizes, scop, dr); |
1634 |
} |
1635 |
|
1636 |
gcc_assert (dr->aux); |
1637 |
@@ -1598,7 +1596,7 @@ build_poly_dr (data_reference_p dr, poly_bb_p pbb) |
1638 |
|
1639 |
new_poly_dr (pbb, dr_base_object_set, |
1640 |
DR_IS_READ (dr) ? PDR_READ : PDR_WRITE, |
1641 |
- dr, DR_NUM_DIMENSIONS (dr), acc, extent); |
1642 |
+ dr, DR_NUM_DIMENSIONS (dr), acc, subscript_sizes); |
1643 |
} |
1644 |
|
1645 |
/* Write to FILE the alias graph of data references in DIMACS format. */ |
1646 |
diff --git a/gcc/testsuite/gcc.dg/graphite/pr61929.c b/gcc/testsuite/gcc.dg/graphite/pr61929.c |
1647 |
new file mode 100644 |
1648 |
index 0000000..9999ebf |
1649 |
--- /dev/null |
1650 |
+++ b/gcc/testsuite/gcc.dg/graphite/pr61929.c |
1651 |
@@ -0,0 +1,19 @@ |
1652 |
+/* { dg-do compile } */ |
1653 |
+/* { dg-options "-O2 -ftree-loop-linear -floop-strip-mine" } */ |
1654 |
+ |
1655 |
+typedef struct m { |
1656 |
+ char *A; |
1657 |
+ char *B; |
1658 |
+} mystruct; |
1659 |
+mystruct arr[52]; |
1660 |
+ |
1661 |
+void main () {} |
1662 |
+void generateICE (void) |
1663 |
+{ |
1664 |
+ int i; |
1665 |
+ for (i=0; i<52; i++) |
1666 |
+ { |
1667 |
+ arr[i].A = ""; |
1668 |
+ arr[i].B = 0; |
1669 |
+ } |
1670 |
+} |
1671 |
-- |
1672 |
2.4.4 |
1673 |
|
1674 |
|
1675 |
|
1676 |
|
1677 |
1.1 src/patchsets/gcc/5.3.0/gentoo/74_all_gcc5_isl-dl.patch |
1678 |
|
1679 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/5.3.0/gentoo/74_all_gcc5_isl-dl.patch?rev=1.1&view=markup |
1680 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/5.3.0/gentoo/74_all_gcc5_isl-dl.patch?rev=1.1&content-type=text/plain |
1681 |
|
1682 |
Index: 74_all_gcc5_isl-dl.patch |
1683 |
=================================================================== |
1684 |
dlopen cloog-isl library rather than link to it directly. This prevents |
1685 |
cloog upgrades that change the soname from breaking the compiler. |
1686 |
|
1687 |
http://pkgs.fedoraproject.org/cgit/gcc.git/tree/gcc5-isl-dl.patch |
1688 |
|
1689 |
In FreeBSD dlopen is part of libc so we can't just hardcode -ldl. |
1690 |
We abuse the existing plugin check logic to pull out that info. |
1691 |
|
1692 |
extended by Gentoo to support isl-0.15 |
1693 |
https://bugs.gentoo.org/552278 |
1694 |
|
1695 |
--- gcc/Makefile.in.jj 2012-12-13 17:09:20.000000000 +0100 |
1696 |
+++ gcc/Makefile.in 2012-12-14 11:45:22.585670055 +0100 |
1697 |
@@ -1006,7 +1006,7 @@ BUILD_LIBDEPS= $(BUILD_LIBIBERTY) |
1698 |
# and the system's installed libraries. |
1699 |
LIBS = @LIBS@ libcommon.a $(CPPLIB) $(LIBINTL) $(LIBICONV) $(LIBBACKTRACE) \ |
1700 |
$(LIBIBERTY) $(LIBDECNUMBER) $(HOST_LIBS) |
1701 |
-BACKENDLIBS = $(ISLLIBS) $(GMPLIBS) $(PLUGINLIBS) $(HOST_LIBS) \ |
1702 |
+BACKENDLIBS = $(if $(ISLLIBS),@DL_LIB@) $(GMPLIBS) $(PLUGINLIBS) $(HOST_LIBS) \ |
1703 |
$(ZLIB) |
1704 |
# Any system libraries needed just for GNAT. |
1705 |
SYSLIBS = @GNAT_LIBEXC@ |
1706 |
@@ -2050,6 +2050,15 @@ $(out_object_file): $(out_file) |
1707 |
$(common_out_object_file): $(common_out_file) |
1708 |
$(COMPILE) $< |
1709 |
$(POSTCOMPILE) |
1710 |
+ |
1711 |
+graphite%.o : \ |
1712 |
+ ALL_CFLAGS := -O $(filter-out -fkeep-inline-functions, $(ALL_CFLAGS)) |
1713 |
+graphite.o : \ |
1714 |
+ ALL_CFLAGS := -O $(filter-out -fkeep-inline-functions, $(ALL_CFLAGS)) |
1715 |
+graphite%.o : \ |
1716 |
+ ALL_CXXFLAGS := -O $(filter-out -fkeep-inline-functions, $(ALL_CXXFLAGS)) |
1717 |
+graphite.o : \ |
1718 |
+ ALL_CXXFLAGS := -O $(filter-out -fkeep-inline-functions, $(ALL_CXXFLAGS)) |
1719 |
# |
1720 |
# Generate header and source files from the machine description, |
1721 |
# and compile them. |
1722 |
--- gcc/configure |
1723 |
+++ gcc/configure |
1724 |
@@ -604,6 +604,7 @@ PICFLAG |
1725 |
enable_host_shared |
1726 |
enable_plugin |
1727 |
pluginlibs |
1728 |
+DL_LIB |
1729 |
ISLINC |
1730 |
ISLLIBS |
1731 |
GMPINC |
1732 |
@@ -28285,6 +28286,7 @@ $as_echo "unable to check" >&6; } |
1733 |
fi |
1734 |
|
1735 |
# Check -ldl |
1736 |
+ DL_LIB= |
1737 |
saved_LIBS="$LIBS" |
1738 |
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5 |
1739 |
$as_echo_n "checking for library containing dlopen... " >&6; } |
1740 |
@@ -28344,6 +28346,7 @@ fi |
1741 |
|
1742 |
if test x"$ac_cv_search_dlopen" = x"-ldl"; then |
1743 |
pluginlibs="$pluginlibs -ldl" |
1744 |
+ DL_LIB=$ac_cv_search_dlopen |
1745 |
fi |
1746 |
LIBS="$saved_LIBS" |
1747 |
|
1748 |
--- gcc/graphite-poly.h.jj 2012-12-13 11:31:27.000000000 +0100 |
1749 |
+++ gcc/graphite-poly.h 2012-12-14 13:41:41.970800726 +0100 |
1750 |
@@ -22,6 +22,493 @@ along with GCC; see the file COPYING3. |
1751 |
#ifndef GCC_GRAPHITE_POLY_H |
1752 |
#define GCC_GRAPHITE_POLY_H |
1753 |
|
1754 |
+#include <isl/aff.h> |
1755 |
+#include <isl/constraint.h> |
1756 |
+#include <isl/union_set.h> |
1757 |
+#include <isl/schedule.h> |
1758 |
+#include <isl/ilp.h> |
1759 |
+#include <isl/flow.h> |
1760 |
+#include <isl/options.h> |
1761 |
+#include <isl/ast.h> |
1762 |
+#include <isl/ast_build.h> |
1763 |
+#include <isl/val_gmp.h> |
1764 |
+#include <dlfcn.h> |
1765 |
+#ifdef HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE |
1766 |
+#define DYNSYM_ZERO_DISTANCE DYNSYM (isl_band_member_is_coincident) |
1767 |
+#else |
1768 |
+#define DYNSYM_ZERO_DISTANCE DYNSYM (isl_band_member_is_zero_distance) |
1769 |
+#endif |
1770 |
+#ifdef HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS |
1771 |
+#define DYNSYM_FUSE DYNSYM (isl_options_set_schedule_serialize_sccs) |
1772 |
+#else |
1773 |
+#define DYNSYM_FUSE DYNSYM (isl_options_set_schedule_fuse) |
1774 |
+#endif |
1775 |
+#define DYNSYMS \ |
1776 |
+ DYNSYM (isl_aff_add_coefficient_si); \ |
1777 |
+ DYNSYM (isl_aff_free); \ |
1778 |
+ DYNSYM (isl_aff_get_space); \ |
1779 |
+ DYNSYM (isl_aff_set_coefficient_si); \ |
1780 |
+ DYNSYM (isl_aff_set_constant_si); \ |
1781 |
+ DYNSYM (isl_aff_zero_on_domain); \ |
1782 |
+ DYNSYM (isl_band_free); \ |
1783 |
+ DYNSYM (isl_band_get_children); \ |
1784 |
+ DYNSYM (isl_band_get_partial_schedule); \ |
1785 |
+ DYNSYM (isl_band_has_children); \ |
1786 |
+ DYNSYM (isl_band_list_free); \ |
1787 |
+ DYNSYM (isl_band_list_get_band); \ |
1788 |
+ DYNSYM (isl_band_list_get_ctx); \ |
1789 |
+ DYNSYM (isl_band_list_n_band); \ |
1790 |
+ DYNSYM_ZERO_DISTANCE; \ |
1791 |
+ DYNSYM (isl_band_n_member); \ |
1792 |
+ DYNSYM (isl_basic_map_add_constraint); \ |
1793 |
+ DYNSYM (isl_basic_map_project_out); \ |
1794 |
+ DYNSYM (isl_basic_map_universe); \ |
1795 |
+ DYNSYM (isl_constraint_set_coefficient_si); \ |
1796 |
+ DYNSYM (isl_constraint_set_constant_si); \ |
1797 |
+ DYNSYM (isl_ctx_alloc); \ |
1798 |
+ DYNSYM (isl_ctx_free); \ |
1799 |
+ DYNSYM (isl_equality_alloc); \ |
1800 |
+ DYNSYM (isl_id_alloc); \ |
1801 |
+ DYNSYM (isl_id_copy); \ |
1802 |
+ DYNSYM (isl_id_free); \ |
1803 |
+ DYNSYM (isl_inequality_alloc); \ |
1804 |
+ DYNSYM (isl_local_space_copy); \ |
1805 |
+ DYNSYM (isl_local_space_free); \ |
1806 |
+ DYNSYM (isl_local_space_from_space); \ |
1807 |
+ DYNSYM (isl_local_space_range); \ |
1808 |
+ DYNSYM (isl_map_add_constraint); \ |
1809 |
+ DYNSYM (isl_map_add_dims); \ |
1810 |
+ DYNSYM (isl_map_align_params); \ |
1811 |
+ DYNSYM (isl_map_apply_range); \ |
1812 |
+ DYNSYM (isl_map_copy); \ |
1813 |
+ DYNSYM (isl_map_dim); \ |
1814 |
+ DYNSYM (isl_map_dump); \ |
1815 |
+ DYNSYM (isl_map_equate); \ |
1816 |
+ DYNSYM (isl_map_fix_si); \ |
1817 |
+ DYNSYM (isl_map_flat_product); \ |
1818 |
+ DYNSYM (isl_map_flat_range_product); \ |
1819 |
+ DYNSYM (isl_map_free); \ |
1820 |
+ DYNSYM (isl_map_from_basic_map); \ |
1821 |
+ DYNSYM (isl_map_from_pw_aff); \ |
1822 |
+ DYNSYM (isl_map_from_union_map); \ |
1823 |
+ DYNSYM (isl_map_get_ctx); \ |
1824 |
+ DYNSYM (isl_map_get_space); \ |
1825 |
+ DYNSYM (isl_map_get_tuple_id); \ |
1826 |
+ DYNSYM (isl_map_insert_dims); \ |
1827 |
+ DYNSYM (isl_map_intersect); \ |
1828 |
+ DYNSYM (isl_map_intersect_domain); \ |
1829 |
+ DYNSYM (isl_map_intersect_range); \ |
1830 |
+ DYNSYM (isl_map_is_empty); \ |
1831 |
+ DYNSYM (isl_map_lex_ge); \ |
1832 |
+ DYNSYM (isl_map_lex_le); \ |
1833 |
+ DYNSYM (isl_map_n_out); \ |
1834 |
+ DYNSYM (isl_map_range); \ |
1835 |
+ DYNSYM (isl_map_set_tuple_id); \ |
1836 |
+ DYNSYM (isl_map_universe); \ |
1837 |
+ DYNSYM (isl_options_set_on_error); \ |
1838 |
+ DYNSYM_FUSE; \ |
1839 |
+ DYNSYM (isl_options_set_schedule_max_constant_term); \ |
1840 |
+ DYNSYM (isl_options_set_schedule_maximize_band_depth); \ |
1841 |
+ DYNSYM (isl_printer_free); \ |
1842 |
+ DYNSYM (isl_printer_print_aff); \ |
1843 |
+ DYNSYM (isl_printer_print_constraint); \ |
1844 |
+ DYNSYM (isl_printer_print_map); \ |
1845 |
+ DYNSYM (isl_printer_print_set); \ |
1846 |
+ DYNSYM (isl_printer_to_file); \ |
1847 |
+ DYNSYM (isl_pw_aff_add); \ |
1848 |
+ DYNSYM (isl_pw_aff_alloc); \ |
1849 |
+ DYNSYM (isl_pw_aff_copy); \ |
1850 |
+ DYNSYM (isl_pw_aff_eq_set); \ |
1851 |
+ DYNSYM (isl_pw_aff_free); \ |
1852 |
+ DYNSYM (isl_pw_aff_from_aff); \ |
1853 |
+ DYNSYM (isl_pw_aff_get_ctx); \ |
1854 |
+ DYNSYM (isl_pw_aff_ge_set); \ |
1855 |
+ DYNSYM (isl_pw_aff_gt_set); \ |
1856 |
+ DYNSYM (isl_pw_aff_is_cst); \ |
1857 |
+ DYNSYM (isl_pw_aff_le_set); \ |
1858 |
+ DYNSYM (isl_pw_aff_lt_set); \ |
1859 |
+ DYNSYM (isl_pw_aff_mul); \ |
1860 |
+ DYNSYM (isl_pw_aff_ne_set); \ |
1861 |
+ DYNSYM (isl_pw_aff_nonneg_set); \ |
1862 |
+ DYNSYM (isl_pw_aff_set_tuple_id); \ |
1863 |
+ DYNSYM (isl_pw_aff_sub); \ |
1864 |
+ DYNSYM (isl_pw_aff_zero_set); \ |
1865 |
+ DYNSYM (isl_schedule_free); \ |
1866 |
+ DYNSYM (isl_schedule_get_band_forest); \ |
1867 |
+ DYNSYM (isl_set_add_constraint); \ |
1868 |
+ DYNSYM (isl_set_add_dims); \ |
1869 |
+ DYNSYM (isl_set_apply); \ |
1870 |
+ DYNSYM (isl_set_coalesce); \ |
1871 |
+ DYNSYM (isl_set_copy); \ |
1872 |
+ DYNSYM (isl_set_dim); \ |
1873 |
+ DYNSYM (isl_set_fix_si); \ |
1874 |
+ DYNSYM (isl_set_free); \ |
1875 |
+ DYNSYM (isl_set_get_space); \ |
1876 |
+ DYNSYM (isl_set_get_tuple_id); \ |
1877 |
+ DYNSYM (isl_set_intersect); \ |
1878 |
+ DYNSYM (isl_set_is_empty); \ |
1879 |
+ DYNSYM (isl_set_n_dim); \ |
1880 |
+ DYNSYM (isl_set_nat_universe); \ |
1881 |
+ DYNSYM (isl_set_project_out); \ |
1882 |
+ DYNSYM (isl_set_set_tuple_id); \ |
1883 |
+ DYNSYM (isl_set_universe); \ |
1884 |
+ DYNSYM (isl_space_add_dims); \ |
1885 |
+ DYNSYM (isl_space_alloc); \ |
1886 |
+ DYNSYM (isl_space_copy); \ |
1887 |
+ DYNSYM (isl_space_dim); \ |
1888 |
+ DYNSYM (isl_space_domain); \ |
1889 |
+ DYNSYM (isl_space_find_dim_by_id); \ |
1890 |
+ DYNSYM (isl_space_free); \ |
1891 |
+ DYNSYM (isl_space_from_domain); \ |
1892 |
+ DYNSYM (isl_space_get_tuple_id); \ |
1893 |
+ DYNSYM (isl_space_params_alloc); \ |
1894 |
+ DYNSYM (isl_space_range); \ |
1895 |
+ DYNSYM (isl_space_set_alloc); \ |
1896 |
+ DYNSYM (isl_space_set_dim_id); \ |
1897 |
+ DYNSYM (isl_space_set_tuple_id); \ |
1898 |
+ DYNSYM (isl_union_map_add_map); \ |
1899 |
+ DYNSYM (isl_union_map_align_params); \ |
1900 |
+ DYNSYM (isl_union_map_apply_domain); \ |
1901 |
+ DYNSYM (isl_union_map_apply_range); \ |
1902 |
+ DYNSYM (isl_union_map_compute_flow); \ |
1903 |
+ DYNSYM (isl_union_map_copy); \ |
1904 |
+ DYNSYM (isl_union_map_empty); \ |
1905 |
+ DYNSYM (isl_union_map_flat_range_product); \ |
1906 |
+ DYNSYM (isl_union_map_foreach_map); \ |
1907 |
+ DYNSYM (isl_union_map_free); \ |
1908 |
+ DYNSYM (isl_union_map_from_map); \ |
1909 |
+ DYNSYM (isl_union_map_get_ctx); \ |
1910 |
+ DYNSYM (isl_union_map_get_space); \ |
1911 |
+ DYNSYM (isl_union_map_gist_domain); \ |
1912 |
+ DYNSYM (isl_union_map_gist_range); \ |
1913 |
+ DYNSYM (isl_union_map_intersect_domain); \ |
1914 |
+ DYNSYM (isl_union_map_is_empty); \ |
1915 |
+ DYNSYM (isl_union_map_subtract); \ |
1916 |
+ DYNSYM (isl_union_map_union); \ |
1917 |
+ DYNSYM (isl_union_set_add_set); \ |
1918 |
+ DYNSYM (isl_union_set_compute_schedule); \ |
1919 |
+ DYNSYM (isl_union_set_copy); \ |
1920 |
+ DYNSYM (isl_union_set_empty); \ |
1921 |
+ DYNSYM (isl_union_set_from_set); \ |
1922 |
+ DYNSYM (isl_aff_add_constant_val); \ |
1923 |
+ DYNSYM (isl_aff_get_coefficient_val); \ |
1924 |
+ DYNSYM (isl_aff_get_ctx); \ |
1925 |
+ DYNSYM (isl_aff_mod_val); \ |
1926 |
+ DYNSYM (isl_ast_build_ast_from_schedule); \ |
1927 |
+ DYNSYM (isl_ast_build_free); \ |
1928 |
+ DYNSYM (isl_ast_build_from_context); \ |
1929 |
+ DYNSYM (isl_ast_build_get_ctx); \ |
1930 |
+ DYNSYM (isl_ast_build_get_schedule); \ |
1931 |
+ DYNSYM (isl_ast_build_get_schedule_space); \ |
1932 |
+ DYNSYM (isl_ast_build_set_before_each_for); \ |
1933 |
+ DYNSYM (isl_ast_build_set_options); \ |
1934 |
+ DYNSYM (isl_ast_expr_free); \ |
1935 |
+ DYNSYM (isl_ast_expr_from_val); \ |
1936 |
+ DYNSYM (isl_ast_expr_get_ctx); \ |
1937 |
+ DYNSYM (isl_ast_expr_get_id); \ |
1938 |
+ DYNSYM (isl_ast_expr_get_op_arg); \ |
1939 |
+ DYNSYM (isl_ast_expr_get_op_n_arg); \ |
1940 |
+ DYNSYM (isl_ast_expr_get_op_type); \ |
1941 |
+ DYNSYM (isl_ast_expr_get_type); \ |
1942 |
+ DYNSYM (isl_ast_expr_get_val); \ |
1943 |
+ DYNSYM (isl_ast_expr_sub); \ |
1944 |
+ DYNSYM (isl_ast_node_block_get_children); \ |
1945 |
+ DYNSYM (isl_ast_node_for_get_body); \ |
1946 |
+ DYNSYM (isl_ast_node_for_get_cond); \ |
1947 |
+ DYNSYM (isl_ast_node_for_get_inc); \ |
1948 |
+ DYNSYM (isl_ast_node_for_get_init); \ |
1949 |
+ DYNSYM (isl_ast_node_for_get_iterator); \ |
1950 |
+ DYNSYM (isl_ast_node_free); \ |
1951 |
+ DYNSYM (isl_ast_node_get_annotation); \ |
1952 |
+ DYNSYM (isl_ast_node_get_type); \ |
1953 |
+ DYNSYM (isl_ast_node_if_get_cond); \ |
1954 |
+ DYNSYM (isl_ast_node_if_get_else); \ |
1955 |
+ DYNSYM (isl_ast_node_if_get_then); \ |
1956 |
+ DYNSYM (isl_ast_node_list_free); \ |
1957 |
+ DYNSYM (isl_ast_node_list_get_ast_node); \ |
1958 |
+ DYNSYM (isl_ast_node_list_n_ast_node); \ |
1959 |
+ DYNSYM (isl_ast_node_user_get_expr); \ |
1960 |
+ DYNSYM (isl_constraint_set_coefficient_val); \ |
1961 |
+ DYNSYM (isl_constraint_set_constant_val); \ |
1962 |
+ DYNSYM (isl_id_get_user); \ |
1963 |
+ DYNSYM (isl_local_space_get_ctx); \ |
1964 |
+ DYNSYM (isl_map_fix_val); \ |
1965 |
+ DYNSYM (isl_options_set_ast_build_atomic_upper_bound); \ |
1966 |
+ DYNSYM (isl_printer_print_ast_node); \ |
1967 |
+ DYNSYM (isl_printer_print_str); \ |
1968 |
+ DYNSYM (isl_printer_set_output_format); \ |
1969 |
+ DYNSYM (isl_pw_aff_mod_val); \ |
1970 |
+ DYNSYM (isl_schedule_constraints_compute_schedule); \ |
1971 |
+ DYNSYM (isl_schedule_constraints_on_domain); \ |
1972 |
+ DYNSYM (isl_schedule_constraints_set_coincidence); \ |
1973 |
+ DYNSYM (isl_schedule_constraints_set_proximity); \ |
1974 |
+ DYNSYM (isl_schedule_constraints_set_validity); \ |
1975 |
+ DYNSYM (isl_set_get_dim_id); \ |
1976 |
+ DYNSYM (isl_set_max_val); \ |
1977 |
+ DYNSYM (isl_set_min_val); \ |
1978 |
+ DYNSYM (isl_set_params); \ |
1979 |
+ DYNSYM (isl_space_align_params); \ |
1980 |
+ DYNSYM (isl_space_map_from_domain_and_range); \ |
1981 |
+ DYNSYM (isl_space_set_tuple_name); \ |
1982 |
+ DYNSYM (isl_space_wrap); \ |
1983 |
+ DYNSYM (isl_union_map_from_domain_and_range); \ |
1984 |
+ DYNSYM (isl_union_map_range); \ |
1985 |
+ DYNSYM (isl_union_set_union); \ |
1986 |
+ DYNSYM (isl_union_set_universe); \ |
1987 |
+ DYNSYM (isl_val_2exp); \ |
1988 |
+ DYNSYM (isl_val_add_ui); \ |
1989 |
+ DYNSYM (isl_val_copy); \ |
1990 |
+ DYNSYM (isl_val_free); \ |
1991 |
+ DYNSYM (isl_val_get_num_gmp); \ |
1992 |
+ DYNSYM (isl_val_int_from_gmp); \ |
1993 |
+ DYNSYM (isl_val_int_from_si); \ |
1994 |
+ DYNSYM (isl_val_int_from_ui); \ |
1995 |
+ DYNSYM (isl_val_is_int); \ |
1996 |
+ DYNSYM (isl_val_mul); \ |
1997 |
+ DYNSYM (isl_val_neg); \ |
1998 |
+ DYNSYM (isl_val_sub); |
1999 |
+ |
2000 |
+extern struct isl_pointers_s__ |
2001 |
+{ |
2002 |
+ bool inited; |
2003 |
+ void *h; |
2004 |
+#define DYNSYM(x) __typeof (x) *p_##x |
2005 |
+ DYNSYMS |
2006 |
+#undef DYNSYM |
2007 |
+} isl_pointers__; |
2008 |
+ |
2009 |
+#define isl_aff_add_coefficient_si (*isl_pointers__.p_isl_aff_add_coefficient_si) |
2010 |
+#define isl_aff_free (*isl_pointers__.p_isl_aff_free) |
2011 |
+#define isl_aff_get_space (*isl_pointers__.p_isl_aff_get_space) |
2012 |
+#define isl_aff_set_coefficient_si (*isl_pointers__.p_isl_aff_set_coefficient_si) |
2013 |
+#define isl_aff_set_constant_si (*isl_pointers__.p_isl_aff_set_constant_si) |
2014 |
+#define isl_aff_zero_on_domain (*isl_pointers__.p_isl_aff_zero_on_domain) |
2015 |
+#define isl_band_free (*isl_pointers__.p_isl_band_free) |
2016 |
+#define isl_band_get_children (*isl_pointers__.p_isl_band_get_children) |
2017 |
+#define isl_band_get_partial_schedule (*isl_pointers__.p_isl_band_get_partial_schedule) |
2018 |
+#define isl_band_has_children (*isl_pointers__.p_isl_band_has_children) |
2019 |
+#define isl_band_list_free (*isl_pointers__.p_isl_band_list_free) |
2020 |
+#define isl_band_list_get_band (*isl_pointers__.p_isl_band_list_get_band) |
2021 |
+#define isl_band_list_get_ctx (*isl_pointers__.p_isl_band_list_get_ctx) |
2022 |
+#define isl_band_list_n_band (*isl_pointers__.p_isl_band_list_n_band) |
2023 |
+#ifdef HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE |
2024 |
+#define isl_band_member_is_coincident (*isl_pointers__.p_isl_band_member_is_coincident) |
2025 |
+#else |
2026 |
+#define isl_band_member_is_zero_distance (*isl_pointers__.p_isl_band_member_is_zero_distance) |
2027 |
+#endif |
2028 |
+#define isl_band_n_member (*isl_pointers__.p_isl_band_n_member) |
2029 |
+#define isl_basic_map_add_constraint (*isl_pointers__.p_isl_basic_map_add_constraint) |
2030 |
+#define isl_basic_map_project_out (*isl_pointers__.p_isl_basic_map_project_out) |
2031 |
+#define isl_basic_map_universe (*isl_pointers__.p_isl_basic_map_universe) |
2032 |
+#define isl_constraint_set_coefficient_si (*isl_pointers__.p_isl_constraint_set_coefficient_si) |
2033 |
+#define isl_constraint_set_constant_si (*isl_pointers__.p_isl_constraint_set_constant_si) |
2034 |
+#define isl_ctx_alloc (*isl_pointers__.p_isl_ctx_alloc) |
2035 |
+#define isl_ctx_free (*isl_pointers__.p_isl_ctx_free) |
2036 |
+#define isl_equality_alloc (*isl_pointers__.p_isl_equality_alloc) |
2037 |
+#define isl_id_alloc (*isl_pointers__.p_isl_id_alloc) |
2038 |
+#define isl_id_copy (*isl_pointers__.p_isl_id_copy) |
2039 |
+#define isl_id_free (*isl_pointers__.p_isl_id_free) |
2040 |
+#define isl_inequality_alloc (*isl_pointers__.p_isl_inequality_alloc) |
2041 |
+#define isl_local_space_copy (*isl_pointers__.p_isl_local_space_copy) |
2042 |
+#define isl_local_space_free (*isl_pointers__.p_isl_local_space_free) |
2043 |
+#define isl_local_space_from_space (*isl_pointers__.p_isl_local_space_from_space) |
2044 |
+#define isl_local_space_range (*isl_pointers__.p_isl_local_space_range) |
2045 |
+#define isl_map_add_constraint (*isl_pointers__.p_isl_map_add_constraint) |
2046 |
+#define isl_map_add_dims (*isl_pointers__.p_isl_map_add_dims) |
2047 |
+#define isl_map_align_params (*isl_pointers__.p_isl_map_align_params) |
2048 |
+#define isl_map_apply_range (*isl_pointers__.p_isl_map_apply_range) |
2049 |
+#define isl_map_copy (*isl_pointers__.p_isl_map_copy) |
2050 |
+#define isl_map_dim (*isl_pointers__.p_isl_map_dim) |
2051 |
+#define isl_map_dump (*isl_pointers__.p_isl_map_dump) |
2052 |
+#define isl_map_equate (*isl_pointers__.p_isl_map_equate) |
2053 |
+#define isl_map_fix_si (*isl_pointers__.p_isl_map_fix_si) |
2054 |
+#define isl_map_flat_product (*isl_pointers__.p_isl_map_flat_product) |
2055 |
+#define isl_map_flat_range_product (*isl_pointers__.p_isl_map_flat_range_product) |
2056 |
+#define isl_map_free (*isl_pointers__.p_isl_map_free) |
2057 |
+#define isl_map_from_basic_map (*isl_pointers__.p_isl_map_from_basic_map) |
2058 |
+#define isl_map_from_pw_aff (*isl_pointers__.p_isl_map_from_pw_aff) |
2059 |
+#define isl_map_from_union_map (*isl_pointers__.p_isl_map_from_union_map) |
2060 |
+#define isl_map_get_ctx (*isl_pointers__.p_isl_map_get_ctx) |
2061 |
+#define isl_map_get_space (*isl_pointers__.p_isl_map_get_space) |
2062 |
+#define isl_map_get_tuple_id (*isl_pointers__.p_isl_map_get_tuple_id) |
2063 |
+#define isl_map_insert_dims (*isl_pointers__.p_isl_map_insert_dims) |
2064 |
+#define isl_map_intersect (*isl_pointers__.p_isl_map_intersect) |
2065 |
+#define isl_map_intersect_domain (*isl_pointers__.p_isl_map_intersect_domain) |
2066 |
+#define isl_map_intersect_range (*isl_pointers__.p_isl_map_intersect_range) |
2067 |
+#define isl_map_is_empty (*isl_pointers__.p_isl_map_is_empty) |
2068 |
+#define isl_map_lex_ge (*isl_pointers__.p_isl_map_lex_ge) |
2069 |
+#define isl_map_lex_le (*isl_pointers__.p_isl_map_lex_le) |
2070 |
+#define isl_map_n_out (*isl_pointers__.p_isl_map_n_out) |
2071 |
+#define isl_map_range (*isl_pointers__.p_isl_map_range) |
2072 |
+#define isl_map_set_tuple_id (*isl_pointers__.p_isl_map_set_tuple_id) |
2073 |
+#define isl_map_universe (*isl_pointers__.p_isl_map_universe) |
2074 |
+#define isl_options_set_on_error (*isl_pointers__.p_isl_options_set_on_error) |
2075 |
+#ifdef HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS |
2076 |
+#define isl_options_set_schedule_serialize_sccs (*isl_pointers__.p_isl_options_set_schedule_serialize_sccs) |
2077 |
+#else |
2078 |
+#define isl_options_set_schedule_fuse (*isl_pointers__.p_isl_options_set_schedule_fuse) |
2079 |
+#endif |
2080 |
+#define isl_options_set_schedule_max_constant_term (*isl_pointers__.p_isl_options_set_schedule_max_constant_term) |
2081 |
+#define isl_options_set_schedule_maximize_band_depth (*isl_pointers__.p_isl_options_set_schedule_maximize_band_depth) |
2082 |
+#define isl_printer_free (*isl_pointers__.p_isl_printer_free) |
2083 |
+#define isl_printer_print_aff (*isl_pointers__.p_isl_printer_print_aff) |
2084 |
+#define isl_printer_print_constraint (*isl_pointers__.p_isl_printer_print_constraint) |
2085 |
+#define isl_printer_print_map (*isl_pointers__.p_isl_printer_print_map) |
2086 |
+#define isl_printer_print_set (*isl_pointers__.p_isl_printer_print_set) |
2087 |
+#define isl_printer_to_file (*isl_pointers__.p_isl_printer_to_file) |
2088 |
+#define isl_pw_aff_add (*isl_pointers__.p_isl_pw_aff_add) |
2089 |
+#define isl_pw_aff_alloc (*isl_pointers__.p_isl_pw_aff_alloc) |
2090 |
+#define isl_pw_aff_copy (*isl_pointers__.p_isl_pw_aff_copy) |
2091 |
+#define isl_pw_aff_eq_set (*isl_pointers__.p_isl_pw_aff_eq_set) |
2092 |
+#define isl_pw_aff_free (*isl_pointers__.p_isl_pw_aff_free) |
2093 |
+#define isl_pw_aff_from_aff (*isl_pointers__.p_isl_pw_aff_from_aff) |
2094 |
+#define isl_pw_aff_get_ctx (*isl_pointers__.p_isl_pw_aff_get_ctx) |
2095 |
+#define isl_pw_aff_ge_set (*isl_pointers__.p_isl_pw_aff_ge_set) |
2096 |
+#define isl_pw_aff_gt_set (*isl_pointers__.p_isl_pw_aff_gt_set) |
2097 |
+#define isl_pw_aff_is_cst (*isl_pointers__.p_isl_pw_aff_is_cst) |
2098 |
+#define isl_pw_aff_le_set (*isl_pointers__.p_isl_pw_aff_le_set) |
2099 |
+#define isl_pw_aff_lt_set (*isl_pointers__.p_isl_pw_aff_lt_set) |
2100 |
+#define isl_pw_aff_mul (*isl_pointers__.p_isl_pw_aff_mul) |
2101 |
+#define isl_pw_aff_ne_set (*isl_pointers__.p_isl_pw_aff_ne_set) |
2102 |
+#define isl_pw_aff_nonneg_set (*isl_pointers__.p_isl_pw_aff_nonneg_set) |
2103 |
+#define isl_pw_aff_set_tuple_id (*isl_pointers__.p_isl_pw_aff_set_tuple_id) |
2104 |
+#define isl_pw_aff_sub (*isl_pointers__.p_isl_pw_aff_sub) |
2105 |
+#define isl_pw_aff_zero_set (*isl_pointers__.p_isl_pw_aff_zero_set) |
2106 |
+#define isl_schedule_free (*isl_pointers__.p_isl_schedule_free) |
2107 |
+#define isl_schedule_get_band_forest (*isl_pointers__.p_isl_schedule_get_band_forest) |
2108 |
+#define isl_set_add_constraint (*isl_pointers__.p_isl_set_add_constraint) |
2109 |
+#define isl_set_add_dims (*isl_pointers__.p_isl_set_add_dims) |
2110 |
+#define isl_set_apply (*isl_pointers__.p_isl_set_apply) |
2111 |
+#define isl_set_coalesce (*isl_pointers__.p_isl_set_coalesce) |
2112 |
+#define isl_set_copy (*isl_pointers__.p_isl_set_copy) |
2113 |
+#define isl_set_dim (*isl_pointers__.p_isl_set_dim) |
2114 |
+#define isl_set_fix_si (*isl_pointers__.p_isl_set_fix_si) |
2115 |
+#define isl_set_free (*isl_pointers__.p_isl_set_free) |
2116 |
+#define isl_set_get_space (*isl_pointers__.p_isl_set_get_space) |
2117 |
+#define isl_set_get_tuple_id (*isl_pointers__.p_isl_set_get_tuple_id) |
2118 |
+#define isl_set_intersect (*isl_pointers__.p_isl_set_intersect) |
2119 |
+#define isl_set_is_empty (*isl_pointers__.p_isl_set_is_empty) |
2120 |
+#define isl_set_n_dim (*isl_pointers__.p_isl_set_n_dim) |
2121 |
+#define isl_set_nat_universe (*isl_pointers__.p_isl_set_nat_universe) |
2122 |
+#define isl_set_project_out (*isl_pointers__.p_isl_set_project_out) |
2123 |
+#define isl_set_set_tuple_id (*isl_pointers__.p_isl_set_set_tuple_id) |
2124 |
+#define isl_set_universe (*isl_pointers__.p_isl_set_universe) |
2125 |
+#define isl_space_add_dims (*isl_pointers__.p_isl_space_add_dims) |
2126 |
+#define isl_space_alloc (*isl_pointers__.p_isl_space_alloc) |
2127 |
+#define isl_space_copy (*isl_pointers__.p_isl_space_copy) |
2128 |
+#define isl_space_dim (*isl_pointers__.p_isl_space_dim) |
2129 |
+#define isl_space_domain (*isl_pointers__.p_isl_space_domain) |
2130 |
+#define isl_space_find_dim_by_id (*isl_pointers__.p_isl_space_find_dim_by_id) |
2131 |
+#define isl_space_free (*isl_pointers__.p_isl_space_free) |
2132 |
+#define isl_space_from_domain (*isl_pointers__.p_isl_space_from_domain) |
2133 |
+#define isl_space_get_tuple_id (*isl_pointers__.p_isl_space_get_tuple_id) |
2134 |
+#define isl_space_params_alloc (*isl_pointers__.p_isl_space_params_alloc) |
2135 |
+#define isl_space_range (*isl_pointers__.p_isl_space_range) |
2136 |
+#define isl_space_set_alloc (*isl_pointers__.p_isl_space_set_alloc) |
2137 |
+#define isl_space_set_dim_id (*isl_pointers__.p_isl_space_set_dim_id) |
2138 |
+#define isl_space_set_tuple_id (*isl_pointers__.p_isl_space_set_tuple_id) |
2139 |
+#define isl_union_map_add_map (*isl_pointers__.p_isl_union_map_add_map) |
2140 |
+#define isl_union_map_align_params (*isl_pointers__.p_isl_union_map_align_params) |
2141 |
+#define isl_union_map_apply_domain (*isl_pointers__.p_isl_union_map_apply_domain) |
2142 |
+#define isl_union_map_apply_range (*isl_pointers__.p_isl_union_map_apply_range) |
2143 |
+#define isl_union_map_compute_flow (*isl_pointers__.p_isl_union_map_compute_flow) |
2144 |
+#define isl_union_map_copy (*isl_pointers__.p_isl_union_map_copy) |
2145 |
+#define isl_union_map_empty (*isl_pointers__.p_isl_union_map_empty) |
2146 |
+#define isl_union_map_flat_range_product (*isl_pointers__.p_isl_union_map_flat_range_product) |
2147 |
+#define isl_union_map_foreach_map (*isl_pointers__.p_isl_union_map_foreach_map) |
2148 |
+#define isl_union_map_free (*isl_pointers__.p_isl_union_map_free) |
2149 |
+#define isl_union_map_from_map (*isl_pointers__.p_isl_union_map_from_map) |
2150 |
+#define isl_union_map_get_ctx (*isl_pointers__.p_isl_union_map_get_ctx) |
2151 |
+#define isl_union_map_get_space (*isl_pointers__.p_isl_union_map_get_space) |
2152 |
+#define isl_union_map_gist_domain (*isl_pointers__.p_isl_union_map_gist_domain) |
2153 |
+#define isl_union_map_gist_range (*isl_pointers__.p_isl_union_map_gist_range) |
2154 |
+#define isl_union_map_intersect_domain (*isl_pointers__.p_isl_union_map_intersect_domain) |
2155 |
+#define isl_union_map_is_empty (*isl_pointers__.p_isl_union_map_is_empty) |
2156 |
+#define isl_union_map_subtract (*isl_pointers__.p_isl_union_map_subtract) |
2157 |
+#define isl_union_map_union (*isl_pointers__.p_isl_union_map_union) |
2158 |
+#define isl_union_set_add_set (*isl_pointers__.p_isl_union_set_add_set) |
2159 |
+#define isl_union_set_compute_schedule (*isl_pointers__.p_isl_union_set_compute_schedule) |
2160 |
+#define isl_union_set_copy (*isl_pointers__.p_isl_union_set_copy) |
2161 |
+#define isl_union_set_empty (*isl_pointers__.p_isl_union_set_empty) |
2162 |
+#define isl_union_set_from_set (*isl_pointers__.p_isl_union_set_from_set) |
2163 |
+#define isl_aff_add_constant_val (*isl_pointers__.p_isl_aff_add_constant_val) |
2164 |
+#define isl_aff_get_coefficient_val (*isl_pointers__.p_isl_aff_get_coefficient_val) |
2165 |
+#define isl_aff_get_ctx (*isl_pointers__.p_isl_aff_get_ctx) |
2166 |
+#define isl_aff_mod_val (*isl_pointers__.p_isl_aff_mod_val) |
2167 |
+#define isl_ast_build_ast_from_schedule (*isl_pointers__.p_isl_ast_build_ast_from_schedule) |
2168 |
+#define isl_ast_build_free (*isl_pointers__.p_isl_ast_build_free) |
2169 |
+#define isl_ast_build_from_context (*isl_pointers__.p_isl_ast_build_from_context) |
2170 |
+#define isl_ast_build_get_ctx (*isl_pointers__.p_isl_ast_build_get_ctx) |
2171 |
+#define isl_ast_build_get_schedule (*isl_pointers__.p_isl_ast_build_get_schedule) |
2172 |
+#define isl_ast_build_get_schedule_space (*isl_pointers__.p_isl_ast_build_get_schedule_space) |
2173 |
+#define isl_ast_build_set_before_each_for (*isl_pointers__.p_isl_ast_build_set_before_each_for) |
2174 |
+#define isl_ast_build_set_options (*isl_pointers__.p_isl_ast_build_set_options) |
2175 |
+#define isl_ast_expr_free (*isl_pointers__.p_isl_ast_expr_free) |
2176 |
+#define isl_ast_expr_from_val (*isl_pointers__.p_isl_ast_expr_from_val) |
2177 |
+#define isl_ast_expr_get_ctx (*isl_pointers__.p_isl_ast_expr_get_ctx) |
2178 |
+#define isl_ast_expr_get_id (*isl_pointers__.p_isl_ast_expr_get_id) |
2179 |
+#define isl_ast_expr_get_op_arg (*isl_pointers__.p_isl_ast_expr_get_op_arg) |
2180 |
+#define isl_ast_expr_get_op_n_arg (*isl_pointers__.p_isl_ast_expr_get_op_n_arg) |
2181 |
+#define isl_ast_expr_get_op_type (*isl_pointers__.p_isl_ast_expr_get_op_type) |
2182 |
+#define isl_ast_expr_get_type (*isl_pointers__.p_isl_ast_expr_get_type) |
2183 |
+#define isl_ast_expr_get_val (*isl_pointers__.p_isl_ast_expr_get_val) |
2184 |
+#define isl_ast_expr_sub (*isl_pointers__.p_isl_ast_expr_sub) |
2185 |
+#define isl_ast_node_block_get_children (*isl_pointers__.p_isl_ast_node_block_get_children) |
2186 |
+#define isl_ast_node_for_get_body (*isl_pointers__.p_isl_ast_node_for_get_body) |
2187 |
+#define isl_ast_node_for_get_cond (*isl_pointers__.p_isl_ast_node_for_get_cond) |
2188 |
+#define isl_ast_node_for_get_inc (*isl_pointers__.p_isl_ast_node_for_get_inc) |
2189 |
+#define isl_ast_node_for_get_init (*isl_pointers__.p_isl_ast_node_for_get_init) |
2190 |
+#define isl_ast_node_for_get_iterator (*isl_pointers__.p_isl_ast_node_for_get_iterator) |
2191 |
+#define isl_ast_node_free (*isl_pointers__.p_isl_ast_node_free) |
2192 |
+#define isl_ast_node_get_annotation (*isl_pointers__.p_isl_ast_node_get_annotation) |
2193 |
+#define isl_ast_node_get_type (*isl_pointers__.p_isl_ast_node_get_type) |
2194 |
+#define isl_ast_node_if_get_cond (*isl_pointers__.p_isl_ast_node_if_get_cond) |
2195 |
+#define isl_ast_node_if_get_else (*isl_pointers__.p_isl_ast_node_if_get_else) |
2196 |
+#define isl_ast_node_if_get_then (*isl_pointers__.p_isl_ast_node_if_get_then) |
2197 |
+#define isl_ast_node_list_free (*isl_pointers__.p_isl_ast_node_list_free) |
2198 |
+#define isl_ast_node_list_get_ast_node (*isl_pointers__.p_isl_ast_node_list_get_ast_node) |
2199 |
+#define isl_ast_node_list_n_ast_node (*isl_pointers__.p_isl_ast_node_list_n_ast_node) |
2200 |
+#define isl_ast_node_user_get_expr (*isl_pointers__.p_isl_ast_node_user_get_expr) |
2201 |
+#define isl_constraint_set_coefficient_val (*isl_pointers__.p_isl_constraint_set_coefficient_val) |
2202 |
+#define isl_constraint_set_constant_val (*isl_pointers__.p_isl_constraint_set_constant_val) |
2203 |
+#define isl_id_get_user (*isl_pointers__.p_isl_id_get_user) |
2204 |
+#define isl_local_space_get_ctx (*isl_pointers__.p_isl_local_space_get_ctx) |
2205 |
+#define isl_map_fix_val (*isl_pointers__.p_isl_map_fix_val) |
2206 |
+#define isl_options_set_ast_build_atomic_upper_bound (*isl_pointers__.p_isl_options_set_ast_build_atomic_upper_bound) |
2207 |
+#define isl_printer_print_ast_node (*isl_pointers__.p_isl_printer_print_ast_node) |
2208 |
+#define isl_printer_print_str (*isl_pointers__.p_isl_printer_print_str) |
2209 |
+#define isl_printer_set_output_format (*isl_pointers__.p_isl_printer_set_output_format) |
2210 |
+#define isl_pw_aff_mod_val (*isl_pointers__.p_isl_pw_aff_mod_val) |
2211 |
+#define isl_schedule_constraints_compute_schedule (*isl_pointers__.p_isl_schedule_constraints_compute_schedule) |
2212 |
+#define isl_schedule_constraints_on_domain (*isl_pointers__.p_isl_schedule_constraints_on_domain) |
2213 |
+#define isl_schedule_constraints_set_coincidence (*isl_pointers__.p_isl_schedule_constraints_set_coincidence) |
2214 |
+#define isl_schedule_constraints_set_proximity (*isl_pointers__.p_isl_schedule_constraints_set_proximity) |
2215 |
+#define isl_schedule_constraints_set_validity (*isl_pointers__.p_isl_schedule_constraints_set_validity) |
2216 |
+#define isl_set_get_dim_id (*isl_pointers__.p_isl_set_get_dim_id) |
2217 |
+#define isl_set_max_val (*isl_pointers__.p_isl_set_max_val) |
2218 |
+#define isl_set_min_val (*isl_pointers__.p_isl_set_min_val) |
2219 |
+#define isl_set_params (*isl_pointers__.p_isl_set_params) |
2220 |
+#define isl_space_align_params (*isl_pointers__.p_isl_space_align_params) |
2221 |
+#define isl_space_map_from_domain_and_range (*isl_pointers__.p_isl_space_map_from_domain_and_range) |
2222 |
+#define isl_space_set_tuple_name (*isl_pointers__.p_isl_space_set_tuple_name) |
2223 |
+#define isl_space_wrap (*isl_pointers__.p_isl_space_wrap) |
2224 |
+#define isl_union_map_from_domain_and_range (*isl_pointers__.p_isl_union_map_from_domain_and_range) |
2225 |
+#define isl_union_map_range (*isl_pointers__.p_isl_union_map_range) |
2226 |
+#define isl_union_set_union (*isl_pointers__.p_isl_union_set_union) |
2227 |
+#define isl_union_set_universe (*isl_pointers__.p_isl_union_set_universe) |
2228 |
+#define isl_val_2exp (*isl_pointers__.p_isl_val_2exp) |
2229 |
+#define isl_val_add_ui (*isl_pointers__.p_isl_val_add_ui) |
2230 |
+#define isl_val_copy (*isl_pointers__.p_isl_val_copy) |
2231 |
+#define isl_val_free (*isl_pointers__.p_isl_val_free) |
2232 |
+#define isl_val_get_num_gmp (*isl_pointers__.p_isl_val_get_num_gmp) |
2233 |
+#define isl_val_int_from_gmp (*isl_pointers__.p_isl_val_int_from_gmp) |
2234 |
+#define isl_val_int_from_si (*isl_pointers__.p_isl_val_int_from_si) |
2235 |
+#define isl_val_int_from_ui (*isl_pointers__.p_isl_val_int_from_ui) |
2236 |
+#define isl_val_is_int (*isl_pointers__.p_isl_val_is_int) |
2237 |
+#define isl_val_mul (*isl_pointers__.p_isl_val_mul) |
2238 |
+#define isl_val_neg (*isl_pointers__.p_isl_val_neg) |
2239 |
+#define isl_val_sub (*isl_pointers__.p_isl_val_sub) |
2240 |
+ |
2241 |
typedef struct poly_dr *poly_dr_p; |
2242 |
|
2243 |
typedef struct poly_bb *poly_bb_p; |
2244 |
--- gcc/graphite.c.jj 2012-12-13 11:31:00.000000000 +0100 |
2245 |
+++ gcc/graphite.c 2012-12-14 13:40:44.155136961 +0100 |
2246 |
@@ -90,6 +90,38 @@ along with GCC; see the file COPYING3. |
2247 |
#include "graphite-isl-ast-to-gimple.h" |
2248 |
#include "graphite-sese-to-poly.h" |
2249 |
|
2250 |
+__typeof (isl_pointers__) isl_pointers__; |
2251 |
+ |
2252 |
+static bool |
2253 |
+init_isl_pointers (void) |
2254 |
+{ |
2255 |
+ void *h; |
2256 |
+ |
2257 |
+ if (isl_pointers__.inited) |
2258 |
+ return isl_pointers__.h != NULL; |
2259 |
+#ifdef HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS |
2260 |
+ h = dlopen ("libisl.so.15", RTLD_LAZY); |
2261 |
+#else |
2262 |
+ h = dlopen ("libisl.so.13", RTLD_LAZY); |
2263 |
+#endif |
2264 |
+ isl_pointers__.h = h; |
2265 |
+ if (h == NULL) |
2266 |
+ return false; |
2267 |
+#define DYNSYM(x) \ |
2268 |
+ do \ |
2269 |
+ { \ |
2270 |
+ union { __typeof (isl_pointers__.p_##x) p; void *q; } u; \ |
2271 |
+ u.q = dlsym (h, #x); \ |
2272 |
+ if (u.q == NULL) \ |
2273 |
+ return false; \ |
2274 |
+ isl_pointers__.p_##x = u.p; \ |
2275 |
+ } \ |
2276 |
+ while (0) |
2277 |
+ DYNSYMS |
2278 |
+#undef DYNSYM |
2279 |
+ return true; |
2280 |
+} |
2281 |
+ |
2282 |
/* Print global statistics to FILE. */ |
2283 |
|
2284 |
static void |
2285 |
@@ -285,6 +313,15 @@ graphite_transform_loops (void) |
2286 |
if (parallelized_function_p (cfun->decl)) |
2287 |
return; |
2288 |
|
2289 |
+ if (number_of_loops (cfun) <= 1) |
2290 |
+ return; |
2291 |
+ |
2292 |
+ if (!init_isl_pointers ()) |
2293 |
+ { |
2294 |
+ sorry ("Graphite loop optimizations cannot be used"); |
2295 |
+ return; |
2296 |
+ } |
2297 |
+ |
2298 |
ctx = isl_ctx_alloc (); |
2299 |
isl_options_set_on_error (ctx, ISL_ON_ERROR_ABORT); |
2300 |
if (!graphite_initialize (ctx)) |
2301 |
|
2302 |
|
2303 |
|
2304 |
1.1 src/patchsets/gcc/5.3.0/gentoo/77_all_gcc-5-pr65958.patch |
2305 |
|
2306 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/5.3.0/gentoo/77_all_gcc-5-pr65958.patch?rev=1.1&view=markup |
2307 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/5.3.0/gentoo/77_all_gcc-5-pr65958.patch?rev=1.1&content-type=text/plain |
2308 |
|
2309 |
Index: 77_all_gcc-5-pr65958.patch |
2310 |
=================================================================== |
2311 |
https://bugs.gentoo.org/518598 |
2312 |
https://gcc.gnu.org/PR65958 |
2313 |
|
2314 |
fix alloca behavior with vla's for all arches |
2315 |
|
2316 |
From 6ad0a0bc2db129994d44470b070e91d9584f0132 Mon Sep 17 00:00:00 2001 |
2317 |
From: ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> |
2318 |
Date: Fri, 4 Dec 2015 11:57:15 +0000 |
2319 |
Subject: [PATCH] |
2320 |
|
2321 |
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231260 138bc75d-0d04-0410-961f-82ee72b054a4 |
2322 |
--- |
2323 |
gcc/ChangeLog | 15 +++++++++++++++ |
2324 |
gcc/doc/extend.texi | 4 +--- |
2325 |
gcc/doc/generic.texi | 14 +++++++++----- |
2326 |
gcc/gimplify.c | 38 ++++++++++++++++++++++++++++---------- |
2327 |
gcc/testsuite/ChangeLog | 4 ++++ |
2328 |
gcc/testsuite/gcc.dg/vla-24.c | 31 +++++++++++++++++++++++++++++++ |
2329 |
6 files changed, 88 insertions(+), 18 deletions(-) |
2330 |
create mode 100644 gcc/testsuite/gcc.dg/vla-24.c |
2331 |
|
2332 |
2015-12-04 Eric Botcazou <ebotcazou@×××××××.com> |
2333 |
|
2334 |
PR middle-end/65958 |
2335 |
* gimplify.c (struct gimplify_ctx): Turn boolean fields into 1-bit |
2336 |
fields, add keep_stack and reorder them. |
2337 |
(gimplify_bind_expr): Save gimplify_ctxp->keep_stack on entry then |
2338 |
set it to false. Do not insert a stack save/restore pair if it has |
2339 |
been set to true by the gimplification of the statements. |
2340 |
Restore it to the saved value on exit if it is still false. |
2341 |
(gimplify_vla_decl): Do not set gimplify_ctxp->save_stack here. |
2342 |
(gimplify_call_expr) <BUILT_IN_ALLOCA[_WITH_ALIGN]>: New case. Set |
2343 |
either save_stack or keep_stack depending on CALL_ALLOCA_FOR_VAR_P. |
2344 |
* doc/extend.texi (Variable Length): Document new behavior. |
2345 |
* doc/generic.texi (Blocks): Document new handling of VLAs. |
2346 |
|
2347 |
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi |
2348 |
index 63fce0f..6a5e2b8 100644 |
2349 |
--- a/gcc/doc/extend.texi |
2350 |
+++ b/gcc/doc/extend.texi |
2351 |
@@ -1658,9 +1658,7 @@ variable-length arrays are more elegant. |
2352 |
There are other differences between these two methods. Space allocated |
2353 |
with @code{alloca} exists until the containing @emph{function} returns. |
2354 |
The space for a variable-length array is deallocated as soon as the array |
2355 |
-name's scope ends. (If you use both variable-length arrays and |
2356 |
-@code{alloca} in the same function, deallocation of a variable-length array |
2357 |
-also deallocates anything more recently allocated with @code{alloca}.) |
2358 |
+name's scope ends, unless you also use @code{alloca} in this scope. |
2359 |
|
2360 |
You can also use variable-length arrays as arguments to functions: |
2361 |
|
2362 |
diff --git a/gcc/doc/generic.texi b/gcc/doc/generic.texi |
2363 |
index bbafad9..f6b4397 100644 |
2364 |
--- a/gcc/doc/generic.texi |
2365 |
+++ b/gcc/doc/generic.texi |
2366 |
@@ -1950,11 +1950,15 @@ this initialization replaces the @code{DECL_STMT}. These variables |
2367 |
will never require cleanups. The scope of these variables is just the |
2368 |
body |
2369 |
|
2370 |
-Variable-length arrays (VLAs) complicate this process, as their |
2371 |
-size often refers to variables initialized earlier in the block. |
2372 |
-To handle this, we currently split the block at that point, and |
2373 |
-move the VLA into a new, inner @code{BIND_EXPR}. This strategy |
2374 |
-may change in the future. |
2375 |
+Variable-length arrays (VLAs) complicate this process, as their size |
2376 |
+often refers to variables initialized earlier in the block and their |
2377 |
+initialization involves an explicit stack allocation. To handle this, |
2378 |
+we add an indirection and replace them with a pointer to stack space |
2379 |
+allocated by means of @code{alloca}. In most cases, we also arrange |
2380 |
+for this space to be reclaimed when the enclosing @code{BIND_EXPR} is |
2381 |
+exited, the exception to this being when there is an explicit call to |
2382 |
+@code{alloca} in the source code, in which case the stack is left |
2383 |
+depressed on exit of the @code{BIND_EXPR}. |
2384 |
|
2385 |
A C++ program will usually contain more @code{BIND_EXPR}s than |
2386 |
there are syntactic blocks in the source code, since several C++ |
2387 |
diff --git a/gcc/gimplify.c b/gcc/gimplify.c |
2388 |
index 7146a01..80c6bf2 100644 |
2389 |
--- a/gcc/gimplify.c |
2390 |
+++ b/gcc/gimplify.c |
2391 |
@@ -155,10 +155,11 @@ struct gimplify_ctx |
2392 |
hash_table<gimplify_hasher> *temp_htab; |
2393 |
|
2394 |
int conditions; |
2395 |
- bool save_stack; |
2396 |
- bool into_ssa; |
2397 |
- bool allow_rhs_cond_expr; |
2398 |
- bool in_cleanup_point_expr; |
2399 |
+ unsigned into_ssa : 1; |
2400 |
+ unsigned allow_rhs_cond_expr : 1; |
2401 |
+ unsigned in_cleanup_point_expr : 1; |
2402 |
+ unsigned keep_stack : 1; |
2403 |
+ unsigned save_stack : 1; |
2404 |
}; |
2405 |
|
2406 |
struct gimplify_omp_ctx |
2407 |
@@ -1080,6 +1081,7 @@ static enum gimplify_status |
2408 |
gimplify_bind_expr (tree *expr_p, gimple_seq *pre_p) |
2409 |
{ |
2410 |
tree bind_expr = *expr_p; |
2411 |
+ bool old_keep_stack = gimplify_ctxp->keep_stack; |
2412 |
bool old_save_stack = gimplify_ctxp->save_stack; |
2413 |
tree t; |
2414 |
gbind *bind_stmt; |
2415 |
@@ -1129,9 +1131,10 @@ gimplify_bind_expr (tree *expr_p, gimple_seq *pre_p) |
2416 |
} |
2417 |
|
2418 |
bind_stmt = gimple_build_bind (BIND_EXPR_VARS (bind_expr), NULL, |
2419 |
- BIND_EXPR_BLOCK (bind_expr)); |
2420 |
+ BIND_EXPR_BLOCK (bind_expr)); |
2421 |
gimple_push_bind_expr (bind_stmt); |
2422 |
|
2423 |
+ gimplify_ctxp->keep_stack = false; |
2424 |
gimplify_ctxp->save_stack = false; |
2425 |
|
2426 |
/* Gimplify the body into the GIMPLE_BIND tuple's body. */ |
2427 |
@@ -1154,7 +1157,10 @@ gimplify_bind_expr (tree *expr_p, gimple_seq *pre_p) |
2428 |
|
2429 |
cleanup = NULL; |
2430 |
stack_save = NULL; |
2431 |
- if (gimplify_ctxp->save_stack) |
2432 |
+ |
2433 |
+ /* If the code both contains VLAs and calls alloca, then we cannot reclaim |
2434 |
+ the stack space allocated to the VLAs. */ |
2435 |
+ if (gimplify_ctxp->save_stack && !gimplify_ctxp->keep_stack) |
2436 |
{ |
2437 |
gcall *stack_restore; |
2438 |
|
2439 |
@@ -1236,7 +1242,11 @@ gimplify_bind_expr (tree *expr_p, gimple_seq *pre_p) |
2440 |
gimple_bind_set_body (bind_stmt, new_body); |
2441 |
} |
2442 |
|
2443 |
+ /* keep_stack propagates all the way up to the outermost BIND_EXPR. */ |
2444 |
+ if (!gimplify_ctxp->keep_stack) |
2445 |
+ gimplify_ctxp->keep_stack = old_keep_stack; |
2446 |
gimplify_ctxp->save_stack = old_save_stack; |
2447 |
+ |
2448 |
gimple_pop_bind_expr (); |
2449 |
|
2450 |
gimplify_seq_add_stmt (pre_p, bind_stmt); |
2451 |
@@ -1393,10 +1403,6 @@ gimplify_vla_decl (tree decl, gimple_seq *seq_p) |
2452 |
t = build2 (MODIFY_EXPR, TREE_TYPE (addr), addr, t); |
2453 |
|
2454 |
gimplify_and_add (t, seq_p); |
2455 |
- |
2456 |
- /* Indicate that we need to restore the stack level when the |
2457 |
- enclosing BIND_EXPR is exited. */ |
2458 |
- gimplify_ctxp->save_stack = true; |
2459 |
} |
2460 |
|
2461 |
/* A helper function to be called via walk_tree. Mark all labels under *TP |
2462 |
@@ -2377,6 +2383,18 @@ gimplify_call_expr (tree *expr_p, gimple_seq *pre_p, bool want_value) |
2463 |
&& DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL) |
2464 |
switch (DECL_FUNCTION_CODE (fndecl)) |
2465 |
{ |
2466 |
+ case BUILT_IN_ALLOCA: |
2467 |
+ case BUILT_IN_ALLOCA_WITH_ALIGN: |
2468 |
+ /* If the call has been built for a variable-sized object, then we |
2469 |
+ want to restore the stack level when the enclosing BIND_EXPR is |
2470 |
+ exited to reclaim the allocated space; otherwise, we precisely |
2471 |
+ need to do the opposite and preserve the latest stack level. */ |
2472 |
+ if (CALL_ALLOCA_FOR_VAR_P (*expr_p)) |
2473 |
+ gimplify_ctxp->save_stack = true; |
2474 |
+ else |
2475 |
+ gimplify_ctxp->keep_stack = true; |
2476 |
+ break; |
2477 |
+ |
2478 |
case BUILT_IN_VA_START: |
2479 |
{ |
2480 |
builtin_va_start_p = TRUE; |
2481 |
|
2482 |
2015-12-04 Eric Botcazou <ebotcazou@×××××××.com> |
2483 |
|
2484 |
* gcc.dg/vla-24.c: New test. |
2485 |
|
2486 |
diff --git a/gcc/testsuite/gcc.dg/vla-24.c b/gcc/testsuite/gcc.dg/vla-24.c |
2487 |
new file mode 100644 |
2488 |
index 0000000..5bd5fed |
2489 |
--- /dev/null |
2490 |
+++ b/gcc/testsuite/gcc.dg/vla-24.c |
2491 |
@@ -0,0 +1,31 @@ |
2492 |
+/* PR middle-end/65958 */ |
2493 |
+ |
2494 |
+/* { dg-do run } */ |
2495 |
+/* { dg-options "-std=gnu99" } */ |
2496 |
+ |
2497 |
+extern void abort (void); |
2498 |
+ |
2499 |
+int foo (int n) |
2500 |
+{ |
2501 |
+ char *p, *q; |
2502 |
+ |
2503 |
+ if (1) |
2504 |
+ { |
2505 |
+ char i[n]; |
2506 |
+ p = __builtin_alloca (8); |
2507 |
+ p[0] = 1; |
2508 |
+ } |
2509 |
+ |
2510 |
+ q = __builtin_alloca (64); |
2511 |
+ __builtin_memset (q, 0, 64); |
2512 |
+ |
2513 |
+ return !p[0]; |
2514 |
+} |
2515 |
+ |
2516 |
+int main (void) |
2517 |
+{ |
2518 |
+ if (foo (48) != 0) |
2519 |
+ abort (); |
2520 |
+ |
2521 |
+ return 0; |
2522 |
+} |
2523 |
-- |
2524 |
2.6.2 |
2525 |
|
2526 |
|
2527 |
|
2528 |
|
2529 |
1.1 src/patchsets/gcc/5.3.0/gentoo/85_all_gcc5-aarch64-pr65689.patch |
2530 |
|
2531 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/5.3.0/gentoo/85_all_gcc5-aarch64-pr65689.patch?rev=1.1&view=markup |
2532 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/5.3.0/gentoo/85_all_gcc5-aarch64-pr65689.patch?rev=1.1&content-type=text/plain |
2533 |
|
2534 |
Index: 85_all_gcc5-aarch64-pr65689.patch |
2535 |
=================================================================== |
2536 |
https://gcc.gnu.org/PR65689 |
2537 |
|
2538 |
2015-04-17 Jakub Jelinek <jakub@××××××.com> |
2539 |
|
2540 |
PR target/65689 |
2541 |
* genpreds.c (struct constraint_data): Add maybe_allows_reg and |
2542 |
maybe_allows_mem bitfields. |
2543 |
(maybe_allows_none_start, maybe_allows_none_end, |
2544 |
maybe_allows_reg_start, maybe_allows_reg_end, maybe_allows_mem_start, |
2545 |
maybe_allows_mem_end): New variables. |
2546 |
(compute_maybe_allows): New function. |
2547 |
(add_constraint): Use it to initialize maybe_allows_reg and |
2548 |
maybe_allows_mem fields. |
2549 |
(choose_enum_order): Sort the non-is_register/is_const_int/is_memory/ |
2550 |
is_address constraints such that those that allow neither mem nor |
2551 |
reg come first, then those that only allow reg but not mem, then |
2552 |
those that only allow mem but not reg, then the rest. |
2553 |
(write_allows_reg_mem_function): New function. |
2554 |
(write_tm_preds_h): Call it. |
2555 |
* stmt.c (parse_output_constraint, parse_input_constraint): Use |
2556 |
the generated insn_extra_constraint_allows_reg_mem function |
2557 |
instead of always setting *allows_reg = true; *allows_mem = true; |
2558 |
for unknown extra constraints. |
2559 |
|
2560 |
* gcc.target/aarch64/c-output-template-4.c: New test. |
2561 |
|
2562 |
--- gcc/genpreds.c.jj 2015-04-08 18:23:50.643556230 +0200 |
2563 |
+++ gcc/genpreds.c 2015-04-17 17:44:23.097650110 +0200 |
2564 |
@@ -640,12 +640,14 @@ struct constraint_data |
2565 |
const char *regclass; /* for register constraints */ |
2566 |
rtx exp; /* for other constraints */ |
2567 |
unsigned int lineno; /* line of definition */ |
2568 |
- unsigned int is_register : 1; |
2569 |
- unsigned int is_const_int : 1; |
2570 |
- unsigned int is_const_dbl : 1; |
2571 |
- unsigned int is_extra : 1; |
2572 |
- unsigned int is_memory : 1; |
2573 |
- unsigned int is_address : 1; |
2574 |
+ unsigned int is_register : 1; |
2575 |
+ unsigned int is_const_int : 1; |
2576 |
+ unsigned int is_const_dbl : 1; |
2577 |
+ unsigned int is_extra : 1; |
2578 |
+ unsigned int is_memory : 1; |
2579 |
+ unsigned int is_address : 1; |
2580 |
+ unsigned int maybe_allows_reg : 1; |
2581 |
+ unsigned int maybe_allows_mem : 1; |
2582 |
}; |
2583 |
|
2584 |
/* Overview of all constraints beginning with a given letter. */ |
2585 |
@@ -691,6 +693,9 @@ static unsigned int satisfied_start; |
2586 |
static unsigned int const_int_start, const_int_end; |
2587 |
static unsigned int memory_start, memory_end; |
2588 |
static unsigned int address_start, address_end; |
2589 |
+static unsigned int maybe_allows_none_start, maybe_allows_none_end; |
2590 |
+static unsigned int maybe_allows_reg_start, maybe_allows_reg_end; |
2591 |
+static unsigned int maybe_allows_mem_start, maybe_allows_mem_end; |
2592 |
|
2593 |
/* Convert NAME, which contains angle brackets and/or underscores, to |
2594 |
a string that can be used as part of a C identifier. The string |
2595 |
@@ -711,6 +716,34 @@ mangle (const char *name) |
2596 |
return XOBFINISH (rtl_obstack, const char *); |
2597 |
} |
2598 |
|
2599 |
+/* Return a bitmask, bit 1 if EXP maybe allows a REG/SUBREG, 2 if EXP |
2600 |
+ maybe allows a MEM. Bits should be clear only when we are sure it |
2601 |
+ will not allow a REG/SUBREG or a MEM. */ |
2602 |
+static int |
2603 |
+compute_maybe_allows (rtx exp) |
2604 |
+{ |
2605 |
+ switch (GET_CODE (exp)) |
2606 |
+ { |
2607 |
+ case IF_THEN_ELSE: |
2608 |
+ /* Conservative answer is like IOR, of the THEN and ELSE branches. */ |
2609 |
+ return compute_maybe_allows (XEXP (exp, 1)) |
2610 |
+ | compute_maybe_allows (XEXP (exp, 2)); |
2611 |
+ case AND: |
2612 |
+ return compute_maybe_allows (XEXP (exp, 0)) |
2613 |
+ & compute_maybe_allows (XEXP (exp, 1)); |
2614 |
+ case IOR: |
2615 |
+ return compute_maybe_allows (XEXP (exp, 0)) |
2616 |
+ | compute_maybe_allows (XEXP (exp, 1)); |
2617 |
+ case MATCH_CODE: |
2618 |
+ if (*XSTR (exp, 1) == '\0') |
2619 |
+ return (strstr (XSTR (exp, 0), "reg") != NULL ? 1 : 0) |
2620 |
+ | (strstr (XSTR (exp, 0), "mem") != NULL ? 2 : 0); |
2621 |
+ /* FALLTHRU */ |
2622 |
+ default: |
2623 |
+ return 3; |
2624 |
+ } |
2625 |
+} |
2626 |
+ |
2627 |
/* Add one constraint, of any sort, to the tables. NAME is its name; |
2628 |
REGCLASS is the register class, if any; EXP is the expression to |
2629 |
test, if any; IS_MEMORY and IS_ADDRESS indicate memory and address |
2630 |
@@ -866,6 +899,11 @@ add_constraint (const char *name, const |
2631 |
c->is_extra = !(regclass || is_const_int || is_const_dbl); |
2632 |
c->is_memory = is_memory; |
2633 |
c->is_address = is_address; |
2634 |
+ int maybe_allows = 3; |
2635 |
+ if (exp) |
2636 |
+ maybe_allows = compute_maybe_allows (exp); |
2637 |
+ c->maybe_allows_reg = (maybe_allows & 1) != 0; |
2638 |
+ c->maybe_allows_mem = (maybe_allows & 2) != 0; |
2639 |
|
2640 |
c->next_this_letter = *slot; |
2641 |
*slot = c; |
2642 |
@@ -940,8 +978,30 @@ choose_enum_order (void) |
2643 |
enum_order[next++] = c; |
2644 |
address_end = next; |
2645 |
|
2646 |
+ maybe_allows_none_start = next; |
2647 |
+ FOR_ALL_CONSTRAINTS (c) |
2648 |
+ if (!c->is_register && !c->is_const_int && !c->is_memory && !c->is_address |
2649 |
+ && !c->maybe_allows_reg && !c->maybe_allows_mem) |
2650 |
+ enum_order[next++] = c; |
2651 |
+ maybe_allows_none_end = next; |
2652 |
+ |
2653 |
+ maybe_allows_reg_start = next; |
2654 |
+ FOR_ALL_CONSTRAINTS (c) |
2655 |
+ if (!c->is_register && !c->is_const_int && !c->is_memory && !c->is_address |
2656 |
+ && c->maybe_allows_reg && !c->maybe_allows_mem) |
2657 |
+ enum_order[next++] = c; |
2658 |
+ maybe_allows_reg_end = next; |
2659 |
+ |
2660 |
+ maybe_allows_mem_start = next; |
2661 |
+ FOR_ALL_CONSTRAINTS (c) |
2662 |
+ if (!c->is_register && !c->is_const_int && !c->is_memory && !c->is_address |
2663 |
+ && !c->maybe_allows_reg && c->maybe_allows_mem) |
2664 |
+ enum_order[next++] = c; |
2665 |
+ maybe_allows_mem_end = next; |
2666 |
+ |
2667 |
FOR_ALL_CONSTRAINTS (c) |
2668 |
- if (!c->is_register && !c->is_const_int && !c->is_memory && !c->is_address) |
2669 |
+ if (!c->is_register && !c->is_const_int && !c->is_memory && !c->is_address |
2670 |
+ && c->maybe_allows_reg && c->maybe_allows_mem) |
2671 |
enum_order[next++] = c; |
2672 |
gcc_assert (next == num_constraints); |
2673 |
} |
2674 |
@@ -1229,6 +1289,41 @@ write_range_function (const char *name, |
2675 |
"}\n\n", name); |
2676 |
} |
2677 |
|
2678 |
+/* Write a definition for insn_extra_constraint_allows_reg_mem function. */ |
2679 |
+static void |
2680 |
+write_allows_reg_mem_function (void) |
2681 |
+{ |
2682 |
+ printf ("static inline void\n" |
2683 |
+ "insn_extra_constraint_allows_reg_mem (enum constraint_num c,\n" |
2684 |
+ "\t\t\t\t bool *allows_reg, bool *allows_mem)\n" |
2685 |
+ "{\n"); |
2686 |
+ if (maybe_allows_none_start != maybe_allows_none_end) |
2687 |
+ printf (" if (c >= CONSTRAINT_%s && c <= CONSTRAINT_%s)\n" |
2688 |
+ " return;\n", |
2689 |
+ enum_order[maybe_allows_none_start]->c_name, |
2690 |
+ enum_order[maybe_allows_none_end - 1]->c_name); |
2691 |
+ if (maybe_allows_reg_start != maybe_allows_reg_end) |
2692 |
+ printf (" if (c >= CONSTRAINT_%s && c <= CONSTRAINT_%s)\n" |
2693 |
+ " {\n" |
2694 |
+ " *allows_reg = true;\n" |
2695 |
+ " return;\n" |
2696 |
+ " }\n", |
2697 |
+ enum_order[maybe_allows_reg_start]->c_name, |
2698 |
+ enum_order[maybe_allows_reg_end - 1]->c_name); |
2699 |
+ if (maybe_allows_mem_start != maybe_allows_mem_end) |
2700 |
+ printf (" if (c >= CONSTRAINT_%s && c <= CONSTRAINT_%s)\n" |
2701 |
+ " {\n" |
2702 |
+ " *allows_mem = true;\n" |
2703 |
+ " return;\n" |
2704 |
+ " }\n", |
2705 |
+ enum_order[maybe_allows_mem_start]->c_name, |
2706 |
+ enum_order[maybe_allows_mem_end - 1]->c_name); |
2707 |
+ printf (" (void) c;\n" |
2708 |
+ " *allows_reg = true;\n" |
2709 |
+ " *allows_mem = true;\n" |
2710 |
+ "}\n\n"); |
2711 |
+} |
2712 |
+ |
2713 |
/* VEC is a list of key/value pairs, with the keys being lower bounds |
2714 |
of a range. Output a decision tree that handles the keys covered by |
2715 |
[VEC[START], VEC[END]), returning FALLBACK for keys lower then VEC[START]'s. |
2716 |
@@ -1326,6 +1421,7 @@ write_tm_preds_h (void) |
2717 |
memory_start, memory_end); |
2718 |
write_range_function ("insn_extra_address_constraint", |
2719 |
address_start, address_end); |
2720 |
+ write_allows_reg_mem_function (); |
2721 |
|
2722 |
if (constraint_max_namelen > 1) |
2723 |
{ |
2724 |
--- gcc/stmt.c.jj 2015-04-08 18:23:50.660555956 +0200 |
2725 |
+++ gcc/stmt.c 2015-04-17 17:36:50.623044548 +0200 |
2726 |
@@ -342,13 +342,7 @@ parse_output_constraint (const char **co |
2727 |
else if (insn_extra_memory_constraint (cn)) |
2728 |
*allows_mem = true; |
2729 |
else |
2730 |
- { |
2731 |
- /* Otherwise we can't assume anything about the nature of |
2732 |
- the constraint except that it isn't purely registers. |
2733 |
- Treat it like "g" and hope for the best. */ |
2734 |
- *allows_reg = true; |
2735 |
- *allows_mem = true; |
2736 |
- } |
2737 |
+ insn_extra_constraint_allows_reg_mem (cn, allows_reg, allows_mem); |
2738 |
break; |
2739 |
} |
2740 |
|
2741 |
@@ -465,13 +459,7 @@ parse_input_constraint (const char **con |
2742 |
else if (insn_extra_memory_constraint (cn)) |
2743 |
*allows_mem = true; |
2744 |
else |
2745 |
- { |
2746 |
- /* Otherwise we can't assume anything about the nature of |
2747 |
- the constraint except that it isn't purely registers. |
2748 |
- Treat it like "g" and hope for the best. */ |
2749 |
- *allows_reg = true; |
2750 |
- *allows_mem = true; |
2751 |
- } |
2752 |
+ insn_extra_constraint_allows_reg_mem (cn, allows_reg, allows_mem); |
2753 |
break; |
2754 |
} |
2755 |
|
2756 |
--- gcc/testsuite/gcc.target/aarch64/c-output-template-4.c.jj 2015-04-17 17:48:27.588654584 +0200 |
2757 |
+++ gcc/testsuite/gcc.target/aarch64/c-output-template-4.c 2015-04-17 17:48:22.149743468 +0200 |
2758 |
@@ -0,0 +1,10 @@ |
2759 |
+/* { dg-do compile } */ |
2760 |
+/* { dg-options "-O0" } */ |
2761 |
+ |
2762 |
+void |
2763 |
+test (void) |
2764 |
+{ |
2765 |
+ __asm__ ("@ %c0" : : "S" (&test + 4)); |
2766 |
+} |
2767 |
+ |
2768 |
+/* { dg-final { scan-assembler "@ test\\+4" } } */ |
2769 |
|
2770 |
|
2771 |
|
2772 |
1.1 src/patchsets/gcc/5.3.0/gentoo/90_all_pr55930-dependency-tracking.patch |
2773 |
|
2774 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/5.3.0/gentoo/90_all_pr55930-dependency-tracking.patch?rev=1.1&view=markup |
2775 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/5.3.0/gentoo/90_all_pr55930-dependency-tracking.patch?rev=1.1&content-type=text/plain |
2776 |
|
2777 |
Index: 90_all_pr55930-dependency-tracking.patch |
2778 |
=================================================================== |
2779 |
libatomic build failure if configured with --disable-dependency-tracking |
2780 |
load_n.c:115:1: fatal error: opening dependency file .deps/load_1_.lo.Ppo: No such file or directory |
2781 |
|
2782 |
https://bugs.gentoo.org/463463 |
2783 |
http://gcc.gnu.org/PR55930 |
2784 |
|
2785 |
--- a/libatomic/Makefile.in |
2786 |
+++ b/libatomic/Makefile.in |
2787 |
@@ -298,7 +298,8 @@ PAT_N = $(word 2,$(PAT_SPLIT)) |
2788 |
PAT_S = $(word 3,$(PAT_SPLIT)) |
2789 |
IFUNC_DEF = -DIFUNC_ALT=$(PAT_S) |
2790 |
IFUNC_OPT = $(word $(PAT_S),$(IFUNC_OPTIONS)) |
2791 |
-M_DEPS = -MT $@ -MD -MP -MF $(DEPDIR)/$(@F).Ppo |
2792 |
+@AMDEP_TRUE@M_DEPS = -MT $@ -MD -MP -MF $(DEPDIR)/$(@F).Ppo |
2793 |
+@AMDEP_FALSE@M_DEPS = |
2794 |
M_SIZE = -DN=$(PAT_N) |
2795 |
M_IFUNC = $(if $(PAT_S),$(IFUNC_DEF) $(IFUNC_OPT)) |
2796 |
M_FILE = $(PAT_BASE)_n.c |
2797 |
|
2798 |
|
2799 |
|
2800 |
1.1 src/patchsets/gcc/5.3.0/gentoo/README.history |
2801 |
|
2802 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/5.3.0/gentoo/README.history?rev=1.1&view=markup |
2803 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/5.3.0/gentoo/README.history?rev=1.1&content-type=text/plain |
2804 |
|
2805 |
Index: README.history |
2806 |
=================================================================== |
2807 |
1.0 05 Dec 2015 |
2808 |
+ 05_all_gcc-spec-env.patch |
2809 |
+ 09_all_default-ssp.patch |
2810 |
+ 10_all_default-fortify-source.patch |
2811 |
+ 11_all_default-warn-format-security.patch |
2812 |
+ 12_all_default-warn-trampolines.patch |
2813 |
+ 20_all_msgfmt-libstdc++-link.patch |
2814 |
+ 25_all_alpha-mieee-default.patch |
2815 |
+ 26_all_alpha-asm-mcpu.patch |
2816 |
+ 29_all_arm_armv4t-default.patch |
2817 |
+ 34_all_ia64_note.GNU-stack.patch |
2818 |
+ 34_all_libjava-classpath-locale-sort.patch |
2819 |
+ 38_all_sh_pr24836_all-archs.patch |
2820 |
+ 42_all_superh_default-multilib.patch |
2821 |
+ 50_all_libiberty-asprintf.patch |
2822 |
+ 51_all_libiberty-pic.patch |
2823 |
+ 52_all_netbsd-Bsymbolic.patch |
2824 |
+ 53_all_libitm-no-fortify-source.patch |
2825 |
+ 67_all_gcc-poison-system-directories.patch |
2826 |
+ 70_all_gcc-5-pr546752.patch |
2827 |
+ 74_all_gcc5_isl-dl.patch |
2828 |
+ 77_all_gcc-5-pr65958.patch |
2829 |
+ 85_all_gcc5-aarch64-pr65689.patch |
2830 |
+ 90_all_pr55930-dependency-tracking.patch |