source: scripts/patch/gcc/4.4.1/01-cloog-fixes.patch@ 590ddeb

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since 590ddeb was ee54da9, checked in by Jim Gifford <clfs@…>, 15 years ago

Updated GCC Script for 4.4.1

  • Property mode set to 100644
File size: 6.4 KB
RevLine 
[ee54da9]12009-01-27 Jakub Jelinek <jakub@redhat.com>
2
3 * Makefile.in (BACKENDLIBS): Link against -ldl instead of -lcloog -lppl.
4 (graphite.o): Force -O, remove -fkeep-inline-functions.
5 * graphite.c: Include <dlfcn.h>. Reference libcloog and libppl symbols
6 through pointers in cloog_pointers variable.
7 (init_cloog_pointers): New function.
8 (gcc_type_for_iv_of_clast_loop): Rename stmt_for argument to stmt_fora.
9 (graphite_transform_loops): Call init_cloog_pointers.
10
11diff -Naur gcc-4.4.0.orig/gcc/graphite.c gcc-4.4.0/gcc/graphite.c
12--- gcc-4.4.0.orig/gcc/graphite.c 2009-03-18 09:59:55.000000000 -0700
13+++ gcc-4.4.0/gcc/graphite.c 2009-07-14 09:26:53.000000000 -0700
14@@ -59,6 +59,110 @@
15 #include "cloog/cloog.h"
16 #include "graphite.h"
17
18+#include <dlfcn.h>
19+#define DYNSYMS \
20+ DYNSYM (cloog_block_alloc); \
21+ DYNSYM (cloog_block_list_free); \
22+ DYNSYM (cloog_block_list_malloc); \
23+ DYNSYM (cloog_clast_create); \
24+ DYNSYM (cloog_clast_free); \
25+ DYNSYM (cloog_domain_free); \
26+ DYNSYM (cloog_domain_matrix2domain); \
27+ DYNSYM (cloog_initialize); \
28+ DYNSYM (cloog_loop_malloc); \
29+ DYNSYM (cloog_matrix_alloc); \
30+ DYNSYM (cloog_matrix_copy); \
31+ DYNSYM (cloog_matrix_free); \
32+ DYNSYM (cloog_matrix_print); \
33+ DYNSYM (cloog_names_malloc); \
34+ DYNSYM (cloog_names_scalarize); \
35+ DYNSYM (cloog_options_free); \
36+ DYNSYM (cloog_options_malloc); \
37+ DYNSYM (cloog_program_dump_cloog); \
38+ DYNSYM (cloog_program_extract_scalars); \
39+ DYNSYM (cloog_program_free); \
40+ DYNSYM (cloog_program_generate); \
41+ DYNSYM (cloog_program_malloc); \
42+ DYNSYM (cloog_program_print); \
43+ DYNSYM (cloog_program_scatter); \
44+ DYNSYM (cloog_statement_alloc); \
45+ DYNSYM (ppl_finalize); \
46+ DYNSYM (pprint); \
47+ DYNSYM (stmt_block); \
48+ DYNSYM (stmt_for); \
49+ DYNSYM (stmt_guard); \
50+ DYNSYM (stmt_root); \
51+ DYNSYM (stmt_user);
52+static struct
53+{
54+ bool inited;
55+ void *h;
56+#define DYNSYM(x) __typeof (x) *p_##x
57+ DYNSYMS
58+#undef DYNSYM
59+} cloog_pointers;
60+
61+#define cloog_block_alloc (*cloog_pointers.p_cloog_block_alloc)
62+#define cloog_block_list_free (*cloog_pointers.p_cloog_block_list_free)
63+#define cloog_block_list_malloc (*cloog_pointers.p_cloog_block_list_malloc)
64+#define cloog_clast_create (*cloog_pointers.p_cloog_clast_create)
65+#define cloog_clast_free (*cloog_pointers.p_cloog_clast_free)
66+#define cloog_domain_free (*cloog_pointers.p_cloog_domain_free)
67+#define cloog_domain_matrix2domain (*cloog_pointers.p_cloog_domain_matrix2domain)
68+#define cloog_initialize (*cloog_pointers.p_cloog_initialize)
69+#define cloog_loop_malloc (*cloog_pointers.p_cloog_loop_malloc)
70+#define cloog_matrix_alloc (*cloog_pointers.p_cloog_matrix_alloc)
71+#define cloog_matrix_copy (*cloog_pointers.p_cloog_matrix_copy)
72+#define cloog_matrix_free (*cloog_pointers.p_cloog_matrix_free)
73+#define cloog_matrix_print (*cloog_pointers.p_cloog_matrix_print)
74+#define cloog_names_malloc (*cloog_pointers.p_cloog_names_malloc)
75+#define cloog_names_scalarize (*cloog_pointers.p_cloog_names_scalarize)
76+#define cloog_options_free (*cloog_pointers.p_cloog_options_free)
77+#define cloog_options_malloc (*cloog_pointers.p_cloog_options_malloc)
78+#define cloog_program_dump_cloog (*cloog_pointers.p_cloog_program_dump_cloog)
79+#define cloog_program_extract_scalars (*cloog_pointers.p_cloog_program_extract_scalars)
80+#define cloog_program_free (*cloog_pointers.p_cloog_program_free)
81+#define cloog_program_generate (*cloog_pointers.p_cloog_program_generate)
82+#define cloog_program_malloc (*cloog_pointers.p_cloog_program_malloc)
83+#define cloog_program_print (*cloog_pointers.p_cloog_program_print)
84+#define cloog_program_scatter (*cloog_pointers.p_cloog_program_scatter)
85+#define cloog_statement_alloc (*cloog_pointers.p_cloog_statement_alloc)
86+#define ppl_finalize (*cloog_pointers.p_ppl_finalize)
87+#define pprint (*cloog_pointers.p_pprint)
88+#define stmt_block (*cloog_pointers.p_stmt_block)
89+#define stmt_for (*cloog_pointers.p_stmt_for)
90+#define stmt_guard (*cloog_pointers.p_stmt_guard)
91+#define stmt_root (*cloog_pointers.p_stmt_root)
92+#define stmt_user (*cloog_pointers.p_stmt_user)
93+
94+#define cloog_finalize (*cloog_pointers.p_ppl_finalize)
95+
96+static bool
97+init_cloog_pointers (void)
98+{
99+ void *h;
100+
101+ if (cloog_pointers.inited)
102+ return cloog_pointers.h != NULL;
103+ h = dlopen ("libcloog.so.0", RTLD_LAZY);
104+ cloog_pointers.h = h;
105+ if (h == NULL)
106+ return false;
107+#define DYNSYM(x) \
108+ do \
109+ { \
110+ union { __typeof (cloog_pointers.p_##x) p; void *q; } u; \
111+ u.q = dlsym (h, #x); \
112+ if (u.q == NULL) \
113+ return false; \
114+ cloog_pointers.p_##x = u.p; \
115+ } \
116+ while (0)
117+ DYNSYMS
118+#undef DYNSYM
119+ return true;
120+}
121+
122 static VEC (scop_p, heap) *current_scops;
123
124 /* Converts a GMP constant V to a tree and returns it. */
125@@ -4075,10 +4179,10 @@
126 STMT. */
127
128 static tree
129-gcc_type_for_iv_of_clast_loop (struct clast_for *stmt_for)
130+gcc_type_for_iv_of_clast_loop (struct clast_for *stmt_fora)
131 {
132- struct clast_user_stmt *stmt = clast_get_body_of_loop ((struct clast_stmt *) stmt_for);
133- const char *cloog_iv = stmt_for->iterator;
134+ struct clast_user_stmt *stmt = clast_get_body_of_loop ((struct clast_stmt *) stmt_fora);
135+ const char *cloog_iv = stmt_fora->iterator;
136 CloogStatement *cs = stmt->statement;
137 graphite_bb_p gbb = (graphite_bb_p) cloog_statement_usr (cs);
138
139@@ -6109,6 +6213,12 @@
140 if (number_of_loops () <= 1)
141 return;
142
143+ if (!init_cloog_pointers ())
144+ {
145+ sorry ("Graphite loop optimizations cannot be used");
146+ return;
147+ }
148+
149 current_scops = VEC_alloc (scop_p, heap, 3);
150 recompute_all_dominators ();
151
152diff -Naur gcc-4.4.0.orig/gcc/Makefile.in gcc-4.4.0/gcc/Makefile.in
153--- gcc-4.4.0.orig/gcc/Makefile.in 2009-07-14 09:25:46.000000000 -0700
154+++ gcc-4.4.0/gcc/Makefile.in 2009-07-14 09:26:53.000000000 -0700
155@@ -914,7 +914,7 @@
156 # How to link with both our special library facilities
157 # and the system's installed libraries.
158 LIBS = @LIBS@ $(CPPLIB) $(LIBINTL) $(LIBICONV) $(LIBIBERTY) $(LIBDECNUMBER)
159-BACKENDLIBS = $(CLOOGLIBS) $(PPLLIBS) $(GMPLIBS)
160+BACKENDLIBS = $(GMPLIBS) $(if $(CLOOGLIBS),-ldl)
161 # Any system libraries needed just for GNAT.
162 SYSLIBS = @GNAT_LIBEXC@
163
164@@ -3061,6 +3061,9 @@
165 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) \
166 $(out_file) $(OUTPUT_OPTION)
167
168+graphite.o : \
169+ ALL_CFLAGS := -O $(filter-out -fkeep-inline-functions, $(ALL_CFLAGS))
170+
171 # Build auxiliary files that support ecoff format.
172 mips-tfile: mips-tfile.o version.o $(LIBDEPS)
173 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ mips-tfile.o version.o $(LIBS)
Note: See TracBrowser for help on using the repository browser.