]> git.ipfire.org Git - ipfire-3.x.git/blame - gcc/patches/gcc46-cloog-dl.patch0
Move all packages to root.
[ipfire-3.x.git] / gcc / patches / gcc46-cloog-dl.patch0
CommitLineData
3c926509
MT
12011-01-04 Jakub Jelinek <jakub@redhat.com>
2
3 * Makefile.in (BACKENDLIBS): Link against -ldl instead of
4 -lcloog -lppl.
5 (graphite.o, graphite%.o): Force -O, remove -fkeep-inline-functions.
6 (GRAPHITE_CLOOG_UTIL_H, GRAPHITE_POLY_H): New.
7 (graphite*.o): Adjust dependencies.
8 * graphite-cloog-compat.h: Include <dlfcn.h>. Reference libcloog and
9 libppl symbols through pointers in cloog_pointers__ variable.
10 * graphite.c (init_cloog_pointers): New function.
11 (graphite_transform_loops): Call init_cloog_pointers.
12 * graphite-clast-to-gimple.c (gcc_type_for_iv_of_clast_loop): Rename
13 stmt_for argument to stmt_fora.
14 * graphite-poly.h: Include graphite-cloog-util.h.
15
16--- gcc/Makefile.in.jj 2011-01-03 13:44:14.163900902 +0100
17+++ gcc/Makefile.in 2011-01-04 17:48:53.588775911 +0100
18@@ -984,6 +984,8 @@ GCC_PLUGIN_H = gcc-plugin.h highlev-plug
19 PLUGIN_H = plugin.h $(GCC_PLUGIN_H)
20 PLUGIN_VERSION_H = plugin-version.h configargs.h
21 LIBFUNCS_H = libfuncs.h $(HASHTAB_H)
22+GRAPHITE_CLOOG_UTIL_H = graphite-cloog-util.h graphite-cloog-compat.h
23+GRAPHITE_POLY_H = graphite-poly.h $(GRAPHITE_CLOOG_UTIL_H)
24
25 #\f
26 # Now figure out from those variables how to compile and link.
27@@ -1037,7 +1039,7 @@ BUILD_LIBDEPS= $(BUILD_LIBIBERTY)
28 # and the system's installed libraries.
29 LIBS = @LIBS@ $(CPPLIB) $(LIBINTL) $(LIBICONV) $(LIBIBERTY) $(LIBDECNUMBER) \
30 $(HOST_LIBS)
31-BACKENDLIBS = $(CLOOGLIBS) $(PPLLIBS) $(GMPLIBS) $(PLUGINLIBS) $(HOST_LIBS) \
32+BACKENDLIBS = $(GMPLIBS) $(if $(CLOOGLIBS),-ldl) $(PLUGINLIBS) $(HOST_LIBS) \
33 $(ZLIB)
34 # Any system libraries needed just for GNAT.
35 SYSLIBS = @GNAT_LIBEXC@
36@@ -2668,40 +2670,40 @@ sese.o : sese.c sese.h $(CONFIG_H) $(SYS
37 $(TREE_FLOW_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) tree-pass.h value-prof.h
38 graphite.o : graphite.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(DIAGNOSTIC_CORE_H) \
39 $(TREE_FLOW_H) $(TREE_DUMP_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) sese.h \
40- $(DBGCNT_H) graphite-ppl.h graphite-poly.h graphite-scop-detection.h \
41+ $(DBGCNT_H) graphite-ppl.h $(GRAPHITE_POLY_H) graphite-scop-detection.h \
42 graphite-clast-to-gimple.h graphite-sese-to-poly.h
43 graphite-blocking.o : graphite-blocking.c $(CONFIG_H) $(SYSTEM_H) \
44 coretypes.h $(TREE_FLOW_H) $(TREE_DUMP_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) \
45- sese.h graphite-ppl.h graphite-poly.h
46+ sese.h graphite-ppl.h $(GRAPHITE_POLY_H)
47 graphite-clast-to-gimple.o : graphite-clast-to-gimple.c $(CONFIG_H) \
48 $(SYSTEM_H) coretypes.h $(DIAGNOSTIC_CORE_H) $(TREE_FLOW_H) $(TREE_DUMP_H) \
49- $(CFGLOOP_H) $(TREE_DATA_REF_H) sese.h graphite-cloog-util.h \
50- graphite-ppl.h graphite-poly.h graphite-clast-to-gimple.h \
51+ $(CFGLOOP_H) $(TREE_DATA_REF_H) sese.h $(GRAPHITE_CLOOG_UTIL_H) \
52+ graphite-ppl.h $(GRAPHITE_POLY_H) graphite-clast-to-gimple.h \
53 graphite-dependences.h graphite-cloog-compat.h
54 graphite-cloog-util.o : graphite-cloog-util.c $(CONFIG_H) $(SYSTEM_H) \
55- coretypes.h graphite-cloog-util.h graphite-cloog-compat.h
56+ coretypes.h $(GRAPHITE_CLOOG_UTIL_H) graphite-cloog-compat.h
57 graphite-dependences.o : graphite-dependences.c $(CONFIG_H) $(SYSTEM_H) \
58 coretypes.h $(TREE_FLOW_H) $(TREE_DUMP_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) \
59- sese.h graphite-ppl.h graphite-poly.h graphite-dependences.h \
60- graphite-cloog-util.h
61+ sese.h graphite-ppl.h $(GRAPHITE_POLY_H) graphite-dependences.h \
62+ $(GRAPHITE_CLOOG_UTIL_H)
63 graphite-flattening.o : graphite-flattening.c $(CONFIG_H) $(SYSTEM_H) \
64 coretypes.h $(TREE_FLOW_H) $(TREE_DUMP_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) \
65- sese.h graphite-ppl.h graphite-poly.h
66+ sese.h graphite-ppl.h $(GRAPHITE_POLY_H)
67 graphite-interchange.o : graphite-interchange.c $(CONFIG_H) $(SYSTEM_H) \
68 coretypes.h $(TREE_FLOW_H) $(TREE_DUMP_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) \
69- sese.h graphite-ppl.h graphite-poly.h
70+ sese.h graphite-ppl.h $(GRAPHITE_POLY_H)
71 graphite-poly.o : graphite-poly.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
72 $(DIAGNOSTIC_CORE_H) $(TREE_FLOW_H) $(TREE_DUMP_H) gimple-pretty-print.h \
73- $(CFGLOOP_H) $(TREE_DATA_REF_H) sese.h graphite-ppl.h graphite-poly.h \
74- graphite-dependences.h graphite-cloog-util.h
75+ $(CFGLOOP_H) $(TREE_DATA_REF_H) sese.h graphite-ppl.h $(GRAPHITE_POLY_H) \
76+ graphite-dependences.h $(GRAPHITE_CLOOG_UTIL_H)
77 graphite-ppl.o : graphite-ppl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
78- graphite-cloog-util.h graphite-ppl.h
79+ $(GRAPHITE_CLOOG_UTIL_H) graphite-ppl.h
80 graphite-scop-detection.o : graphite-scop-detection.c $(CONFIG_H) $(SYSTEM_H) \
81 coretypes.h $(TREE_FLOW_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) $(TREE_PASS_H) \
82- sese.h graphite-ppl.h graphite-poly.h graphite-scop-detection.h
83+ sese.h graphite-ppl.h $(GRAPHITE_POLY_H) graphite-scop-detection.h
84 graphite-sese-to-poly.o : graphite-sese-to-poly.c $(CONFIG_H) \
85 $(SYSTEM_H) coretypes.h $(TREE_FLOW_H) $(TREE_DUMP_H) $(CFGLOOP_H) \
86- $(TREE_DATA_REF_H) domwalk.h sese.h graphite-ppl.h graphite-poly.h \
87+ $(TREE_DATA_REF_H) domwalk.h sese.h graphite-ppl.h $(GRAPHITE_POLY_H) \
88 graphite-sese-to-poly.h
89 tree-vect-loop.o: tree-vect-loop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
90 $(TM_H) $(GGC_H) $(TREE_H) $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) $(TREE_FLOW_H) \
91@@ -3482,6 +3484,11 @@ $(out_object_file): $(out_file) $(CONFIG
92 $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) \
93 $(out_file) $(OUTPUT_OPTION)
94
95+graphite%.o : \
96+ ALL_CFLAGS := -O $(filter-out -fkeep-inline-functions, $(ALL_CFLAGS))
97+graphite.o : \
98+ ALL_CFLAGS := -O $(filter-out -fkeep-inline-functions, $(ALL_CFLAGS))
99+
100 # Build auxiliary files that support ecoff format.
101 mips-tfile: mips-tfile.o version.o $(LIBDEPS)
102 $(LINKER) $(LINKERFLAGS) $(LDFLAGS) -o $@ \
103--- gcc/graphite-cloog-compat.h.jj 2011-01-03 12:53:05.000000000 +0100
104+++ gcc/graphite-cloog-compat.h 2011-01-04 17:34:09.857757544 +0100
105@@ -272,4 +272,263 @@ static inline int cloog_matrix_nrows (Cl
106 return m->NbRows;
107 }
108 #endif /* CLOOG_ORG */
109+
110+#include <dlfcn.h>
111+#define DYNSYMS \
112+ DYNSYM (cloog_block_alloc); \
113+ DYNSYM (cloog_block_list_free); \
114+ DYNSYM (cloog_block_list_malloc); \
115+ DYNSYM (cloog_clast_create); \
116+ DYNSYM (cloog_clast_free); \
117+ DYNSYM (cloog_domain_free); \
118+ DYNSYM (cloog_domain_matrix2domain); \
119+ DYNSYM (cloog_initialize); \
120+ DYNSYM (cloog_loop_malloc); \
121+ DYNSYM (cloog_matrix_alloc); \
122+ DYNSYM (cloog_matrix_copy); \
123+ DYNSYM (cloog_matrix_free); \
124+ DYNSYM (cloog_matrix_print); \
125+ DYNSYM (cloog_names_malloc); \
126+ DYNSYM (cloog_names_scalarize); \
127+ DYNSYM (cloog_options_free); \
128+ DYNSYM (cloog_options_malloc); \
129+ DYNSYM (cloog_program_dump_cloog); \
130+ DYNSYM (cloog_program_extract_scalars); \
131+ DYNSYM (cloog_program_free); \
132+ DYNSYM (cloog_program_generate); \
133+ DYNSYM (cloog_program_malloc); \
134+ DYNSYM (cloog_program_print); \
135+ DYNSYM (cloog_program_scatter); \
136+ DYNSYM (cloog_statement_alloc); \
137+ DYNSYM (cloog_domain_union); \
138+ DYNSYM (cloog_matrix_read); \
139+ DYNSYM (cloog_new_pol); \
140+ DYNSYM (cloog_vector_gcd); \
141+ DYNSYM (ppl_finalize); \
142+ DYNSYM (ppl_assign_Coefficient_from_mpz_t); \
143+ DYNSYM (ppl_assign_Linear_Expression_from_Linear_Expression); \
144+ DYNSYM (ppl_Coefficient_to_mpz_t); \
145+ DYNSYM (ppl_Constraint_coefficient); \
146+ DYNSYM (ppl_Constraint_inhomogeneous_term); \
147+ DYNSYM (ppl_Constraint_space_dimension); \
148+ DYNSYM (ppl_Constraint_System_begin); \
149+ DYNSYM (ppl_Constraint_System_const_iterator_dereference); \
150+ DYNSYM (ppl_Constraint_System_const_iterator_equal_test); \
151+ DYNSYM (ppl_Constraint_System_const_iterator_increment); \
152+ DYNSYM (ppl_Constraint_System_end); \
153+ DYNSYM (ppl_Constraint_System_insert_Constraint); \
154+ DYNSYM (ppl_Constraint_System_space_dimension); \
155+ DYNSYM (ppl_Constraint_type); \
156+ DYNSYM (ppl_delete_Coefficient); \
157+ DYNSYM (ppl_delete_Constraint); \
158+ DYNSYM (ppl_delete_Constraint_System_const_iterator); \
159+ DYNSYM (ppl_delete_Linear_Expression); \
160+ DYNSYM (ppl_delete_Pointset_Powerset_C_Polyhedron); \
161+ DYNSYM (ppl_delete_Pointset_Powerset_C_Polyhedron_iterator); \
162+ DYNSYM (ppl_delete_Polyhedron); \
163+ DYNSYM (ppl_Linear_Expression_add_to_coefficient); \
164+ DYNSYM (ppl_Linear_Expression_add_to_inhomogeneous); \
165+ DYNSYM (ppl_Linear_Expression_coefficient); \
166+ DYNSYM (ppl_Linear_Expression_inhomogeneous_term); \
167+ DYNSYM (ppl_Linear_Expression_space_dimension); \
168+ DYNSYM (ppl_new_Coefficient); \
169+ DYNSYM (ppl_new_Coefficient_from_mpz_t); \
170+ DYNSYM (ppl_new_Constraint); \
171+ DYNSYM (ppl_new_Constraint_System); \
172+ DYNSYM (ppl_new_Constraint_System_const_iterator); \
173+ DYNSYM (ppl_new_C_Polyhedron_from_C_Polyhedron); \
174+ DYNSYM (ppl_new_C_Polyhedron_from_space_dimension); \
175+ DYNSYM (ppl_new_C_Polyhedron_recycle_Constraint_System); \
176+ DYNSYM (ppl_new_Linear_Expression); \
177+ DYNSYM (ppl_new_Linear_Expression_from_Constraint); \
178+ DYNSYM (ppl_new_Linear_Expression_from_Linear_Expression); \
179+ DYNSYM (ppl_new_Linear_Expression_with_dimension); \
180+ DYNSYM (ppl_new_Pointset_Powerset_C_Polyhedron_from_C_Polyhedron); \
181+ DYNSYM (ppl_new_Pointset_Powerset_C_Polyhedron_from_Pointset_Powerset_C_Polyhedron); \
182+ DYNSYM (ppl_new_Pointset_Powerset_C_Polyhedron_from_space_dimension); \
183+ DYNSYM (ppl_new_Pointset_Powerset_C_Polyhedron_iterator); \
184+ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_add_constraint); \
185+ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_add_space_dimensions_and_embed); \
186+ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_difference_assign); \
187+ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_intersection_assign); \
188+ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_is_empty); \
189+ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_iterator_begin); \
190+ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_iterator_dereference); \
191+ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_iterator_end); \
192+ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_iterator_equal_test); \
193+ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_iterator_increment); \
194+ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_map_space_dimensions); \
195+ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_maximize); \
196+ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_minimize); \
197+ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_remove_space_dimensions); \
198+ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_size); \
199+ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_space_dimension); \
200+ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_upper_bound_assign); \
201+ DYNSYM (ppl_Polyhedron_add_constraint); \
202+ DYNSYM (ppl_Polyhedron_add_constraints); \
203+ DYNSYM (ppl_Polyhedron_add_space_dimensions_and_embed); \
204+ DYNSYM (ppl_Polyhedron_get_constraints); \
205+ DYNSYM (ppl_Polyhedron_map_space_dimensions); \
206+ DYNSYM (ppl_Polyhedron_remove_space_dimensions); \
207+ DYNSYM (ppl_Polyhedron_space_dimension); \
208+ DYNSYM (ppl_subtract_Linear_Expression_from_Linear_Expression); \
209+ DYNSYM (pprint); \
210+ DYNSYM (stmt_block); \
211+ DYNSYM (stmt_for); \
212+ DYNSYM (stmt_guard); \
213+ DYNSYM (stmt_root); \
214+ DYNSYM (stmt_user); \
215+ DYNSYM (ppl_delete_Constraint_System); \
216+ DYNSYM (ppl_initialize); \
217+ DYNSYM (ppl_new_Constraint_System_from_Constraint); \
218+ DYNSYM (ppl_new_C_Polyhedron_from_Constraint_System); \
219+ DYNSYM (ppl_Polyhedron_affine_image); \
220+ DYNSYM (ppl_io_fprint_Pointset_Powerset_C_Polyhedron);
221+extern struct
222+{
223+ bool inited;
224+ void *h;
225+#define DYNSYM(x) __typeof (x) *p_##x
226+ DYNSYMS
227+#undef DYNSYM
228+} cloog_pointers__;
229+
230+#define cloog_block_alloc (*cloog_pointers__.p_cloog_block_alloc)
231+#define cloog_block_list_free (*cloog_pointers__.p_cloog_block_list_free)
232+#define cloog_block_list_malloc (*cloog_pointers__.p_cloog_block_list_malloc)
233+#define cloog_clast_create (*cloog_pointers__.p_cloog_clast_create)
234+#define cloog_clast_free (*cloog_pointers__.p_cloog_clast_free)
235+#define cloog_domain_free (*cloog_pointers__.p_cloog_domain_free)
236+#define cloog_domain_matrix2domain (*cloog_pointers__.p_cloog_domain_matrix2domain)
237+#define cloog_initialize (*cloog_pointers__.p_cloog_initialize)
238+#ifndef CLOOG_ORG
239+#undef cloog_loop_malloc
240+#define cloog_loop_malloc(STATE) (*cloog_pointers__.p_cloog_loop_malloc) ()
241+#else
242+#define cloog_loop_malloc (*cloog_pointers__.p_cloog_loop_malloc)
243+#endif
244+#define cloog_matrix_alloc (*cloog_pointers__.p_cloog_matrix_alloc)
245+#define cloog_matrix_copy (*cloog_pointers__.p_cloog_matrix_copy)
246+#define cloog_matrix_free (*cloog_pointers__.p_cloog_matrix_free)
247+#define cloog_matrix_print (*cloog_pointers__.p_cloog_matrix_print)
248+#define cloog_names_malloc (*cloog_pointers__.p_cloog_names_malloc)
249+#define cloog_names_scalarize (*cloog_pointers__.p_cloog_names_scalarize)
250+#define cloog_options_free (*cloog_pointers__.p_cloog_options_free)
251+#ifndef CLOOG_ORG
252+#undef cloog_options_malloc
253+#define cloog_options_malloc(STATE) (*cloog_pointers__.p_cloog_options_malloc) ()
254+#undef cloog_program_dump_cloog
255+#define cloog_program_dump_cloog(DUMPFILE, PROGRAM, SCATTERINGLIST) \
256+ (*cloog_pointers__.p_cloog_program_dump_cloog) (DUMPFILE, PROGRAM)
257+#undef cloog_program_extract_scalars
258+#define cloog_program_extract_scalars(PROG, SCATT, OPT) \
259+ (*cloog_pointers__.p_cloog_program_extract_scalars) (PROG, SCATT)
260+#else
261+#define cloog_options_malloc (*cloog_pointers__.p_cloog_options_malloc)
262+#define cloog_program_dump_cloog (*cloog_pointers__.p_cloog_program_dump_cloog)
263+#define cloog_program_extract_scalars (*cloog_pointers__.p_cloog_program_extract_scalars)
264+#endif
265+#define cloog_program_free (*cloog_pointers__.p_cloog_program_free)
266+#define cloog_program_generate (*cloog_pointers__.p_cloog_program_generate)
267+#define cloog_program_malloc (*cloog_pointers__.p_cloog_program_malloc)
268+#define cloog_program_print (*cloog_pointers__.p_cloog_program_print)
269+#ifndef CLOOG_ORG
270+#undef cloog_program_scatter
271+#define cloog_program_scatter(PROG, SCATT, OPT) \
272+ (*cloog_pointers__.p_cloog_program_scatter) (PROG, SCATT)
273+#undef cloog_statement_alloc
274+#define cloog_statement_alloc(STATE, INDEX) \
275+ (*cloog_pointers__.p_cloog_statement_alloc) (INDEX)
276+#else
277+#define cloog_program_scatter (*cloog_pointers__.p_cloog_program_scatter)
278+#define cloog_statement_alloc (*cloog_pointers__.p_cloog_statement_alloc)
279+#endif
280+#define cloog_domain_union (*cloog_pointers__.p_cloog_domain_union)
281+#define cloog_matrix_read (*cloog_pointers__.p_cloog_matrix_read)
282+#define cloog_new_pol (*cloog_pointers__.p_cloog_new_pol)
283+#define cloog_vector_gcd (*cloog_pointers__.p_cloog_vector_gcd)
284+#define ppl_finalize (*cloog_pointers__.p_ppl_finalize)
285+#define ppl_assign_Coefficient_from_mpz_t (*cloog_pointers__.p_ppl_assign_Coefficient_from_mpz_t)
286+#define ppl_assign_Linear_Expression_from_Linear_Expression (*cloog_pointers__.p_ppl_assign_Linear_Expression_from_Linear_Expression)
287+#define ppl_Coefficient_to_mpz_t (*cloog_pointers__.p_ppl_Coefficient_to_mpz_t)
288+#define ppl_Constraint_coefficient (*cloog_pointers__.p_ppl_Constraint_coefficient)
289+#define ppl_Constraint_inhomogeneous_term (*cloog_pointers__.p_ppl_Constraint_inhomogeneous_term)
290+#define ppl_Constraint_space_dimension (*cloog_pointers__.p_ppl_Constraint_space_dimension)
291+#define ppl_Constraint_System_begin (*cloog_pointers__.p_ppl_Constraint_System_begin)
292+#define ppl_Constraint_System_const_iterator_dereference (*cloog_pointers__.p_ppl_Constraint_System_const_iterator_dereference)
293+#define ppl_Constraint_System_const_iterator_equal_test (*cloog_pointers__.p_ppl_Constraint_System_const_iterator_equal_test)
294+#define ppl_Constraint_System_const_iterator_increment (*cloog_pointers__.p_ppl_Constraint_System_const_iterator_increment)
295+#define ppl_Constraint_System_end (*cloog_pointers__.p_ppl_Constraint_System_end)
296+#define ppl_Constraint_System_insert_Constraint (*cloog_pointers__.p_ppl_Constraint_System_insert_Constraint)
297+#define ppl_Constraint_System_space_dimension (*cloog_pointers__.p_ppl_Constraint_System_space_dimension)
298+#define ppl_Constraint_type (*cloog_pointers__.p_ppl_Constraint_type)
299+#define ppl_delete_Coefficient (*cloog_pointers__.p_ppl_delete_Coefficient)
300+#define ppl_delete_Constraint (*cloog_pointers__.p_ppl_delete_Constraint)
301+#define ppl_delete_Constraint_System_const_iterator (*cloog_pointers__.p_ppl_delete_Constraint_System_const_iterator)
302+#define ppl_delete_Linear_Expression (*cloog_pointers__.p_ppl_delete_Linear_Expression)
303+#define ppl_delete_Pointset_Powerset_C_Polyhedron (*cloog_pointers__.p_ppl_delete_Pointset_Powerset_C_Polyhedron)
304+#define ppl_delete_Pointset_Powerset_C_Polyhedron_iterator (*cloog_pointers__.p_ppl_delete_Pointset_Powerset_C_Polyhedron_iterator)
305+#define ppl_delete_Polyhedron (*cloog_pointers__.p_ppl_delete_Polyhedron)
306+#define ppl_Linear_Expression_add_to_coefficient (*cloog_pointers__.p_ppl_Linear_Expression_add_to_coefficient)
307+#define ppl_Linear_Expression_add_to_inhomogeneous (*cloog_pointers__.p_ppl_Linear_Expression_add_to_inhomogeneous)
308+#define ppl_Linear_Expression_coefficient (*cloog_pointers__.p_ppl_Linear_Expression_coefficient)
309+#define ppl_Linear_Expression_inhomogeneous_term (*cloog_pointers__.p_ppl_Linear_Expression_inhomogeneous_term)
310+#define ppl_Linear_Expression_space_dimension (*cloog_pointers__.p_ppl_Linear_Expression_space_dimension)
311+#define ppl_new_Coefficient (*cloog_pointers__.p_ppl_new_Coefficient)
312+#define ppl_new_Coefficient_from_mpz_t (*cloog_pointers__.p_ppl_new_Coefficient_from_mpz_t)
313+#define ppl_new_Constraint (*cloog_pointers__.p_ppl_new_Constraint)
314+#define ppl_new_Constraint_System (*cloog_pointers__.p_ppl_new_Constraint_System)
315+#define ppl_new_Constraint_System_const_iterator (*cloog_pointers__.p_ppl_new_Constraint_System_const_iterator)
316+#define ppl_new_C_Polyhedron_from_C_Polyhedron (*cloog_pointers__.p_ppl_new_C_Polyhedron_from_C_Polyhedron)
317+#define ppl_new_C_Polyhedron_from_space_dimension (*cloog_pointers__.p_ppl_new_C_Polyhedron_from_space_dimension)
318+#define ppl_new_C_Polyhedron_recycle_Constraint_System (*cloog_pointers__.p_ppl_new_C_Polyhedron_recycle_Constraint_System)
319+#define ppl_new_Linear_Expression (*cloog_pointers__.p_ppl_new_Linear_Expression)
320+#define ppl_new_Linear_Expression_from_Constraint (*cloog_pointers__.p_ppl_new_Linear_Expression_from_Constraint)
321+#define ppl_new_Linear_Expression_from_Linear_Expression (*cloog_pointers__.p_ppl_new_Linear_Expression_from_Linear_Expression)
322+#define ppl_new_Linear_Expression_with_dimension (*cloog_pointers__.p_ppl_new_Linear_Expression_with_dimension)
323+#define ppl_new_Pointset_Powerset_C_Polyhedron_from_C_Polyhedron (*cloog_pointers__.p_ppl_new_Pointset_Powerset_C_Polyhedron_from_C_Polyhedron)
324+#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)
325+#define ppl_new_Pointset_Powerset_C_Polyhedron_from_space_dimension (*cloog_pointers__.p_ppl_new_Pointset_Powerset_C_Polyhedron_from_space_dimension)
326+#define ppl_new_Pointset_Powerset_C_Polyhedron_iterator (*cloog_pointers__.p_ppl_new_Pointset_Powerset_C_Polyhedron_iterator)
327+#define ppl_Pointset_Powerset_C_Polyhedron_add_constraint (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_add_constraint)
328+#define ppl_Pointset_Powerset_C_Polyhedron_add_space_dimensions_and_embed (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_add_space_dimensions_and_embed)
329+#define ppl_Pointset_Powerset_C_Polyhedron_difference_assign (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_difference_assign)
330+#define ppl_Pointset_Powerset_C_Polyhedron_intersection_assign (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_intersection_assign)
331+#define ppl_Pointset_Powerset_C_Polyhedron_is_empty (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_is_empty)
332+#define ppl_Pointset_Powerset_C_Polyhedron_iterator_begin (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_iterator_begin)
333+#define ppl_Pointset_Powerset_C_Polyhedron_iterator_dereference (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_iterator_dereference)
334+#define ppl_Pointset_Powerset_C_Polyhedron_iterator_end (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_iterator_end)
335+#define ppl_Pointset_Powerset_C_Polyhedron_iterator_equal_test (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_iterator_equal_test)
336+#define ppl_Pointset_Powerset_C_Polyhedron_iterator_increment (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_iterator_increment)
337+#define ppl_Pointset_Powerset_C_Polyhedron_map_space_dimensions (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_map_space_dimensions)
338+#define ppl_Pointset_Powerset_C_Polyhedron_maximize (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_maximize)
339+#define ppl_Pointset_Powerset_C_Polyhedron_minimize (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_minimize)
340+#define ppl_Pointset_Powerset_C_Polyhedron_remove_space_dimensions (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_remove_space_dimensions)
341+#define ppl_Pointset_Powerset_C_Polyhedron_size (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_size)
342+#define ppl_Pointset_Powerset_C_Polyhedron_space_dimension (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_space_dimension)
343+#define ppl_Pointset_Powerset_C_Polyhedron_upper_bound_assign (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_upper_bound_assign)
344+#define ppl_Polyhedron_add_constraint (*cloog_pointers__.p_ppl_Polyhedron_add_constraint)
345+#define ppl_Polyhedron_add_constraints (*cloog_pointers__.p_ppl_Polyhedron_add_constraints)
346+#define ppl_Polyhedron_add_space_dimensions_and_embed (*cloog_pointers__.p_ppl_Polyhedron_add_space_dimensions_and_embed)
347+#define ppl_Polyhedron_get_constraints (*cloog_pointers__.p_ppl_Polyhedron_get_constraints)
348+#define ppl_Polyhedron_map_space_dimensions (*cloog_pointers__.p_ppl_Polyhedron_map_space_dimensions)
349+#define ppl_Polyhedron_remove_space_dimensions (*cloog_pointers__.p_ppl_Polyhedron_remove_space_dimensions)
350+#define ppl_Polyhedron_space_dimension (*cloog_pointers__.p_ppl_Polyhedron_space_dimension)
351+#define ppl_subtract_Linear_Expression_from_Linear_Expression (*cloog_pointers__.p_ppl_subtract_Linear_Expression_from_Linear_Expression)
352+#define pprint (*cloog_pointers__.p_pprint)
353+#define stmt_block (*cloog_pointers__.p_stmt_block)
354+#define stmt_for (*cloog_pointers__.p_stmt_for)
355+#define stmt_guard (*cloog_pointers__.p_stmt_guard)
356+#define stmt_root (*cloog_pointers__.p_stmt_root)
357+#define stmt_user (*cloog_pointers__.p_stmt_user)
358+#define ppl_delete_Constraint_System (*cloog_pointers__.p_ppl_delete_Constraint_System)
359+#define ppl_initialize (*cloog_pointers__.p_ppl_initialize)
360+#define ppl_new_Constraint_System_from_Constraint (*cloog_pointers__.p_ppl_new_Constraint_System_from_Constraint)
361+#define ppl_new_C_Polyhedron_from_Constraint_System (*cloog_pointers__.p_ppl_new_C_Polyhedron_from_Constraint_System)
362+#define ppl_Polyhedron_affine_image (*cloog_pointers__.p_ppl_Polyhedron_affine_image)
363+#define ppl_io_fprint_Pointset_Powerset_C_Polyhedron (cloog_pointers__.p_ppl_io_fprint_Pointset_Powerset_C_Polyhedron)
364+
365+#define cloog_finalize (*cloog_pointers__.p_ppl_finalize)
366+
367+
368 #endif /* GRAPHITE_CLOOG_COMPAT_H */
369--- gcc/graphite.c.jj 2011-01-03 12:53:05.194056513 +0100
370+++ gcc/graphite.c 2011-01-04 16:18:32.385007767 +0100
371@@ -54,6 +54,35 @@ along with GCC; see the file COPYING3.
372 #include "graphite-clast-to-gimple.h"
373 #include "graphite-sese-to-poly.h"
374
375+__typeof (cloog_pointers__) cloog_pointers__;
376+
377+static bool
378+init_cloog_pointers (void)
379+{
380+ void *h;
381+
382+ if (cloog_pointers__.inited)
383+ return cloog_pointers__.h != NULL;
384+ h = dlopen ("libcloog.so.0", RTLD_LAZY);
385+ cloog_pointers__.h = h;
386+ if (h == NULL)
387+ return false;
388+#define DYNSYM(x) \
389+ do \
390+ { \
391+ union { __typeof (cloog_pointers__.p_##x) p; void *q; } u; \
392+ u.q = dlsym (h, #x); \
393+ if (u.q == NULL) \
394+ return false; \
395+ cloog_pointers__.p_##x = u.p; \
396+ } \
397+ while (0)
398+ DYNSYMS
399+#undef DYNSYM
400+ return true;
401+}
402+
403+
404 /* Print global statistics to FILE. */
405
406 static void
407@@ -199,6 +228,12 @@ graphite_initialize (void)
408 return false;
409 }
410
411+ if (!init_cloog_pointers ())
412+ {
413+ sorry ("Graphite loop optimizations cannot be used");
414+ return false;
415+ }
416+
417 scev_reset ();
418 recompute_all_dominators ();
419 initialize_original_copy_tables ();
420--- gcc/graphite-clast-to-gimple.c.jj 2011-01-03 12:53:05.000000000 +0100
421+++ gcc/graphite-clast-to-gimple.c 2011-01-04 16:29:55.738007463 +0100
422@@ -738,10 +738,10 @@ clast_get_body_of_loop (struct clast_stm
423 from STMT_FOR. */
424
425 static tree
426-gcc_type_for_iv_of_clast_loop (struct clast_for *stmt_for, int level,
427+gcc_type_for_iv_of_clast_loop (struct clast_for *stmt_fora, int level,
428 tree lb_type, tree ub_type)
429 {
430- struct clast_stmt *stmt = (struct clast_stmt *) stmt_for;
431+ struct clast_stmt *stmt = (struct clast_stmt *) stmt_fora;
432 struct clast_user_stmt *body = clast_get_body_of_loop (stmt);
433 CloogStatement *cs = body->statement;
434 poly_bb_p pbb = (poly_bb_p) cloog_statement_usr (cs);
435--- gcc/graphite-poly.h.jj 2011-01-03 12:53:05.000000000 +0100
436+++ gcc/graphite-poly.h 2011-01-04 17:35:53.308788629 +0100
437@@ -22,6 +22,8 @@ along with GCC; see the file COPYING3.
438 #ifndef GCC_GRAPHITE_POLY_H
439 #define GCC_GRAPHITE_POLY_H
440
441+#include "graphite-cloog-util.h"
442+
443 typedef struct poly_dr *poly_dr_p;
444 DEF_VEC_P(poly_dr_p);
445 DEF_VEC_ALLOC_P (poly_dr_p, heap);