Gentoo Archives: gentoo-commits

From: "Ryan Hill (dirtyepic)" <dirtyepic@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo commit in src/patchsets/gcc/4.7.0/gentoo: 74_all_gcc46_cloog-dl.patch 74_all_gcc47_cloog-dl.patch 76_all_4.7.0_c-family-headers.patch README.history
Date: Sun, 20 May 2012 05:40:37
Message-Id: 20120520054025.C6A2B2004B@flycatcher.gentoo.org
1 dirtyepic 12/05/20 05:40:25
2
3 Modified: README.history
4 Added: 74_all_gcc47_cloog-dl.patch
5 Removed: 74_all_gcc46_cloog-dl.patch
6 76_all_4.7.0_c-family-headers.patch
7 Log:
8 Finish up patch porting.
9
10 Revision Changes Path
11 1.4 src/patchsets/gcc/4.7.0/gentoo/README.history
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.0/gentoo/README.history?rev=1.4&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.0/gentoo/README.history?rev=1.4&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.0/gentoo/README.history?r1=1.3&r2=1.4
16
17 Index: README.history
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo/src/patchsets/gcc/4.7.0/gentoo/README.history,v
20 retrieving revision 1.3
21 retrieving revision 1.4
22 diff -u -r1.3 -r1.4
23 --- README.history 15 May 2012 05:46:17 -0000 1.3
24 +++ README.history 20 May 2012 05:40:25 -0000 1.4
25 @@ -14,6 +14,5 @@
26 + 50_all_libiberty-asprintf.patch
27 + 51_all_libiberty-pic.patch
28 + 52_all_netbsd-Bsymbolic.patch
29 - + 74_all_gcc46_cloog-dl.patch
30 - + 76_all_4.7.0_c-family-headers.patch
31 + + 74_all_gcc47_cloog-dl.patch
32 + 92_all_freebsd-pie.patch
33
34
35
36 1.1 src/patchsets/gcc/4.7.0/gentoo/74_all_gcc47_cloog-dl.patch
37
38 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.0/gentoo/74_all_gcc47_cloog-dl.patch?rev=1.1&view=markup
39 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.0/gentoo/74_all_gcc47_cloog-dl.patch?rev=1.1&content-type=text/plain
40
41 Index: 74_all_gcc47_cloog-dl.patch
42 ===================================================================
43 2011-01-04 Jakub Jelinek <jakub@××××××.com>
44
45 * Makefile.in (BACKENDLIBS): Link against -ldl instead of
46 -lcloog -lppl.
47 (graphite.o, graphite%.o): Force -O, remove -fkeep-inline-functions.
48 (GRAPHITE_CLOOG_UTIL_H, GRAPHITE_POLY_H): New.
49 (graphite*.o): Adjust dependencies.
50 * graphite-cloog-compat.h: Include <dlfcn.h>. Reference libcloog and
51 libppl symbols through pointers in cloog_pointers__ variable.
52 * graphite.c (init_cloog_pointers): New function.
53 (graphite_transform_loops): Call init_cloog_pointers.
54 * graphite-clast-to-gimple.c (gcc_type_for_iv_of_clast_loop): Rename
55 stmt_for argument to stmt_fora.
56 * graphite-poly.h: Include graphite-cloog-util.h.
57
58 2012-05-19 Ryan Hill <dirtyepic@g.o>
59
60 * configure.ac (DL_LIB): Check how to dlopen.
61 * configure: Regenerate.
62 * Makefile.in (BACKENDLIBS): Use DL_LIB.
63
64
65 --- a/gcc/Makefile.in
66 +++ b/gcc/Makefile.in
67 @@ -963,6 +963,8 @@ GCC_PLUGIN_H = gcc-plugin.h highlev-plugin-common.h $(CONFIG_H) $(SYSTEM_H) \
68 PLUGIN_H = plugin.h $(GCC_PLUGIN_H)
69 PLUGIN_VERSION_H = plugin-version.h configargs.h
70 LIBFUNCS_H = libfuncs.h $(HASHTAB_H)
71 +GRAPHITE_CLOOG_UTIL_H = graphite-cloog-util.h graphite-cloog-compat.h
72 +GRAPHITE_POLY_H = graphite-poly.h $(GRAPHITE_CLOOG_UTIL_H)
73
74 #
75 # Now figure out from those variables how to compile and link.
76 @@ -1017,7 +1019,7 @@ BUILD_LIBDEPS= $(BUILD_LIBIBERTY)
77 # and the system's installed libraries.
78 LIBS = @LIBS@ libcommon.a $(CPPLIB) $(LIBINTL) $(LIBICONV) $(LIBIBERTY) \
79 $(LIBDECNUMBER) $(HOST_LIBS)
80 -BACKENDLIBS = $(CLOOGLIBS) $(PPLLIBS) $(GMPLIBS) $(PLUGINLIBS) $(HOST_LIBS) \
81 +BACKENDLIBS = $(GMPLIBS) $(if $(CLOOGLIBS),@DL_LIB@) $(PLUGINLIBS) $(HOST_LIBS) \
82 $(ZLIB)
83 # Any system libraries needed just for GNAT.
84 SYSLIBS = @GNAT_LIBEXC@
85 @@ -2603,40 +2605,40 @@ sese.o : sese.c sese.h $(CONFIG_H) $(SYSTEM_H) coretypes.h tree-pretty-print.h \
86 $(TREE_FLOW_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) tree-pass.h value-prof.h
87 graphite.o : graphite.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(DIAGNOSTIC_CORE_H) \
88 $(TREE_FLOW_H) $(TREE_DUMP_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) sese.h \
89 - $(DBGCNT_H) graphite-ppl.h graphite-poly.h graphite-scop-detection.h \
90 + $(DBGCNT_H) graphite-ppl.h $(GRAPHITE_POLY_H) graphite-scop-detection.h \
91 graphite-clast-to-gimple.h graphite-sese-to-poly.h
92 graphite-blocking.o : graphite-blocking.c $(CONFIG_H) $(SYSTEM_H) \
93 coretypes.h $(TREE_FLOW_H) $(TREE_DUMP_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) \
94 - sese.h graphite-ppl.h graphite-poly.h
95 + sese.h graphite-ppl.h $(GRAPHITE_POLY_H)
96 graphite-clast-to-gimple.o : graphite-clast-to-gimple.c $(CONFIG_H) \
97 $(SYSTEM_H) coretypes.h $(DIAGNOSTIC_CORE_H) $(TREE_FLOW_H) $(TREE_DUMP_H) \
98 - $(CFGLOOP_H) $(TREE_DATA_REF_H) sese.h graphite-cloog-util.h \
99 - graphite-ppl.h graphite-poly.h graphite-clast-to-gimple.h \
100 + $(CFGLOOP_H) $(TREE_DATA_REF_H) sese.h $(GRAPHITE_CLOOG_UTIL_H) \
101 + graphite-ppl.h $(GRAPHITE_POLY_H) graphite-clast-to-gimple.h \
102 graphite-dependences.h graphite-cloog-compat.h
103 graphite-cloog-util.o : graphite-cloog-util.c $(CONFIG_H) $(SYSTEM_H) \
104 - coretypes.h graphite-cloog-util.h graphite-cloog-compat.h
105 + coretypes.h $(GRAPHITE_CLOOG_UTIL_H) graphite-cloog-compat.h
106 graphite-dependences.o : graphite-dependences.c $(CONFIG_H) $(SYSTEM_H) \
107 coretypes.h $(TREE_FLOW_H) $(TREE_DUMP_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) \
108 - sese.h graphite-ppl.h graphite-poly.h graphite-dependences.h \
109 - graphite-cloog-util.h
110 + sese.h graphite-ppl.h $(GRAPHITE_POLY_H) graphite-dependences.h \
111 + $(GRAPHITE_CLOOG_UTIL_H)
112 graphite-flattening.o : graphite-flattening.c $(CONFIG_H) $(SYSTEM_H) \
113 coretypes.h $(TREE_FLOW_H) $(TREE_DUMP_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) \
114 - sese.h graphite-ppl.h graphite-poly.h
115 + sese.h graphite-ppl.h $(GRAPHITE_POLY_H)
116 graphite-interchange.o : graphite-interchange.c $(CONFIG_H) $(SYSTEM_H) \
117 coretypes.h $(TREE_FLOW_H) $(TREE_DUMP_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) \
118 - sese.h graphite-ppl.h graphite-poly.h
119 + sese.h graphite-ppl.h $(GRAPHITE_POLY_H)
120 graphite-poly.o : graphite-poly.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
121 $(DIAGNOSTIC_CORE_H) $(TREE_FLOW_H) $(TREE_DUMP_H) gimple-pretty-print.h \
122 - $(CFGLOOP_H) $(TREE_DATA_REF_H) sese.h graphite-ppl.h graphite-poly.h \
123 - graphite-dependences.h graphite-cloog-util.h
124 + $(CFGLOOP_H) $(TREE_DATA_REF_H) sese.h graphite-ppl.h $(GRAPHITE_POLY_H) \
125 + graphite-dependences.h $(GRAPHITE_CLOOG_UTIL_H)
126 graphite-ppl.o : graphite-ppl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
127 - graphite-cloog-util.h graphite-ppl.h
128 + $(GRAPHITE_CLOOG_UTIL_H) graphite-ppl.h
129 graphite-scop-detection.o : graphite-scop-detection.c $(CONFIG_H) $(SYSTEM_H) \
130 coretypes.h $(TREE_FLOW_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) $(TREE_PASS_H) \
131 - sese.h graphite-ppl.h graphite-poly.h graphite-scop-detection.h
132 + sese.h graphite-ppl.h $(GRAPHITE_POLY_H) graphite-scop-detection.h
133 graphite-sese-to-poly.o : graphite-sese-to-poly.c $(CONFIG_H) \
134 $(SYSTEM_H) coretypes.h $(TREE_FLOW_H) $(TREE_DUMP_H) $(CFGLOOP_H) \
135 - $(TREE_DATA_REF_H) domwalk.h sese.h graphite-ppl.h graphite-poly.h \
136 + $(TREE_DATA_REF_H) domwalk.h sese.h graphite-ppl.h $(GRAPHITE_POLY_H) \
137 graphite-sese-to-poly.h
138 tree-vect-loop.o: tree-vect-loop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
139 $(TM_H) $(GGC_H) $(TREE_H) $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) $(TREE_FLOW_H) \
140 @@ -3455,6 +3457,15 @@ $(common_out_object_file): $(common_out_file) $(CONFIG_H) $(SYSTEM_H) \
141 $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) \
142 $< $(OUTPUT_OPTION)
143
144 +graphite%.o : \
145 + ALL_CFLAGS := -O $(filter-out -fkeep-inline-functions, $(ALL_CFLAGS))
146 +graphite.o : \
147 + ALL_CFLAGS := -O $(filter-out -fkeep-inline-functions, $(ALL_CFLAGS))
148 +graphite%.o : \
149 + ALL_CXXFLAGS := -O $(filter-out -fkeep-inline-functions, $(ALL_CXXFLAGS))
150 +graphite.o : \
151 + ALL_CXXFLAGS := -O $(filter-out -fkeep-inline-functions, $(ALL_CXXFLAGS))
152 +
153 # Build auxiliary files that support ecoff format.
154 mips-tfile: mips-tfile.o $(LIBDEPS)
155 $(LINKER) $(LINKERFLAGS) $(LDFLAGS) -o $@ \
156 --- a/gcc/configure
157 +++ b/gcc/configure
158 @@ -602,6 +602,7 @@ ac_subst_vars='LTLIBOBJS
159 LIBOBJS
160 enable_plugin
161 pluginlibs
162 +DL_LIB
163 CLOOGINC
164 CLOOGLIBS
165 PPLINC
166 @@ -27236,6 +27237,7 @@ $as_echo "unable to check" >&6; }
167 fi
168
169 # Check -ldl
170 + DL_LIB=
171 saved_LIBS="$LIBS"
172 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5
173 $as_echo_n "checking for library containing dlopen... " >&6; }
174 @@ -27295,7 +27297,9 @@ fi
175
176 if test x"$ac_cv_search_dlopen" = x"-ldl"; then
177 pluginlibs="$pluginlibs -ldl"
178 + DL_LIB=$ac_cv_search_dlopen
179 fi
180 +
181 LIBS="$saved_LIBS"
182
183 # Check that we can build shared objects with -fPIC -shared
184 --- a/gcc/configure.ac
185 +++ b/gcc/configure.ac
186 @@ -5109,11 +5109,14 @@ if test x"$enable_plugin" = x"yes"; then
187 fi
188
189 # Check -ldl
190 + DL_LIB=
191 saved_LIBS="$LIBS"
192 AC_SEARCH_LIBS([dlopen], [dl])
193 if test x"$ac_cv_search_dlopen" = x"-ldl"; then
194 pluginlibs="$pluginlibs -ldl"
195 + DL_LIB=$ac_cv_search_dlopen
196 fi
197 + AC_SUBST(DL_LIB)
198 LIBS="$saved_LIBS"
199
200 # Check that we can build shared objects with -fPIC -shared
201 --- a/gcc/graphite-clast-to-gimple.c
202 +++ b/gcc/graphite-clast-to-gimple.c
203 @@ -836,7 +836,7 @@ clast_get_body_of_loop (struct clast_stmt *stmt)
204 from STMT_FOR. */
205
206 static tree
207 -type_for_clast_for (struct clast_for *stmt_for, ivs_params_p ip)
208 +type_for_clast_for (struct clast_for *stmt_fora, ivs_params_p ip)
209 {
210 mpz_t bound_one, bound_two;
211 tree lb_type, ub_type;
212 @@ -844,8 +844,8 @@ type_for_clast_for (struct clast_for *stmt_for, ivs_params_p ip)
213 mpz_init (bound_one);
214 mpz_init (bound_two);
215
216 - lb_type = type_for_clast_expr (stmt_for->LB, ip, bound_one, bound_two);
217 - ub_type = type_for_clast_expr (stmt_for->UB, ip, bound_one, bound_two);
218 + lb_type = type_for_clast_expr (stmt_fora->LB, ip, bound_one, bound_two);
219 + ub_type = type_for_clast_expr (stmt_fora->UB, ip, bound_one, bound_two);
220
221 mpz_clear (bound_one);
222 mpz_clear (bound_two);
223 --- a/gcc/graphite-cloog-compat.h
224 +++ b/gcc/graphite-cloog-compat.h
225 @@ -272,4 +272,279 @@ static inline int cloog_matrix_nrows (CloogMatrix * m)
226 return m->NbRows;
227 }
228 #endif /* CLOOG_ORG */
229 +
230 +#include <dlfcn.h>
231 +#if PPL_VERSION_MAJOR == 0 && PPL_VERSION_MINOR < 11
232 +#define DYNSYMS_PPL11
233 +#else
234 +#define DYNSYMS_PPL11 \
235 + DYNSYM (ppl_new_PIP_Problem_from_constraints); \
236 + DYNSYM (ppl_PIP_Problem_is_satisfiable); \
237 + DYNSYM (ppl_delete_PIP_Problem);
238 +#endif
239 +#define DYNSYMS \
240 + DYNSYM (cloog_block_alloc); \
241 + DYNSYM (cloog_block_list_free); \
242 + DYNSYM (cloog_block_list_malloc); \
243 + DYNSYM (cloog_clast_create); \
244 + DYNSYM (cloog_clast_free); \
245 + DYNSYM (cloog_domain_free); \
246 + DYNSYM (cloog_domain_matrix2domain); \
247 + DYNSYM (cloog_initialize); \
248 + DYNSYM (cloog_loop_malloc); \
249 + DYNSYM (cloog_matrix_alloc); \
250 + DYNSYM (cloog_matrix_copy); \
251 + DYNSYM (cloog_matrix_free); \
252 + DYNSYM (cloog_matrix_print); \
253 + DYNSYM (cloog_names_malloc); \
254 + DYNSYM (cloog_names_scalarize); \
255 + DYNSYM (cloog_options_free); \
256 + DYNSYM (cloog_options_malloc); \
257 + DYNSYM (cloog_program_dump_cloog); \
258 + DYNSYM (cloog_program_extract_scalars); \
259 + DYNSYM (cloog_program_free); \
260 + DYNSYM (cloog_program_generate); \
261 + DYNSYM (cloog_program_malloc); \
262 + DYNSYM (cloog_program_print); \
263 + DYNSYM (cloog_program_scatter); \
264 + DYNSYM (cloog_statement_alloc); \
265 + DYNSYM (cloog_domain_union); \
266 + DYNSYM (cloog_matrix_read); \
267 + DYNSYM (cloog_new_pol); \
268 + DYNSYM (cloog_vector_gcd); \
269 + DYNSYM (ppl_finalize); \
270 + DYNSYM (ppl_assign_Coefficient_from_mpz_t); \
271 + DYNSYM (ppl_assign_Linear_Expression_from_Linear_Expression); \
272 + DYNSYM (ppl_Coefficient_to_mpz_t); \
273 + DYNSYM (ppl_Constraint_coefficient); \
274 + DYNSYM (ppl_Constraint_inhomogeneous_term); \
275 + DYNSYM (ppl_Constraint_space_dimension); \
276 + DYNSYM (ppl_Constraint_System_begin); \
277 + DYNSYM (ppl_Constraint_System_const_iterator_dereference); \
278 + DYNSYM (ppl_Constraint_System_const_iterator_equal_test); \
279 + DYNSYM (ppl_Constraint_System_const_iterator_increment); \
280 + DYNSYM (ppl_Constraint_System_end); \
281 + DYNSYM (ppl_Constraint_System_insert_Constraint); \
282 + DYNSYM (ppl_Constraint_System_space_dimension); \
283 + DYNSYM (ppl_Constraint_type); \
284 + DYNSYM (ppl_delete_Coefficient); \
285 + DYNSYM (ppl_delete_Constraint); \
286 + DYNSYM (ppl_delete_Constraint_System_const_iterator); \
287 + DYNSYM (ppl_delete_Linear_Expression); \
288 + DYNSYM (ppl_delete_Pointset_Powerset_C_Polyhedron); \
289 + DYNSYM (ppl_delete_Pointset_Powerset_C_Polyhedron_iterator); \
290 + DYNSYM (ppl_delete_Polyhedron); \
291 + DYNSYM (ppl_Linear_Expression_add_to_coefficient); \
292 + DYNSYM (ppl_Linear_Expression_add_to_inhomogeneous); \
293 + DYNSYM (ppl_Linear_Expression_coefficient); \
294 + DYNSYM (ppl_Linear_Expression_inhomogeneous_term); \
295 + DYNSYM (ppl_Linear_Expression_space_dimension); \
296 + DYNSYM (ppl_new_Coefficient); \
297 + DYNSYM (ppl_new_Coefficient_from_mpz_t); \
298 + DYNSYM (ppl_new_Constraint); \
299 + DYNSYM (ppl_new_Constraint_System); \
300 + DYNSYM (ppl_new_Constraint_System_const_iterator); \
301 + DYNSYM (ppl_new_C_Polyhedron_from_C_Polyhedron); \
302 + DYNSYM (ppl_new_C_Polyhedron_from_space_dimension); \
303 + DYNSYM (ppl_new_C_Polyhedron_recycle_Constraint_System); \
304 + DYNSYM (ppl_new_Linear_Expression); \
305 + DYNSYM (ppl_new_Linear_Expression_from_Constraint); \
306 + DYNSYM (ppl_new_Linear_Expression_from_Linear_Expression); \
307 + DYNSYM (ppl_new_Linear_Expression_with_dimension); \
308 + DYNSYM (ppl_new_Pointset_Powerset_C_Polyhedron_from_C_Polyhedron); \
309 + DYNSYM (ppl_new_Pointset_Powerset_C_Polyhedron_from_Pointset_Powerset_C_Polyhedron); \
310 + DYNSYM (ppl_new_Pointset_Powerset_C_Polyhedron_from_space_dimension); \
311 + DYNSYM (ppl_new_Pointset_Powerset_C_Polyhedron_iterator); \
312 + DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_add_constraint); \
313 + DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_add_space_dimensions_and_embed); \
314 + DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_difference_assign); \
315 + DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_intersection_assign); \
316 + DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_is_empty); \
317 + DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_iterator_begin); \
318 + DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_iterator_dereference); \
319 + DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_iterator_end); \
320 + DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_iterator_equal_test); \
321 + DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_iterator_increment); \
322 + DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_map_space_dimensions); \
323 + DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_maximize); \
324 + DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_minimize); \
325 + DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_remove_space_dimensions); \
326 + DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_size); \
327 + DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_space_dimension); \
328 + DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_upper_bound_assign); \
329 + DYNSYM (ppl_Polyhedron_add_constraint); \
330 + DYNSYM (ppl_Polyhedron_add_constraints); \
331 + DYNSYM (ppl_Polyhedron_add_space_dimensions_and_embed); \
332 + DYNSYM (ppl_Polyhedron_get_constraints); \
333 + DYNSYM (ppl_Polyhedron_map_space_dimensions); \
334 + DYNSYM (ppl_Polyhedron_remove_space_dimensions); \
335 + DYNSYM (ppl_Polyhedron_space_dimension); \
336 + DYNSYM (ppl_subtract_Linear_Expression_from_Linear_Expression); \
337 + DYNSYM (pprint); \
338 + DYNSYM (stmt_block); \
339 + DYNSYM (stmt_for); \
340 + DYNSYM (stmt_guard); \
341 + DYNSYM (stmt_root); \
342 + DYNSYM (stmt_user); \
343 + DYNSYM (stmt_ass); \
344 + DYNSYM (ppl_delete_Constraint_System); \
345 + DYNSYM (ppl_initialize); \
346 + DYNSYM (ppl_new_Constraint_System_from_Constraint); \
347 + DYNSYM (ppl_new_C_Polyhedron_from_Constraint_System); \
348 + DYNSYM (ppl_Polyhedron_affine_image); \
349 + DYNSYM (ppl_io_fprint_Pointset_Powerset_C_Polyhedron); \
350 + DYNSYMS_PPL11
351 +extern struct cloog_pointers_s__
352 +{
353 + bool inited;
354 + void *h;
355 +#define DYNSYM(x) __typeof (x) *p_##x
356 + DYNSYMS
357 +#undef DYNSYM
358 +} cloog_pointers__;
359 +
360 +#define cloog_block_alloc (*cloog_pointers__.p_cloog_block_alloc)
361 +#define cloog_block_list_free (*cloog_pointers__.p_cloog_block_list_free)
362 +#define cloog_block_list_malloc (*cloog_pointers__.p_cloog_block_list_malloc)
363 +#define cloog_clast_create (*cloog_pointers__.p_cloog_clast_create)
364 +#define cloog_clast_free (*cloog_pointers__.p_cloog_clast_free)
365 +#define cloog_domain_free (*cloog_pointers__.p_cloog_domain_free)
366 +#define cloog_domain_matrix2domain (*cloog_pointers__.p_cloog_domain_matrix2domain)
367 +#define cloog_initialize (*cloog_pointers__.p_cloog_initialize)
368 +#ifndef CLOOG_ORG
369 +#undef cloog_loop_malloc
370 +#define cloog_loop_malloc(STATE) (*cloog_pointers__.p_cloog_loop_malloc) ()
371 +#else
372 +#define cloog_loop_malloc (*cloog_pointers__.p_cloog_loop_malloc)
373 +#endif
374 +#define cloog_matrix_alloc (*cloog_pointers__.p_cloog_matrix_alloc)
375 +#define cloog_matrix_copy (*cloog_pointers__.p_cloog_matrix_copy)
376 +#define cloog_matrix_free (*cloog_pointers__.p_cloog_matrix_free)
377 +#define cloog_matrix_print (*cloog_pointers__.p_cloog_matrix_print)
378 +#define cloog_names_malloc (*cloog_pointers__.p_cloog_names_malloc)
379 +#define cloog_names_scalarize (*cloog_pointers__.p_cloog_names_scalarize)
380 +#define cloog_options_free (*cloog_pointers__.p_cloog_options_free)
381 +#ifndef CLOOG_ORG
382 +#undef cloog_options_malloc
383 +#define cloog_options_malloc(STATE) (*cloog_pointers__.p_cloog_options_malloc) ()
384 +#undef cloog_program_dump_cloog
385 +#define cloog_program_dump_cloog(DUMPFILE, PROGRAM, SCATTERINGLIST) \
386 + (*cloog_pointers__.p_cloog_program_dump_cloog) (DUMPFILE, PROGRAM)
387 +#undef cloog_program_extract_scalars
388 +#define cloog_program_extract_scalars(PROG, SCATT, OPT) \
389 + (*cloog_pointers__.p_cloog_program_extract_scalars) (PROG, SCATT)
390 +#else
391 +#define cloog_options_malloc (*cloog_pointers__.p_cloog_options_malloc)
392 +#define cloog_program_dump_cloog (*cloog_pointers__.p_cloog_program_dump_cloog)
393 +#define cloog_program_extract_scalars (*cloog_pointers__.p_cloog_program_extract_scalars)
394 +#endif
395 +#define cloog_program_free (*cloog_pointers__.p_cloog_program_free)
396 +#define cloog_program_generate (*cloog_pointers__.p_cloog_program_generate)
397 +#define cloog_program_malloc (*cloog_pointers__.p_cloog_program_malloc)
398 +#define cloog_program_print (*cloog_pointers__.p_cloog_program_print)
399 +#ifndef CLOOG_ORG
400 +#undef cloog_program_scatter
401 +#define cloog_program_scatter(PROG, SCATT, OPT) \
402 + (*cloog_pointers__.p_cloog_program_scatter) (PROG, SCATT)
403 +#undef cloog_statement_alloc
404 +#define cloog_statement_alloc(STATE, INDEX) \
405 + (*cloog_pointers__.p_cloog_statement_alloc) (INDEX)
406 +#else
407 +#define cloog_program_scatter (*cloog_pointers__.p_cloog_program_scatter)
408 +#define cloog_statement_alloc (*cloog_pointers__.p_cloog_statement_alloc)
409 +#endif
410 +#define cloog_domain_union (*cloog_pointers__.p_cloog_domain_union)
411 +#define cloog_matrix_read (*cloog_pointers__.p_cloog_matrix_read)
412 +#define cloog_new_pol (*cloog_pointers__.p_cloog_new_pol)
413 +#define cloog_vector_gcd (*cloog_pointers__.p_cloog_vector_gcd)
414 +#define ppl_finalize (*cloog_pointers__.p_ppl_finalize)
415 +#define ppl_assign_Coefficient_from_mpz_t (*cloog_pointers__.p_ppl_assign_Coefficient_from_mpz_t)
416 +#define ppl_assign_Linear_Expression_from_Linear_Expression (*cloog_pointers__.p_ppl_assign_Linear_Expression_from_Linear_Expression)
417 +#define ppl_Coefficient_to_mpz_t (*cloog_pointers__.p_ppl_Coefficient_to_mpz_t)
418 +#define ppl_Constraint_coefficient (*cloog_pointers__.p_ppl_Constraint_coefficient)
419 +#define ppl_Constraint_inhomogeneous_term (*cloog_pointers__.p_ppl_Constraint_inhomogeneous_term)
420 +#define ppl_Constraint_space_dimension (*cloog_pointers__.p_ppl_Constraint_space_dimension)
421 +#define ppl_Constraint_System_begin (*cloog_pointers__.p_ppl_Constraint_System_begin)
422 +#define ppl_Constraint_System_const_iterator_dereference (*cloog_pointers__.p_ppl_Constraint_System_const_iterator_dereference)
423 +#define ppl_Constraint_System_const_iterator_equal_test (*cloog_pointers__.p_ppl_Constraint_System_const_iterator_equal_test)
424 +#define ppl_Constraint_System_const_iterator_increment (*cloog_pointers__.p_ppl_Constraint_System_const_iterator_increment)
425 +#define ppl_Constraint_System_end (*cloog_pointers__.p_ppl_Constraint_System_end)
426 +#define ppl_Constraint_System_insert_Constraint (*cloog_pointers__.p_ppl_Constraint_System_insert_Constraint)
427 +#define ppl_Constraint_System_space_dimension (*cloog_pointers__.p_ppl_Constraint_System_space_dimension)
428 +#define ppl_Constraint_type (*cloog_pointers__.p_ppl_Constraint_type)
429 +#define ppl_delete_Coefficient (*cloog_pointers__.p_ppl_delete_Coefficient)
430 +#define ppl_delete_Constraint (*cloog_pointers__.p_ppl_delete_Constraint)
431 +#define ppl_delete_Constraint_System_const_iterator (*cloog_pointers__.p_ppl_delete_Constraint_System_const_iterator)
432 +#define ppl_delete_Linear_Expression (*cloog_pointers__.p_ppl_delete_Linear_Expression)
433 +#define ppl_delete_Pointset_Powerset_C_Polyhedron (*cloog_pointers__.p_ppl_delete_Pointset_Powerset_C_Polyhedron)
434 +#define ppl_delete_Pointset_Powerset_C_Polyhedron_iterator (*cloog_pointers__.p_ppl_delete_Pointset_Powerset_C_Polyhedron_iterator)
435 +#define ppl_delete_Polyhedron (*cloog_pointers__.p_ppl_delete_Polyhedron)
436 +#define ppl_Linear_Expression_add_to_coefficient (*cloog_pointers__.p_ppl_Linear_Expression_add_to_coefficient)
437 +#define ppl_Linear_Expression_add_to_inhomogeneous (*cloog_pointers__.p_ppl_Linear_Expression_add_to_inhomogeneous)
438 +#define ppl_Linear_Expression_coefficient (*cloog_pointers__.p_ppl_Linear_Expression_coefficient)
439 +#define ppl_Linear_Expression_inhomogeneous_term (*cloog_pointers__.p_ppl_Linear_Expression_inhomogeneous_term)
440 +#define ppl_Linear_Expression_space_dimension (*cloog_pointers__.p_ppl_Linear_Expression_space_dimension)
441 +#define ppl_new_Coefficient (*cloog_pointers__.p_ppl_new_Coefficient)
442 +#define ppl_new_Coefficient_from_mpz_t (*cloog_pointers__.p_ppl_new_Coefficient_from_mpz_t)
443 +#define ppl_new_Constraint (*cloog_pointers__.p_ppl_new_Constraint)
444 +#define ppl_new_Constraint_System (*cloog_pointers__.p_ppl_new_Constraint_System)
445 +#define ppl_new_Constraint_System_const_iterator (*cloog_pointers__.p_ppl_new_Constraint_System_const_iterator)
446 +#define ppl_new_C_Polyhedron_from_C_Polyhedron (*cloog_pointers__.p_ppl_new_C_Polyhedron_from_C_Polyhedron)
447 +#define ppl_new_C_Polyhedron_from_space_dimension (*cloog_pointers__.p_ppl_new_C_Polyhedron_from_space_dimension)
448 +#define ppl_new_C_Polyhedron_recycle_Constraint_System (*cloog_pointers__.p_ppl_new_C_Polyhedron_recycle_Constraint_System)
449 +#define ppl_new_Linear_Expression (*cloog_pointers__.p_ppl_new_Linear_Expression)
450 +#define ppl_new_Linear_Expression_from_Constraint (*cloog_pointers__.p_ppl_new_Linear_Expression_from_Constraint)
451 +#define ppl_new_Linear_Expression_from_Linear_Expression (*cloog_pointers__.p_ppl_new_Linear_Expression_from_Linear_Expression)
452 +#define ppl_new_Linear_Expression_with_dimension (*cloog_pointers__.p_ppl_new_Linear_Expression_with_dimension)
453 +#define ppl_new_Pointset_Powerset_C_Polyhedron_from_C_Polyhedron (*cloog_pointers__.p_ppl_new_Pointset_Powerset_C_Polyhedron_from_C_Polyhedron)
454 +#define ppl_new_Pointset_Powerset_C_Polyhedron_from_Pointset_Powerset_C_Polyhedron (*cloog_pointers__.p_ppl_new_Pointset_Powerset_C_Polyhedron_from_Pointset_Powerset_C_Polyhedron)
455 +#define ppl_new_Pointset_Powerset_C_Polyhedron_from_space_dimension (*cloog_pointers__.p_ppl_new_Pointset_Powerset_C_Polyhedron_from_space_dimension)
456 +#define ppl_new_Pointset_Powerset_C_Polyhedron_iterator (*cloog_pointers__.p_ppl_new_Pointset_Powerset_C_Polyhedron_iterator)
457 +#define ppl_Pointset_Powerset_C_Polyhedron_add_constraint (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_add_constraint)
458 +#define ppl_Pointset_Powerset_C_Polyhedron_add_space_dimensions_and_embed (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_add_space_dimensions_and_embed)
459 +#define ppl_Pointset_Powerset_C_Polyhedron_difference_assign (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_difference_assign)
460 +#define ppl_Pointset_Powerset_C_Polyhedron_intersection_assign (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_intersection_assign)
461 +#define ppl_Pointset_Powerset_C_Polyhedron_is_empty (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_is_empty)
462 +#define ppl_Pointset_Powerset_C_Polyhedron_iterator_begin (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_iterator_begin)
463 +#define ppl_Pointset_Powerset_C_Polyhedron_iterator_dereference (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_iterator_dereference)
464 +#define ppl_Pointset_Powerset_C_Polyhedron_iterator_end (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_iterator_end)
465 +#define ppl_Pointset_Powerset_C_Polyhedron_iterator_equal_test (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_iterator_equal_test)
466 +#define ppl_Pointset_Powerset_C_Polyhedron_iterator_increment (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_iterator_increment)
467 +#define ppl_Pointset_Powerset_C_Polyhedron_map_space_dimensions (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_map_space_dimensions)
468 +#define ppl_Pointset_Powerset_C_Polyhedron_maximize (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_maximize)
469 +#define ppl_Pointset_Powerset_C_Polyhedron_minimize (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_minimize)
470 +#define ppl_Pointset_Powerset_C_Polyhedron_remove_space_dimensions (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_remove_space_dimensions)
471 +#define ppl_Pointset_Powerset_C_Polyhedron_size (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_size)
472 +#define ppl_Pointset_Powerset_C_Polyhedron_space_dimension (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_space_dimension)
473 +#define ppl_Pointset_Powerset_C_Polyhedron_upper_bound_assign (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_upper_bound_assign)
474 +#define ppl_Polyhedron_add_constraint (*cloog_pointers__.p_ppl_Polyhedron_add_constraint)
475 +#define ppl_Polyhedron_add_constraints (*cloog_pointers__.p_ppl_Polyhedron_add_constraints)
476 +#define ppl_Polyhedron_add_space_dimensions_and_embed (*cloog_pointers__.p_ppl_Polyhedron_add_space_dimensions_and_embed)
477 +#define ppl_Polyhedron_get_constraints (*cloog_pointers__.p_ppl_Polyhedron_get_constraints)
478 +#define ppl_Polyhedron_map_space_dimensions (*cloog_pointers__.p_ppl_Polyhedron_map_space_dimensions)
479 +#define ppl_Polyhedron_remove_space_dimensions (*cloog_pointers__.p_ppl_Polyhedron_remove_space_dimensions)
480 +#define ppl_Polyhedron_space_dimension (*cloog_pointers__.p_ppl_Polyhedron_space_dimension)
481 +#define ppl_subtract_Linear_Expression_from_Linear_Expression (*cloog_pointers__.p_ppl_subtract_Linear_Expression_from_Linear_Expression)
482 +#define pprint (*cloog_pointers__.p_pprint)
483 +#define stmt_block (*cloog_pointers__.p_stmt_block)
484 +#define stmt_for (*cloog_pointers__.p_stmt_for)
485 +#define stmt_guard (*cloog_pointers__.p_stmt_guard)
486 +#define stmt_root (*cloog_pointers__.p_stmt_root)
487 +#define stmt_user (*cloog_pointers__.p_stmt_user)
488 +#define stmt_ass (*cloog_pointers__.p_stmt_ass)
489 +#define ppl_delete_Constraint_System (*cloog_pointers__.p_ppl_delete_Constraint_System)
490 +#define ppl_initialize (*cloog_pointers__.p_ppl_initialize)
491 +#define ppl_new_Constraint_System_from_Constraint (*cloog_pointers__.p_ppl_new_Constraint_System_from_Constraint)
492 +#define ppl_new_C_Polyhedron_from_Constraint_System (*cloog_pointers__.p_ppl_new_C_Polyhedron_from_Constraint_System)
493 +#define ppl_Polyhedron_affine_image (*cloog_pointers__.p_ppl_Polyhedron_affine_image)
494 +#define ppl_io_fprint_Pointset_Powerset_C_Polyhedron (*cloog_pointers__.p_ppl_io_fprint_Pointset_Powerset_C_Polyhedron)
495 +#if !(PPL_VERSION_MAJOR == 0 && PPL_VERSION_MINOR < 11)
496 +#define ppl_new_PIP_Problem_from_constraints (*cloog_pointers__.p_ppl_new_PIP_Problem_from_constraints)
497 +#define ppl_PIP_Problem_is_satisfiable (*cloog_pointers__.p_ppl_PIP_Problem_is_satisfiable)
498 +#define ppl_delete_PIP_Problem (*cloog_pointers__.p_ppl_delete_PIP_Problem)
499 +#endif
500 +
501 +#define cloog_finalize (*cloog_pointers__.p_ppl_finalize)
502 +
503 +
504 #endif /* GRAPHITE_CLOOG_COMPAT_H */
505 --- a/gcc/graphite-poly.h
506 +++ b/gcc/graphite-poly.h
507 @@ -22,6 +22,8 @@ along with GCC; see the file COPYING3. If not see
508 #ifndef GCC_GRAPHITE_POLY_H
509 #define GCC_GRAPHITE_POLY_H
510
511 +#include "graphite-cloog-util.h"
512 +
513 typedef struct poly_dr *poly_dr_p;
514 DEF_VEC_P(poly_dr_p);
515 DEF_VEC_ALLOC_P (poly_dr_p, heap);
516 --- a/gcc/graphite.c
517 +++ b/gcc/graphite.c
518 @@ -56,6 +56,35 @@ along with GCC; see the file COPYING3. If not see
519
520 CloogState *cloog_state;
521
522 +__typeof (cloog_pointers__) cloog_pointers__;
523 +
524 +static bool
525 +init_cloog_pointers (void)
526 +{
527 + void *h;
528 +
529 + if (cloog_pointers__.inited)
530 + return cloog_pointers__.h != NULL;
531 + h = dlopen ("libcloog.so.0", RTLD_LAZY);
532 + cloog_pointers__.h = h;
533 + if (h == NULL)
534 + return false;
535 +#define DYNSYM(x) \
536 + do \
537 + { \
538 + union { __typeof (cloog_pointers__.p_##x) p; void *q; } u; \
539 + u.q = dlsym (h, #x); \
540 + if (u.q == NULL) \
541 + return false; \
542 + cloog_pointers__.p_##x = u.p; \
543 + } \
544 + while (0)
545 + DYNSYMS
546 +#undef DYNSYM
547 + return true;
548 +}
549 +
550 +
551 /* Print global statistics to FILE. */
552
553 static void
554 @@ -201,6 +230,12 @@ graphite_initialize (void)
555 return false;
556 }
557
558 + if (!init_cloog_pointers ())
559 + {
560 + sorry ("Graphite loop optimizations cannot be used");
561 + return false;
562 + }
563 +
564 scev_reset ();
565 recompute_all_dominators ();
566 initialize_original_copy_tables ();