2 ===================================================================
3 --- configure (.../tags/gcc_4_2_0_release) (revision 126002)
4 +++ configure (.../branches/gcc-4_2-branch) (revision 126002)
5 @@ -4769,12 +4769,14 @@
7 CC_FOR_TARGET="${ncn_target_tool_prefix}$2"
10 + CC_FOR_TARGET="$ac_cv_prog_CC_FOR_TARGET"
13 if test -n "$with_build_time_tools"; then
14 for ncn_progname in c++ g++ cxx gxx; do
15 echo $ac_n "checking for ${ncn_progname} in $with_build_time_tools""... $ac_c" 1>&6
16 -echo "configure:4778: checking for ${ncn_progname} in $with_build_time_tools" >&5
17 +echo "configure:4780: checking for ${ncn_progname} in $with_build_time_tools" >&5
18 if test -x $with_build_time_tools/${ncn_progname}; then
19 ac_cv_prog_CXX_FOR_TARGET=$with_build_time_tools/${ncn_progname}
20 echo "$ac_t""yes" 1>&6
22 # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args.
23 set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2
24 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
25 -echo "configure:4795: checking for $ac_word" >&5
26 +echo "configure:4797: checking for $ac_word" >&5
27 if eval "test \"`echo '$''{'ac_cv_prog_CXX_FOR_TARGET'+set}'`\" = set"; then
28 echo $ac_n "(cached) $ac_c" 1>&6
31 # Extract the first word of "${ncn_progname}", so it can be a program name with args.
32 set dummy ${ncn_progname}; ac_word=$2
33 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
34 -echo "configure:4826: checking for $ac_word" >&5
35 +echo "configure:4828: checking for $ac_word" >&5
36 if eval "test \"`echo '$''{'ac_cv_prog_CXX_FOR_TARGET'+set}'`\" = set"; then
37 echo $ac_n "(cached) $ac_c" 1>&6
39 @@ -4860,12 +4862,14 @@
41 CXX_FOR_TARGET="${ncn_target_tool_prefix}$2"
44 + CXX_FOR_TARGET="$ac_cv_prog_CXX_FOR_TARGET"
47 if test -n "$with_build_time_tools"; then
48 for ncn_progname in gcc; do
49 echo $ac_n "checking for ${ncn_progname} in $with_build_time_tools""... $ac_c" 1>&6
50 -echo "configure:4869: checking for ${ncn_progname} in $with_build_time_tools" >&5
51 +echo "configure:4873: checking for ${ncn_progname} in $with_build_time_tools" >&5
52 if test -x $with_build_time_tools/${ncn_progname}; then
53 ac_cv_prog_GCC_FOR_TARGET=$with_build_time_tools/${ncn_progname}
54 echo "$ac_t""yes" 1>&6
56 # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args.
57 set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2
58 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
59 -echo "configure:4886: checking for $ac_word" >&5
60 +echo "configure:4890: checking for $ac_word" >&5
61 if eval "test \"`echo '$''{'ac_cv_prog_GCC_FOR_TARGET'+set}'`\" = set"; then
62 echo $ac_n "(cached) $ac_c" 1>&6
65 # Extract the first word of "${ncn_progname}", so it can be a program name with args.
66 set dummy ${ncn_progname}; ac_word=$2
67 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
68 -echo "configure:4917: checking for $ac_word" >&5
69 +echo "configure:4921: checking for $ac_word" >&5
70 if eval "test \"`echo '$''{'ac_cv_prog_GCC_FOR_TARGET'+set}'`\" = set"; then
71 echo $ac_n "(cached) $ac_c" 1>&6
73 @@ -4946,12 +4950,14 @@
75 if test -z "$ac_cv_prog_GCC_FOR_TARGET" ; then
76 GCC_FOR_TARGET="${CC_FOR_TARGET}"
78 + GCC_FOR_TARGET="$ac_cv_prog_GCC_FOR_TARGET"
81 if test -n "$with_build_time_tools"; then
82 for ncn_progname in gcj; do
83 echo $ac_n "checking for ${ncn_progname} in $with_build_time_tools""... $ac_c" 1>&6
84 -echo "configure:4955: checking for ${ncn_progname} in $with_build_time_tools" >&5
85 +echo "configure:4961: checking for ${ncn_progname} in $with_build_time_tools" >&5
86 if test -x $with_build_time_tools/${ncn_progname}; then
87 ac_cv_prog_GCJ_FOR_TARGET=$with_build_time_tools/${ncn_progname}
88 echo "$ac_t""yes" 1>&6
90 # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args.
91 set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2
92 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
93 -echo "configure:4972: checking for $ac_word" >&5
94 +echo "configure:4978: checking for $ac_word" >&5
95 if eval "test \"`echo '$''{'ac_cv_prog_GCJ_FOR_TARGET'+set}'`\" = set"; then
96 echo $ac_n "(cached) $ac_c" 1>&6
99 # Extract the first word of "${ncn_progname}", so it can be a program name with args.
100 set dummy ${ncn_progname}; ac_word=$2
101 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
102 -echo "configure:5003: checking for $ac_word" >&5
103 +echo "configure:5009: checking for $ac_word" >&5
104 if eval "test \"`echo '$''{'ac_cv_prog_GCJ_FOR_TARGET'+set}'`\" = set"; then
105 echo $ac_n "(cached) $ac_c" 1>&6
107 @@ -5037,12 +5043,14 @@
109 GCJ_FOR_TARGET="${ncn_target_tool_prefix}$2"
112 + GCJ_FOR_TARGET="$ac_cv_prog_GCJ_FOR_TARGET"
115 if test -n "$with_build_time_tools"; then
116 for ncn_progname in gfortran; do
117 echo $ac_n "checking for ${ncn_progname} in $with_build_time_tools""... $ac_c" 1>&6
118 -echo "configure:5046: checking for ${ncn_progname} in $with_build_time_tools" >&5
119 +echo "configure:5054: checking for ${ncn_progname} in $with_build_time_tools" >&5
120 if test -x $with_build_time_tools/${ncn_progname}; then
121 ac_cv_prog_GFORTRAN_FOR_TARGET=$with_build_time_tools/${ncn_progname}
122 echo "$ac_t""yes" 1>&6
123 @@ -5059,7 +5067,7 @@
124 # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args.
125 set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2
126 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
127 -echo "configure:5063: checking for $ac_word" >&5
128 +echo "configure:5071: checking for $ac_word" >&5
129 if eval "test \"`echo '$''{'ac_cv_prog_GFORTRAN_FOR_TARGET'+set}'`\" = set"; then
130 echo $ac_n "(cached) $ac_c" 1>&6
132 @@ -5090,7 +5098,7 @@
133 # Extract the first word of "${ncn_progname}", so it can be a program name with args.
134 set dummy ${ncn_progname}; ac_word=$2
135 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
136 -echo "configure:5094: checking for $ac_word" >&5
137 +echo "configure:5102: checking for $ac_word" >&5
138 if eval "test \"`echo '$''{'ac_cv_prog_GFORTRAN_FOR_TARGET'+set}'`\" = set"; then
139 echo $ac_n "(cached) $ac_c" 1>&6
141 @@ -5128,6 +5136,8 @@
143 GFORTRAN_FOR_TARGET="${ncn_target_tool_prefix}$2"
146 + GFORTRAN_FOR_TARGET="$ac_cv_prog_GFORTRAN_FOR_TARGET"
150 @@ -5197,7 +5207,7 @@
151 if test -z "$ac_cv_path_AR_FOR_TARGET" ; then
152 if test -n "$with_build_time_tools"; then
153 echo $ac_n "checking for ar in $with_build_time_tools""... $ac_c" 1>&6
154 -echo "configure:5201: checking for ar in $with_build_time_tools" >&5
155 +echo "configure:5211: checking for ar in $with_build_time_tools" >&5
156 if test -x $with_build_time_tools/ar; then
157 AR_FOR_TARGET=`cd $with_build_time_tools && pwd`/ar
158 ac_cv_path_AR_FOR_TARGET=$AR_FOR_TARGET
159 @@ -5208,14 +5218,14 @@
160 elif test $build != $host && test $have_gcc_for_target = yes; then
161 AR_FOR_TARGET=`$GCC_FOR_TARGET --print-prog-name=ar`
162 test $AR_FOR_TARGET=ar && AR_FOR_TARGET=
163 - ac_cv_path_AR_FOR_TARGET=$AR_FOR_TARGET
164 + test -n "$AR_FOR_TARGET" && ac_cv_path_AR_FOR_TARGET=$AR_FOR_TARGET
167 if test -z "$ac_cv_path_AR_FOR_TARGET" ; then
168 # Extract the first word of "ar", so it can be a program name with args.
169 set dummy ar; ac_word=$2
170 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
171 -echo "configure:5219: checking for $ac_word" >&5
172 +echo "configure:5229: checking for $ac_word" >&5
173 if eval "test \"`echo '$''{'ac_cv_path_AR_FOR_TARGET'+set}'`\" = set"; then
174 echo $ac_n "(cached) $ac_c" 1>&6
176 @@ -5252,7 +5262,7 @@
177 if test -n "$with_build_time_tools"; then
178 for ncn_progname in ar; do
179 echo $ac_n "checking for ${ncn_progname} in $with_build_time_tools""... $ac_c" 1>&6
180 -echo "configure:5256: checking for ${ncn_progname} in $with_build_time_tools" >&5
181 +echo "configure:5266: checking for ${ncn_progname} in $with_build_time_tools" >&5
182 if test -x $with_build_time_tools/${ncn_progname}; then
183 ac_cv_prog_AR_FOR_TARGET=$with_build_time_tools/${ncn_progname}
184 echo "$ac_t""yes" 1>&6
185 @@ -5269,7 +5279,7 @@
186 # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args.
187 set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2
188 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
189 -echo "configure:5273: checking for $ac_word" >&5
190 +echo "configure:5283: checking for $ac_word" >&5
191 if eval "test \"`echo '$''{'ac_cv_prog_AR_FOR_TARGET'+set}'`\" = set"; then
192 echo $ac_n "(cached) $ac_c" 1>&6
194 @@ -5300,7 +5310,7 @@
195 # Extract the first word of "${ncn_progname}", so it can be a program name with args.
196 set dummy ${ncn_progname}; ac_word=$2
197 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
198 -echo "configure:5304: checking for $ac_word" >&5
199 +echo "configure:5314: checking for $ac_word" >&5
200 if eval "test \"`echo '$''{'ac_cv_prog_AR_FOR_TARGET'+set}'`\" = set"; then
201 echo $ac_n "(cached) $ac_c" 1>&6
203 @@ -5338,6 +5348,8 @@
205 AR_FOR_TARGET="${ncn_target_tool_prefix}$2"
208 + AR_FOR_TARGET="$ac_cv_prog_AR_FOR_TARGET"
212 @@ -5350,7 +5362,7 @@
213 if test -z "$ac_cv_path_AS_FOR_TARGET" ; then
214 if test -n "$with_build_time_tools"; then
215 echo $ac_n "checking for as in $with_build_time_tools""... $ac_c" 1>&6
216 -echo "configure:5354: checking for as in $with_build_time_tools" >&5
217 +echo "configure:5366: checking for as in $with_build_time_tools" >&5
218 if test -x $with_build_time_tools/as; then
219 AS_FOR_TARGET=`cd $with_build_time_tools && pwd`/as
220 ac_cv_path_AS_FOR_TARGET=$AS_FOR_TARGET
221 @@ -5361,14 +5373,14 @@
222 elif test $build != $host && test $have_gcc_for_target = yes; then
223 AS_FOR_TARGET=`$GCC_FOR_TARGET --print-prog-name=as`
224 test $AS_FOR_TARGET=as && AS_FOR_TARGET=
225 - ac_cv_path_AS_FOR_TARGET=$AS_FOR_TARGET
226 + test -n "$AS_FOR_TARGET" && ac_cv_path_AS_FOR_TARGET=$AS_FOR_TARGET
229 if test -z "$ac_cv_path_AS_FOR_TARGET" ; then
230 # Extract the first word of "as", so it can be a program name with args.
231 set dummy as; ac_word=$2
232 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
233 -echo "configure:5372: checking for $ac_word" >&5
234 +echo "configure:5384: checking for $ac_word" >&5
235 if eval "test \"`echo '$''{'ac_cv_path_AS_FOR_TARGET'+set}'`\" = set"; then
236 echo $ac_n "(cached) $ac_c" 1>&6
238 @@ -5405,7 +5417,7 @@
239 if test -n "$with_build_time_tools"; then
240 for ncn_progname in as; do
241 echo $ac_n "checking for ${ncn_progname} in $with_build_time_tools""... $ac_c" 1>&6
242 -echo "configure:5409: checking for ${ncn_progname} in $with_build_time_tools" >&5
243 +echo "configure:5421: checking for ${ncn_progname} in $with_build_time_tools" >&5
244 if test -x $with_build_time_tools/${ncn_progname}; then
245 ac_cv_prog_AS_FOR_TARGET=$with_build_time_tools/${ncn_progname}
246 echo "$ac_t""yes" 1>&6
247 @@ -5422,7 +5434,7 @@
248 # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args.
249 set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2
250 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
251 -echo "configure:5426: checking for $ac_word" >&5
252 +echo "configure:5438: checking for $ac_word" >&5
253 if eval "test \"`echo '$''{'ac_cv_prog_AS_FOR_TARGET'+set}'`\" = set"; then
254 echo $ac_n "(cached) $ac_c" 1>&6
256 @@ -5453,7 +5465,7 @@
257 # Extract the first word of "${ncn_progname}", so it can be a program name with args.
258 set dummy ${ncn_progname}; ac_word=$2
259 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
260 -echo "configure:5457: checking for $ac_word" >&5
261 +echo "configure:5469: checking for $ac_word" >&5
262 if eval "test \"`echo '$''{'ac_cv_prog_AS_FOR_TARGET'+set}'`\" = set"; then
263 echo $ac_n "(cached) $ac_c" 1>&6
265 @@ -5491,6 +5503,8 @@
267 AS_FOR_TARGET="${ncn_target_tool_prefix}$2"
270 + AS_FOR_TARGET="$ac_cv_prog_AS_FOR_TARGET"
274 @@ -5503,7 +5517,7 @@
275 if test -z "$ac_cv_path_DLLTOOL_FOR_TARGET" ; then
276 if test -n "$with_build_time_tools"; then
277 echo $ac_n "checking for dlltool in $with_build_time_tools""... $ac_c" 1>&6
278 -echo "configure:5507: checking for dlltool in $with_build_time_tools" >&5
279 +echo "configure:5521: checking for dlltool in $with_build_time_tools" >&5
280 if test -x $with_build_time_tools/dlltool; then
281 DLLTOOL_FOR_TARGET=`cd $with_build_time_tools && pwd`/dlltool
282 ac_cv_path_DLLTOOL_FOR_TARGET=$DLLTOOL_FOR_TARGET
283 @@ -5514,14 +5528,14 @@
284 elif test $build != $host && test $have_gcc_for_target = yes; then
285 DLLTOOL_FOR_TARGET=`$GCC_FOR_TARGET --print-prog-name=dlltool`
286 test $DLLTOOL_FOR_TARGET=dlltool && DLLTOOL_FOR_TARGET=
287 - ac_cv_path_DLLTOOL_FOR_TARGET=$DLLTOOL_FOR_TARGET
288 + test -n "$DLLTOOL_FOR_TARGET" && ac_cv_path_DLLTOOL_FOR_TARGET=$DLLTOOL_FOR_TARGET
291 if test -z "$ac_cv_path_DLLTOOL_FOR_TARGET" ; then
292 # Extract the first word of "dlltool", so it can be a program name with args.
293 set dummy dlltool; ac_word=$2
294 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
295 -echo "configure:5525: checking for $ac_word" >&5
296 +echo "configure:5539: checking for $ac_word" >&5
297 if eval "test \"`echo '$''{'ac_cv_path_DLLTOOL_FOR_TARGET'+set}'`\" = set"; then
298 echo $ac_n "(cached) $ac_c" 1>&6
300 @@ -5558,7 +5572,7 @@
301 if test -n "$with_build_time_tools"; then
302 for ncn_progname in dlltool; do
303 echo $ac_n "checking for ${ncn_progname} in $with_build_time_tools""... $ac_c" 1>&6
304 -echo "configure:5562: checking for ${ncn_progname} in $with_build_time_tools" >&5
305 +echo "configure:5576: checking for ${ncn_progname} in $with_build_time_tools" >&5
306 if test -x $with_build_time_tools/${ncn_progname}; then
307 ac_cv_prog_DLLTOOL_FOR_TARGET=$with_build_time_tools/${ncn_progname}
308 echo "$ac_t""yes" 1>&6
309 @@ -5575,7 +5589,7 @@
310 # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args.
311 set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2
312 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
313 -echo "configure:5579: checking for $ac_word" >&5
314 +echo "configure:5593: checking for $ac_word" >&5
315 if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL_FOR_TARGET'+set}'`\" = set"; then
316 echo $ac_n "(cached) $ac_c" 1>&6
318 @@ -5606,7 +5620,7 @@
319 # Extract the first word of "${ncn_progname}", so it can be a program name with args.
320 set dummy ${ncn_progname}; ac_word=$2
321 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
322 -echo "configure:5610: checking for $ac_word" >&5
323 +echo "configure:5624: checking for $ac_word" >&5
324 if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL_FOR_TARGET'+set}'`\" = set"; then
325 echo $ac_n "(cached) $ac_c" 1>&6
327 @@ -5644,6 +5658,8 @@
329 DLLTOOL_FOR_TARGET="${ncn_target_tool_prefix}$2"
332 + DLLTOOL_FOR_TARGET="$ac_cv_prog_DLLTOOL_FOR_TARGET"
336 @@ -5656,7 +5672,7 @@
337 if test -z "$ac_cv_path_LD_FOR_TARGET" ; then
338 if test -n "$with_build_time_tools"; then
339 echo $ac_n "checking for ld in $with_build_time_tools""... $ac_c" 1>&6
340 -echo "configure:5660: checking for ld in $with_build_time_tools" >&5
341 +echo "configure:5676: checking for ld in $with_build_time_tools" >&5
342 if test -x $with_build_time_tools/ld; then
343 LD_FOR_TARGET=`cd $with_build_time_tools && pwd`/ld
344 ac_cv_path_LD_FOR_TARGET=$LD_FOR_TARGET
345 @@ -5667,14 +5683,14 @@
346 elif test $build != $host && test $have_gcc_for_target = yes; then
347 LD_FOR_TARGET=`$GCC_FOR_TARGET --print-prog-name=ld`
348 test $LD_FOR_TARGET=ld && LD_FOR_TARGET=
349 - ac_cv_path_LD_FOR_TARGET=$LD_FOR_TARGET
350 + test -n "$LD_FOR_TARGET" && ac_cv_path_LD_FOR_TARGET=$LD_FOR_TARGET
353 if test -z "$ac_cv_path_LD_FOR_TARGET" ; then
354 # Extract the first word of "ld", so it can be a program name with args.
355 set dummy ld; ac_word=$2
356 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
357 -echo "configure:5678: checking for $ac_word" >&5
358 +echo "configure:5694: checking for $ac_word" >&5
359 if eval "test \"`echo '$''{'ac_cv_path_LD_FOR_TARGET'+set}'`\" = set"; then
360 echo $ac_n "(cached) $ac_c" 1>&6
362 @@ -5711,7 +5727,7 @@
363 if test -n "$with_build_time_tools"; then
364 for ncn_progname in ld; do
365 echo $ac_n "checking for ${ncn_progname} in $with_build_time_tools""... $ac_c" 1>&6
366 -echo "configure:5715: checking for ${ncn_progname} in $with_build_time_tools" >&5
367 +echo "configure:5731: checking for ${ncn_progname} in $with_build_time_tools" >&5
368 if test -x $with_build_time_tools/${ncn_progname}; then
369 ac_cv_prog_LD_FOR_TARGET=$with_build_time_tools/${ncn_progname}
370 echo "$ac_t""yes" 1>&6
371 @@ -5728,7 +5744,7 @@
372 # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args.
373 set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2
374 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
375 -echo "configure:5732: checking for $ac_word" >&5
376 +echo "configure:5748: checking for $ac_word" >&5
377 if eval "test \"`echo '$''{'ac_cv_prog_LD_FOR_TARGET'+set}'`\" = set"; then
378 echo $ac_n "(cached) $ac_c" 1>&6
380 @@ -5759,7 +5775,7 @@
381 # Extract the first word of "${ncn_progname}", so it can be a program name with args.
382 set dummy ${ncn_progname}; ac_word=$2
383 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
384 -echo "configure:5763: checking for $ac_word" >&5
385 +echo "configure:5779: checking for $ac_word" >&5
386 if eval "test \"`echo '$''{'ac_cv_prog_LD_FOR_TARGET'+set}'`\" = set"; then
387 echo $ac_n "(cached) $ac_c" 1>&6
389 @@ -5797,6 +5813,8 @@
391 LD_FOR_TARGET="${ncn_target_tool_prefix}$2"
394 + LD_FOR_TARGET="$ac_cv_prog_LD_FOR_TARGET"
398 @@ -5809,7 +5827,7 @@
399 if test -z "$ac_cv_path_LIPO_FOR_TARGET" ; then
400 if test -n "$with_build_time_tools"; then
401 echo $ac_n "checking for lipo in $with_build_time_tools""... $ac_c" 1>&6
402 -echo "configure:5813: checking for lipo in $with_build_time_tools" >&5
403 +echo "configure:5831: checking for lipo in $with_build_time_tools" >&5
404 if test -x $with_build_time_tools/lipo; then
405 LIPO_FOR_TARGET=`cd $with_build_time_tools && pwd`/lipo
406 ac_cv_path_LIPO_FOR_TARGET=$LIPO_FOR_TARGET
407 @@ -5820,14 +5838,14 @@
408 elif test $build != $host && test $have_gcc_for_target = yes; then
409 LIPO_FOR_TARGET=`$GCC_FOR_TARGET --print-prog-name=lipo`
410 test $LIPO_FOR_TARGET=lipo && LIPO_FOR_TARGET=
411 - ac_cv_path_LIPO_FOR_TARGET=$LIPO_FOR_TARGET
412 + test -n "$LIPO_FOR_TARGET" && ac_cv_path_LIPO_FOR_TARGET=$LIPO_FOR_TARGET
415 if test -z "$ac_cv_path_LIPO_FOR_TARGET" ; then
416 # Extract the first word of "lipo", so it can be a program name with args.
417 set dummy lipo; ac_word=$2
418 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
419 -echo "configure:5831: checking for $ac_word" >&5
420 +echo "configure:5849: checking for $ac_word" >&5
421 if eval "test \"`echo '$''{'ac_cv_path_LIPO_FOR_TARGET'+set}'`\" = set"; then
422 echo $ac_n "(cached) $ac_c" 1>&6
424 @@ -5864,7 +5882,7 @@
425 if test -n "$with_build_time_tools"; then
426 for ncn_progname in lipo; do
427 echo $ac_n "checking for ${ncn_progname} in $with_build_time_tools""... $ac_c" 1>&6
428 -echo "configure:5868: checking for ${ncn_progname} in $with_build_time_tools" >&5
429 +echo "configure:5886: checking for ${ncn_progname} in $with_build_time_tools" >&5
430 if test -x $with_build_time_tools/${ncn_progname}; then
431 ac_cv_prog_LIPO_FOR_TARGET=$with_build_time_tools/${ncn_progname}
432 echo "$ac_t""yes" 1>&6
433 @@ -5881,7 +5899,7 @@
434 # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args.
435 set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2
436 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
437 -echo "configure:5885: checking for $ac_word" >&5
438 +echo "configure:5903: checking for $ac_word" >&5
439 if eval "test \"`echo '$''{'ac_cv_prog_LIPO_FOR_TARGET'+set}'`\" = set"; then
440 echo $ac_n "(cached) $ac_c" 1>&6
442 @@ -5912,7 +5930,7 @@
443 # Extract the first word of "${ncn_progname}", so it can be a program name with args.
444 set dummy ${ncn_progname}; ac_word=$2
445 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
446 -echo "configure:5916: checking for $ac_word" >&5
447 +echo "configure:5934: checking for $ac_word" >&5
448 if eval "test \"`echo '$''{'ac_cv_prog_LIPO_FOR_TARGET'+set}'`\" = set"; then
449 echo $ac_n "(cached) $ac_c" 1>&6
451 @@ -5950,6 +5968,8 @@
453 LIPO_FOR_TARGET="${ncn_target_tool_prefix}$2"
456 + LIPO_FOR_TARGET="$ac_cv_prog_LIPO_FOR_TARGET"
460 @@ -5962,7 +5982,7 @@
461 if test -z "$ac_cv_path_NM_FOR_TARGET" ; then
462 if test -n "$with_build_time_tools"; then
463 echo $ac_n "checking for nm in $with_build_time_tools""... $ac_c" 1>&6
464 -echo "configure:5966: checking for nm in $with_build_time_tools" >&5
465 +echo "configure:5986: checking for nm in $with_build_time_tools" >&5
466 if test -x $with_build_time_tools/nm; then
467 NM_FOR_TARGET=`cd $with_build_time_tools && pwd`/nm
468 ac_cv_path_NM_FOR_TARGET=$NM_FOR_TARGET
469 @@ -5973,14 +5993,14 @@
470 elif test $build != $host && test $have_gcc_for_target = yes; then
471 NM_FOR_TARGET=`$GCC_FOR_TARGET --print-prog-name=nm`
472 test $NM_FOR_TARGET=nm && NM_FOR_TARGET=
473 - ac_cv_path_NM_FOR_TARGET=$NM_FOR_TARGET
474 + test -n "$NM_FOR_TARGET" && ac_cv_path_NM_FOR_TARGET=$NM_FOR_TARGET
477 if test -z "$ac_cv_path_NM_FOR_TARGET" ; then
478 # Extract the first word of "nm", so it can be a program name with args.
479 set dummy nm; ac_word=$2
480 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
481 -echo "configure:5984: checking for $ac_word" >&5
482 +echo "configure:6004: checking for $ac_word" >&5
483 if eval "test \"`echo '$''{'ac_cv_path_NM_FOR_TARGET'+set}'`\" = set"; then
484 echo $ac_n "(cached) $ac_c" 1>&6
486 @@ -6017,7 +6037,7 @@
487 if test -n "$with_build_time_tools"; then
488 for ncn_progname in nm; do
489 echo $ac_n "checking for ${ncn_progname} in $with_build_time_tools""... $ac_c" 1>&6
490 -echo "configure:6021: checking for ${ncn_progname} in $with_build_time_tools" >&5
491 +echo "configure:6041: checking for ${ncn_progname} in $with_build_time_tools" >&5
492 if test -x $with_build_time_tools/${ncn_progname}; then
493 ac_cv_prog_NM_FOR_TARGET=$with_build_time_tools/${ncn_progname}
494 echo "$ac_t""yes" 1>&6
495 @@ -6034,7 +6054,7 @@
496 # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args.
497 set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2
498 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
499 -echo "configure:6038: checking for $ac_word" >&5
500 +echo "configure:6058: checking for $ac_word" >&5
501 if eval "test \"`echo '$''{'ac_cv_prog_NM_FOR_TARGET'+set}'`\" = set"; then
502 echo $ac_n "(cached) $ac_c" 1>&6
504 @@ -6065,7 +6085,7 @@
505 # Extract the first word of "${ncn_progname}", so it can be a program name with args.
506 set dummy ${ncn_progname}; ac_word=$2
507 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
508 -echo "configure:6069: checking for $ac_word" >&5
509 +echo "configure:6089: checking for $ac_word" >&5
510 if eval "test \"`echo '$''{'ac_cv_prog_NM_FOR_TARGET'+set}'`\" = set"; then
511 echo $ac_n "(cached) $ac_c" 1>&6
513 @@ -6103,6 +6123,8 @@
515 NM_FOR_TARGET="${ncn_target_tool_prefix}$2"
518 + NM_FOR_TARGET="$ac_cv_prog_NM_FOR_TARGET"
522 @@ -6115,7 +6137,7 @@
523 if test -z "$ac_cv_path_OBJDUMP_FOR_TARGET" ; then
524 if test -n "$with_build_time_tools"; then
525 echo $ac_n "checking for objdump in $with_build_time_tools""... $ac_c" 1>&6
526 -echo "configure:6119: checking for objdump in $with_build_time_tools" >&5
527 +echo "configure:6141: checking for objdump in $with_build_time_tools" >&5
528 if test -x $with_build_time_tools/objdump; then
529 OBJDUMP_FOR_TARGET=`cd $with_build_time_tools && pwd`/objdump
530 ac_cv_path_OBJDUMP_FOR_TARGET=$OBJDUMP_FOR_TARGET
531 @@ -6126,14 +6148,14 @@
532 elif test $build != $host && test $have_gcc_for_target = yes; then
533 OBJDUMP_FOR_TARGET=`$GCC_FOR_TARGET --print-prog-name=objdump`
534 test $OBJDUMP_FOR_TARGET=objdump && OBJDUMP_FOR_TARGET=
535 - ac_cv_path_OBJDUMP_FOR_TARGET=$OBJDUMP_FOR_TARGET
536 + test -n "$OBJDUMP_FOR_TARGET" && ac_cv_path_OBJDUMP_FOR_TARGET=$OBJDUMP_FOR_TARGET
539 if test -z "$ac_cv_path_OBJDUMP_FOR_TARGET" ; then
540 # Extract the first word of "objdump", so it can be a program name with args.
541 set dummy objdump; ac_word=$2
542 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
543 -echo "configure:6137: checking for $ac_word" >&5
544 +echo "configure:6159: checking for $ac_word" >&5
545 if eval "test \"`echo '$''{'ac_cv_path_OBJDUMP_FOR_TARGET'+set}'`\" = set"; then
546 echo $ac_n "(cached) $ac_c" 1>&6
548 @@ -6170,7 +6192,7 @@
549 if test -n "$with_build_time_tools"; then
550 for ncn_progname in objdump; do
551 echo $ac_n "checking for ${ncn_progname} in $with_build_time_tools""... $ac_c" 1>&6
552 -echo "configure:6174: checking for ${ncn_progname} in $with_build_time_tools" >&5
553 +echo "configure:6196: checking for ${ncn_progname} in $with_build_time_tools" >&5
554 if test -x $with_build_time_tools/${ncn_progname}; then
555 ac_cv_prog_OBJDUMP_FOR_TARGET=$with_build_time_tools/${ncn_progname}
556 echo "$ac_t""yes" 1>&6
557 @@ -6187,7 +6209,7 @@
558 # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args.
559 set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2
560 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
561 -echo "configure:6191: checking for $ac_word" >&5
562 +echo "configure:6213: checking for $ac_word" >&5
563 if eval "test \"`echo '$''{'ac_cv_prog_OBJDUMP_FOR_TARGET'+set}'`\" = set"; then
564 echo $ac_n "(cached) $ac_c" 1>&6
566 @@ -6218,7 +6240,7 @@
567 # Extract the first word of "${ncn_progname}", so it can be a program name with args.
568 set dummy ${ncn_progname}; ac_word=$2
569 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
570 -echo "configure:6222: checking for $ac_word" >&5
571 +echo "configure:6244: checking for $ac_word" >&5
572 if eval "test \"`echo '$''{'ac_cv_prog_OBJDUMP_FOR_TARGET'+set}'`\" = set"; then
573 echo $ac_n "(cached) $ac_c" 1>&6
575 @@ -6256,6 +6278,8 @@
577 OBJDUMP_FOR_TARGET="${ncn_target_tool_prefix}$2"
580 + OBJDUMP_FOR_TARGET="$ac_cv_prog_OBJDUMP_FOR_TARGET"
584 @@ -6268,7 +6292,7 @@
585 if test -z "$ac_cv_path_RANLIB_FOR_TARGET" ; then
586 if test -n "$with_build_time_tools"; then
587 echo $ac_n "checking for ranlib in $with_build_time_tools""... $ac_c" 1>&6
588 -echo "configure:6272: checking for ranlib in $with_build_time_tools" >&5
589 +echo "configure:6296: checking for ranlib in $with_build_time_tools" >&5
590 if test -x $with_build_time_tools/ranlib; then
591 RANLIB_FOR_TARGET=`cd $with_build_time_tools && pwd`/ranlib
592 ac_cv_path_RANLIB_FOR_TARGET=$RANLIB_FOR_TARGET
593 @@ -6279,14 +6303,14 @@
594 elif test $build != $host && test $have_gcc_for_target = yes; then
595 RANLIB_FOR_TARGET=`$GCC_FOR_TARGET --print-prog-name=ranlib`
596 test $RANLIB_FOR_TARGET=ranlib && RANLIB_FOR_TARGET=
597 - ac_cv_path_RANLIB_FOR_TARGET=$RANLIB_FOR_TARGET
598 + test -n "$RANLIB_FOR_TARGET" && ac_cv_path_RANLIB_FOR_TARGET=$RANLIB_FOR_TARGET
601 if test -z "$ac_cv_path_RANLIB_FOR_TARGET" ; then
602 # Extract the first word of "ranlib", so it can be a program name with args.
603 set dummy ranlib; ac_word=$2
604 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
605 -echo "configure:6290: checking for $ac_word" >&5
606 +echo "configure:6314: checking for $ac_word" >&5
607 if eval "test \"`echo '$''{'ac_cv_path_RANLIB_FOR_TARGET'+set}'`\" = set"; then
608 echo $ac_n "(cached) $ac_c" 1>&6
610 @@ -6323,7 +6347,7 @@
611 if test -n "$with_build_time_tools"; then
612 for ncn_progname in ranlib; do
613 echo $ac_n "checking for ${ncn_progname} in $with_build_time_tools""... $ac_c" 1>&6
614 -echo "configure:6327: checking for ${ncn_progname} in $with_build_time_tools" >&5
615 +echo "configure:6351: checking for ${ncn_progname} in $with_build_time_tools" >&5
616 if test -x $with_build_time_tools/${ncn_progname}; then
617 ac_cv_prog_RANLIB_FOR_TARGET=$with_build_time_tools/${ncn_progname}
618 echo "$ac_t""yes" 1>&6
619 @@ -6340,7 +6364,7 @@
620 # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args.
621 set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2
622 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
623 -echo "configure:6344: checking for $ac_word" >&5
624 +echo "configure:6368: checking for $ac_word" >&5
625 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB_FOR_TARGET'+set}'`\" = set"; then
626 echo $ac_n "(cached) $ac_c" 1>&6
628 @@ -6371,7 +6395,7 @@
629 # Extract the first word of "${ncn_progname}", so it can be a program name with args.
630 set dummy ${ncn_progname}; ac_word=$2
631 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
632 -echo "configure:6375: checking for $ac_word" >&5
633 +echo "configure:6399: checking for $ac_word" >&5
634 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB_FOR_TARGET'+set}'`\" = set"; then
635 echo $ac_n "(cached) $ac_c" 1>&6
637 @@ -6409,6 +6433,8 @@
639 RANLIB_FOR_TARGET="${ncn_target_tool_prefix}$2"
642 + RANLIB_FOR_TARGET="$ac_cv_prog_RANLIB_FOR_TARGET"
646 @@ -6421,7 +6447,7 @@
647 if test -z "$ac_cv_path_STRIP_FOR_TARGET" ; then
648 if test -n "$with_build_time_tools"; then
649 echo $ac_n "checking for strip in $with_build_time_tools""... $ac_c" 1>&6
650 -echo "configure:6425: checking for strip in $with_build_time_tools" >&5
651 +echo "configure:6451: checking for strip in $with_build_time_tools" >&5
652 if test -x $with_build_time_tools/strip; then
653 STRIP_FOR_TARGET=`cd $with_build_time_tools && pwd`/strip
654 ac_cv_path_STRIP_FOR_TARGET=$STRIP_FOR_TARGET
655 @@ -6432,14 +6458,14 @@
656 elif test $build != $host && test $have_gcc_for_target = yes; then
657 STRIP_FOR_TARGET=`$GCC_FOR_TARGET --print-prog-name=strip`
658 test $STRIP_FOR_TARGET=strip && STRIP_FOR_TARGET=
659 - ac_cv_path_STRIP_FOR_TARGET=$STRIP_FOR_TARGET
660 + test -n "$STRIP_FOR_TARGET" && ac_cv_path_STRIP_FOR_TARGET=$STRIP_FOR_TARGET
663 if test -z "$ac_cv_path_STRIP_FOR_TARGET" ; then
664 # Extract the first word of "strip", so it can be a program name with args.
665 set dummy strip; ac_word=$2
666 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
667 -echo "configure:6443: checking for $ac_word" >&5
668 +echo "configure:6469: checking for $ac_word" >&5
669 if eval "test \"`echo '$''{'ac_cv_path_STRIP_FOR_TARGET'+set}'`\" = set"; then
670 echo $ac_n "(cached) $ac_c" 1>&6
672 @@ -6476,7 +6502,7 @@
673 if test -n "$with_build_time_tools"; then
674 for ncn_progname in strip; do
675 echo $ac_n "checking for ${ncn_progname} in $with_build_time_tools""... $ac_c" 1>&6
676 -echo "configure:6480: checking for ${ncn_progname} in $with_build_time_tools" >&5
677 +echo "configure:6506: checking for ${ncn_progname} in $with_build_time_tools" >&5
678 if test -x $with_build_time_tools/${ncn_progname}; then
679 ac_cv_prog_STRIP_FOR_TARGET=$with_build_time_tools/${ncn_progname}
680 echo "$ac_t""yes" 1>&6
681 @@ -6493,7 +6519,7 @@
682 # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args.
683 set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2
684 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
685 -echo "configure:6497: checking for $ac_word" >&5
686 +echo "configure:6523: checking for $ac_word" >&5
687 if eval "test \"`echo '$''{'ac_cv_prog_STRIP_FOR_TARGET'+set}'`\" = set"; then
688 echo $ac_n "(cached) $ac_c" 1>&6
690 @@ -6524,7 +6550,7 @@
691 # Extract the first word of "${ncn_progname}", so it can be a program name with args.
692 set dummy ${ncn_progname}; ac_word=$2
693 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
694 -echo "configure:6528: checking for $ac_word" >&5
695 +echo "configure:6554: checking for $ac_word" >&5
696 if eval "test \"`echo '$''{'ac_cv_prog_STRIP_FOR_TARGET'+set}'`\" = set"; then
697 echo $ac_n "(cached) $ac_c" 1>&6
699 @@ -6562,6 +6588,8 @@
701 STRIP_FOR_TARGET="${ncn_target_tool_prefix}$2"
704 + STRIP_FOR_TARGET="$ac_cv_prog_STRIP_FOR_TARGET"
708 @@ -6574,7 +6602,7 @@
709 if test -z "$ac_cv_path_WINDRES_FOR_TARGET" ; then
710 if test -n "$with_build_time_tools"; then
711 echo $ac_n "checking for windres in $with_build_time_tools""... $ac_c" 1>&6
712 -echo "configure:6578: checking for windres in $with_build_time_tools" >&5
713 +echo "configure:6606: checking for windres in $with_build_time_tools" >&5
714 if test -x $with_build_time_tools/windres; then
715 WINDRES_FOR_TARGET=`cd $with_build_time_tools && pwd`/windres
716 ac_cv_path_WINDRES_FOR_TARGET=$WINDRES_FOR_TARGET
717 @@ -6585,14 +6613,14 @@
718 elif test $build != $host && test $have_gcc_for_target = yes; then
719 WINDRES_FOR_TARGET=`$GCC_FOR_TARGET --print-prog-name=windres`
720 test $WINDRES_FOR_TARGET=windres && WINDRES_FOR_TARGET=
721 - ac_cv_path_WINDRES_FOR_TARGET=$WINDRES_FOR_TARGET
722 + test -n "$WINDRES_FOR_TARGET" && ac_cv_path_WINDRES_FOR_TARGET=$WINDRES_FOR_TARGET
725 if test -z "$ac_cv_path_WINDRES_FOR_TARGET" ; then
726 # Extract the first word of "windres", so it can be a program name with args.
727 set dummy windres; ac_word=$2
728 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
729 -echo "configure:6596: checking for $ac_word" >&5
730 +echo "configure:6624: checking for $ac_word" >&5
731 if eval "test \"`echo '$''{'ac_cv_path_WINDRES_FOR_TARGET'+set}'`\" = set"; then
732 echo $ac_n "(cached) $ac_c" 1>&6
734 @@ -6629,7 +6657,7 @@
735 if test -n "$with_build_time_tools"; then
736 for ncn_progname in windres; do
737 echo $ac_n "checking for ${ncn_progname} in $with_build_time_tools""... $ac_c" 1>&6
738 -echo "configure:6633: checking for ${ncn_progname} in $with_build_time_tools" >&5
739 +echo "configure:6661: checking for ${ncn_progname} in $with_build_time_tools" >&5
740 if test -x $with_build_time_tools/${ncn_progname}; then
741 ac_cv_prog_WINDRES_FOR_TARGET=$with_build_time_tools/${ncn_progname}
742 echo "$ac_t""yes" 1>&6
743 @@ -6646,7 +6674,7 @@
744 # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args.
745 set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2
746 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
747 -echo "configure:6650: checking for $ac_word" >&5
748 +echo "configure:6678: checking for $ac_word" >&5
749 if eval "test \"`echo '$''{'ac_cv_prog_WINDRES_FOR_TARGET'+set}'`\" = set"; then
750 echo $ac_n "(cached) $ac_c" 1>&6
752 @@ -6677,7 +6705,7 @@
753 # Extract the first word of "${ncn_progname}", so it can be a program name with args.
754 set dummy ${ncn_progname}; ac_word=$2
755 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
756 -echo "configure:6681: checking for $ac_word" >&5
757 +echo "configure:6709: checking for $ac_word" >&5
758 if eval "test \"`echo '$''{'ac_cv_prog_WINDRES_FOR_TARGET'+set}'`\" = set"; then
759 echo $ac_n "(cached) $ac_c" 1>&6
761 @@ -6715,6 +6743,8 @@
763 WINDRES_FOR_TARGET="${ncn_target_tool_prefix}$2"
766 + WINDRES_FOR_TARGET="$ac_cv_prog_WINDRES_FOR_TARGET"
770 @@ -6725,7 +6755,7 @@
771 RAW_CXX_FOR_TARGET="$CXX_FOR_TARGET"
773 echo $ac_n "checking where to find the target ar""... $ac_c" 1>&6
774 -echo "configure:6729: checking where to find the target ar" >&5
775 +echo "configure:6759: checking where to find the target ar" >&5
776 if test "x${build}" != "x${host}" ; then
777 if expr "x$AR_FOR_TARGET" : "x/" > /dev/null; then
778 # We already found the complete path
779 @@ -6758,7 +6788,7 @@
782 echo $ac_n "checking where to find the target as""... $ac_c" 1>&6
783 -echo "configure:6762: checking where to find the target as" >&5
784 +echo "configure:6792: checking where to find the target as" >&5
785 if test "x${build}" != "x${host}" ; then
786 if expr "x$AS_FOR_TARGET" : "x/" > /dev/null; then
787 # We already found the complete path
788 @@ -6791,7 +6821,7 @@
791 echo $ac_n "checking where to find the target cc""... $ac_c" 1>&6
792 -echo "configure:6795: checking where to find the target cc" >&5
793 +echo "configure:6825: checking where to find the target cc" >&5
794 if test "x${build}" != "x${host}" ; then
795 if expr "x$CC_FOR_TARGET" : "x/" > /dev/null; then
796 # We already found the complete path
797 @@ -6824,7 +6854,7 @@
800 echo $ac_n "checking where to find the target c++""... $ac_c" 1>&6
801 -echo "configure:6828: checking where to find the target c++" >&5
802 +echo "configure:6858: checking where to find the target c++" >&5
803 if test "x${build}" != "x${host}" ; then
804 if expr "x$CXX_FOR_TARGET" : "x/" > /dev/null; then
805 # We already found the complete path
806 @@ -6860,7 +6890,7 @@
809 echo $ac_n "checking where to find the target c++ for libstdc++""... $ac_c" 1>&6
810 -echo "configure:6864: checking where to find the target c++ for libstdc++" >&5
811 +echo "configure:6894: checking where to find the target c++ for libstdc++" >&5
812 if test "x${build}" != "x${host}" ; then
813 if expr "x$RAW_CXX_FOR_TARGET" : "x/" > /dev/null; then
814 # We already found the complete path
815 @@ -6896,7 +6926,7 @@
818 echo $ac_n "checking where to find the target dlltool""... $ac_c" 1>&6
819 -echo "configure:6900: checking where to find the target dlltool" >&5
820 +echo "configure:6930: checking where to find the target dlltool" >&5
821 if test "x${build}" != "x${host}" ; then
822 if expr "x$DLLTOOL_FOR_TARGET" : "x/" > /dev/null; then
823 # We already found the complete path
824 @@ -6929,7 +6959,7 @@
827 echo $ac_n "checking where to find the target gcc""... $ac_c" 1>&6
828 -echo "configure:6933: checking where to find the target gcc" >&5
829 +echo "configure:6963: checking where to find the target gcc" >&5
830 if test "x${build}" != "x${host}" ; then
831 if expr "x$GCC_FOR_TARGET" : "x/" > /dev/null; then
832 # We already found the complete path
833 @@ -6962,7 +6992,7 @@
836 echo $ac_n "checking where to find the target gcj""... $ac_c" 1>&6
837 -echo "configure:6966: checking where to find the target gcj" >&5
838 +echo "configure:6996: checking where to find the target gcj" >&5
839 if test "x${build}" != "x${host}" ; then
840 if expr "x$GCJ_FOR_TARGET" : "x/" > /dev/null; then
841 # We already found the complete path
842 @@ -6998,7 +7028,7 @@
845 echo $ac_n "checking where to find the target gfortran""... $ac_c" 1>&6
846 -echo "configure:7002: checking where to find the target gfortran" >&5
847 +echo "configure:7032: checking where to find the target gfortran" >&5
848 if test "x${build}" != "x${host}" ; then
849 if expr "x$GFORTRAN_FOR_TARGET" : "x/" > /dev/null; then
850 # We already found the complete path
851 @@ -7034,7 +7064,7 @@
854 echo $ac_n "checking where to find the target ld""... $ac_c" 1>&6
855 -echo "configure:7038: checking where to find the target ld" >&5
856 +echo "configure:7068: checking where to find the target ld" >&5
857 if test "x${build}" != "x${host}" ; then
858 if expr "x$LD_FOR_TARGET" : "x/" > /dev/null; then
859 # We already found the complete path
860 @@ -7067,7 +7097,7 @@
863 echo $ac_n "checking where to find the target lipo""... $ac_c" 1>&6
864 -echo "configure:7071: checking where to find the target lipo" >&5
865 +echo "configure:7101: checking where to find the target lipo" >&5
866 if test "x${build}" != "x${host}" ; then
867 if expr "x$LIPO_FOR_TARGET" : "x/" > /dev/null; then
868 # We already found the complete path
869 @@ -7090,7 +7120,7 @@
872 echo $ac_n "checking where to find the target nm""... $ac_c" 1>&6
873 -echo "configure:7094: checking where to find the target nm" >&5
874 +echo "configure:7124: checking where to find the target nm" >&5
875 if test "x${build}" != "x${host}" ; then
876 if expr "x$NM_FOR_TARGET" : "x/" > /dev/null; then
877 # We already found the complete path
878 @@ -7123,7 +7153,7 @@
881 echo $ac_n "checking where to find the target objdump""... $ac_c" 1>&6
882 -echo "configure:7127: checking where to find the target objdump" >&5
883 +echo "configure:7157: checking where to find the target objdump" >&5
884 if test "x${build}" != "x${host}" ; then
885 if expr "x$OBJDUMP_FOR_TARGET" : "x/" > /dev/null; then
886 # We already found the complete path
887 @@ -7156,7 +7186,7 @@
890 echo $ac_n "checking where to find the target ranlib""... $ac_c" 1>&6
891 -echo "configure:7160: checking where to find the target ranlib" >&5
892 +echo "configure:7190: checking where to find the target ranlib" >&5
893 if test "x${build}" != "x${host}" ; then
894 if expr "x$RANLIB_FOR_TARGET" : "x/" > /dev/null; then
895 # We already found the complete path
896 @@ -7189,7 +7219,7 @@
899 echo $ac_n "checking where to find the target strip""... $ac_c" 1>&6
900 -echo "configure:7193: checking where to find the target strip" >&5
901 +echo "configure:7223: checking where to find the target strip" >&5
902 if test "x${build}" != "x${host}" ; then
903 if expr "x$STRIP_FOR_TARGET" : "x/" > /dev/null; then
904 # We already found the complete path
905 @@ -7222,7 +7252,7 @@
908 echo $ac_n "checking where to find the target windres""... $ac_c" 1>&6
909 -echo "configure:7226: checking where to find the target windres" >&5
910 +echo "configure:7256: checking where to find the target windres" >&5
911 if test "x${build}" != "x${host}" ; then
912 if expr "x$WINDRES_FOR_TARGET" : "x/" > /dev/null; then
913 # We already found the complete path
914 @@ -7283,7 +7313,7 @@
917 echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
918 -echo "configure:7287: checking whether to enable maintainer-specific portions of Makefiles" >&5
919 +echo "configure:7317: checking whether to enable maintainer-specific portions of Makefiles" >&5
920 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
921 if test "${enable_maintainer_mode+set}" = set; then
922 enableval="$enable_maintainer_mode"
923 @@ -7332,16 +7362,22 @@
924 # Pass -fkeep-inline-functions for stage 1 if the GCC version supports it.
925 CFLAGS="$CFLAGS -fkeep-inline-functions"
926 echo $ac_n "checking whether -fkeep-inline-functions is supported""... $ac_c" 1>&6
927 -echo "configure:7336: checking whether -fkeep-inline-functions is supported" >&5
928 +echo "configure:7366: checking whether -fkeep-inline-functions is supported" >&5
929 cat > conftest.$ac_ext <<EOF
930 -#line 7338 "configure"
931 +#line 7368 "configure"
932 #include "confdefs.h"
934 +#if (__GNUC__ < 3) \
935 + || (__GNUC__ == 3 && (__GNUC_MINOR__ < 3 \
936 + || (__GNUC_MINOR__ == 3 && __GNUC_PATCHLEVEL__ < 1)))
937 +#error http://gcc.gnu.org/PR29382
944 -if { (eval echo configure:7345: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
945 +if { (eval echo configure:7381: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
947 echo "$ac_t""yes" 1>&6; stage1_cflags="$stage1_cflags -fkeep-inline-functions"
949 Index: libgomp/ChangeLog
950 ===================================================================
951 --- libgomp/ChangeLog (.../tags/gcc_4_2_0_release) (revision 126002)
952 +++ libgomp/ChangeLog (.../branches/gcc-4_2-branch) (revision 126002)
954 +2007-06-21 Jakub Jelinek <jakub@redhat.com>
956 + PR middle-end/32362
957 + * testsuite/libgomp.c/pr32362-1.c: New test.
958 + * testsuite/libgomp.c/pr32362-2.c: New test.
959 + * testsuite/libgomp.c/pr32362-3.c: New test.
961 2007-05-13 Release Manager
963 * GCC 4.2.0 released.
964 Index: libgomp/testsuite/libgomp.c/pr32362-1.c
965 ===================================================================
966 --- libgomp/testsuite/libgomp.c/pr32362-1.c (.../tags/gcc_4_2_0_release) (revision 0)
967 +++ libgomp/testsuite/libgomp.c/pr32362-1.c (.../branches/gcc-4_2-branch) (revision 126002)
969 +/* PR middle-end/32362 */
971 +/* { dg-options "-O2" } */
979 + int n[4] = { -1, -1, -1, -1 };
980 + static int a = 2, b = 4;
981 + omp_set_num_threads (4);
982 + omp_set_dynamic (0);
983 + omp_set_nested (1);
984 +#pragma omp parallel private(b)
986 + b = omp_get_thread_num ();
987 +#pragma omp parallel firstprivate(a)
989 + a = (omp_get_thread_num () + a) + 1;
990 + if (b == omp_get_thread_num ())
991 + n[omp_get_thread_num ()] = a + (b << 4);
997 + && (n[1] != 0x14 || n[2] != 0x25 || n[3] != 0x36))
1001 Index: libgomp/testsuite/libgomp.c/pr32362-3.c
1002 ===================================================================
1003 --- libgomp/testsuite/libgomp.c/pr32362-3.c (.../tags/gcc_4_2_0_release) (revision 0)
1004 +++ libgomp/testsuite/libgomp.c/pr32362-3.c (.../branches/gcc-4_2-branch) (revision 126002)
1006 +/* PR middle-end/32362 */
1007 +/* { dg-do run } */
1008 +/* { dg-options "-O2" } */
1011 +#include <stdlib.h>
1018 + int n[4] = { -1, -1, -1, -1 };
1020 + omp_set_num_threads (4);
1021 + omp_set_dynamic (0);
1022 + omp_set_nested (1);
1023 +#pragma omp parallel private(b)
1025 + b = omp_get_thread_num ();
1026 +#pragma omp parallel firstprivate(a)
1028 + a = (omp_get_thread_num () + a) + 1;
1029 + if (b == omp_get_thread_num ())
1030 + n[omp_get_thread_num ()] = a + (b << 4);
1036 + && (n[1] != 0x14 || n[2] != 0x25 || n[3] != 0x36))
1040 Index: libgomp/testsuite/libgomp.c/pr32362-2.c
1041 ===================================================================
1042 --- libgomp/testsuite/libgomp.c/pr32362-2.c (.../tags/gcc_4_2_0_release) (revision 0)
1043 +++ libgomp/testsuite/libgomp.c/pr32362-2.c (.../branches/gcc-4_2-branch) (revision 126002)
1045 +/* PR middle-end/32362 */
1046 +/* { dg-do run } */
1047 +/* { dg-options "-O2" } */
1050 +#include <stdlib.h>
1057 + int n[4] = { -1, -1, -1, -1 };
1058 + omp_set_num_threads (4);
1059 + omp_set_dynamic (0);
1060 + omp_set_nested (1);
1061 +#pragma omp parallel private(b)
1063 + b = omp_get_thread_num ();
1064 +#pragma omp parallel firstprivate(a)
1066 + a = (omp_get_thread_num () + a) + 1;
1067 + if (b == omp_get_thread_num ())
1068 + n[omp_get_thread_num ()] = a + (b << 4);
1074 + && (n[1] != 0x14 || n[2] != 0x25 || n[3] != 0x36))
1078 Index: gcc/tree-vrp.c
1079 ===================================================================
1080 --- gcc/tree-vrp.c (.../tags/gcc_4_2_0_release) (revision 126002)
1081 +++ gcc/tree-vrp.c (.../branches/gcc-4_2-branch) (revision 126002)
1082 @@ -195,7 +195,28 @@
1083 || operand_equal_p (val, TYPE_MIN_VALUE (TREE_TYPE (val)), 0)));
1086 +/* If VAL is now an overflow infinity, return VAL. Otherwise, return
1087 + the same value with TREE_OVERFLOW clear. This can be used to avoid
1088 + confusing a regular value with an overflow value. */
1091 +avoid_overflow_infinity (tree val)
1093 + if (!is_overflow_infinity (val))
1096 + if (operand_equal_p (val, TYPE_MAX_VALUE (TREE_TYPE (val)), 0))
1097 + return TYPE_MAX_VALUE (TREE_TYPE (val));
1100 +#ifdef ENABLE_CHECKING
1101 + gcc_assert (operand_equal_p (val, TYPE_MIN_VALUE (TREE_TYPE (val)), 0));
1103 + return TYPE_MIN_VALUE (TREE_TYPE (val));
1108 /* Return whether VAL is equal to the maximum value of its type. This
1109 will be true for a positive overflow infinity. We can't do a
1110 simple equality comparison with TYPE_MAX_VALUE because C typedefs
1111 @@ -351,23 +372,11 @@
1112 infinity when we shouldn't. */
1115 -set_value_range_to_value (value_range_t *vr, tree val)
1116 +set_value_range_to_value (value_range_t *vr, tree val, bitmap equiv)
1118 gcc_assert (is_gimple_min_invariant (val));
1119 - if (is_overflow_infinity (val))
1121 - if (operand_equal_p (val, TYPE_MAX_VALUE (TREE_TYPE (val)), 0))
1122 - val = TYPE_MAX_VALUE (TREE_TYPE (val));
1125 -#ifdef ENABLE_CHECKING
1126 - gcc_assert (operand_equal_p (val,
1127 - TYPE_MIN_VALUE (TREE_TYPE (val)), 0));
1129 - val = TYPE_MIN_VALUE (TREE_TYPE (val));
1132 - set_value_range (vr, VR_RANGE, val, val, NULL);
1133 + val = avoid_overflow_infinity (val);
1134 + set_value_range (vr, VR_RANGE, val, val, equiv);
1137 /* Set value range VR to a non-negative range of type TYPE.
1140 set_value_range_to_null (value_range_t *vr, tree type)
1142 - tree zero = build_int_cst (type, 0);
1143 - set_value_range (vr, VR_RANGE, zero, zero, vr->equiv);
1144 + set_value_range_to_value (vr, build_int_cst (type, 0), vr->equiv);
1149 if (!TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (val1)))
1152 - if (strict_overflow_p != NULL)
1153 + if (strict_overflow_p != NULL
1154 + && (code1 == SSA_NAME || !TREE_NO_WARNING (val1))
1155 + && (code2 == SSA_NAME || !TREE_NO_WARNING (val2)))
1156 *strict_overflow_p = true;
1158 if (code1 == SSA_NAME)
1159 @@ -1028,6 +1038,8 @@
1160 cond_code = swap_tree_comparison (TREE_CODE (cond));
1163 + limit = avoid_overflow_infinity (limit);
1165 type = TREE_TYPE (limit);
1166 gcc_assert (limit != var);
1168 @@ -1167,6 +1179,8 @@
1170 tree one = build_int_cst (type, 1);
1171 max = fold_build2 (MINUS_EXPR, type, max, one);
1173 + TREE_NO_WARNING (max) = 1;
1176 set_value_range (vr_p, VR_RANGE, min, max, vr_p->equiv);
1177 @@ -1200,6 +1214,8 @@
1179 tree one = build_int_cst (type, 1);
1180 min = fold_build2 (PLUS_EXPR, type, min, one);
1182 + TREE_NO_WARNING (min) = 1;
1185 set_value_range (vr_p, VR_RANGE, min, max, vr_p->equiv);
1186 @@ -1619,7 +1635,7 @@
1187 if (TREE_CODE (op0) == SSA_NAME)
1188 vr0 = *(get_value_range (op0));
1189 else if (is_gimple_min_invariant (op0))
1190 - set_value_range_to_value (&vr0, op0);
1191 + set_value_range_to_value (&vr0, op0, NULL);
1193 set_value_range_to_varying (&vr0);
1195 @@ -1627,7 +1643,7 @@
1196 if (TREE_CODE (op1) == SSA_NAME)
1197 vr1 = *(get_value_range (op1));
1198 else if (is_gimple_min_invariant (op1))
1199 - set_value_range_to_value (&vr1, op1);
1200 + set_value_range_to_value (&vr1, op1, NULL);
1202 set_value_range_to_varying (&vr1);
1204 @@ -2006,7 +2022,7 @@
1205 if (TREE_CODE (op0) == SSA_NAME)
1206 vr0 = *(get_value_range (op0));
1207 else if (is_gimple_min_invariant (op0))
1208 - set_value_range_to_value (&vr0, op0);
1209 + set_value_range_to_value (&vr0, op0, NULL);
1211 set_value_range_to_varying (&vr0);
1213 @@ -2091,6 +2107,8 @@
1214 && is_gimple_val (new_max)
1215 && tree_int_cst_equal (new_min, orig_min)
1216 && tree_int_cst_equal (new_max, orig_max)
1217 + && (!is_overflow_infinity (new_min)
1218 + || !is_overflow_infinity (new_max))
1219 && compare_values (new_min, new_max) <= 0
1220 && compare_values (new_min, new_max) >= -1)
1222 @@ -2393,7 +2411,10 @@
1223 its type may be different from _Bool. Convert VAL to EXPR's
1225 val = fold_convert (TREE_TYPE (expr), val);
1226 - set_value_range (vr, VR_RANGE, val, val, vr->equiv);
1227 + if (is_gimple_min_invariant (val))
1228 + set_value_range_to_value (vr, val, vr->equiv);
1230 + set_value_range (vr, VR_RANGE, val, val, vr->equiv);
1233 set_value_range_to_varying (vr);
1234 @@ -2424,7 +2445,7 @@
1235 else if (TREE_CODE_CLASS (code) == tcc_comparison)
1236 extract_range_from_comparison (vr, expr);
1237 else if (is_gimple_min_invariant (expr))
1238 - set_value_range_to_value (vr, expr);
1239 + set_value_range_to_value (vr, expr, NULL);
1241 set_value_range_to_varying (vr);
1243 @@ -2545,6 +2566,13 @@
1244 if (compare_values (min, max) == 1)
1248 + /* According to the loop information, the variable does not
1249 + overflow. If we think it does, probably because of an
1250 + overflow due to arithmetic on a different INF value,
1252 + if (is_negative_overflow_infinity (min))
1257 @@ -2557,13 +2585,62 @@
1258 if (compare_values (min, max) == 1)
1262 + if (is_positive_overflow_infinity (max))
1266 set_value_range (vr, VR_RANGE, min, max, vr->equiv);
1270 +/* Return true if VAR may overflow at STMT. This checks any available
1271 + loop information to see if we can determine that VAR does not
1275 +vrp_var_may_overflow (tree var, tree stmt)
1278 + tree chrec, init, step;
1280 + if (current_loops == NULL)
1283 + l = loop_containing_stmt (stmt);
1287 + chrec = instantiate_parameters (l, analyze_scalar_evolution (l, var));
1288 + if (TREE_CODE (chrec) != POLYNOMIAL_CHREC)
1291 + init = initial_condition_in_loop_num (chrec, l->num);
1292 + step = evolution_part_in_loop_num (chrec, l->num);
1294 + if (step == NULL_TREE
1295 + || !is_gimple_min_invariant (step)
1296 + || !valid_value_p (init))
1299 + /* If we get here, we know something useful about VAR based on the
1300 + loop information. If it wraps, it may overflow. */
1302 + if (scev_probably_wraps_p (init, step, stmt,
1303 + current_loops->parray[CHREC_VARIABLE (chrec)],
1307 + if (dump_file && (dump_flags & TDF_DETAILS) != 0)
1309 + print_generic_expr (dump_file, var, 0);
1310 + fprintf (dump_file, ": loop information indicates does not overflow\n");
1317 /* Given two numeric value ranges VR0, VR1 and a comparison code COMP:
1319 - Return BOOLEAN_TRUE_NODE if VR0 COMP VR1 always returns true for
1320 @@ -4156,7 +4233,7 @@
1321 t = retval = NULL_TREE;
1322 EXECUTE_IF_SET_IN_BITMAP (e2, 0, i2, bi2)
1327 value_range_t vr2 = *(vr_value[i2]);
1329 @@ -4773,7 +4850,8 @@
1330 if (vrp_val_is_max (vr_result.max))
1333 - if (!needs_overflow_infinity (TREE_TYPE (vr_result.min)))
1334 + if (!needs_overflow_infinity (TREE_TYPE (vr_result.min))
1335 + || !vrp_var_may_overflow (lhs, phi))
1336 vr_result.min = TYPE_MIN_VALUE (TREE_TYPE (vr_result.min));
1337 else if (supports_overflow_infinity (TREE_TYPE (vr_result.min)))
1339 @@ -4791,7 +4869,8 @@
1340 if (vrp_val_is_min (vr_result.min))
1343 - if (!needs_overflow_infinity (TREE_TYPE (vr_result.max)))
1344 + if (!needs_overflow_infinity (TREE_TYPE (vr_result.max))
1345 + || !vrp_var_may_overflow (lhs, phi))
1346 vr_result.max = TYPE_MAX_VALUE (TREE_TYPE (vr_result.max));
1347 else if (supports_overflow_infinity (TREE_TYPE (vr_result.max)))
1349 @@ -4971,6 +5050,8 @@
1351 tree one = build_int_cst (TREE_TYPE (op0), 1);
1352 max = fold_build2 (MINUS_EXPR, TREE_TYPE (op0), max, one);
1354 + TREE_NO_WARNING (max) = 1;
1357 else if (cond_code == GE_EXPR || cond_code == GT_EXPR)
1358 @@ -4984,6 +5065,8 @@
1360 tree one = build_int_cst (TREE_TYPE (op0), 1);
1361 min = fold_build2 (PLUS_EXPR, TREE_TYPE (op0), min, one);
1363 + TREE_NO_WARNING (min) = 1;
1367 Index: gcc/DATESTAMP
1368 ===================================================================
1369 --- gcc/DATESTAMP (.../tags/gcc_4_2_0_release) (revision 126002)
1370 +++ gcc/DATESTAMP (.../branches/gcc-4_2-branch) (revision 126002)
1375 ===================================================================
1376 --- gcc/reload.c (.../tags/gcc_4_2_0_release) (revision 126002)
1377 +++ gcc/reload.c (.../branches/gcc-4_2-branch) (revision 126002)
1378 @@ -1180,7 +1180,7 @@
1380 /* If IN appears in OUT, we can't share any input-only reload for IN. */
1381 if (in != 0 && out != 0 && MEM_P (out)
1382 - && (REG_P (in) || MEM_P (in))
1383 + && (REG_P (in) || MEM_P (in) || GET_CODE (in) == PLUS)
1384 && reg_overlap_mentioned_for_reload_p (in, XEXP (out, 0)))
1387 @@ -6540,7 +6540,8 @@
1390 else if (GET_CODE (in) == PLUS)
1391 - return (reg_overlap_mentioned_for_reload_p (x, XEXP (in, 0))
1392 + return (rtx_equal_p (x, in)
1393 + || reg_overlap_mentioned_for_reload_p (x, XEXP (in, 0))
1394 || reg_overlap_mentioned_for_reload_p (x, XEXP (in, 1)));
1395 else return (reg_overlap_mentioned_for_reload_p (XEXP (x, 0), in)
1396 || reg_overlap_mentioned_for_reload_p (XEXP (x, 1), in));
1397 Index: gcc/pointer-set.c
1398 ===================================================================
1399 --- gcc/pointer-set.c (.../tags/gcc_4_2_0_release) (revision 126002)
1400 +++ gcc/pointer-set.c (.../branches/gcc-4_2-branch) (revision 126002)
1403 #include "pointer-set.h"
1405 -/* A pointer sets is represented as a simple open-addressing hash
1406 +/* A pointer set is represented as a simple open-addressing hash
1407 table. Simplifications: The hash code is based on the value of the
1408 pointer, not what it points to. The number of buckets is always a
1409 power of 2. Null pointers are a reserved value. Deletion is not
1410 - supported. There is no mechanism for user control of hash
1411 - function, equality comparison, initial size, or resizing policy.
1413 + supported (yet). There is no mechanism for user control of hash
1414 + function, equality comparison, initial size, or resizing policy. */
1416 struct pointer_set_t
1418 @@ -114,22 +113,16 @@
1422 -/* Subroutine of pointer_set_insert. Inserts P into an empty
1423 - element of SLOTS, an array of length N_SLOTS. Returns nonzero
1424 - if P was already present in N_SLOTS. */
1426 +/* Subroutine of pointer_set_insert. Return the insertion slot for P into
1427 + an empty element of SLOTS, an array of length N_SLOTS. */
1428 +static inline size_t
1429 insert_aux (void *p, void **slots, size_t n_slots, size_t log_slots)
1431 size_t n = hash1 (p, n_slots, log_slots);
1434 - if (slots[n] == p)
1436 - else if (slots[n] == 0)
1441 + if (slots[n] == p || slots[n] == 0)
1446 @@ -144,12 +137,10 @@
1448 pointer_set_insert (struct pointer_set_t *pset, void *p)
1450 - if (insert_aux (p, pset->slots, pset->n_slots, pset->log_slots))
1453 - /* We've inserted a new element. Expand the table if necessary to keep
1454 - the load factor small. */
1455 - ++pset->n_elements;
1458 + /* For simplicity, expand the set even if P is already there. This can be
1459 + superfluous but can happen at most once. */
1460 if (pset->n_elements > pset->n_slots / 4)
1462 size_t new_log_slots = pset->log_slots + 1;
1463 @@ -158,9 +149,10 @@
1466 for (i = 0; i < pset->n_slots; ++i)
1468 - if (pset->slots[i])
1469 - insert_aux (pset->slots[i], new_slots, new_n_slots, new_log_slots);
1471 + void *value = pset->slots[i];
1472 + n = insert_aux (value, new_slots, new_n_slots, new_log_slots);
1473 + new_slots[n] = value;
1476 XDELETEVEC (pset->slots);
1477 @@ -169,5 +161,144 @@
1478 pset->slots = new_slots;
1481 + n = insert_aux (p, pset->slots, pset->n_slots, pset->log_slots);
1482 + if (pset->slots[n])
1485 + pset->slots[n] = p;
1486 + ++pset->n_elements;
1490 +/* Pass each pointer in PSET to the function in FN, together with the fixed
1491 + parameter DATA. If FN returns false, the iteration stops. */
1493 +void pointer_set_traverse (struct pointer_set_t *pset,
1494 + bool (*fn) (void *, void *), void *data)
1497 + for (i = 0; i < pset->n_slots; ++i)
1498 + if (pset->slots[i] && !fn (pset->slots[i], data))
1503 +/* A pointer map is represented the same way as a pointer_set, so
1504 + the hash code is based on the address of the key, rather than
1505 + its contents. Null keys are a reserved value. Deletion is not
1506 + supported (yet). There is no mechanism for user control of hash
1507 + function, equality comparison, initial size, or resizing policy. */
1509 +struct pointer_map_t
1512 + size_t n_slots; /* n_slots = 2^log_slots */
1513 + size_t n_elements;
1519 +/* Allocate an empty pointer map. */
1520 +struct pointer_map_t *
1521 +pointer_map_create (void)
1523 + struct pointer_map_t *result = XNEW (struct pointer_map_t);
1525 + result->n_elements = 0;
1526 + result->log_slots = 8;
1527 + result->n_slots = (size_t) 1 << result->log_slots;
1529 + result->keys = XCNEWVEC (void *, result->n_slots);
1530 + result->values = XCNEWVEC (void *, result->n_slots);
1534 +/* Reclaims all memory associated with PMAP. */
1535 +void pointer_map_destroy (struct pointer_map_t *pmap)
1537 + XDELETEVEC (pmap->keys);
1538 + XDELETEVEC (pmap->values);
1542 +/* Returns a pointer to the value to which P maps, if PMAP contains P. P
1543 + must be nonnull. Return NULL if PMAP does not contain P.
1545 + Collisions are resolved by linear probing. */
1547 +pointer_map_contains (struct pointer_map_t *pmap, void *p)
1549 + size_t n = hash1 (p, pmap->n_slots, pmap->log_slots);
1553 + if (pmap->keys[n] == p)
1554 + return &pmap->values[n];
1555 + else if (pmap->keys[n] == 0)
1560 + if (n == pmap->n_slots)
1566 +/* Inserts P into PMAP if it wasn't already there. Returns a pointer
1567 + to the value. P must be nonnull. */
1569 +pointer_map_insert (struct pointer_map_t *pmap, void *p)
1573 + /* For simplicity, expand the map even if P is already there. This can be
1574 + superfluous but can happen at most once. */
1575 + if (pmap->n_elements > pmap->n_slots / 4)
1577 + size_t new_log_slots = pmap->log_slots + 1;
1578 + size_t new_n_slots = pmap->n_slots * 2;
1579 + void **new_keys = XCNEWVEC (void *, new_n_slots);
1580 + void **new_values = XCNEWVEC (void *, new_n_slots);
1583 + for (i = 0; i < pmap->n_slots; ++i)
1584 + if (pmap->keys[i])
1586 + void *key = pmap->keys[i];
1587 + n = insert_aux (key, new_keys, new_n_slots, new_log_slots);
1588 + new_keys[n] = key;
1589 + new_values[n] = pmap->values[i];
1592 + XDELETEVEC (pmap->keys);
1593 + XDELETEVEC (pmap->values);
1594 + pmap->n_slots = new_n_slots;
1595 + pmap->log_slots = new_log_slots;
1596 + pmap->keys = new_keys;
1597 + pmap->values = new_values;
1600 + n = insert_aux (p, pmap->keys, pmap->n_slots, pmap->log_slots);
1601 + if (!pmap->keys[n])
1603 + ++pmap->n_elements;
1604 + pmap->keys[n] = p;
1607 + return &pmap->values[n];
1610 +/* Pass each pointer in PMAP to the function in FN, together with the pointer
1611 + to the value and the fixed parameter DATA. If FN returns false, the
1612 + iteration stops. */
1614 +void pointer_map_traverse (struct pointer_map_t *pmap,
1615 + bool (*fn) (void *, void **, void *), void *data)
1618 + for (i = 0; i < pmap->n_slots; ++i)
1619 + if (pmap->keys[i] && !fn (pmap->keys[i], &pmap->values[i], data))
1622 Index: gcc/pointer-set.h
1623 ===================================================================
1624 --- gcc/pointer-set.h (.../tags/gcc_4_2_0_release) (revision 126002)
1625 +++ gcc/pointer-set.h (.../branches/gcc-4_2-branch) (revision 126002)
1627 #define POINTER_SET_H
1629 struct pointer_set_t;
1631 struct pointer_set_t *pointer_set_create (void);
1632 void pointer_set_destroy (struct pointer_set_t *pset);
1634 int pointer_set_contains (struct pointer_set_t *pset, void *p);
1635 int pointer_set_insert (struct pointer_set_t *pset, void *p);
1636 +void pointer_set_traverse (struct pointer_set_t *, bool (*) (void *, void *),
1639 +struct pointer_map_t;
1640 +struct pointer_map_t *pointer_map_create (void);
1641 +void pointer_map_destroy (struct pointer_map_t *pmap);
1643 +void **pointer_map_contains (struct pointer_map_t *pmap, void *p);
1644 +void **pointer_map_insert (struct pointer_map_t *pmap, void *p);
1645 +void pointer_map_traverse (struct pointer_map_t *,
1646 + bool (*) (void *, void **, void *), void *);
1648 #endif /* POINTER_SET_H */
1649 Index: gcc/fold-const.c
1650 ===================================================================
1651 --- gcc/fold-const.c (.../tags/gcc_4_2_0_release) (revision 126002)
1652 +++ gcc/fold-const.c (.../branches/gcc-4_2-branch) (revision 126002)
1653 @@ -4450,13 +4450,24 @@
1655 low = range_successor (high1);
1657 - in_p = (low != 0);
1661 + /* We are in the weird situation where high0 > high1 but
1662 + high1 has no successor. Punt. */
1666 else if (! subset || highequal)
1669 high = range_predecessor (low1);
1670 - in_p = (high != 0);
1674 + /* low0 < low1 but low1 has no predecessor. Punt. */
1680 @@ -4476,7 +4487,12 @@
1682 low = range_successor (high0);
1684 - in_p = (low != 0);
1688 + /* high1 > high0 but high0 has no successor. Punt. */
1694 @@ -12634,9 +12650,14 @@
1695 /* ... fall through ... */
1698 - if (truth_value_p (TREE_CODE (t)))
1699 - /* Truth values evaluate to 0 or 1, which is nonnegative. */
1702 + tree type = TREE_TYPE (t);
1703 + if ((TYPE_PRECISION (type) != 1 || TYPE_UNSIGNED (type))
1704 + && truth_value_p (TREE_CODE (t)))
1705 + /* Truth values evaluate to 0 or 1, which is nonnegative unless we
1706 + have a signed:1 type (where the value is -1 and 0). */
1711 /* We don't know sign of `t', so be conservative and return false. */
1712 Index: gcc/omp-low.c
1713 ===================================================================
1714 --- gcc/omp-low.c (.../tags/gcc_4_2_0_release) (revision 126002)
1715 +++ gcc/omp-low.c (.../branches/gcc-4_2-branch) (revision 126002)
1716 @@ -1505,9 +1505,9 @@
1717 for (up = ctx->outer, t = NULL; up && t == NULL; up = up->outer)
1718 t = maybe_lookup_decl (decl, up);
1721 + gcc_assert (t || is_global_var (decl));
1724 + return t ? t : decl;
1728 Index: gcc/DEV-PHASE
1729 ===================================================================
1730 --- gcc/DEV-PHASE (.../tags/gcc_4_2_0_release) (revision 126002)
1731 +++ gcc/DEV-PHASE (.../branches/gcc-4_2-branch) (revision 126002)
1734 Index: gcc/ChangeLog
1735 ===================================================================
1736 --- gcc/ChangeLog (.../tags/gcc_4_2_0_release) (revision 126002)
1737 +++ gcc/ChangeLog (.../branches/gcc-4_2-branch) (revision 126002)
1739 +2007-06-21 H.J. Lu <hongjiu.lu@intel.com>
1741 + * config/i386/i386.c (ix86_builtins): Add IX86_BUILTIN_VEC_EXT_V16QI.
1742 + (ix86_init_mmx_sse_builtins): Add __builtin_ia32_vec_ext_v16qi.
1743 + (ix86_expand_builtin): Handle IX86_BUILTIN_VEC_EXT_V16QI.
1745 +2007-06-21 Jakub Jelinek <jakub@redhat.com>
1747 + PR middle-end/32362
1748 + * omp-low.c (lookup_decl_in_outer_ctx): Don't ICE if t is NULL,
1749 + but decl is a global var, instead return decl.
1750 + * gimplify.c (gimplify_adjust_omp_clauses_1): Add shared clauses
1751 + even for is_global_var decls, if they are private in some outer
1754 +2007-06-21 Uros Bizjak <ubizjak@gmail.com>
1757 + * config/i386/i386.h (enum ix86_stack_slot): Add SLOT_VIRTUAL.
1758 + * config/i386/i386.c (assign_386_stack_local): Assert that
1759 + SLOT_VIRTUAL is valid only before virtual regs are instantiated.
1760 + (ix86_expand_builtin) [IX86_BUILTIN_LDMXCSR, IX86_BUILTIN_STMXCSR]:
1761 + Use SLOT_VIRTUAL stack slot instead of SLOT_TEMP.
1762 + * config/i386/i386.md (truncdfsf2, truncxfsf2, truncxfdf2): Ditto.
1764 +2007-06-20 Jakub Jelinek <jakub@redhat.com>
1766 + PR inline-asm/32109
1767 + * gimplify.c (gimplify_asm_expr): Issue error if type is addressable
1770 + PR middle-end/32285
1771 + * calls.c (precompute_arguments): Also precompute CALL_EXPR arguments
1772 + if ACCUMULATE_OUTGOING_ARGS.
1774 +2007-06-20 Kaz Kojima <kkojima@gcc.gnu.org>
1776 + PR rtl-optimization/28011
1777 + Backport from mainline.
1778 + * reload.c (push_reload): Set dont_share if IN appears in OUT
1779 + also when IN is a PLUS rtx.
1780 + (reg_overlap_mentioned_for_reload_p): Return true if X and IN
1781 + are same PLUS rtx.
1783 +2007-06-19 Richard Guenther <rguenther@suse.de>
1784 + Michael Matz <matz@suse.de>
1786 + PR tree-optimization/30252
1787 + * tree-ssa-structalias.c (solution_set_add): Make sure to
1788 + preserve all relevant vars.
1789 + (handle_ptr_arith): Make sure to only handle positive
1791 + (push_fields_onto_fieldstack): Create fields for empty
1794 +2007-06-19 Jakub Jelinek <jakub@redhat.com>
1796 + PR tree-optimization/32353
1797 + * tree-ssa-structalias.c (set_uids_in_ptset): Also handle RESULT_DECL.
1799 +2007-06-17 Eric Botcazou <ebotcazou@libertysurf.fr>
1801 + * config/sparc/sparc.c (sparc_vis_init_builtins): Retrieve the
1802 + return mode from the builtin itself.
1803 + (sparc_fold_builtin): Fix cast of zero constant.
1805 +2007-06-15 Diego Novillo <dnovillo@google.com>
1808 + * tree-ssa-operands.c (build_ssa_operands): Initially assume
1809 + that the statement does not take any addresses.
1811 +2007-06-13 Eric Botcazou <ebotcazou@libertysurf.fr>
1813 + * config/sparc/sparc.c (sparc_override_options): Initialize
1814 + fpu mask correctly.
1816 +2007-06-09 Ian Lance Taylor <iant@google.com>
1818 + PR tree-optimization/32169
1819 + * tree-vrp.c (extract_range_from_unary_expr): For NOP_EXPR and
1820 + CONVERT_EXPR, check whether min and max both converted to an
1821 + overflow infinity representation.
1823 +2007-06-08 Kaz Kojima <kkojima@gcc.gnu.org>
1826 + Backport from mainline.
1827 + * config/sh/sh.md (symGOT_load): Don't schedule insns when
1828 + the symbol is generated with the stack protector.
1830 +2007-06-06 Ian Lance Taylor <iant@google.com>
1832 + * fold-const.c (merge_ranges): If range_successor or
1833 + range_predecessor fail, just return 0.
1835 +2007-06-05 Ian Lance Taylor <iant@google.com>
1837 + * tree-vrp.c (compare_values_warnv): Check TREE_NO_WARNING on a
1838 + PLUS_EXPR or MINUS_EXPR node before setting *strict_overflow_p.
1839 + (extract_range_from_assert): Set TREE_NO_WARNING when creating an
1841 + (test_for_singularity): Likewise.
1843 +2007-06-04 Ian Lance Taylor <iant@google.com>
1845 + * tree-vrp.c (adjust_range_with_scev): When loop is not expected
1846 + to overflow, reduce overflow infinity to regular infinity.
1847 + (vrp_var_may_overflow): New static function.
1848 + (vrp_visit_phi_node): Check vrp_var_may_overflow.
1850 +2007-05-31 H.J. Lu <hongjiu.lu@intel.com>
1852 + Backport from mainline:
1853 + 2007-05-25 H.J. Lu <hongjiu.lu@intel.com>
1855 + * config/i386/i386.c (__builtin_ia32_vec_ext_v2df): Mark it
1857 + (__builtin_ia32_vec_ext_v2di): Likewise.
1858 + (__builtin_ia32_vec_ext_v4si): Likewise.
1859 + (__builtin_ia32_vec_ext_v8hi): Likewise.
1860 + (__builtin_ia32_vec_set_v8hi): Likewise.
1862 +2007-05-31 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
1864 + Backport from mainline:
1865 + 2007-05-05 Aurelien Jarno <aurelien@aurel32.net>
1867 + * config/pa/pa.md: Split tgd_load, tld_load and tie_load
1868 + into pic and non-pic versions. Mark r19 as used for
1869 + tgd_load_pic, tld_load_pic and tie_load_pic. Mark r27 as used
1870 + for tgd_load, tld_load and tie_load .
1871 + * config/pa/pa.c (legitimize_tls_address): Emit pic or non-pic
1872 + version of tgd_load, tld_load and tie_load depending on the
1873 + value of flag_pic.
1875 +2007-05-27 Daniel Berlin <dberlin@dberlin.org>
1878 + Backport PTA solver from mainline
1880 + * pointer-set.c: Copy from mainline
1881 + * pointer-set.h: Ditto.
1882 + * tree-ssa-structalias.c: Copy solver portions from mainline.
1883 + * Makefile.in (tree-ssa-structalias.o): Update dependencies
1885 +2007-05-30 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1887 + * tree-vrp.c (compare_names): Initialize sop.
1889 +2007-05-30 Jakub Jelinek <jakub@redhat.com>
1891 + PR tree-optimization/31769
1892 + * except.c (duplicate_eh_regions): Clear prev_try if
1893 + ERT_MUST_NOT_THROW region is inside of ERT_TRY region.
1895 +2007-05-28 Andrew Pinski <andrew_pinski@playstation.sony.com>
1898 + * fold-const.c (tree_expr_nonnegative_warnv_p): Don't
1899 + return true when truth_value_p is true and the type
1902 +2007-05-27 H.J. Lu <hongjiu.lu@intel.com>
1904 + Backport from mainline:
1905 + 2007-05-25 Uros Bizjak <ubizjak@gmail.com>
1907 + * config/i386/sse.md (*vec_extractv2di_1_sse2): Do not calculate
1908 + "memory" attribute for "sseishft" type insn without operands[2].
1910 + 2007-05-25 H.J. Lu <hongjiu.lu@intel.com>
1912 + * config/i386/sse.md (*vec_extractv2di_1_sse2): Correct shift.
1914 +2007-05-22 Ian Lance Taylor <iant@google.com>
1916 + * tree-vrp.c (avoid_overflow_infinity): New static function,
1917 + broken out of set_value_range_to_value.
1918 + (set_value_range_to_value): Call avoid_overflow_infinity.
1919 + (extract_range_from_assert): Likewise.
1921 +2007-05-23 Chen Liqin <liqin@sunnorth.com.cn>
1924 + * config/score/misc.md (bitclr_c, bitset_c, bittgl_c): remove.
1925 + * config/score/predicate.md (const_pow2, const_npow2): remove.
1926 + * config/score/score.h (ASM_OUTPUT_EXTERNAL): add ASM_OUTPUT_EXTERNAL undef.
1928 + * config/score/score.c (score_print_operand): makes sure that only lower
1931 +2007-05-21 Uros Bizjak <ubizjak@gmail.com>
1934 + Backport from mainline.
1935 + * config/i386/i386.md (*addti3_1, *addti3_1 splitter): Use
1936 + x86_64_general_operand as operand[2] predicate. Remove "iF"
1937 + from operand constraints and use "e" constraint instead.
1938 + (*subti3_1, *subti3_1 splitter): Ditto.
1939 + (*negti2_1, *negti2_1 splitter): Use nonimmediate_operand as
1940 + operand[1] predicate.
1942 +2007-05-21 Uros Bizjak <ubizjak@gmail.com>
1945 + Backport from mainline.
1946 + * config/i386/sse.md ("*sse3_movddup"): Use operands[0] and
1947 + operands[1] in insn constraint. Correct type attribute to sselog1.
1949 +2007-05-20 Kaz Kojima <kkojima@gcc.gnu.org>
1952 + Backport from mainline.
1953 + * config/sh/sh.c (output_stack_adjust): Avoid using the frame
1954 + register itself to hold the offset constant. Tell flow the use
1955 + of r4 and r5 when they are used.
1957 +2007-05-20 Kaz Kojima <kkojima@gcc.gnu.org>
1960 + Backport from mainline.
1961 + * config/sh/sh.md (length): Check if prev_nonnote_insn (insn)
1964 +2007-05-20 Kaz Kojima <kkojima@gcc.gnu.org>
1967 + Backport from mainline.
1968 + * config/sh/sh.c (sh_adjust_cost): Use the result of single_set
1969 + instead of PATTERN.
1971 +2007-05-20 Kaz Kojima <kkojima@gcc.gnu.org>
1974 + Backport from mainline.
1975 + * config/sh/sh.md (cmp{eq,gt,gtu}{si,di}_media): Remove.
1976 + (cmpsi{eq,gt,gtu}{si,di}_media): Rename to
1977 + cmp{eq,gt,gtu}{si,di}_media.
1978 + (*cmpne0si_media): Remove.
1979 + (*movsicc_umin): Adjust gen_cmp*_media call.
1980 + (unordered): Change the mode of unordered and operands[1] to
1982 + (seq): Adjust gen_cmp*_media calls. Make the mode of
1983 + a temporary result of compare SImode if needed. If the mode
1984 + of operands[0] is DImode, extend the temporary result to DImode.
1985 + (slt, sle, sgt, sge, sgtu, sltu, sleu, sgue, sne): Likewise.
1986 + (sunorderd): Change the mode of match_operand and unorderd to
1988 + (cmpeq{sf,df}_media): Remove.
1989 + (cmpsieq{sf,df}_media): Rename to cmpeq{sf,df}_media.
1990 + (cmp{gt,ge,un}{sf,df}_media): Change the mode of match_operand
1991 + and compare operation to SImode.
1993 +2007-05-18 Joseph Myers <joseph@codesourcery.com>
1995 + * config/soft-fp/double.h, config/soft-fp/extended.h,
1996 + config/soft-fp/floatundidf.c, config/soft-fp/floatundisf.c,
1997 + config/soft-fp/floatunsidf.c, config/soft-fp/floatunsisf.c,
1998 + config/soft-fp/op-2.h, config/soft-fp/op-4.h,
1999 + config/soft-fp/op-common.h, config/soft-fp/quad.h: Update from
2002 +2007-05-17 Ian Lance Taylor <iant@google.com>
2004 + PR tree-optimization/31953
2005 + * tree-vrp.c (set_value_range_to_value): Add equiv parameter.
2006 + Change all callers.
2007 + (set_value_range_to_null): Call set_value_range_to_value.
2008 + (extract_range_from_comparison): Likewise.
2010 +2007-05-17 Eric Botcazou <ebotcazou@libertysurf.fr>
2012 + PR rtl-optimization/31691
2013 + * combine.c (simplify_set): Build a new src pattern instead of
2014 + substituting its operands in the COMPARE case.
2016 +2007-05-14 Mark Mitchell <mark@codesourcery.com>
2018 + * BASE-VER: Set to 4.2.1.
2019 + * DEV-PHASE: Set to prerelease.
2021 2007-05-13 Release Manager
2023 * GCC 4.2.0 released.
2025 2007-04-03 Stuart Hastings <stuart@apple.com>
2028 - * objc/objc-act.c (next_sjlj_build_catch_list): Delete volatile from rethrow decl.
2029 + * objc/objc-act.c (next_sjlj_build_catch_list): Delete volatile
2030 + from rethrow decl.
2031 * cse.c (record_jump_equiv): Bail out on CCmode comparisons.
2033 2007-04-03 Jakub Jelinek <jakub@redhat.com>
2034 Index: gcc/testsuite/gcc.c-torture/execute/20070614-1.c
2035 ===================================================================
2036 --- gcc/testsuite/gcc.c-torture/execute/20070614-1.c (.../tags/gcc_4_2_0_release) (revision 0)
2037 +++ gcc/testsuite/gcc.c-torture/execute/20070614-1.c (.../branches/gcc-4_2-branch) (revision 126002)
2039 +extern void abort (void);
2041 +_Complex v = 3.0 + 1.0iF;
2044 +foo (_Complex z, int *x)
2050 +_Complex bar (_Complex z) __attribute__ ((pure));
2061 + for (i = 0; i < 6; i++)
2062 + foo (bar (1.0iF * i), &a);
2072 Index: gcc/testsuite/gcc.c-torture/execute/vrp-7.c
2073 ===================================================================
2074 --- gcc/testsuite/gcc.c-torture/execute/vrp-7.c (.../tags/gcc_4_2_0_release) (revision 0)
2075 +++ gcc/testsuite/gcc.c-torture/execute/vrp-7.c (.../branches/gcc-4_2-branch) (revision 126002)
2085 +void __attribute__((noinline)) foo (int f)
2087 + t.b = (f & 0x10) ? 1 : 0;
2097 Index: gcc/testsuite/gcc.c-torture/execute/20070517-1.c
2098 ===================================================================
2099 --- gcc/testsuite/gcc.c-torture/execute/20070517-1.c (.../tags/gcc_4_2_0_release) (revision 0)
2100 +++ gcc/testsuite/gcc.c-torture/execute/20070517-1.c (.../branches/gcc-4_2-branch) (revision 126002)
2102 +/* PR rtl-optimization/31691 */
2103 +/* Origin: Chi-Hua Chen <stephaniechc-gccbug@yahoo.com> */
2105 +extern void abort (void);
2107 +static int get_kind(int) __attribute__ ((noinline));
2109 +static int get_kind(int v)
2111 + volatile int k = v;
2115 +static int some_call(void) __attribute__ ((noinline));
2117 +static int some_call(void)
2122 +static void example (int arg)
2124 + int tmp, kind = get_kind (arg);
2126 + if (kind == 9 || kind == 10 || kind == 5)
2128 + if (some_call() == 0)
2130 + if (kind == 9 || kind == 10)
2143 Index: gcc/testsuite/gcc.c-torture/compile/pr32169.c
2144 ===================================================================
2145 --- gcc/testsuite/gcc.c-torture/compile/pr32169.c (.../tags/gcc_4_2_0_release) (revision 0)
2146 +++ gcc/testsuite/gcc.c-torture/compile/pr32169.c (.../branches/gcc-4_2-branch) (revision 126002)
2150 +void * __memset_generic(char c)
2154 +int prepare_startup_playback_urb(
2161 + __memset_generic(c == ( 1) ? 0x80 : 0);
2163 + __memset_generic (c == ( 1) ? 0x80 : 0);
2165 Index: gcc/testsuite/gcc.c-torture/compile/pr31953.c
2166 ===================================================================
2167 --- gcc/testsuite/gcc.c-torture/compile/pr31953.c (.../tags/gcc_4_2_0_release) (revision 0)
2168 +++ gcc/testsuite/gcc.c-torture/compile/pr31953.c (.../branches/gcc-4_2-branch) (revision 126002)
2172 + int hexedit_mode:1;
2174 +toggle_hexedit_mode (struct WView *view)
2176 + if (view->hexedit_mode)
2181 + view->hexedit_mode = !view->hexedit_mode;
2184 Index: gcc/testsuite/gcc.target/sparc/combined-2.c
2185 ===================================================================
2186 --- gcc/testsuite/gcc.target/sparc/combined-2.c (.../tags/gcc_4_2_0_release) (revision 126002)
2187 +++ gcc/testsuite/gcc.target/sparc/combined-2.c (.../branches/gcc-4_2-branch) (revision 126002)
2189 /* { dg-do compile } */
2190 /* { dg-options "-O2 -mcpu=ultrasparc -mvis" } */
2191 -typedef char pixel __attribute__((vector_size(4)));
2192 -typedef char vec8 __attribute__((vector_size(8)));
2193 +typedef unsigned char pixel __attribute__((vector_size(4)));
2194 +typedef unsigned char vec8 __attribute__((vector_size(8)));
2195 typedef short vec16 __attribute__((vector_size(8)));
2197 vec16 foo (pixel a, pixel b) {
2198 Index: gcc/testsuite/gcc.target/sparc/fpmul.c
2199 ===================================================================
2200 --- gcc/testsuite/gcc.target/sparc/fpmul.c (.../tags/gcc_4_2_0_release) (revision 126002)
2201 +++ gcc/testsuite/gcc.target/sparc/fpmul.c (.../branches/gcc-4_2-branch) (revision 126002)
2203 /* { dg-options "-mcpu=ultrasparc -mvis" } */
2204 typedef int vec32 __attribute__((vector_size(8)));
2205 typedef short vec16 __attribute__((vector_size(8)));
2206 -typedef char pixel __attribute__((vector_size(4)));
2207 +typedef unsigned char pixel __attribute__((vector_size(4)));
2208 typedef short pixel16 __attribute__((vector_size(4)));
2209 -typedef char vec8 __attribute__((vector_size(8)));
2210 +typedef unsigned char vec8 __attribute__((vector_size(8)));
2212 vec16 foo1 (pixel a, vec16 b) {
2213 return __builtin_vis_fmul8x16 (a, b);
2214 Index: gcc/testsuite/gcc.target/sparc/pdist.c
2215 ===================================================================
2216 --- gcc/testsuite/gcc.target/sparc/pdist.c (.../tags/gcc_4_2_0_release) (revision 126002)
2217 +++ gcc/testsuite/gcc.target/sparc/pdist.c (.../branches/gcc-4_2-branch) (revision 126002)
2219 /* { dg-do compile } */
2220 /* { dg-options "-mcpu=ultrasparc -mvis" } */
2222 typedef long long int64_t;
2223 -typedef char vec8 __attribute__((vector_size(8)));
2224 +typedef unsigned char vec8 __attribute__((vector_size(8)));
2226 int64_t foo (vec8 a, vec8 b) {
2228 Index: gcc/testsuite/gcc.target/sparc/fexpand.c
2229 ===================================================================
2230 --- gcc/testsuite/gcc.target/sparc/fexpand.c (.../tags/gcc_4_2_0_release) (revision 126002)
2231 +++ gcc/testsuite/gcc.target/sparc/fexpand.c (.../branches/gcc-4_2-branch) (revision 126002)
2233 /* { dg-do compile } */
2234 /* { dg-options "-mcpu=ultrasparc -mvis" } */
2235 typedef short vec16 __attribute__((vector_size(8)));
2236 -typedef char vec8 __attribute__((vector_size(4)));
2237 +typedef unsigned char vec8 __attribute__((vector_size(4)));
2239 vec16 foo (vec8 a) {
2240 return __builtin_vis_fexpand (a);
2241 Index: gcc/testsuite/gcc.target/sparc/fnot.c
2242 ===================================================================
2243 --- gcc/testsuite/gcc.target/sparc/fnot.c (.../tags/gcc_4_2_0_release) (revision 126002)
2244 +++ gcc/testsuite/gcc.target/sparc/fnot.c (.../branches/gcc-4_2-branch) (revision 126002)
2246 /* { dg-do compile } */
2247 /* { dg-options "-O -mcpu=ultrasparc -mvis" } */
2248 -typedef char vec8 __attribute__((vector_size(8)));
2249 +typedef unsigned char vec8 __attribute__((vector_size(8)));
2250 typedef short vec16 __attribute__((vector_size(8)));
2251 -typedef int vec32 __attribute__((vector_size(8)));
2252 +typedef int vec32 __attribute__((vector_size(8)));
2254 extern vec8 foo1_8(void);
2255 extern void foo2_8(vec8);
2259 extern vec16 foo1_16(void);
2260 -extern void foo2_16(vec8);
2261 +extern void foo2_16(vec16);
2268 extern vec32 foo1_32(void);
2269 -extern void foo2_32(vec8);
2270 +extern void foo2_32(vec32);
2274 Index: gcc/testsuite/gcc.target/sparc/mfpu.c
2275 ===================================================================
2276 --- gcc/testsuite/gcc.target/sparc/mfpu.c (.../tags/gcc_4_2_0_release) (revision 0)
2277 +++ gcc/testsuite/gcc.target/sparc/mfpu.c (.../branches/gcc-4_2-branch) (revision 126002)
2279 +/* Reported by Peter A. Krauss <peter.a.krauss@web.de> */
2281 +/* { dg-do compile } */
2282 +/* { dg-options "-mfpu" } */
2284 +float square(float x)
2289 +/* { dg-final { scan-assembler "fmuls" } } */
2290 Index: gcc/testsuite/gcc.target/sparc/noresult.c
2291 ===================================================================
2292 --- gcc/testsuite/gcc.target/sparc/noresult.c (.../tags/gcc_4_2_0_release) (revision 126002)
2293 +++ gcc/testsuite/gcc.target/sparc/noresult.c (.../branches/gcc-4_2-branch) (revision 126002)
2295 /* { dg-do compile } */
2296 /* { dg-options "-mcpu=ultrasparc -mvis" } */
2297 typedef short vec16 __attribute__((vector_size(8)));
2298 -typedef char vec8 __attribute__((vector_size(4)));
2300 void foo (vec16 a) {
2301 __builtin_vis_fpack16 (a);
2302 Index: gcc/testsuite/gcc.target/sparc/fpmerge.c
2303 ===================================================================
2304 --- gcc/testsuite/gcc.target/sparc/fpmerge.c (.../tags/gcc_4_2_0_release) (revision 126002)
2305 +++ gcc/testsuite/gcc.target/sparc/fpmerge.c (.../branches/gcc-4_2-branch) (revision 126002)
2307 /* { dg-do compile } */
2308 /* { dg-options "-mcpu=ultrasparc -mvis" } */
2309 -typedef char pixel __attribute__((vector_size(8)));
2310 -typedef char vec8 __attribute__((vector_size(4)));
2311 +typedef unsigned char pixel __attribute__((vector_size(8)));
2312 +typedef unsigned char vec8 __attribute__((vector_size(4)));
2314 pixel foo (vec8 a, vec8 b) {
2315 return __builtin_vis_fpmerge (a, b);
2316 Index: gcc/testsuite/gcc.target/sparc/align.c
2317 ===================================================================
2318 --- gcc/testsuite/gcc.target/sparc/align.c (.../tags/gcc_4_2_0_release) (revision 126002)
2319 +++ gcc/testsuite/gcc.target/sparc/align.c (.../branches/gcc-4_2-branch) (revision 126002)
2321 /* { dg-do compile } */
2322 /* { dg-options "-mcpu=ultrasparc -mvis" } */
2324 typedef long long int64_t;
2325 typedef int vec32 __attribute__((vector_size(8)));
2326 typedef short vec16 __attribute__((vector_size(8)));
2327 -typedef char vec8 __attribute__((vector_size(8)));
2328 +typedef unsigned char vec8 __attribute__((vector_size(8)));
2330 vec16 foo1 (vec16 a, vec16 b) {
2331 return __builtin_vis_faligndatav4hi (a, b);
2332 Index: gcc/testsuite/gcc.target/sparc/fpack16.c
2333 ===================================================================
2334 --- gcc/testsuite/gcc.target/sparc/fpack16.c (.../tags/gcc_4_2_0_release) (revision 126002)
2335 +++ gcc/testsuite/gcc.target/sparc/fpack16.c (.../branches/gcc-4_2-branch) (revision 126002)
2337 /* { dg-do compile } */
2338 /* { dg-options "-mcpu=ultrasparc -mvis" } */
2339 typedef short vec16 __attribute__((vector_size(8)));
2340 -typedef char vec8 __attribute__((vector_size(4)));
2341 +typedef unsigned char vec8 __attribute__((vector_size(4)));
2343 vec8 foo (vec16 a) {
2344 return __builtin_vis_fpack16 (a);
2345 Index: gcc/testsuite/gcc.target/i386/sse2-vec-3.c
2346 ===================================================================
2347 --- gcc/testsuite/gcc.target/i386/sse2-vec-3.c (.../tags/gcc_4_2_0_release) (revision 0)
2348 +++ gcc/testsuite/gcc.target/i386/sse2-vec-3.c (.../branches/gcc-4_2-branch) (revision 126002)
2350 +/* { dg-do run { target i?86-*-* x86_64-*-* } } */
2351 +/* { dg-options "-O2 -msse2" } */
2353 +#include "sse2-check.h"
2355 +#include <emmintrin.h>
2372 + for (i = 0; i < 16; i++)
2375 + res[0] = __builtin_ia32_vec_ext_v4si ((__v4si)val1.x, 0);
2376 + res[1] = __builtin_ia32_vec_ext_v4si ((__v4si)val1.x, 1);
2377 + res[2] = __builtin_ia32_vec_ext_v4si ((__v4si)val1.x, 2);
2378 + res[3] = __builtin_ia32_vec_ext_v4si ((__v4si)val1.x, 3);
2380 + for (i = 0; i < 4; i++)
2383 + for (i = 0; i < 4; i++)
2384 + if (res[i] != val1.i [masks[i]])
2387 Index: gcc/testsuite/gcc.target/i386/pr32389.c
2388 ===================================================================
2389 --- gcc/testsuite/gcc.target/i386/pr32389.c (.../tags/gcc_4_2_0_release) (revision 0)
2390 +++ gcc/testsuite/gcc.target/i386/pr32389.c (.../branches/gcc-4_2-branch) (revision 126002)
2392 +/* Testcase by Mike Frysinger <vapier@gentoo.org> */
2394 +/* { dg-do compile { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
2395 +/* { dg-options "-msse" } */
2399 + __builtin_ia32_stmxcsr();
2402 Index: gcc/testsuite/gcc.target/i386/pr31167.c
2403 ===================================================================
2404 --- gcc/testsuite/gcc.target/i386/pr31167.c (.../tags/gcc_4_2_0_release) (revision 0)
2405 +++ gcc/testsuite/gcc.target/i386/pr31167.c (.../branches/gcc-4_2-branch) (revision 126002)
2407 +/* { dg-do compile { target x86_64-*-* } } */
2408 +/* { dg-options "-O" } */
2410 +typedef int int32_t;
2412 +int32_t round32hi (const __int128_t arg)
2414 + const int SHIFT = 96;
2415 + const int mshift = 96;
2416 + const __int128_t M = (~(__int128_t) 0) << mshift;
2417 + const __int128_t L = (~M) + 1;
2418 + const __int128_t L1 = ((__int128_t) L) >> 1;
2419 + const __int128_t Mlo = ((__int128_t) (~M)) >> 1;
2420 + __int128_t vv = arg & M;
2422 + if ((arg & (L1)) && ((arg & Mlo) || (arg & L)))
2425 + return (int32_t) (vv >> SHIFT);
2427 Index: gcc/testsuite/gcc.target/i386/sse2-vec-4.c
2428 ===================================================================
2429 --- gcc/testsuite/gcc.target/i386/sse2-vec-4.c (.../tags/gcc_4_2_0_release) (revision 0)
2430 +++ gcc/testsuite/gcc.target/i386/sse2-vec-4.c (.../branches/gcc-4_2-branch) (revision 126002)
2432 +/* { dg-do run { target i?86-*-* x86_64-*-* } } */
2433 +/* { dg-options "-O2 -msse2" } */
2435 +#include "sse2-check.h"
2437 +#include <emmintrin.h>
2454 + for (i = 0; i < 16; i++)
2457 + res[0] = __builtin_ia32_vec_ext_v8hi ((__v8hi)val1.x, 0);
2458 + res[1] = __builtin_ia32_vec_ext_v8hi ((__v8hi)val1.x, 1);
2459 + res[2] = __builtin_ia32_vec_ext_v8hi ((__v8hi)val1.x, 2);
2460 + res[3] = __builtin_ia32_vec_ext_v8hi ((__v8hi)val1.x, 3);
2461 + res[4] = __builtin_ia32_vec_ext_v8hi ((__v8hi)val1.x, 4);
2462 + res[5] = __builtin_ia32_vec_ext_v8hi ((__v8hi)val1.x, 5);
2463 + res[6] = __builtin_ia32_vec_ext_v8hi ((__v8hi)val1.x, 6);
2464 + res[7] = __builtin_ia32_vec_ext_v8hi ((__v8hi)val1.x, 7);
2466 + for (i = 0; i < 8; i++)
2469 + for (i = 0; i < 8; i++)
2470 + if (res[i] != val1.s [masks[i]])
2473 Index: gcc/testsuite/gcc.target/i386/sse2-check.h
2474 ===================================================================
2475 --- gcc/testsuite/gcc.target/i386/sse2-check.h (.../tags/gcc_4_2_0_release) (revision 0)
2476 +++ gcc/testsuite/gcc.target/i386/sse2-check.h (.../branches/gcc-4_2-branch) (revision 126002)
2479 +#include <stdlib.h>
2481 +#include "../../gcc.dg/i386-cpuid.h"
2483 +static void sse2_test (void);
2488 + unsigned long cpu_facilities;
2490 + cpu_facilities = i386_cpuid_edx ();
2492 + /* Run SSE2 test only if host has SSE2 support. */
2493 + if ((cpu_facilities & bit_SSE2))
2498 Index: gcc/testsuite/gcc.target/i386/sse2-vec-1.c
2499 ===================================================================
2500 --- gcc/testsuite/gcc.target/i386/sse2-vec-1.c (.../tags/gcc_4_2_0_release) (revision 0)
2501 +++ gcc/testsuite/gcc.target/i386/sse2-vec-1.c (.../branches/gcc-4_2-branch) (revision 126002)
2503 +/* { dg-do run { target i?86-*-* x86_64-*-* } } */
2504 +/* { dg-options "-O2 -msse2" } */
2506 +#include "sse2-check.h"
2508 +#include <emmintrin.h>
2528 + res[0] = __builtin_ia32_vec_ext_v2df ((__v2df)val1.x, msk0);
2529 + res[1] = __builtin_ia32_vec_ext_v2df ((__v2df)val1.x, msk1);
2534 + for (i = 0; i < 2; i++)
2535 + if (res[i] != val1.d [masks[i]])
2538 Index: gcc/testsuite/gcc.target/i386/sse2-vec-5.c
2539 ===================================================================
2540 --- gcc/testsuite/gcc.target/i386/sse2-vec-5.c (.../tags/gcc_4_2_0_release) (revision 0)
2541 +++ gcc/testsuite/gcc.target/i386/sse2-vec-5.c (.../branches/gcc-4_2-branch) (revision 126002)
2543 +/* { dg-do run { target i?86-*-* x86_64-*-* } } */
2544 +/* { dg-options "-O2 -msse2" } */
2546 +#include "sse2-check.h"
2548 +#include <emmintrin.h>
2565 + for (i = 0; i < 16; i++)
2568 + res[0] = __builtin_ia32_vec_ext_v16qi ((__v16qi)val1.x, 0);
2569 + res[1] = __builtin_ia32_vec_ext_v16qi ((__v16qi)val1.x, 1);
2570 + res[2] = __builtin_ia32_vec_ext_v16qi ((__v16qi)val1.x, 2);
2571 + res[3] = __builtin_ia32_vec_ext_v16qi ((__v16qi)val1.x, 3);
2572 + res[4] = __builtin_ia32_vec_ext_v16qi ((__v16qi)val1.x, 4);
2573 + res[5] = __builtin_ia32_vec_ext_v16qi ((__v16qi)val1.x, 5);
2574 + res[6] = __builtin_ia32_vec_ext_v16qi ((__v16qi)val1.x, 6);
2575 + res[7] = __builtin_ia32_vec_ext_v16qi ((__v16qi)val1.x, 7);
2576 + res[8] = __builtin_ia32_vec_ext_v16qi ((__v16qi)val1.x, 8);
2577 + res[9] = __builtin_ia32_vec_ext_v16qi ((__v16qi)val1.x, 9);
2578 + res[10] = __builtin_ia32_vec_ext_v16qi ((__v16qi)val1.x, 10);
2579 + res[11] = __builtin_ia32_vec_ext_v16qi ((__v16qi)val1.x, 11);
2580 + res[12] = __builtin_ia32_vec_ext_v16qi ((__v16qi)val1.x, 12);
2581 + res[13] = __builtin_ia32_vec_ext_v16qi ((__v16qi)val1.x, 13);
2582 + res[14] = __builtin_ia32_vec_ext_v16qi ((__v16qi)val1.x, 14);
2583 + res[15] = __builtin_ia32_vec_ext_v16qi ((__v16qi)val1.x, 15);
2585 + for (i = 0; i < 16; i++)
2588 + for (i = 0; i < 16; i++)
2589 + if (res[i] != val1.c [masks[i]])
2592 Index: gcc/testsuite/gcc.target/i386/sse2-vec-2.c
2593 ===================================================================
2594 --- gcc/testsuite/gcc.target/i386/sse2-vec-2.c (.../tags/gcc_4_2_0_release) (revision 0)
2595 +++ gcc/testsuite/gcc.target/i386/sse2-vec-2.c (.../branches/gcc-4_2-branch) (revision 126002)
2597 +/* { dg-do run { target i?86-*-* x86_64-*-* } } */
2598 +/* { dg-options "-O2 -msse2" } */
2600 +#include "sse2-check.h"
2602 +#include <emmintrin.h>
2619 + for (i = 0; i < 16; i++)
2622 + res[0] = __builtin_ia32_vec_ext_v2di ((__v2di)val1.x, 0);
2623 + res[1] = __builtin_ia32_vec_ext_v2di ((__v2di)val1.x, 1);
2625 + for (i = 0; i < 2; i++)
2628 + for (i = 0; i < 2; i++)
2629 + if (res[i] != val1.ll [masks[i]])
2632 Index: gcc/testsuite/gcc.target/i386/sse2-vec-6.c
2633 ===================================================================
2634 --- gcc/testsuite/gcc.target/i386/sse2-vec-6.c (.../tags/gcc_4_2_0_release) (revision 0)
2635 +++ gcc/testsuite/gcc.target/i386/sse2-vec-6.c (.../branches/gcc-4_2-branch) (revision 126002)
2637 +/* { dg-do run { target i?86-*-* x86_64-*-* } } */
2638 +/* { dg-options "-O2 -msse2" } */
2640 +#include "sse2-check.h"
2642 +#include <emmintrin.h>
2643 +#include <string.h>
2655 + } val1, res[16], tmp;
2656 + short ins[8] = { 8, 5, 9, 4, 2, 6, 1, 20 };
2660 + for (i = 0; i < 16; i++)
2663 + res[0].x = (__m128i) __builtin_ia32_vec_set_v8hi ((__v8hi)val1.x,
2665 + res[1].x = (__m128i) __builtin_ia32_vec_set_v8hi ((__v8hi)val1.x,
2667 + res[2].x = (__m128i) __builtin_ia32_vec_set_v8hi ((__v8hi)val1.x,
2669 + res[3].x = (__m128i) __builtin_ia32_vec_set_v8hi ((__v8hi)val1.x,
2671 + res[4].x = (__m128i) __builtin_ia32_vec_set_v8hi ((__v8hi)val1.x,
2673 + res[5].x = (__m128i) __builtin_ia32_vec_set_v8hi ((__v8hi)val1.x,
2675 + res[6].x = (__m128i) __builtin_ia32_vec_set_v8hi ((__v8hi)val1.x,
2677 + res[7].x = (__m128i) __builtin_ia32_vec_set_v8hi ((__v8hi)val1.x,
2680 + for (i = 0; i < 8; i++)
2683 + for (i = 0; i < 8; i++)
2686 + tmp.s[masks[i]] = ins[0];
2687 + if (memcmp (&tmp, &res[i], sizeof (tmp)))
2691 + for (i = 0; i < 8; i++)
2693 + res[i].x = (__m128i) __builtin_ia32_vec_set_v8hi ((__v8hi)val1.x,
2698 + for (i = 0; i < 8; i++)
2701 + tmp.s[masks[i]] = ins[i];
2702 + if (memcmp (&tmp, &res[i], sizeof (tmp)))
2706 Index: gcc/testsuite/gcc.dg/Wstrict-overflow-18.c
2707 ===================================================================
2708 --- gcc/testsuite/gcc.dg/Wstrict-overflow-18.c (.../tags/gcc_4_2_0_release) (revision 0)
2709 +++ gcc/testsuite/gcc.dg/Wstrict-overflow-18.c (.../branches/gcc-4_2-branch) (revision 126002)
2711 +/* { dg-do compile } */
2712 +/* { dg-options "-fstrict-overflow -O2 -Wstrict-overflow" } */
2714 +/* Don't warn about an overflow when folding i > 0. The loop analysis
2715 + should determine that i does not wrap. */
2717 +struct c { unsigned int a; unsigned int b; };
2718 +extern void bar (struct c *);
2725 + for (i = 0; i < p->a - p->b; ++i)
2733 Index: gcc/testsuite/gcc.dg/Wstrict-overflow-19.c
2734 ===================================================================
2735 --- gcc/testsuite/gcc.dg/Wstrict-overflow-19.c (.../tags/gcc_4_2_0_release) (revision 0)
2736 +++ gcc/testsuite/gcc.dg/Wstrict-overflow-19.c (.../branches/gcc-4_2-branch) (revision 126002)
2738 +/* { dg-do compile } */
2739 +/* { dg-options "-fstrict-overflow -O2 -Wstrict-overflow" } */
2741 +/* Don't warn about an overflow when threading jumps. We used to get
2742 + a warning from comparing bounds generated by VRP. */
2745 +bar(int a, int b, int n)
2753 Index: gcc/testsuite/ChangeLog
2754 ===================================================================
2755 --- gcc/testsuite/ChangeLog (.../tags/gcc_4_2_0_release) (revision 126002)
2756 +++ gcc/testsuite/ChangeLog (.../branches/gcc-4_2-branch) (revision 126002)
2758 +2007-06-21 Uros Bizjak <ubizjak@gmail.com>
2761 + * gcc.target/i386/pr32389.c New test.
2763 +2007-06-20 Daniel Franke <franke.daniel@gmail.com>
2765 + Backport from trunk:
2767 + * gfortran.dg/compliant_elemental_intrinsics_2.f90: New test.
2769 +2007-06-20 Jakub Jelinek <jakub@redhat.com>
2771 + PR inline-asm/32109
2772 + * g++.dg/ext/asm10.C: New test.
2774 + PR middle-end/32285
2775 + * gcc.c-torture/execute/20070614-1.c: New test.
2777 +2007-06-20 Paul Thomas <pault@gcc.gnu.org>
2780 + * gfortran.dg/common_resize_1.f90: New test.
2782 +2007-06-19 Richard Guenther <rguenther@suse.de>
2783 + Michael Matz <matz@suse.de>
2785 + PR tree-optimization/30252
2786 + * g++.dg/opt/pr30252.C: New testcase.
2788 +2007-06-19 Jakub Jelinek <jakub@redhat.com>
2790 + PR tree-optimization/32353
2791 + * g++.dg/opt/nrv13.C: New test.
2793 +2007-06-15 Mark Mitchell <mark@codesourcery.com>
2795 + * g++.dg/lookup/anon6.C: New test.
2797 +2007-06-17 Eric Botcazou <ebotcazou@libertysurf.fr>
2799 + * gcc.target/sparc/align.c: Use 'unsigned char' as element type.
2800 + * gcc.target/sparc/combined-2.c: Likewise.
2801 + * gcc.target/sparc/fexpand.c : Likewise.
2802 + * gcc.target/sparc/fnot.c: Likewise. Fix a couple of prototypes.
2803 + * gcc.target/sparc/fpack16.c : Likewise.
2804 + * gcc.target/sparc/fpmerge.c : Likewise.
2805 + * gcc.target/sparc/fpmul.c : Likewise.
2806 + * gcc.target/sparc/noresult.c : Likewise.
2807 + * gcc.target/sparc/pdist.c: Likewise.
2809 +2007-06-15 Diego Novillo <dnovillo@google.com>
2812 + * g++.dg/tree-ssa/pr32327-1.C: New test.
2813 + * g++.dg/tree-ssa/pr32327.C: New test.
2815 +2007-06-13 Eric Botcazou <ebotcazou@libertysurf.fr>
2817 + * gcc.target/sparc/mfpu.c: New test.
2819 +2007-06-09 Ian Lance Taylor <iant@google.com>
2821 + PR tree-optimization/32169
2822 + * gcc.c-torture/compile/pr32169.c: New test.
2824 +2007-06-08 Dirk Mueller <dmueller@suse.de>
2827 + Backport from mainline:
2828 + 2007-05-30 Jakub Jelinek <jakub@redhat.com>
2830 + * g++.dg/opt/static5.C: New test.
2832 +2007-06-06 Ian Lance Taylor <iant@google.com>
2834 + * g++.dg/conversion/enum1.C: New test.
2836 +2007-06-05 Ian Lance Taylor <iant@google.com>
2838 + * gcc.dg/Wstrict-overflow-19.c: New test.
2840 +2007-06-04 Ian Lance Taylor <iant@google.com>
2842 + * gcc.dg/Wstrict-overflow-18.c: New test.
2844 +2007-05-31 H.J. Lu <hongjiu.lu@intel.com>
2846 + Backport from mainline:
2847 + 2007-05-25 H.J. Lu <hongjiu.lu@intel.com>
2849 + * gcc.target/i386/sse2-check.h: New.
2850 + * gcc.target/i386/sse2-vec-1.c: Likewise.
2851 + * gcc.target/i386/sse2-vec-2.c: Likewise.
2852 + * gcc.target/i386/sse2-vec-3.c: Likewise.
2853 + * gcc.target/i386/sse2-vec-4.c: Likewise.
2854 + * gcc.target/i386/sse2-vec-5.c: Likewise.
2855 + * gcc.target/i386/sse2-vec-6.c: Likewise.
2857 +2007-05-31 Paul Thomas <pault@gcc.gnu.org>
2860 + * gfortran.dg/altreturn_5.f90: New test.
2863 + * gfortran.dg/char_result_5.f90: New test.
2866 + * gfortran.dg/char_length_5.f90: New test.
2869 + * gfortran.dg/array_reference_1.f90: New test.
2871 +2007-05-22 Tobias Burnus <burnus@net-b.de>
2874 + Backport from mainline.
2875 + * primary.c (match_variable): External functions
2878 +2007-05-30 Jakub Jelinek <jakub@redhat.com>
2880 + PR tree-optimization/31769
2881 + * g++.dg/gomp/pr31769.C: New test.
2883 +2007-05-28 Andrew Pinski <andrew_pinski@playstation.sony.com>
2886 + * gcc.c-torture/execute/vrp-7.c: New test.
2888 +2007-05-23 Jerry DeLisle <jvdelisle@gcc.gnu.org>
2890 + PR libfortran/31964
2891 + * gfortran.fortran-torture/execute/intrinsic_bitops.f90: Update.
2893 +2007-05-22 Jerry DeLisle <jvdelisle@gcc.gnu.org>
2895 + PR libgfortran/31051
2896 + * gfortran.dg/fmt_t_3.f90: New.
2898 +2007-05-22 Dominique d'Humieres <dominiq@lps.ens.fr>
2900 + * gfortran.dg/unf_io_convert_3.f90: Fix dg directive.
2902 +2007-05-22 Tobias Burnus <burnus@net-b.de>
2905 + Backport from mainline.
2906 + * func_assign.f90: New test.
2908 +2007-05-21 Uros Bizjak <ubizjak@gmail.com>
2911 + Backport from mainline.
2912 + * gcc.target/i386/pr31167.c: New test.
2914 +2007-05-20 Jerry DeLisle <jvdelisle@gcc.gnu.org>
2916 + PR libgfortran/31395
2917 + * gfortran.dg/fmt_colon.f90: New test.
2919 +2007-05-20 Thomas Koenig <tkoenig@gcc.gnu.org>
2922 + Backport from trunk.
2923 + * gfortran.dg/backspace_8.f: New test case.
2925 +2007-05-20 Thomas Koenig <tkoenig@gcc.gnu.org>
2927 + PR libfortran/31196
2928 + Backport from trunk.
2929 + * gfortran.dg/reshape_transpose_1.f90: New test.
2931 +2007-05-17 Ian Lance Taylor <iant@google.com>
2933 + PR tree-optimization/31953
2934 + * gcc.c-torture/compile/pr31953.c: New test.
2936 +2007-05-17 Eric Botcazou <ebotcazou@libertysurf.fr>
2938 + * gcc.c-torture/execute/20070517-1.c: New test.
2940 +2007-05-16 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
2943 + * gfortran.dg/substr_4.f: New test.
2945 2007-05-13 Release Manager
2947 * GCC 4.2.0 released.
2948 Index: gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_bitops.f90
2949 ===================================================================
2950 --- gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_bitops.f90 (.../tags/gcc_4_2_0_release) (revision 126002)
2951 +++ gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_bitops.f90 (.../branches/gcc-4_2-branch) (revision 126002)
2959 if (.not. btest (i, o+1)) call abort
2960 if (btest (i, o+2)) call abort
2961 if (iand (i, j) .ne. 2) call abort
2963 if (ishftc (k, o-30) .ne. 48) call abort
2964 if (ishftc (k, o+1, o+3) .ne. 9) call abort
2965 if (not (i) .ne. -3) call abort
2966 + if (ishftc (a, 1, bit_size(a)) .ne. 10) call abort
2967 + if (ishftc (1, 1, 32) .ne. 2) call abort
2969 Index: gcc/testsuite/g++.dg/tree-ssa/pr32327-1.C
2970 ===================================================================
2971 --- gcc/testsuite/g++.dg/tree-ssa/pr32327-1.C (.../tags/gcc_4_2_0_release) (revision 0)
2972 +++ gcc/testsuite/g++.dg/tree-ssa/pr32327-1.C (.../branches/gcc-4_2-branch) (revision 126002)
2974 +// { dg-do run { target { { i?86-*-* x86_64-*-* } && ilp32 } } }
2975 +// { dg-options "-O2" }
2977 +// Endian sensitive. This is a little-endian redux.
2979 +typedef long long int64;
2980 +typedef unsigned long long uint64;
2981 +typedef __SIZE_TYPE__ size_t;
2984 +extern void *memcpy (void *__restrict __dest,
2985 + __const void *__restrict __src, size_t __n) /*throw ()*/;
2986 +extern void abort (void);
2989 +inline uint64 Swap64(uint64 ull) {
2990 + uint64 b0 = (ull >> 0) & 0xff;
2991 + uint64 b1 = (ull >> 8) & 0xff;
2992 + uint64 b2 = (ull >> 16) & 0xff;
2993 + uint64 b3 = (ull >> 24) & 0xff;
2994 + uint64 b4 = (ull >> 32) & 0xff;
2995 + uint64 b5 = (ull >> 40) & 0xff;
2996 + uint64 b6 = (ull >> 48) & 0xff;
2997 + uint64 b7 = (ull >> 56) & 0xff;
2998 + return (b0 << 56) | (b1 << 48) | (b2 << 40) | (b3 << 32) |
2999 + (b4 << 24) | (b5 << 16) | (b6 << 8) | (b7 << 0);
3002 +inline void KeyFromUint64(uint64 ull, unsigned char* key) {
3003 + uint64 ull_swap = Swap64(ull);
3004 + memcpy(key, &ull_swap, sizeof(uint64));
3007 +inline int64 int64_from_double(const double& source) {
3009 + memcpy(&dest, &source, sizeof(dest));
3013 +void KeyFromDouble(double x, unsigned char* key) __attribute__ ((noinline));
3014 +void KeyFromDouble(double x, unsigned char* key) {
3015 + int64 n = int64_from_double(x);
3021 + KeyFromUint64(n, key);
3025 +void TestKeyFromDouble(uint64 ull) {
3027 + memcpy(&d, &ull, sizeof(d));
3029 + unsigned char key[sizeof(uint64)];
3030 + unsigned char expected_key[sizeof(uint64)] = { 0x81, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef };
3032 + KeyFromDouble(d, key);
3034 + for (size_t i = 0; i < sizeof(key); ++i) {
3035 + if ((key[i] & 0xff) != expected_key[i])
3041 + TestKeyFromDouble(0x0123456789abcdefull);
3044 Index: gcc/testsuite/g++.dg/tree-ssa/pr32327.C
3045 ===================================================================
3046 --- gcc/testsuite/g++.dg/tree-ssa/pr32327.C (.../tags/gcc_4_2_0_release) (revision 0)
3047 +++ gcc/testsuite/g++.dg/tree-ssa/pr32327.C (.../branches/gcc-4_2-branch) (revision 126002)
3049 +// { dg-do run { target { { i?86-*-* x86_64-*-* } && ilp32 } } }
3050 +// { dg-options "-O2" }
3052 +typedef unsigned long long uint64;
3053 +typedef __SIZE_TYPE__ size_t;
3056 +extern void *memcpy (void *__restrict __dest,
3057 + __const void *__restrict __src, size_t __n) /*throw ()*/;
3058 +extern void abort (void);
3061 +extern void foo (void* p);
3066 + // __r is allocated the same stack slot as dest below
3067 + union { unsigned long long int __ll;
3068 + unsigned long int __l[2]; } __w, __r;
3072 + register unsigned int __v;
3073 + __asm__ __volatile__ ("bswap %0" : "=r" (__v) :
3074 + "0" ((unsigned int) (__w.__l[1])));
3079 + register unsigned int __v;
3080 + __asm__ __volatile__ ("bswap %0" : "=r" (__v) :
3081 + "0" ((unsigned int) (__w.__l[0])));
3088 +double_2_uint64 (const double *source)
3090 + uint64 dest; // allocated the same stack slot as __r above
3091 + memcpy(&dest, source, sizeof(dest));
3096 +KeyFromUint64(uint64 fp) {
3098 + norder = ghtonll (fp);
3099 + foo((char*)(&norder));
3103 +KeyFromDouble(double x) {
3104 + uint64 n = double_2_uint64 (&x);
3112 +#define NUM 0x0123456789abcdefll
3113 +#define EXPECTED 0xe0bc9a7856347243ll
3117 + if (*((uint64 *)x) != (uint64) EXPECTED)
3123 + if (sizeof (double) != sizeof (uint64))
3126 + if (sizeof (uint64) == sizeof (unsigned long int))
3129 + KeyFromDouble ((double)NUM);
3133 Index: gcc/testsuite/g++.dg/conversion/enum1.C
3134 ===================================================================
3135 --- gcc/testsuite/g++.dg/conversion/enum1.C (.../tags/gcc_4_2_0_release) (revision 0)
3136 +++ gcc/testsuite/g++.dg/conversion/enum1.C (.../branches/gcc-4_2-branch) (revision 126002)
3139 +// { dg-options "-O2 -finline-functions" }
3142 +static const E E_MIN = V;
3143 +static const E E_MAX = V;
3145 +bool valid(E v) { return v >= E_MIN && v <= E_MAX; }
3147 +int main() { return valid(E(2)); }
3148 Index: gcc/testsuite/g++.dg/ext/asm10.C
3149 ===================================================================
3150 --- gcc/testsuite/g++.dg/ext/asm10.C (.../tags/gcc_4_2_0_release) (revision 0)
3151 +++ gcc/testsuite/g++.dg/ext/asm10.C (.../branches/gcc-4_2-branch) (revision 126002)
3153 +// PR inline-asm/32109
3154 +// { dg-do compile }
3155 +// { dg-options "-O2" }
3157 +struct A { int i[3]; ~A (); };
3159 +struct B { struct A c; int i; B (); } b;
3163 + __asm ("" : : "r" (a)); // { dg-error "impossible constraint|non-memory input" }
3164 + __asm ("" : : "r" (b.c)); // { dg-error "impossible constraint|non-memory input" }
3165 + __asm ("" : : "r" (c)); // { dg-error "impossible constraint|non-memory input" }
3167 Index: gcc/testsuite/g++.dg/gomp/pr31769.C
3168 ===================================================================
3169 --- gcc/testsuite/g++.dg/gomp/pr31769.C (.../tags/gcc_4_2_0_release) (revision 0)
3170 +++ gcc/testsuite/g++.dg/gomp/pr31769.C (.../branches/gcc-4_2-branch) (revision 126002)
3172 +// PR tree-optimization/31769
3173 +// { dg-options "-O2 -fopenmp" }
3174 +// { dg-do compile }
3183 + C (int x, int y) {}
3185 +template<typename T, int U>
3200 + A () { b = __null; }
3201 + ~A () { if (b != __null) delete b; }
3203 +struct F : public A
3205 + explicit F (int x) { foo (0); }
3208 + F operator () (C x) const
3210 + return F (const_cast<F &>(*this), x);
3212 + template <typename U> F & operator+= (const U &);
3225 +#pragma omp parallel for
3226 + for (int i = 0; i < 2; ++i)
3233 Index: gcc/testsuite/g++.dg/opt/pr30252.C
3234 ===================================================================
3235 --- gcc/testsuite/g++.dg/opt/pr30252.C (.../tags/gcc_4_2_0_release) (revision 0)
3236 +++ gcc/testsuite/g++.dg/opt/pr30252.C (.../branches/gcc-4_2-branch) (revision 126002)
3238 +/* { dg-do run } */
3239 +/* { dg-options "-O -fstrict-aliasing" } */
3241 +extern "C" void abort (void);
3243 + template <class T_type>
3246 + typedef T_type& pass;
3247 + typedef const T_type& take;
3248 + typedef T_type* pointer;
3250 + template <class T_base, class T_derived>
3251 + struct is_base_and_derived
3256 + static big is_base_class_(...);
3257 + static char is_base_class_(typename type_trait<T_base>::pointer);
3258 + static const bool value =
3259 + sizeof(is_base_class_(reinterpret_cast<typename type_trait<T_derived>::pointer>(0))) ==
3263 + struct functor_base {};
3264 + template <class T_functor, bool I_derives_functor_base=is_base_and_derived<functor_base,T_functor>::value>
3265 + struct functor_trait
3268 + template <class T_functor>
3269 + struct functor_trait<T_functor,true>
3271 + typedef typename T_functor::result_type result_type;
3272 + typedef T_functor functor_type;
3274 + template <class T_arg1, class T_return>
3275 + class pointer_functor1 : public functor_base
3277 + typedef T_return (*function_type)(T_arg1);
3278 + function_type func_ptr_;
3280 + typedef T_return result_type;
3281 + explicit pointer_functor1(function_type _A_func): func_ptr_(_A_func) {}
3282 + T_return operator()(typename type_trait<T_arg1>::take _A_a1) const
3283 + { return func_ptr_(_A_a1); }
3285 + template <class T_arg1, class T_return>
3286 + inline pointer_functor1<T_arg1, T_return>
3287 + ptr_fun1(T_return (*_A_func)(T_arg1))
3288 + { return pointer_functor1<T_arg1, T_return>(_A_func); }
3289 + struct adaptor_base : public functor_base {};
3290 + template <class T_functor,
3291 + class T_arg1=void,
3292 + bool I_derives_adaptor_base=is_base_and_derived<adaptor_base,T_functor>::value>
3293 + struct deduce_result_type
3294 + { typedef typename functor_trait<T_functor>::result_type type; };
3295 + template <class T_functor>
3296 + struct adaptor_functor : public adaptor_base
3298 + template <class T_arg1=void>
3299 + struct deduce_result_type
3300 + { typedef typename sigc::deduce_result_type<T_functor, T_arg1>::type type; };
3301 + typedef typename functor_trait<T_functor>::result_type result_type;
3303 + operator()() const;
3304 + template <class T_arg1>
3305 + typename deduce_result_type<T_arg1>::type
3306 + operator()(T_arg1 _A_arg1) const
3307 + { return functor_(_A_arg1); }
3308 + explicit adaptor_functor(const T_functor& _A_functor)
3309 + : functor_(_A_functor)
3311 + mutable T_functor functor_;
3313 + template <class T_functor>
3314 + typename adaptor_functor<T_functor>::result_type
3315 + adaptor_functor<T_functor>::operator()() const
3316 + { return functor_(); }
3317 + template <class T_functor, bool I_isadaptor = is_base_and_derived<adaptor_base, T_functor>::value> struct adaptor_trait;
3318 + template <class T_functor>
3319 + struct adaptor_trait<T_functor, true>
3321 + typedef T_functor adaptor_type;
3323 + template <class T_functor>
3324 + struct adaptor_trait<T_functor, false>
3326 + typedef typename functor_trait<T_functor>::functor_type functor_type;
3327 + typedef adaptor_functor<functor_type> adaptor_type;
3329 + template <class T_functor>
3330 + struct adapts : public adaptor_base
3332 + typedef typename adaptor_trait<T_functor>::adaptor_type adaptor_type;
3333 + explicit adapts(const T_functor& _A_functor)
3334 + : functor_(_A_functor)
3336 + mutable adaptor_type functor_;
3338 + template <class T_type>
3339 + struct reference_wrapper
3342 + template <class T_type>
3343 + struct unwrap_reference
3345 + typedef T_type type;
3347 + template <class T_type>
3348 + class bound_argument
3351 + bound_argument(const T_type& _A_argument)
3352 + : visited_(_A_argument)
3354 + inline T_type& invoke()
3355 + { return visited_; }
3358 + template <class T_wrapped>
3359 + class bound_argument< reference_wrapper<T_wrapped> >
3362 + template <int I_location, class T_functor, class T_type1=nil>
3363 + struct bind_functor;
3364 + template <class T_functor, class T_type1>
3365 + struct bind_functor<-1, T_functor, T_type1> : public adapts<T_functor>
3367 + typedef typename adapts<T_functor>::adaptor_type adaptor_type;
3368 + typedef typename adaptor_type::result_type result_type;
3372 + return this->functor_.template operator()<typename type_trait<typename unwrap_reference<T_type1>::type>::pass> (bound1_.invoke());
3374 + bind_functor(typename type_trait<T_functor>::take _A_func, typename type_trait<T_type1>::take _A_bound1)
3375 + : adapts<T_functor>(_A_func), bound1_(_A_bound1)
3377 + bound_argument<T_type1> bound1_;
3379 + template <class T_type1, class T_functor>
3380 + inline bind_functor<-1, T_functor,
3382 + bind(const T_functor& _A_func, T_type1 _A_b1)
3383 + { return bind_functor<-1, T_functor,
3387 + namespace internal {
3389 + typedef void* (*hook)(slot_rep *);
3395 + class slot_base : public functor_base
3398 + typedef internal::slot_rep rep_type;
3399 + explicit slot_base(rep_type* rep)
3403 + mutable rep_type *rep_;
3405 + namespace internal {
3406 + template <class T_functor>
3407 + struct typed_slot_rep : public slot_rep
3409 + typedef typename adaptor_trait<T_functor>::adaptor_type adaptor_type;
3410 + adaptor_type functor_;
3411 + inline typed_slot_rep(const T_functor& functor)
3412 + : functor_(functor)
3416 + template<class T_functor>
3419 + static void *call_it(slot_rep* rep)
3421 + typedef typed_slot_rep<T_functor> typed_slot;
3422 + typed_slot *typed_rep = static_cast<typed_slot*>(rep);
3423 + return (typed_rep->functor_)();
3425 + static hook address()
3432 + class slot0 : public slot_base
3435 + typedef void * (*call_type)(rep_type*);
3436 + inline void *operator()() const
3438 + return slot_base::rep_->call_ (slot_base::rep_);
3440 + template <class T_functor>
3441 + slot0(const T_functor& _A_func)
3442 + : slot_base(new internal::typed_slot_rep<T_functor>(_A_func))
3444 + slot_base::rep_->call_ = internal::slot_call0<T_functor>::address();
3450 + static void *foo (void *p) { return p; }
3451 + typedef sigc::slot0 C;
3456 + return sigc::bind (sigc::ptr_fun1 (&A::foo), (void*)0);
3461 + if (a.bar ()() != 0)
3464 Index: gcc/testsuite/g++.dg/opt/static5.C
3465 ===================================================================
3466 --- gcc/testsuite/g++.dg/opt/static5.C (.../tags/gcc_4_2_0_release) (revision 0)
3467 +++ gcc/testsuite/g++.dg/opt/static5.C (.../branches/gcc-4_2-branch) (revision 126002)
3471 +// { dg-options "-O2" }
3476 + static inline S f (unsigned a);
3482 + static S t = { a };
3486 +const static S s = S::f (26);
3488 +extern "C" void abort (void);
3498 Index: gcc/testsuite/g++.dg/opt/nrv13.C
3499 ===================================================================
3500 --- gcc/testsuite/g++.dg/opt/nrv13.C (.../tags/gcc_4_2_0_release) (revision 0)
3501 +++ gcc/testsuite/g++.dg/opt/nrv13.C (.../branches/gcc-4_2-branch) (revision 126002)
3503 +// PR tree-optimization/32353
3505 +// { dg-options "-O2" }
3507 +extern "C" void abort ();
3512 + A (int x) : f (x) {}
3516 +foo (const A &x, const A &y)
3519 + r = x.f == -111 ? y : (y.f == -111 || x.f > y.f) ? x : y;
3521 + r = r.f == -111 ? s : (r.f > s.f) ? r : s;
3528 + if (foo (A (0), A (1)).f != 1)
3530 + if (foo (A (1), A (9)).f != 9)
3532 + if (foo (A (9), A (1)).f != 9)
3534 + if (foo (A (-4), A (-5)).f != 0)
3536 + if (foo (A (-111), A (-111)).f != 0)
3538 + if (foo (A (2), A (-111)).f != 2)
3540 + if (foo (A (-111), A (6)).f != 6)
3542 + if (foo (A (-111), A (-4)).f != 0)
3545 Index: gcc/testsuite/g++.dg/lookup/anon6.C
3546 ===================================================================
3547 --- gcc/testsuite/g++.dg/lookup/anon6.C (.../tags/gcc_4_2_0_release) (revision 0)
3548 +++ gcc/testsuite/g++.dg/lookup/anon6.C (.../branches/gcc-4_2-branch) (revision 126002)
3550 +extern int v1; // { dg-error "declared" }
3551 +static union { int v1; }; // { dg-error "redeclaration" }
3553 +static union { int v2; }; // { dg-error "declared" }
3554 +extern int v2; // { dg-error "redeclaration" }
3556 +int v3; // { dg-error "declared" }
3557 +static union { int v3; }; // { dg-error "redeclaration" }
3559 +static union { int v4; }; // { dg-error "declared" }
3560 +static union { int v4; }; // { dg-error "redeclaration" }
3561 Index: gcc/testsuite/gfortran.dg/char_length_5.f90
3562 ===================================================================
3563 --- gcc/testsuite/gfortran.dg/char_length_5.f90 (.../tags/gcc_4_2_0_release) (revision 0)
3564 +++ gcc/testsuite/gfortran.dg/char_length_5.f90 (.../branches/gcc-4_2-branch) (revision 126002)
3567 +! Tests the fix for PR31867, in which the interface evaluation
3568 +! of the character length of 'join' (ie. the length available in
3569 +! the caller) was wrong.
3571 +! Contributed by <beliavsky@aol.com>
3576 + function join (words, sep) result(str)
3577 + character (len=*), intent(in) :: words(:),sep
3578 + character (len = (size (words) - 1) * len_trim (sep) + &
3579 + sum (len_trim (words))) :: str
3589 + str = trim (str) // trim (sep) // words(i)
3592 +end module util_mod
3595 + use util_mod, only: join
3598 + character (len=5) :: words(5:8) = (/"two ","three","four ","five "/), sep = "^#^"
3599 + character (len=5) :: words2(4) = (/"bat ","ball ","goal ","stump"/), sep2 = "&"
3601 + if (join (words, sep) .ne. "two^#^three^#^four^#^five") call abort ()
3602 + if (len (join (words, sep)) .ne. 25) call abort ()
3604 + if (join (words(5:6), sep) .ne. "two^#^three") call abort ()
3605 + if (len (join (words(5:6), sep)) .ne. 11) call abort ()
3607 + if (join (words(7:8), sep) .ne. "four^#^five") call abort ()
3608 + if (len (join (words(7:8), sep)) .ne. 11) call abort ()
3610 + if (join (words(5:7:2), sep) .ne. "two^#^four") call abort ()
3611 + if (len (join (words(5:7:2), sep)) .ne. 10) call abort ()
3613 + if (join (words(6:8:2), sep) .ne. "three^#^five") call abort ()
3614 + if (len (join (words(6:8:2), sep)) .ne. 12) call abort ()
3616 + if (join (words2, sep2) .ne. "bat&ball&goal&stump") call abort ()
3617 + if (len (join (words2, sep2)) .ne. 19) call abort ()
3619 + if (join (words2(1:2), sep2) .ne. "bat&ball") call abort ()
3620 + if (len (join (words2(1:2), sep2)) .ne. 8) call abort ()
3622 + if (join (words2(2:4:2), sep2) .ne. "ball&stump") call abort ()
3623 + if (len (join (words2(2:4:2), sep2)) .ne. 10) call abort ()
3626 +! { dg-final { cleanup-modules "util_mod" } }
3627 Index: gcc/testsuite/gfortran.dg/array_reference_1.f90
3628 ===================================================================
3629 --- gcc/testsuite/gfortran.dg/array_reference_1.f90 (.../tags/gcc_4_2_0_release) (revision 0)
3630 +++ gcc/testsuite/gfortran.dg/array_reference_1.f90 (.../branches/gcc-4_2-branch) (revision 126002)
3633 +! Tests the fix for PR31994, aka 31867, in which the offset
3634 +! of 'a' in both subroutines was being evaluated incorrectly.
3635 +! The testcase for PR31867 is char_length_5.f90
3637 +! Contributed by Elizabeth Yip <elizabeth.l.yip@boeing.com>
3638 +! and Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
3642 + call PR31994_comment6
3644 + subroutine PR31994
3646 + complex (kind=4), dimension(2,2) :: a, b, c
3651 + b=conjg (transpose (a))
3654 + if (any (b .ne. c)) call abort ()
3655 + end subroutine PR31994
3656 + subroutine PR31994_comment6
3658 + real ,dimension(2,2)::a
3659 + integer ,dimension(2,2) :: b, c
3660 + a = reshape ((/1.,2.,3.,4./), (/2,2/))
3661 + b=int (transpose(a))
3664 + if (any (b .ne. c)) call abort ()
3665 + end subroutine PR31994_comment6
3667 Index: gcc/testsuite/gfortran.dg/reshape_transpose_1.f90
3668 ===================================================================
3669 --- gcc/testsuite/gfortran.dg/reshape_transpose_1.f90 (.../tags/gcc_4_2_0_release) (revision 0)
3670 +++ gcc/testsuite/gfortran.dg/reshape_transpose_1.f90 (.../branches/gcc-4_2-branch) (revision 126002)
3673 +! PR 31196 - reshape of transposed derived types generated
3680 + character (len=20) line1, line2
3681 + TYPE(datatype), dimension(2,2) :: data, result
3686 + write (unit=line1, fmt="(4I4)") reshape(transpose(data),shape(data))
3687 + write (unit=line2, fmt="(4I4)") (/ 1, 3, 2, 4 /)
3688 + if (line1 /= line2) call abort
3690 Index: gcc/testsuite/gfortran.dg/common_resize_1.f
3691 ===================================================================
3692 --- gcc/testsuite/gfortran.dg/common_resize_1.f (.../tags/gcc_4_2_0_release) (revision 0)
3693 +++ gcc/testsuite/gfortran.dg/common_resize_1.f (.../branches/gcc-4_2-branch) (revision 126002)
3696 +c { dg-options "-std=legacy" }
3698 +c Tests the fix for PR32302, in which the resizing of 'aux32' would cause
3699 +c misalignment for double precision types and a wrong result would be obtained
3700 +c at any level of optimization except none.
3702 +c Contributed by Dale Ranta <dir@lanl.gov>
3704 + subroutine unpki(ixp,nwcon,nmel)
3706 + implicit double precision (a-h,o-z) dp
3708 +c unpack connection data
3710 + common/aux32/kka(lnv),kkb(lnv),kkc(lnv),
3711 + 1 kk1(lnv),kk2(lnv),kk3(lnv),dxy(lnv),
3712 + 2 dyx(lnv),dyz(lnv),dzy(lnv),dzx(lnv),
3713 + 3 dxz(lnv),vx17(lnv),vx28(lnv),vx35(lnv),
3714 + 4 vx46(lnv),vy17(lnv),vy28(lnv),
3715 + 5 vy35(lnv),vy46(lnv),vz17(lnv),vz28(lnv),vz35(lnv),vz46(lnv)
3716 + common/aux33/ix1(lnv),ix2(lnv),ix3(lnv),ix4(lnv),ix5(lnv),
3717 + 1 ix6(lnv),ix7(lnv),ix8(lnv),mxt(lnv)
3718 + dimension ixp(nwcon,*)
3724 + implicit double precision (a-h,o-z) dp
3726 + & x1(lnv),x2(lnv),x3(lnv),x4(lnv),
3727 + & x5(lnv),x6(lnv),x7(lnv),x8(lnv),
3728 + & y1(lnv),y2(lnv),y3(lnv),y4(lnv),
3729 + & y5(lnv),y6(lnv),y7(lnv),y8(lnv),
3730 + & z1(lnv),z2(lnv),z3(lnv),z4(lnv),
3731 + & z5(lnv),z6(lnv),z7(lnv),z8(lnv)
3732 + common/aux9/vlrho(lnv),det(lnv)
3734 + 1 px1(lnv),px2(lnv),px3(lnv),px4(lnv),
3735 + & px5(lnv),px6(lnv),px7(lnv),px8(lnv),
3736 + 2 py1(lnv),py2(lnv),py3(lnv),py4(lnv),
3737 + & py5(lnv),py6(lnv),py7(lnv),py8(lnv),
3738 + 3 pz1(lnv),pz2(lnv),pz3(lnv),pz4(lnv),
3739 + & pz5(lnv),pz6(lnv),pz7(lnv),pz8(lnv),
3740 + 4 vx1(lnv),vx2(lnv),vx3(lnv),vx4(lnv),
3741 + 5 vx5(lnv),vx6(lnv),vx7(lnv),vx8(lnv),
3742 + 6 vy1(lnv),vy2(lnv),vy3(lnv),vy4(lnv),
3743 + 7 vy5(lnv),vy6(lnv),vy7(lnv),vy8(lnv),
3744 + 8 vz1(lnv),vz2(lnv),vz3(lnv),vz4(lnv),
3745 + 9 vz5(lnv),vz6(lnv),vz7(lnv),vz8(lnv)
3746 + common/aux32/ ! { dg-warning "shall be of the same size" }
3747 + a a17(lnv),a28(lnv),dett(lnv),
3748 + 1 aj1(lnv),aj2(lnv),aj3(lnv),aj4(lnv),
3749 + 2 aj5(lnv),aj6(lnv),aj7(lnv),aj8(lnv),
3750 + 3 aj9(lnv),x17(lnv),x28(lnv),x35(lnv),
3751 + 4 x46(lnv),y17(lnv),y28(lnv),y35(lnv),
3752 + 5 y46(lnv),z17(lnv),z28(lnv),z35(lnv),z46(lnv)
3753 + common/aux33/ ! { dg-warning "shall be of the same size" }
3754 + a ix1(lnv),ix2(lnv),ix3(lnv),ix4(lnv),ix5(lnv),
3755 + 1 ix6(lnv),ix7(lnv),ix8(lnv),mxt(lnv),nmel
3756 + common/aux36/lft,llt
3757 + common/failu/sieu(lnv),failu(lnv)
3758 + common/sand1/ihf,ibemf,ishlf,itshf
3759 + dimension aj5968(lnv),aj6749(lnv),aj4857(lnv),aji1(lnv),aji2(lnv),
3760 + 1 aji3(lnv),aji4(lnv),aji5(lnv),
3761 + 1 aji6(lnv),aji7(lnv),aji8(lnv),aji9(lnv),aj12(lnv),
3762 + 2 aj45(lnv),aj78(lnv),b17(lnv),b28(lnv),c17(lnv),c28(lnv)
3764 + equivalence (x17,aj5968),(x28,aj6749),(x35,aj4857),(x46,aji1),
3765 + 1 (y17,aji2),(y28,aji3),(y35,aji4),(y46,aji5),(z17,aji6),
3766 + 2 (z28,aji7),(z35,aji8),(z46,aji9),(aj1,aj12),(aj2,aj45),
3767 + 3 (aj3,aj78),(px1,b17),(px2,b28),(px3,c17),(px4,c28)
3768 + data o64th/0.0156250/
3773 + x17(i)=x7(i)-x1(i)
3774 + x28(i)=x8(i)-x2(i)
3775 + x35(i)=x5(i)-x3(i)
3776 + x46(i)=x6(i)-x4(i)
3777 + y17(i)=y7(i)-y1(i)
3778 + y28(i)=y8(i)-y2(i)
3779 + y35(i)=y5(i)-y3(i)
3780 + y46(i)=y6(i)-y4(i)
3781 + z17(i)=z7(i)-z1(i)
3782 + z28(i)=z8(i)-z2(i)
3783 + z35(i)=z5(i)-z3(i)
3784 + 10 z46(i)=z6(i)-z4(i)
3786 + aj1(i)=x17(i)+x28(i)-x35(i)-x46(i)
3787 + aj2(i)=y17(i)+y28(i)-y35(i)-y46(i)
3788 + aj3(i)=z17(i)+z28(i)-z35(i)-z46(i)
3789 + a17(i)=x17(i)+x46(i)
3790 + a28(i)=x28(i)+x35(i)
3791 + b17(i)=y17(i)+y46(i)
3792 + b28(i)=y28(i)+y35(i)
3793 + c17(i)=z17(i)+z46(i)
3794 + 20 c28(i)=z28(i)+z35(i)
3796 + aj4(i)=a17(i)+a28(i)
3797 + aj5(i)=b17(i)+b28(i)
3798 + aj6(i)=c17(i)+c28(i)
3799 + aj7(i)=a17(i)-a28(i)
3800 + aj8(i)=b17(i)-b28(i)
3801 + 30 aj9(i)=c17(i)-c28(i)
3806 + aj5968(i)=aj5(i)*aj9(i)-aj6(i)*aj8(i)
3807 + aj6749(i)=aj6(i)*aj7(i)-aj4(i)*aj9(i)
3808 + 40 aj4857(i)=aj4(i)*aj8(i)-aj5(i)*aj7(i)
3809 + if (ihf.ne.1) then
3811 + 50 det(i)=o64th*(aj1(i)*aj5968(i)+aj2(i)*aj6749(i)+aj3(i)*aj4857(i))
3814 + det(i)=o64th*(aj1(i)*aj5968(i)+aj2(i)*aj6749(i)+aj3(i)*aj4857(i))
3815 + 1 *failu(i) + (1. - failu(i))
3819 + 60 dett(i)=o64th/det(i)
3821 + if (det(lft) .ne. 1d0) call abort ()
3822 + if (det(llt) .ne. 1d0) call abort ()
3829 + implicit double precision (a-h,o-z) dp
3831 + & x1(lnv),x2(lnv),x3(lnv),x4(lnv),
3832 + & x5(lnv),x6(lnv),x7(lnv),x8(lnv),
3833 + & y1(lnv),y2(lnv),y3(lnv),y4(lnv),
3834 + & y5(lnv),y6(lnv),y7(lnv),y8(lnv),
3835 + & z1(lnv),z2(lnv),z3(lnv),z4(lnv),
3836 + & z5(lnv),z6(lnv),z7(lnv),z8(lnv)
3837 + common/aux36/lft,llt
3838 + common/sand1/ihf,ibemf,ishlf,itshf
3871 Index: gcc/testsuite/gfortran.dg/fmt_colon.f90
3872 ===================================================================
3873 --- gcc/testsuite/gfortran.dg/fmt_colon.f90 (.../tags/gcc_4_2_0_release) (revision 0)
3874 +++ gcc/testsuite/gfortran.dg/fmt_colon.f90 (.../branches/gcc-4_2-branch) (revision 126002)
3877 +! PR31395 Colon edit descriptor is ignored.
3878 +! Test case derived from PR. Prepared by Jerry DeLisle
3879 +! <jvdelisle@gcc.gnu.org>
3882 + character(30) :: astring
3883 + WRITE(astring, 10) i
3884 + 10 FORMAT('i =',I2:' this should not print')
3885 + if (astring.ne."i = 1") call abort
3886 + write(astring, 20) i, i
3887 + 20 format('i =',I2:' this should print',I2)
3888 + if (astring.ne."i = 1 this should print 1") call abort
3890 \ No newline at end of file
3891 Index: gcc/testsuite/gfortran.dg/char_result_13.f90
3892 ===================================================================
3893 --- gcc/testsuite/gfortran.dg/char_result_13.f90 (.../tags/gcc_4_2_0_release) (revision 0)
3894 +++ gcc/testsuite/gfortran.dg/char_result_13.f90 (.../branches/gcc-4_2-branch) (revision 126002)
3896 +! { dg-do compile }
3897 +! tests the fix for PR31540, in which the character lengths in
3898 +! parentheses were not resolved.
3900 +! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
3904 + external pfname1, pfname2
3905 + character ((136)) pfname1
3906 + character ((129+7)) pfname2
3909 Index: gcc/testsuite/gfortran.dg/compliant_elemental_intrinsics_2.f90
3910 ===================================================================
3911 --- gcc/testsuite/gfortran.dg/compliant_elemental_intrinsics_2.f90 (.../tags/gcc_4_2_0_release) (revision 0)
3912 +++ gcc/testsuite/gfortran.dg/compliant_elemental_intrinsics_2.f90 (.../branches/gcc-4_2-branch) (revision 126002)
3916 +! Testcases from PR32002.
3918 +PROGRAM test_pr32002
3920 + CALL test_1() ! scalar/vector
3921 + CALL test_2() ! vector/vector
3922 + CALL test_3() ! matrix/vector
3923 + CALL test_4() ! matrix/matrix
3926 + ELEMENTAL FUNCTION f(x)
3927 + INTEGER, INTENT(in) :: x
3932 + SUBROUTINE test_1()
3933 + INTEGER :: a = 0, b(2) = 0
3934 + a = f(b) ! { dg-error "Incompatible ranks" }
3935 + b = f(a) ! ok, set all array elements to f(a)
3938 + SUBROUTINE test_2()
3939 + INTEGER :: a(2) = 0, b(3) = 0
3940 + a = f(b) ! { dg-error "different shape" }
3941 + a = f(b(1:2)) ! ok, slice, stride 1
3942 + a = f(b(1:3:2)) ! ok, slice, stride 2
3945 + SUBROUTINE test_3()
3946 + INTEGER :: a(4) = 0, b(2,2) = 0
3947 + a = f(b) ! { dg-error "Incompatible ranks" }
3948 + a = f(RESHAPE(b, (/ 4 /))) ! ok, same shape
3951 + SUBROUTINE test_4()
3952 + INTEGER :: a(2,2) = 0, b(3,3) = 0
3953 + a = f(b) ! { dg-error "different shape" }
3954 + a = f(b(1:3, 1:2)) ! { dg-error "different shape" }
3955 + a = f(b(1:3:2, 1:3:2)) ! ok, same shape
3958 Index: gcc/testsuite/gfortran.dg/altreturn_5.f90
3959 ===================================================================
3960 --- gcc/testsuite/gfortran.dg/altreturn_5.f90 (.../tags/gcc_4_2_0_release) (revision 0)
3961 +++ gcc/testsuite/gfortran.dg/altreturn_5.f90 (.../branches/gcc-4_2-branch) (revision 126002)
3964 +! Tests the fix for PR31483, in which dummy argument procedures
3965 +! produced an ICE if they had an alternate return.
3967 +! Contributed by Mathias Fröhlich <M.Froehlich@science-computing.de>
3969 + SUBROUTINE R (i, *, *)
3974 + SUBROUTINE PHLOAD (READER, i, res)
3979 + CALL READER (i, *1, *2)
3988 + call PHLOAD (R, 1, res)
3989 + if (res .ne. "one") call abort ()
3990 + CALL PHLOAD (R, 2, res)
3991 + if (res .ne. "two") call abort ()
3993 \ No newline at end of file
3994 Index: gcc/testsuite/gfortran.dg/substr_4.f
3995 ===================================================================
3996 --- gcc/testsuite/gfortran.dg/substr_4.f (.../tags/gcc_4_2_0_release) (revision 0)
3997 +++ gcc/testsuite/gfortran.dg/substr_4.f (.../branches/gcc-4_2-branch) (revision 126002)
4000 + subroutine test_lower
4002 + character(3), dimension(3) :: zsymel,zsymelr
4003 + common /xx/ zsymel, zsymelr
4004 + integer :: znsymelr
4005 + zsymel = (/ 'X', 'Y', ' ' /)
4006 + zsymelr= (/ 'X', 'Y', ' ' /)
4008 + call check_zsymel(zsymel,zsymelr,znsymelr)
4012 + subroutine check_zsymel(zsymel,zsymelr,znsymelr)
4014 + integer znsymelr, isym
4015 + character(*) zsymel(*),zsymelr(*)
4016 + character(len=80) buf
4017 + zsymel(3)(lenstr(zsymel(3))+1:)='X'
4018 + write (buf,10) (trim(zsymelr(isym)),isym=1,znsymelr)
4019 +10 format(3(a,:,','))
4020 + if (trim(buf) /= 'X,Y') call abort
4021 + end subroutine check_zsymel
4023 + function lenstr(s)
4024 + character(len=*),intent(in) :: s
4026 + if (len_trim(s) /= 0) call abort
4027 + lenstr = len_trim(s)
4028 + end function lenstr
4030 + end subroutine test_lower
4032 + subroutine test_upper
4034 + character(3), dimension(3) :: zsymel,zsymelr
4035 + common /xx/ zsymel, zsymelr
4036 + integer :: znsymelr
4037 + zsymel = (/ 'X', 'Y', ' ' /)
4038 + zsymelr= (/ 'X', 'Y', ' ' /)
4040 + call check_zsymel(zsymel,zsymelr,znsymelr)
4044 + subroutine check_zsymel(zsymel,zsymelr,znsymelr)
4046 + integer znsymelr, isym
4047 + character(*) zsymel(*),zsymelr(*)
4048 + character(len=80) buf
4049 + zsymel(3)(:lenstr(zsymel(3))+1)='X'
4050 + write (buf,20) (trim(zsymelr(isym)),isym=1,znsymelr)
4051 +20 format(3(a,:,','))
4052 + if (trim(buf) /= 'X,Y') call abort
4053 + end subroutine check_zsymel
4055 + function lenstr(s)
4056 + character(len=*),intent(in) :: s
4058 + if (len_trim(s) /= 0) call abort
4059 + lenstr = len_trim(s)
4060 + end function lenstr
4062 + end subroutine test_upper
4068 Index: gcc/testsuite/gfortran.dg/fmt_t_3.f90
4069 ===================================================================
4070 --- gcc/testsuite/gfortran.dg/fmt_t_3.f90 (.../tags/gcc_4_2_0_release) (revision 0)
4071 +++ gcc/testsuite/gfortran.dg/fmt_t_3.f90 (.../branches/gcc-4_2-branch) (revision 126002)
4074 +! PR31051 bug with x and t format descriptors.
4075 +! Test case prepared by Jerry DeLisle <jvdelisle@gcc.gnu.org> from PR.
4077 + integer, parameter :: n = 9
4078 + character(len=40) :: fmt
4079 + character(len=2), dimension(n) :: y
4080 + open(unit=10, status="scratch")
4082 + fmt = '(a,1x,(t7, 3a))'
4083 + write(10, fmt) 'xxxx', (y(i), i = 1,n)
4085 + read(10, '(a)') fmt
4086 + if (fmt.ne."xxxx a a a") call abort()
4088 Index: gcc/testsuite/gfortran.dg/backspace_8.f
4089 ===================================================================
4090 --- gcc/testsuite/gfortran.dg/backspace_8.f (.../tags/gcc_4_2_0_release) (revision 0)
4091 +++ gcc/testsuite/gfortran.dg/backspace_8.f (.../branches/gcc-4_2-branch) (revision 126002)
4094 +C PR libfortran/31618 - backspace after an error didn't work.
4097 + open (21, file="backspace_7.dat", form="unformatted")
4099 + write (21) 4711, 4712
4103 + read (21,err=100,end=100) i,j,k
4108 + if (i .ne. 4711 .or. j .ne. 4712) call abort
4109 + close (21,status="delete")
4111 Index: gcc/testsuite/gfortran.dg/func_assign.f90
4112 ===================================================================
4113 --- gcc/testsuite/gfortran.dg/func_assign.f90 (.../tags/gcc_4_2_0_release) (revision 0)
4114 +++ gcc/testsuite/gfortran.dg/func_assign.f90 (.../branches/gcc-4_2-branch) (revision 126002)
4116 +! { dg-do compile }
4119 +! Do not allow assigning to external functions
4121 +! Contributed by Steve Kargl <sgk@troutmask.apl.washington.edu>
4126 + integer function bar()
4135 + function funget(a)
4139 + end subroutine sub
4141 + sub = 'a' ! { dg-error "Expected VARIABLE" }
4142 + fun = 4.4 ! { dg-error "Expected VARIABLE" }
4143 + funget = 4 ! { dg-error "is not a VALUE" }
4144 + bar = 5 ! { dg-error "is not a VALUE" }
4149 Index: gcc/testsuite/gfortran.dg/unf_io_convert_3.f90
4150 ===================================================================
4151 --- gcc/testsuite/gfortran.dg/unf_io_convert_3.f90 (.../tags/gcc_4_2_0_release) (revision 126002)
4152 +++ gcc/testsuite/gfortran.dg/unf_io_convert_3.f90 (.../branches/gcc-4_2-branch) (revision 126002)
4156 ! { dg-require-effective-target fortran_large_real }
4158 integer,parameter :: k = selected_real_kind (precision (0.0_8) + 1)
4159 Index: gcc/cp/class.c
4160 ===================================================================
4161 --- gcc/cp/class.c (.../tags/gcc_4_2_0_release) (revision 126002)
4162 +++ gcc/cp/class.c (.../branches/gcc-4_2-branch) (revision 126002)
4163 @@ -5350,22 +5350,34 @@
4165 else if (TREE_CODE (TREE_TYPE (instance)) == REFERENCE_TYPE)
4167 + /* We only need one hash table because it is always left empty. */
4170 + ht = htab_create (37,
4171 + htab_hash_pointer,
4173 + /*htab_del=*/NULL);
4175 /* Reference variables should be references to objects. */
4179 - /* DECL_VAR_MARKED_P is used to prevent recursion; a
4180 + /* Enter the INSTANCE in a table to prevent recursion; a
4181 variable's initializer may refer to the variable
4183 if (TREE_CODE (instance) == VAR_DECL
4184 && DECL_INITIAL (instance)
4185 - && !DECL_VAR_MARKED_P (instance))
4186 + && !htab_find (ht, instance))
4189 - DECL_VAR_MARKED_P (instance) = 1;
4192 + slot = htab_find_slot (ht, instance, INSERT);
4194 type = fixed_type_or_null (DECL_INITIAL (instance),
4196 - DECL_VAR_MARKED_P (instance) = 0;
4197 + htab_clear_slot (ht, slot);
4202 Index: gcc/cp/decl.c
4203 ===================================================================
4204 --- gcc/cp/decl.c (.../tags/gcc_4_2_0_release) (revision 126002)
4205 +++ gcc/cp/decl.c (.../branches/gcc-4_2-branch) (revision 126002)
4206 @@ -2161,8 +2161,24 @@
4208 else if (toplevel_bindings_p () || DECL_NAMESPACE_SCOPE_P (newdecl))
4210 - /* Objects declared at top level: */
4211 - /* If at least one is a reference, it's ok. */
4212 + /* The objects have been declared at namespace scope. If either
4213 + is a member of an anonymous union, then this is an invalid
4214 + redeclaration. For example:
4220 + if (DECL_ANON_UNION_VAR_P (newdecl)
4221 + || DECL_ANON_UNION_VAR_P (olddecl))
4222 + return "redeclaration of %q#D";
4223 + /* If at least one declaration is a reference, there is no
4224 + conflict. For example:
4230 if (DECL_EXTERNAL (newdecl) || DECL_EXTERNAL (olddecl))
4232 /* Reject two definitions. */
4233 @@ -5368,7 +5384,18 @@
4234 initializer. It is not legal to redeclare a static data
4235 member, so this issue does not arise in that case. */
4236 if (var_definition_p && TREE_STATIC (decl))
4237 - expand_static_init (decl, init);
4239 + /* If a TREE_READONLY variable needs initialization
4240 + at runtime, it is no longer readonly and we need to
4241 + avoid MEM_READONLY_P being set on RTL created for it. */
4244 + if (TREE_READONLY (decl))
4245 + TREE_READONLY (decl) = 0;
4248 + expand_static_init (decl, init);
4253 Index: gcc/cp/cp-tree.h
4254 ===================================================================
4255 --- gcc/cp/cp-tree.h (.../tags/gcc_4_2_0_release) (revision 126002)
4256 +++ gcc/cp/cp-tree.h (.../branches/gcc-4_2-branch) (revision 126002)
4258 DECL_IMPLICIT_TYPEDEF_P (in a TYPE_DECL)
4260 4: DECL_C_BIT_FIELD (in a FIELD_DECL)
4261 - DECL_VAR_MARKED_P (in a VAR_DECL)
4262 + DECL_ANON_UNION_VAR_P (in a VAR_DECL)
4263 DECL_SELF_REFERENCE_P (in a TYPE_DECL)
4264 DECL_INVALID_OVERRIDER_P (in a FUNCTION_DECL)
4265 5: DECL_INTERFACE_KNOWN.
4266 @@ -2111,10 +2111,10 @@
4267 (DECL_LANG_SPECIFIC (VAR_TEMPL_TYPE_OR_FUNCTION_DECL_CHECK (NODE)) \
4268 ->decl_flags.u.template_info)
4270 -/* For a VAR_DECL, indicates that the variable has been processed.
4271 - This flag is set and unset throughout the code; it is always
4272 - used for a temporary purpose. */
4273 -#define DECL_VAR_MARKED_P(NODE) \
4274 +/* For a VAR_DECL, indicates that the variable is actually a
4275 + non-static data member of anonymous union that has been promoted to
4276 + variable status. */
4277 +#define DECL_ANON_UNION_VAR_P(NODE) \
4278 (DECL_LANG_FLAG_4 (VAR_DECL_CHECK (NODE)))
4280 /* Template information for a RECORD_TYPE or UNION_TYPE. */
4281 Index: gcc/cp/ChangeLog
4282 ===================================================================
4283 --- gcc/cp/ChangeLog (.../tags/gcc_4_2_0_release) (revision 126002)
4284 +++ gcc/cp/ChangeLog (.../branches/gcc-4_2-branch) (revision 126002)
4286 +2007-06-15 Mark Mitchell <mark@codesourcery.com>
4288 + * cp-tree.h (DECL_VAR_MARKED_P): Remove.
4289 + (DECL_ANON_UNION_VAR_P): New macro.
4290 + * class.c (fixed_type_or_null): Tidy. Use a hash table, rather
4291 + than DECL_VAR_MARKED_P, to keep track of which variables we have
4293 + * decl.c (redeclaration_error_message): Complain about redeclaring
4294 + anonymous union members at namespace scope.
4295 + * decl2.c (build_anon_union_vars): Set DECL_ANON_UNION_VAR_P.
4297 +2007-06-08 Dirk Mueller <dmueller@suse.de>
4301 + Backport from mainline:
4302 + 2007-05-31 Jakub Jelinek <jakub@redhat.com>
4304 + * decl.c (cp_finish_decl): Also clear was_readonly if a static var
4305 + needs runtime initialization.
4307 + 2007-05-30 Jakub Jelinek <jakub@redhat.com>
4309 + * decl.c (cp_finish_decl): Clear TREE_READONLY flag on TREE_STATIC
4310 + variables that need runtime initialization.
4312 2007-05-13 Release Manager
4314 * GCC 4.2.0 released.
4315 Index: gcc/cp/decl2.c
4316 ===================================================================
4317 --- gcc/cp/decl2.c (.../tags/gcc_4_2_0_release) (revision 126002)
4318 +++ gcc/cp/decl2.c (.../branches/gcc-4_2-branch) (revision 126002)
4319 @@ -1056,6 +1056,7 @@
4322 decl = build_decl (VAR_DECL, DECL_NAME (field), TREE_TYPE (field));
4323 + DECL_ANON_UNION_VAR_P (decl) = 1;
4325 base = get_base_address (object);
4326 TREE_PUBLIC (decl) = TREE_PUBLIC (base);
4327 Index: gcc/fortran/trans-expr.c
4328 ===================================================================
4329 --- gcc/fortran/trans-expr.c (.../tags/gcc_4_2_0_release) (revision 126002)
4330 +++ gcc/fortran/trans-expr.c (.../branches/gcc-4_2-branch) (revision 126002)
4331 @@ -255,6 +255,10 @@
4332 gfc_conv_string_parameter (se);
4335 + /* Avoid multiple evaluation of substring start. */
4336 + if (!CONSTANT_CLASS_P (start.expr) && !DECL_P (start.expr))
4337 + start.expr = gfc_evaluate_now (start.expr, &se->pre);
4339 /* Change the start of the string. */
4340 if (TYPE_STRING_FLAG (TREE_TYPE (se->expr)))
4342 @@ -273,6 +277,10 @@
4343 gfc_conv_expr_type (&end, ref->u.ss.end, gfc_charlen_type_node);
4344 gfc_add_block_to_block (&se->pre, &end.pre);
4347 + if (!CONSTANT_CLASS_P (end.expr) && !DECL_P (end.expr))
4348 + end.expr = gfc_evaluate_now (end.expr, &se->pre);
4350 tmp = fold_build2 (MINUS_EXPR, gfc_charlen_type_node,
4351 build_int_cst (gfc_charlen_type_node, 1),
4353 @@ -2340,17 +2348,23 @@
4355 /* Generate the actual call. */
4356 gfc_conv_function_val (se, sym);
4358 /* If there are alternate return labels, function type should be
4359 integer. Can't modify the type in place though, since it can be shared
4360 - with other functions. */
4361 + with other functions. For dummy arguments, the typing is done to
4362 + to this result, even if it has to be repeated for each call. */
4363 if (has_alternate_specifier
4364 && TREE_TYPE (TREE_TYPE (TREE_TYPE (se->expr))) != integer_type_node)
4366 - gcc_assert (! sym->attr.dummy);
4367 - TREE_TYPE (sym->backend_decl)
4368 - = build_function_type (integer_type_node,
4369 - TYPE_ARG_TYPES (TREE_TYPE (sym->backend_decl)));
4370 - se->expr = build_fold_addr_expr (sym->backend_decl);
4371 + if (!sym->attr.dummy)
4373 + TREE_TYPE (sym->backend_decl)
4374 + = build_function_type (integer_type_node,
4375 + TYPE_ARG_TYPES (TREE_TYPE (sym->backend_decl)));
4376 + se->expr = build_fold_addr_expr (sym->backend_decl);
4379 + TREE_TYPE (TREE_TYPE (TREE_TYPE (se->expr))) = integer_type_node;
4382 fntype = TREE_TYPE (TREE_TYPE (se->expr));
4383 Index: gcc/fortran/trans-array.c
4384 ===================================================================
4385 --- gcc/fortran/trans-array.c (.../tags/gcc_4_2_0_release) (revision 126002)
4386 +++ gcc/fortran/trans-array.c (.../branches/gcc-4_2-branch) (revision 126002)
4387 @@ -4422,6 +4422,8 @@
4389 if (se->direct_byref)
4390 base = gfc_index_zero_node;
4391 + else if (GFC_ARRAY_TYPE_P (TREE_TYPE (desc)))
4392 + base = gfc_evaluate_now (gfc_conv_array_offset (desc), &loop.pre);
4396 @@ -4489,8 +4491,20 @@
4397 stride, info->stride[dim]);
4399 if (se->direct_byref)
4400 - base = fold_build2 (MINUS_EXPR, TREE_TYPE (base),
4403 + base = fold_build2 (MINUS_EXPR, TREE_TYPE (base),
4406 + else if (GFC_ARRAY_TYPE_P (TREE_TYPE (desc)))
4408 + tmp = gfc_conv_array_lbound (desc, n);
4409 + tmp = fold_build2 (MINUS_EXPR, TREE_TYPE (base),
4410 + tmp, loop.from[dim]);
4411 + tmp = fold_build2 (MULT_EXPR, TREE_TYPE (base),
4412 + tmp, gfc_conv_array_stride (desc, n));
4413 + base = fold_build2 (PLUS_EXPR, TREE_TYPE (base),
4417 /* Store the new stride. */
4418 tmp = gfc_conv_descriptor_stride (parm, gfc_rank_cst[dim]);
4419 @@ -4511,7 +4525,8 @@
4420 gfc_conv_descriptor_data_set (&loop.pre, parm, offset);
4423 - if (se->direct_byref && !se->data_not_needed)
4424 + if ((se->direct_byref || GFC_ARRAY_TYPE_P (TREE_TYPE (desc)))
4425 + && !se->data_not_needed)
4427 /* Set the offset. */
4428 tmp = gfc_conv_descriptor_offset (parm);
4429 Index: gcc/fortran/gfortran.texi
4430 ===================================================================
4431 --- gcc/fortran/gfortran.texi (.../tags/gcc_4_2_0_release) (revision 126002)
4432 +++ gcc/fortran/gfortran.texi (.../branches/gcc-4_2-branch) (revision 126002)
4434 to change the representation of data for unformatted files.
4435 The syntax for the @env{GFORTRAN_CONVERT_UNIT} variable is:
4437 -GFORTRAN_CONVERT_UNIT: mode | mode ';' exception ;
4438 +GFORTRAN_CONVERT_UNIT: mode | mode ';' exception | exception ;
4439 mode: 'native' | 'swap' | 'big_endian' | 'little_endian' ;
4440 exception: mode ':' unit_list | unit_list ;
4441 unit_list: unit_spec | unit_list unit_spec ;
4442 @@ -668,7 +668,12 @@
4443 setting a default data representation for the whole program. The
4444 @code{CONVERT} specifier overrides the @option{-fconvert} compile options.
4446 +@emph{Note that the values specified via the GFORTRAN_CONVERT_UNIT
4447 +environment variable will override the CONVERT specifier in the
4448 +open statement}. This is to give control over data formats to
4449 +users who do not have the source code of their program available.
4452 @c =====================================================================
4453 @c PART II: LANGUAGE REFERENCE
4454 @c =====================================================================
4455 Index: gcc/fortran/trans-common.c
4456 ===================================================================
4457 --- gcc/fortran/trans-common.c (.../tags/gcc_4_2_0_release) (revision 126002)
4458 +++ gcc/fortran/trans-common.c (.../branches/gcc-4_2-branch) (revision 126002)
4459 @@ -359,14 +359,15 @@
4460 tree size = TYPE_SIZE_UNIT (union_type);
4461 if (tree_int_cst_lt (DECL_SIZE_UNIT (decl), size))
4463 - /* Named common blocks of the same name shall be of the same size
4464 - in all scoping units of a program in which they appear, but
4465 - blank common blocks may be of different sizes. */
4466 - if (strcmp (com->name, BLANK_COMMON_NAME))
4467 + /* Named common blocks of the same name shall be of the same size
4468 + in all scoping units of a program in which they appear, but
4469 + blank common blocks may be of different sizes. */
4470 + if (strcmp (com->name, BLANK_COMMON_NAME))
4471 gfc_warning ("Named COMMON block '%s' at %L shall be of the "
4472 "same size", com->name, &com->where);
4473 - DECL_SIZE_UNIT (decl) = size;
4475 + DECL_SIZE_UNIT (decl) = size;
4476 + TREE_TYPE (decl) = union_type;
4480 /* If this common block has been declared in a previous program unit,
4481 Index: gcc/fortran/ChangeLog
4482 ===================================================================
4483 --- gcc/fortran/ChangeLog (.../tags/gcc_4_2_0_release) (revision 126002)
4484 +++ gcc/fortran/ChangeLog (.../branches/gcc-4_2-branch) (revision 126002)
4486 +2007-07-20 Daniel Franke <franke.daniel@gmail.com>
4488 + Backport from trunk:
4490 + * resolve.c (resolve_actual_arglist): Resolve actual argument after
4491 + being identified as variable.
4493 +2007-06-20 Paul Thomas <pault@gcc.gnu.org>
4496 + * trans-common.c (build_common_decl): If resizing of common
4497 + decl is needed, update the TREE_TYPE.
4499 +2007-05-31 Paul Thomas <pault@gcc.gnu.org>
4502 + * trans-expr.c (gfc_conv_function_call): Give a dummy
4503 + procedure the correct type if it has alternate returns.
4507 + * resolve.c (resolve_fl_procedure): Resolve constant character
4512 + * trans-array.c (gfc_conv_expr_descriptor): Obtain the stored
4513 + offset for non-descriptor, source arrays and correct for stride
4514 + not equal to one before writing to field of output descriptor.
4516 +2007-05-17 Tobias Burnus <burnus@net-b.de>
4518 + * gfortran.texi (GFORTRAN_CONVERT_UNIT): Improve documentation.
4520 +2007-05-16 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
4523 + * trans-expr.c (gfc_conv_substring): Evaluate substring bounds
4526 2007-05-13 Release Manager
4528 * GCC 4.2.0 released.
4529 Index: gcc/fortran/resolve.c
4530 ===================================================================
4531 --- gcc/fortran/resolve.c (.../tags/gcc_4_2_0_release) (revision 126002)
4532 +++ gcc/fortran/resolve.c (.../branches/gcc-4_2-branch) (revision 126002)
4533 @@ -1006,6 +1006,13 @@
4534 e->ref->u.ar.as = sym->as;
4537 + /* Expressions are assigned a default ts.type of BT_PROCEDURE in
4538 + primary.c (match_actual_arg). If above code determines that it
4539 + is a variable instead, it needs to be resolved as it was not
4540 + done at the beginning of this function. */
4541 + if (gfc_resolve_expr (e) != SUCCESS)
4545 /* Check argument list functions %VAL, %LOC and %REF. There is
4546 nothing to do for %REF. */
4547 @@ -5742,6 +5749,11 @@
4548 if (sym->ts.type == BT_CHARACTER)
4550 gfc_charlen *cl = sym->ts.cl;
4552 + if (cl && cl->length && gfc_is_constant_expr (cl->length)
4553 + && resolve_charlen (cl) == FAILURE)
4556 if (!cl || !cl->length || cl->length->expr_type != EXPR_CONSTANT)
4558 if (sym->attr.proc == PROC_ST_FUNCTION)
4559 Index: gcc/fortran/primary.c
4560 ===================================================================
4561 --- gcc/fortran/primary.c (.../tags/gcc_4_2_0_release) (revision 126002)
4562 +++ gcc/fortran/primary.c (.../branches/gcc-4_2-branch) (revision 126002)
4563 @@ -2415,7 +2415,8 @@
4566 /* Check for a nonrecursive function result */
4567 - if (sym->attr.function && (sym->result == sym || sym->attr.entry))
4568 + if (sym->attr.function && (sym->result == sym || sym->attr.entry)
4569 + && !sym->attr.external)
4571 /* If a function result is a derived type, then the derived
4572 type may still have to be resolved. */
4574 ===================================================================
4575 --- gcc/BASE-VER (.../tags/gcc_4_2_0_release) (revision 126002)
4576 +++ gcc/BASE-VER (.../branches/gcc-4_2-branch) (revision 126002)
4580 Index: gcc/gimplify.c
4581 ===================================================================
4582 --- gcc/gimplify.c (.../tags/gcc_4_2_0_release) (revision 126002)
4583 +++ gcc/gimplify.c (.../branches/gcc-4_2-branch) (revision 126002)
4584 @@ -4053,6 +4053,19 @@
4585 parse_input_constraint (&constraint, 0, 0, noutputs, 0,
4586 oconstraints, &allows_mem, &allows_reg);
4588 + /* If we can't make copies, we can only accept memory. */
4589 + if (TREE_ADDRESSABLE (TREE_TYPE (TREE_VALUE (link))))
4595 + error ("impossible constraint in %<asm%>");
4596 + error ("non-memory input %d must stay in memory", i);
4601 /* If the operand is a memory input, it should be an lvalue. */
4602 if (!allows_reg && allows_mem)
4604 @@ -4802,7 +4815,20 @@
4605 else if (flags & GOVD_SHARED)
4607 if (is_global_var (decl))
4610 + struct gimplify_omp_ctx *ctx = gimplify_omp_ctxp->outer_context;
4611 + while (ctx != NULL)
4613 + splay_tree_node on
4614 + = splay_tree_lookup (ctx->variables, (splay_tree_key) decl);
4615 + if (on && (on->value & (GOVD_FIRSTPRIVATE | GOVD_LASTPRIVATE
4616 + | GOVD_PRIVATE | GOVD_REDUCTION)) != 0)
4618 + ctx = ctx->outer_context;
4623 code = OMP_CLAUSE_SHARED;
4625 else if (flags & GOVD_PRIVATE)
4627 ===================================================================
4628 --- gcc/calls.c (.../tags/gcc_4_2_0_release) (revision 126002)
4629 +++ gcc/calls.c (.../branches/gcc-4_2-branch) (revision 126002)
4630 @@ -1238,13 +1238,25 @@
4632 /* If this is a libcall, then precompute all arguments so that we do not
4633 get extraneous instructions emitted as part of the libcall sequence. */
4634 - if ((flags & ECF_LIBCALL_BLOCK) == 0)
4636 + /* If we preallocated the stack space, and some arguments must be passed
4637 + on the stack, then we must precompute any parameter which contains a
4638 + function call which will store arguments on the stack.
4639 + Otherwise, evaluating the parameter may clobber previous parameters
4640 + which have already been stored into the stack. (we have code to avoid
4641 + such case by saving the outgoing stack arguments, but it results in
4643 + if ((flags & ECF_LIBCALL_BLOCK) == 0 && !ACCUMULATE_OUTGOING_ARGS)
4646 for (i = 0; i < num_actuals; i++)
4648 enum machine_mode mode;
4650 + if ((flags & ECF_LIBCALL_BLOCK) == 0
4651 + && TREE_CODE (args[i].tree_value) != CALL_EXPR)
4654 /* If this is an addressable type, we cannot pre-evaluate it. */
4655 gcc_assert (!TREE_ADDRESSABLE (TREE_TYPE (args[i].tree_value)));
4658 ===================================================================
4659 --- gcc/except.c (.../tags/gcc_4_2_0_release) (revision 126002)
4660 +++ gcc/except.c (.../branches/gcc-4_2-branch) (revision 126002)
4661 @@ -1005,7 +1005,11 @@
4662 for (prev_try = VEC_index (eh_region, cfun->eh->region_array, outer_region);
4663 prev_try && prev_try->type != ERT_TRY;
4664 prev_try = prev_try->outer)
4666 + if (prev_try->type == ERT_MUST_NOT_THROW)
4672 /* Remap all of the internal catch and cleanup linkages. Since we
4673 duplicate entire subtrees, all of the referenced regions will have
4674 Index: gcc/combine.c
4675 ===================================================================
4676 --- gcc/combine.c (.../tags/gcc_4_2_0_release) (revision 126002)
4677 +++ gcc/combine.c (.../branches/gcc-4_2-branch) (revision 126002)
4678 @@ -5341,14 +5341,14 @@
4680 else if (GET_MODE (op0) == compare_mode && op1 == const0_rtx)
4682 - SUBST(SET_SRC (x), op0);
4683 + SUBST (SET_SRC (x), op0);
4687 + /* Otherwise, update the COMPARE if needed. */
4688 + else if (XEXP (src, 0) != op0 || XEXP (src, 1) != op1)
4690 - /* Otherwise, update the COMPARE if needed. */
4691 - SUBST (XEXP (src, 0), op0);
4692 - SUBST (XEXP (src, 1), op1);
4693 + SUBST (SET_SRC (x), gen_rtx_COMPARE (compare_mode, op0, op1));
4694 + src = SET_SRC (x);
4698 Index: gcc/Makefile.in
4699 ===================================================================
4700 --- gcc/Makefile.in (.../tags/gcc_4_2_0_release) (revision 126002)
4701 +++ gcc/Makefile.in (.../branches/gcc-4_2-branch) (revision 126002)
4702 @@ -1839,7 +1839,7 @@
4703 tree-ssa-structalias.o: tree-ssa-structalias.c tree-ssa-structalias.h \
4704 $(SYSTEM_H) $(CONFIG_H) $(GGC_H) $(TREE_H) $(TREE_FLOW_H) \
4705 $(TM_H) coretypes.h $(CGRAPH_H) tree-pass.h $(TIMEVAR_H) \
4706 - gt-tree-ssa-structalias.h $(PARAMS_H)
4707 + gt-tree-ssa-structalias.h $(PARAMS_H) pointer-set.h
4708 tree-ssa.o : tree-ssa.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \
4709 $(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) output.h $(DIAGNOSTIC_H) \
4710 toplev.h $(FUNCTION_H) $(TIMEVAR_H) $(TM_H) coretypes.h \
4711 Index: gcc/tree-ssa-structalias.c
4712 ===================================================================
4713 --- gcc/tree-ssa-structalias.c (.../tags/gcc_4_2_0_release) (revision 126002)
4714 +++ gcc/tree-ssa-structalias.c (.../branches/gcc-4_2-branch) (revision 126002)
4717 #include "tree-ssa-structalias.h"
4719 +#include "pointer-set.h"
4721 /* The idea behind this analyzer is to generate set constraints from the
4722 program, then solve the resulting constraints in order to generate the
4726 Set constraints are a way of modeling program analysis problems that
4727 involve sets. They consist of an inclusion constraint language,
4730 Also see "Ultra-fast Aliasing Analysis using CLA: A Million Lines
4731 of C Code in a Second" by ""Nevin Heintze and Olivier Tardieu" at
4732 - http://citeseer.ist.psu.edu/heintze01ultrafast.html
4733 + http://citeseer.ist.psu.edu/heintze01ultrafast.html
4735 - There are three types of constraint expressions, DEREF, ADDRESSOF, and
4736 - SCALAR. Each constraint expression consists of a constraint type,
4737 - a variable, and an offset.
4739 + There are three types of real constraint expressions, DEREF,
4740 + ADDRESSOF, and SCALAR. Each constraint expression consists
4741 + of a constraint type, a variable, and an offset.
4743 SCALAR is a constraint expression type used to represent x, whether
4744 it appears on the LHS or the RHS of a statement.
4745 DEREF is a constraint expression type used to represent *x, whether
4746 - it appears on the LHS or the RHS of a statement.
4747 + it appears on the LHS or the RHS of a statement.
4748 ADDRESSOF is a constraint expression used to represent &x, whether
4749 it appears on the LHS or the RHS of a statement.
4752 Each pointer variable in the program is assigned an integer id, and
4753 each field of a structure variable is assigned an integer id as well.
4756 Structure variables are linked to their list of fields through a "next
4757 field" in each variable that points to the next field in offset
4759 - Each variable for a structure field has
4761 + Each variable for a structure field has
4763 1. "size", that tells the size in bits of that field.
4764 2. "fullsize, that tells the size in bits of the entire structure.
4765 3. "offset", that tells the offset in bits from the beginning of the
4766 structure to this field.
4773 @@ -110,50 +111,51 @@
4774 foo.b -> id 2, size 32, offset 32, fullsize 64, next NULL
4775 bar -> id 3, size 32, offset 0, fullsize 32, next NULL
4779 In order to solve the system of set constraints, the following is
4782 1. Each constraint variable x has a solution set associated with it,
4786 2. Constraints are separated into direct, copy, and complex.
4787 Direct constraints are ADDRESSOF constraints that require no extra
4788 processing, such as P = &Q
4789 Copy constraints are those of the form P = Q.
4790 - Complex constraints are all the constraints involving dereferences.
4792 + Complex constraints are all the constraints involving dereferences
4793 + and offsets (including offsetted copies).
4795 3. All direct constraints of the form P = &Q are processed, such
4796 - that Q is added to Sol(P)
4797 + that Q is added to Sol(P)
4799 4. All complex constraints for a given constraint variable are stored in a
4800 - linked list attached to that variable's node.
4801 + linked list attached to that variable's node.
4803 5. A directed graph is built out of the copy constraints. Each
4804 - constraint variable is a node in the graph, and an edge from
4805 + constraint variable is a node in the graph, and an edge from
4806 Q to P is added for each copy constraint of the form P = Q
4809 6. The graph is then walked, and solution sets are
4810 propagated along the copy edges, such that an edge from Q to P
4811 causes Sol(P) <- Sol(P) union Sol(Q).
4814 7. As we visit each node, all complex constraints associated with
4815 that node are processed by adding appropriate copy edges to the graph, or the
4816 - appropriate variables to the solution set.
4817 + appropriate variables to the solution set.
4819 8. The process of walking the graph is iterated until no solution
4822 Prior to walking the graph in steps 6 and 7, We perform static
4823 - cycle elimination on the constraint graph, as well
4824 + cycle elimination on the constraint graph, as well
4825 as off-line variable substitution.
4828 TODO: Adding offsets to pointer-to-structures can be handled (IE not punted
4829 on and turned into anything), but isn't. You can just see what offset
4830 inside the pointed-to struct it's going to access.
4833 TODO: Constant bounded arrays can be handled as if they were structs of the
4834 - same number of elements.
4835 + same number of elements.
4837 TODO: Modeling heap and incoming pointers becomes much better if we
4838 add fields to them as we discover them, which we could do.
4839 @@ -161,20 +163,29 @@
4840 TODO: We could handle unions, but to be honest, it's probably not
4841 worth the pain or slowdown. */
4843 -static GTY ((if_marked ("tree_map_marked_p"), param_is (struct tree_map)))
4844 -htab_t heapvar_for_stmt;
4845 +static GTY ((if_marked ("tree_map_marked_p"), param_is (struct tree_map))) htab_t heapvar_for_stmt;
4847 /* One variable to represent all non-local accesses. */
4850 static bool use_field_sensitive = true;
4851 static int in_ipa_mode = 0;
4853 +/* Used for predecessor bitmaps. */
4854 static bitmap_obstack predbitmap_obstack;
4855 -static bitmap_obstack ptabitmap_obstack;
4857 +/* Used for points-to sets. */
4858 +static bitmap_obstack pta_obstack;
4860 +/* Used for oldsolution members of variables. */
4861 +static bitmap_obstack oldpta_obstack;
4863 +/* Used for per-solver-iteration bitmaps. */
4864 static bitmap_obstack iteration_obstack;
4866 static unsigned int create_variable_info_for (tree, const char *);
4867 -static void build_constraint_graph (void);
4868 +typedef struct constraint_graph *constraint_graph_t;
4869 +static void unify_nodes (constraint_graph_t, unsigned int, unsigned int, bool);
4871 DEF_VEC_P(constraint_t);
4872 DEF_VEC_ALLOC_P(constraint_t,heap);
4873 @@ -186,11 +197,13 @@
4874 static struct constraint_stats
4876 unsigned int total_vars;
4877 - unsigned int collapsed_vars;
4878 + unsigned int nonpointer_vars;
4879 unsigned int unified_vars_static;
4880 unsigned int unified_vars_dynamic;
4881 unsigned int iterations;
4882 unsigned int num_edges;
4883 + unsigned int num_implicit_edges;
4884 + unsigned int points_to_sets_created;
4887 struct variable_info
4891 /* Offset of this variable, in bits, from the base variable */
4892 - unsigned HOST_WIDE_INT offset;
4893 + unsigned HOST_WIDE_INT offset;
4895 /* Size of the variable, in bits. */
4896 unsigned HOST_WIDE_INT size;
4897 @@ -216,34 +229,21 @@
4898 /* A link to the variable for the next field in this structure. */
4899 struct variable_info *next;
4901 - /* Node in the graph that represents the constraints and points-to
4902 - solution for the variable. */
4903 - unsigned int node;
4905 - /* True if the address of this variable is taken. Needed for
4906 - variable substitution. */
4907 - unsigned int address_taken:1;
4909 - /* True if this variable is the target of a dereference. Needed for
4910 - variable substitution. */
4911 - unsigned int indirect_target:1;
4913 /* True if the variable is directly the target of a dereference.
4914 This is used to track which variables are *actually* dereferenced
4915 - so we can prune their points to listed. This is equivalent to the
4916 - indirect_target flag when no merging of variables happens. */
4917 + so we can prune their points to listed. */
4918 unsigned int directly_dereferenced:1;
4920 /* True if this is a variable created by the constraint analysis, such as
4921 heap variables and constraints we had to break up. */
4922 unsigned int is_artificial_var:1;
4925 /* True if this is a special variable whose solution set should not be
4927 unsigned int is_special_var:1;
4929 /* True for variables whose size is not known or variable. */
4930 - unsigned int is_unknown_size_var:1;
4931 + unsigned int is_unknown_size_var:1;
4933 /* True for variables that have unions somewhere in them. */
4934 unsigned int has_union:1;
4935 @@ -254,16 +254,15 @@
4936 /* Points-to set for this variable. */
4939 + /* Old points-to set for this variable. */
4940 + bitmap oldsolution;
4942 /* Variable ids represented by this node. */
4945 - /* Vector of complex constraints for this node. Complex
4946 - constraints are those involving dereferences. */
4947 - VEC(constraint_t,heap) *complex;
4949 - /* Variable id this was collapsed to due to type unsafety.
4950 - This should be unused completely after build_constraint_graph, or
4951 - something is broken. */
4952 + /* Variable id this was collapsed to due to type unsafety. This
4953 + should be unused completely after build_succ_graph, or something
4955 struct variable_info *collapsed_to;
4957 typedef struct variable_info *varinfo_t;
4960 DEF_VEC_ALLOC_P(varinfo_t, heap);
4962 -/* Table of variable info structures for constraint variables. Indexed directly
4963 - by variable info id. */
4964 +/* Table of variable info structures for constraint variables.
4965 + Indexed directly by variable info id. */
4966 static VEC(varinfo_t,heap) *varmap;
4968 /* Return the varmap element N */
4970 static inline varinfo_t
4971 get_varinfo (unsigned int n)
4973 - return VEC_index(varinfo_t, varmap, n);
4974 + return VEC_index (varinfo_t, varmap, n);
4977 /* Return the varmap element N, following the collapsed_to link. */
4979 static inline varinfo_t
4980 get_varinfo_fc (unsigned int n)
4982 - varinfo_t v = VEC_index(varinfo_t, varmap, n);
4983 + varinfo_t v = VEC_index (varinfo_t, varmap, n);
4985 if (v->collapsed_to)
4986 return v->collapsed_to;
4987 @@ -331,10 +330,9 @@
4988 /* Variable that represents non-local variables before we expand it to
4989 one for each type. */
4990 static unsigned int nonlocal_vars_id;
4992 /* Lookup a heap var for FROM, and return it if we find one. */
4996 heapvar_lookup (tree from)
4998 struct tree_map *h, in;
4999 @@ -367,25 +365,21 @@
5000 named NAME, and using constraint graph node NODE. */
5003 -new_var_info (tree t, unsigned int id, const char *name, unsigned int node)
5004 +new_var_info (tree t, unsigned int id, const char *name)
5006 varinfo_t ret = pool_alloc (variable_info_pool);
5012 - ret->address_taken = false;
5013 - ret->indirect_target = false;
5014 ret->directly_dereferenced = false;
5015 ret->is_artificial_var = false;
5016 ret->is_heap_var = false;
5017 ret->is_special_var = false;
5018 ret->is_unknown_size_var = false;
5019 ret->has_union = false;
5020 - ret->solution = BITMAP_ALLOC (&ptabitmap_obstack);
5021 - ret->variables = BITMAP_ALLOC (&ptabitmap_obstack);
5022 - ret->complex = NULL;
5023 + ret->solution = BITMAP_ALLOC (&pta_obstack);
5024 + ret->oldsolution = BITMAP_ALLOC (&oldpta_obstack);
5026 ret->collapsed_to = NULL;
5030 /* An expression that appears in a constraint. */
5032 -struct constraint_expr
5033 +struct constraint_expr
5035 /* Constraint type. */
5036 constraint_expr_type type;
5038 static void do_deref (VEC (ce_s, heap) **);
5040 /* Our set constraints are made up of two constraint expressions, one
5044 As described in the introduction, our set constraints each represent an
5045 operation between set valued variables.
5046 @@ -434,63 +428,98 @@
5047 static VEC(constraint_t,heap) *constraints;
5048 static alloc_pool constraint_pool;
5050 -/* An edge in the weighted constraint graph. The edges are weighted,
5051 - with a bit set in weights meaning their is an edge with that
5053 - We don't keep the src in the edge, because we always know what it
5056 -struct constraint_edge
5058 +DEF_VEC_ALLOC_I(int, heap);
5060 +/* The constraint graph is represented as an array of bitmaps
5061 + containing successor nodes. */
5063 +struct constraint_graph
5065 - unsigned int dest;
5068 + /* Size of this graph, which may be different than the number of
5069 + nodes in the variable map. */
5070 + unsigned int size;
5072 -typedef struct constraint_edge *constraint_edge_t;
5073 -static alloc_pool constraint_edge_pool;
5074 + /* Explicit successors of each node. */
5077 -/* Return a new constraint edge from SRC to DEST. */
5078 + /* Implicit predecessors of each node (Used for variable
5080 + bitmap *implicit_preds;
5082 -static constraint_edge_t
5083 -new_constraint_edge (unsigned int dest)
5085 - constraint_edge_t ret = pool_alloc (constraint_edge_pool);
5087 - ret->weights = NULL;
5090 + /* Explicit predecessors of each node (Used for variable substitution). */
5093 -DEF_VEC_P(constraint_edge_t);
5094 -DEF_VEC_ALLOC_P(constraint_edge_t,heap);
5095 + /* Indirect cycle representatives, or -1 if the node has no indirect
5097 + int *indirect_cycles;
5099 + /* Representative node for a node. rep[a] == a unless the node has
5101 + unsigned int *rep;
5103 -/* The constraint graph is represented internally in two different
5104 - ways. The overwhelming majority of edges in the constraint graph
5105 - are zero weigh edges, and thus, using a vector of contrainst_edge_t
5106 - is a waste of time and memory, since they have no weights. We
5107 - simply use a bitmap to store the preds and succs for each node.
5108 - The weighted edges are stored as a set of adjacency vectors, one
5109 - per variable. succs[x] is the vector of successors for variable x,
5110 - and preds[x] is the vector of predecessors for variable x. IOW,
5111 - all edges are "forward" edges, which is not like our CFG. So
5112 - remember that preds[x]->src == x, and succs[x]->src == x. */
5113 + /* Equivalence class representative for a node. This is used for
5114 + variable substitution. */
5117 -struct constraint_graph
5119 - bitmap *zero_weight_succs;
5120 - bitmap *zero_weight_preds;
5121 - VEC(constraint_edge_t,heap) **succs;
5122 - VEC(constraint_edge_t,heap) **preds;
5123 + /* Label for each node, used during variable substitution. */
5124 + unsigned int *label;
5126 + /* Bitmap of nodes where the bit is set if the node is a direct
5127 + node. Used for variable substitution. */
5128 + sbitmap direct_nodes;
5130 + /* Vector of complex constraints for each graph node. Complex
5131 + constraints are those involving dereferences or offsets that are
5133 + VEC(constraint_t,heap) **complex;
5136 -typedef struct constraint_graph *constraint_graph_t;
5138 static constraint_graph_t graph;
5139 -static int graph_size;
5141 +/* During variable substitution and the offline version of indirect
5142 + cycle finding, we create nodes to represent dereferences and
5143 + address taken constraints. These represent where these start and
5145 +#define FIRST_REF_NODE (VEC_length (varinfo_t, varmap))
5146 +#define LAST_REF_NODE (FIRST_REF_NODE + (FIRST_REF_NODE - 1))
5147 +#define FIRST_ADDR_NODE (LAST_REF_NODE + 1)
5149 +/* Return the representative node for NODE, if NODE has been unioned
5150 + with another NODE.
5151 + This function performs path compression along the way to finding
5152 + the representative. */
5154 +static unsigned int
5155 +find (unsigned int node)
5157 + gcc_assert (node < graph->size);
5158 + if (graph->rep[node] != node)
5159 + return graph->rep[node] = find (graph->rep[node]);
5163 +/* Union the TO and FROM nodes to the TO nodes.
5164 + Note that at some point in the future, we may want to do
5165 + union-by-rank, in which case we are going to have to return the
5166 + node we unified to. */
5169 +unite (unsigned int to, unsigned int from)
5171 + gcc_assert (to < graph->size && from < graph->size);
5172 + if (to != from && graph->rep[from] != to)
5174 + graph->rep[from] = to;
5180 /* Create a new constraint consisting of LHS and RHS expressions. */
5182 -static constraint_t
5183 +static constraint_t
5184 new_constraint (const struct constraint_expr lhs,
5185 const struct constraint_expr rhs)
5188 if (c->lhs.type == ADDRESSOF)
5189 fprintf (file, "&");
5190 else if (c->lhs.type == DEREF)
5191 - fprintf (file, "*");
5192 + fprintf (file, "*");
5193 fprintf (file, "%s", get_varinfo_fc (c->lhs.var)->name);
5194 if (c->lhs.offset != 0)
5195 fprintf (file, " + " HOST_WIDE_INT_PRINT_DEC, c->lhs.offset);
5196 @@ -550,23 +579,24 @@
5197 dump_constraints (stderr);
5200 -/* SOLVER FUNCTIONS
5201 +/* SOLVER FUNCTIONS
5203 The solver is a simple worklist solver, that works on the following
5206 - sbitmap changed_nodes = all ones;
5207 - changed_count = number of nodes;
5208 - For each node that was already collapsed:
5211 + sbitmap changed_nodes = all zeroes;
5212 + changed_count = 0;
5213 + For each node that is not already collapsed:
5215 + set bit in changed nodes
5217 while (changed_count > 0)
5219 compute topological ordering for constraint graph
5222 find and collapse cycles in the constraint graph (updating
5223 changed if necessary)
5226 for each node (n) in the graph in topological order:
5229 @@ -619,11 +649,11 @@
5232 /* Return true if two constraints A and B are equal. */
5236 constraint_equal (struct constraint a, struct constraint b)
5238 - return constraint_expr_equal (a.lhs, b.lhs)
5239 + return constraint_expr_equal (a.lhs, b.lhs)
5240 && constraint_expr_equal (a.rhs, b.rhs);
5244 constraint_vec_find (VEC(constraint_t,heap) *vec,
5245 struct constraint lookfor)
5247 - unsigned int place;
5248 + unsigned int place;
5252 @@ -678,30 +708,47 @@
5253 bitmap result = BITMAP_ALLOC (&iteration_obstack);
5256 + unsigned HOST_WIDE_INT min = -1, max = 0;
5258 + /* Compute set of vars we can reach from set + offset. */
5260 EXECUTE_IF_SET_IN_BITMAP (set, 0, i, bi)
5262 + if (get_varinfo (i)->is_artificial_var
5263 + || get_varinfo (i)->has_union
5264 + || get_varinfo (i)->is_unknown_size_var)
5267 + if (get_varinfo (i)->offset + offset < min)
5268 + min = get_varinfo (i)->offset + offset;
5269 + if (get_varinfo (i)->offset + get_varinfo (i)->size + offset > max)
5271 + max = get_varinfo (i)->offset + get_varinfo (i)->size + offset;
5272 + if (max > get_varinfo (i)->fullsize)
5273 + max = get_varinfo (i)->fullsize;
5277 + EXECUTE_IF_SET_IN_BITMAP (set, 0, i, bi)
5279 /* If this is a properly sized variable, only add offset if it's
5280 less than end. Otherwise, it is globbed to a single
5283 - if ((get_varinfo (i)->offset + offset) < get_varinfo (i)->fullsize)
5285 + if (get_varinfo (i)->offset + get_varinfo (i)->size - 1 >= min
5286 + && get_varinfo (i)->offset < max)
5288 - unsigned HOST_WIDE_INT fieldoffset = get_varinfo (i)->offset + offset;
5289 - varinfo_t v = first_vi_for_offset (get_varinfo (i), fieldoffset);
5292 - bitmap_set_bit (result, v->id);
5293 + bitmap_set_bit (result, i);
5295 - else if (get_varinfo (i)->is_artificial_var
5296 + else if (get_varinfo (i)->is_artificial_var
5297 || get_varinfo (i)->has_union
5298 || get_varinfo (i)->is_unknown_size_var)
5300 bitmap_set_bit (result, i);
5304 - bitmap_copy (set, result);
5306 + bitmap_copy (set, result);
5307 BITMAP_FREE (result);
5310 @@ -727,397 +774,149 @@
5314 -/* Insert constraint C into the list of complex constraints for VAR. */
5315 +/* Insert constraint C into the list of complex constraints for graph
5319 -insert_into_complex (unsigned int var, constraint_t c)
5320 +insert_into_complex (constraint_graph_t graph,
5321 + unsigned int var, constraint_t c)
5323 - varinfo_t vi = get_varinfo (var);
5324 - unsigned int place = VEC_lower_bound (constraint_t, vi->complex, c,
5325 + VEC (constraint_t, heap) *complex = graph->complex[var];
5326 + unsigned int place = VEC_lower_bound (constraint_t, complex, c,
5328 - VEC_safe_insert (constraint_t, heap, vi->complex, place, c);
5332 -/* Compare two constraint edges A and B, return true if they are equal. */
5335 -constraint_edge_equal (struct constraint_edge a, struct constraint_edge b)
5337 - return a.dest == b.dest;
5338 + /* Only insert constraints that do not already exist. */
5339 + if (place >= VEC_length (constraint_t, complex)
5340 + || !constraint_equal (*c, *VEC_index (constraint_t, complex, place)))
5341 + VEC_safe_insert (constraint_t, heap, graph->complex[var], place, c);
5344 -/* Compare two constraint edges, return true if A is less than B */
5347 -constraint_edge_less (const constraint_edge_t a, const constraint_edge_t b)
5349 - if (a->dest < b->dest)
5354 -/* Find the constraint edge that matches LOOKFOR, in VEC.
5355 - Return the edge, if found, NULL otherwise. */
5357 -static constraint_edge_t
5358 -constraint_edge_vec_find (VEC(constraint_edge_t,heap) *vec,
5359 - struct constraint_edge lookfor)
5361 - unsigned int place;
5362 - constraint_edge_t edge = NULL;
5364 - place = VEC_lower_bound (constraint_edge_t, vec, &lookfor,
5365 - constraint_edge_less);
5366 - if (place >= VEC_length (constraint_edge_t, vec))
5368 - edge = VEC_index (constraint_edge_t, vec, place);
5369 - if (!constraint_edge_equal (*edge, lookfor))
5374 /* Condense two variable nodes into a single variable node, by moving
5375 all associated info from SRC to TO. */
5378 -condense_varmap_nodes (unsigned int to, unsigned int src)
5380 +merge_node_constraints (constraint_graph_t graph, unsigned int to,
5381 + unsigned int from)
5383 - varinfo_t tovi = get_varinfo (to);
5384 - varinfo_t srcvi = get_varinfo (src);
5387 - bitmap_iterator bi;
5389 - /* the src node, and all its variables, are now the to node. */
5391 - EXECUTE_IF_SET_IN_BITMAP (srcvi->variables, 0, i, bi)
5392 - get_varinfo (i)->node = to;
5394 - /* Merge the src node variables and the to node variables. */
5395 - bitmap_set_bit (tovi->variables, src);
5396 - bitmap_ior_into (tovi->variables, srcvi->variables);
5397 - bitmap_clear (srcvi->variables);
5400 + gcc_assert (find (from) == to);
5402 /* Move all complex constraints from src node into to node */
5403 - for (i = 0; VEC_iterate (constraint_t, srcvi->complex, i, c); i++)
5404 + for (i = 0; VEC_iterate (constraint_t, graph->complex[from], i, c); i++)
5406 /* In complex constraints for node src, we may have either
5407 - a = *src, and *src = a. */
5409 + a = *src, and *src = a, or an offseted constraint which are
5410 + always added to the rhs node's constraints. */
5412 if (c->rhs.type == DEREF)
5414 + else if (c->lhs.type == DEREF)
5420 - constraint_set_union (&tovi->complex, &srcvi->complex);
5421 - VEC_free (constraint_t, heap, srcvi->complex);
5422 - srcvi->complex = NULL;
5423 + constraint_set_union (&graph->complex[to], &graph->complex[from]);
5424 + VEC_free (constraint_t, heap, graph->complex[from]);
5425 + graph->complex[from] = NULL;
5428 -/* Erase an edge from SRC to SRC from GRAPH. This routine only
5429 - handles self-edges (e.g. an edge from a to a). */
5432 -erase_graph_self_edge (constraint_graph_t graph, unsigned int src)
5434 - VEC(constraint_edge_t,heap) *predvec = graph->preds[src];
5435 - VEC(constraint_edge_t,heap) *succvec = graph->succs[src];
5436 - struct constraint_edge edge;
5437 - unsigned int place;
5441 - /* Remove from the successors. */
5442 - place = VEC_lower_bound (constraint_edge_t, succvec, &edge,
5443 - constraint_edge_less);
5445 - /* Make sure we found the edge. */
5446 -#ifdef ENABLE_CHECKING
5448 - constraint_edge_t tmp = VEC_index (constraint_edge_t, succvec, place);
5449 - gcc_assert (constraint_edge_equal (*tmp, edge));
5452 - VEC_ordered_remove (constraint_edge_t, succvec, place);
5454 - /* Remove from the predecessors. */
5455 - place = VEC_lower_bound (constraint_edge_t, predvec, &edge,
5456 - constraint_edge_less);
5458 - /* Make sure we found the edge. */
5459 -#ifdef ENABLE_CHECKING
5461 - constraint_edge_t tmp = VEC_index (constraint_edge_t, predvec, place);
5462 - gcc_assert (constraint_edge_equal (*tmp, edge));
5465 - VEC_ordered_remove (constraint_edge_t, predvec, place);
5468 /* Remove edges involving NODE from GRAPH. */
5471 clear_edges_for_node (constraint_graph_t graph, unsigned int node)
5473 - VEC(constraint_edge_t,heap) *succvec = graph->succs[node];
5474 - VEC(constraint_edge_t,heap) *predvec = graph->preds[node];
5475 - bitmap_iterator bi;
5477 - constraint_edge_t c = NULL;
5480 - /* Walk the successors, erase the associated preds. */
5482 - EXECUTE_IF_IN_NONNULL_BITMAP (graph->zero_weight_succs[node], 0, j, bi)
5484 - bitmap_clear_bit (graph->zero_weight_preds[j], node);
5486 - for (i = 0; VEC_iterate (constraint_edge_t, succvec, i, c); i++)
5487 - if (c->dest != node)
5489 - unsigned int place;
5490 - struct constraint_edge lookfor;
5491 - constraint_edge_t result;
5493 - lookfor.dest = node;
5494 - place = VEC_lower_bound (constraint_edge_t, graph->preds[c->dest],
5495 - &lookfor, constraint_edge_less);
5496 - result = VEC_ordered_remove (constraint_edge_t,
5497 - graph->preds[c->dest], place);
5498 - pool_free (constraint_edge_pool, result);
5501 - /* Walk the preds, erase the associated succs. */
5503 - EXECUTE_IF_IN_NONNULL_BITMAP (graph->zero_weight_preds[node], 0, j, bi)
5505 - bitmap_clear_bit (graph->zero_weight_succs[j], node);
5507 - for (i =0; VEC_iterate (constraint_edge_t, predvec, i, c); i++)
5508 - if (c->dest != node)
5510 - unsigned int place;
5511 - struct constraint_edge lookfor;
5512 - constraint_edge_t result;
5514 - lookfor.dest = node;
5515 - place = VEC_lower_bound (constraint_edge_t, graph->succs[c->dest],
5516 - &lookfor, constraint_edge_less);
5517 - result = VEC_ordered_remove (constraint_edge_t,
5518 - graph->succs[c->dest], place);
5519 - pool_free (constraint_edge_pool, result);
5523 - if (graph->zero_weight_preds[node])
5525 - BITMAP_FREE (graph->zero_weight_preds[node]);
5526 - graph->zero_weight_preds[node] = NULL;
5529 - if (graph->zero_weight_succs[node])
5531 - BITMAP_FREE (graph->zero_weight_succs[node]);
5532 - graph->zero_weight_succs[node] = NULL;
5535 - VEC_free (constraint_edge_t, heap, graph->preds[node]);
5536 - VEC_free (constraint_edge_t, heap, graph->succs[node]);
5537 - graph->preds[node] = NULL;
5538 - graph->succs[node] = NULL;
5539 + if (graph->succs[node])
5540 + BITMAP_FREE (graph->succs[node]);
5543 -static bool edge_added = false;
5545 -/* Add edge (src, dest) to the graph. */
5548 -add_graph_edge (constraint_graph_t graph, unsigned int src, unsigned int dest)
5550 - unsigned int place;
5551 - VEC(constraint_edge_t,heap) *vec;
5552 - struct constraint_edge newe;
5555 - vec = graph->preds[src];
5556 - place = VEC_lower_bound (constraint_edge_t, vec, &newe,
5557 - constraint_edge_less);
5558 - if (place == VEC_length (constraint_edge_t, vec)
5559 - || VEC_index (constraint_edge_t, vec, place)->dest != dest)
5561 - constraint_edge_t edge = new_constraint_edge (dest);
5563 - VEC_safe_insert (constraint_edge_t, heap, graph->preds[src],
5565 - edge = new_constraint_edge (src);
5567 - place = VEC_lower_bound (constraint_edge_t, graph->succs[dest],
5568 - edge, constraint_edge_less);
5569 - VEC_safe_insert (constraint_edge_t, heap, graph->succs[dest],
5571 - edge_added = true;
5572 - stats.num_edges++;
5580 -/* Return the bitmap representing the weights of edge (SRC, DEST). */
5583 -get_graph_weights (constraint_graph_t graph, unsigned int src,
5584 - unsigned int dest)
5586 - constraint_edge_t edge;
5587 - VEC(constraint_edge_t,heap) *vec;
5588 - struct constraint_edge lookfor;
5590 - lookfor.dest = dest;
5592 - vec = graph->preds[src];
5593 - edge = constraint_edge_vec_find (vec, lookfor);
5594 - gcc_assert (edge != NULL);
5595 - return &edge->weights;
5598 -/* Allocate graph weight bitmap for the edges associated with SRC and
5599 - DEST in GRAPH. Both the pred and the succ edges share a single
5600 - bitmap, so we need to set both edges to that bitmap. */
5603 -allocate_graph_weights (constraint_graph_t graph, unsigned int src,
5604 - unsigned int dest)
5607 - constraint_edge_t edge;
5608 - VEC(constraint_edge_t,heap) *vec;
5609 - struct constraint_edge lookfor;
5611 - result = BITMAP_ALLOC (&ptabitmap_obstack);
5613 - /* Set the pred weight. */
5614 - lookfor.dest = dest;
5615 - vec = graph->preds[src];
5616 - edge = constraint_edge_vec_find (vec, lookfor);
5617 - gcc_assert (edge != NULL);
5618 - edge->weights = result;
5620 - /* Set the succ weight. */
5621 - lookfor.dest = src;
5622 - vec = graph->succs[dest];
5623 - edge = constraint_edge_vec_find (vec, lookfor);
5624 - gcc_assert (edge != NULL);
5625 - edge->weights = result;
5631 /* Merge GRAPH nodes FROM and TO into node TO. */
5634 -merge_graph_nodes (constraint_graph_t graph, unsigned int to,
5635 +merge_graph_nodes (constraint_graph_t graph, unsigned int to,
5638 - VEC(constraint_edge_t,heap) *succvec = graph->succs[from];
5639 - VEC(constraint_edge_t,heap) *predvec = graph->preds[from];
5641 - constraint_edge_t c;
5643 - bitmap_iterator bi;
5645 - /* Merge all the zero weighted predecessor edges. */
5646 - if (graph->zero_weight_preds[from])
5647 + if (graph->indirect_cycles[from] != -1)
5649 - if (!graph->zero_weight_preds[to])
5650 - graph->zero_weight_preds[to] = BITMAP_ALLOC (&predbitmap_obstack);
5652 - EXECUTE_IF_SET_IN_BITMAP (graph->zero_weight_preds[from], 0, j, bi)
5653 + /* If we have indirect cycles with the from node, and we have
5654 + none on the to node, the to node has indirect cycles from the
5655 + from node now that they are unified.
5656 + If indirect cycles exist on both, unify the nodes that they
5657 + are in a cycle with, since we know they are in a cycle with
5659 + if (graph->indirect_cycles[to] == -1)
5663 - bitmap_clear_bit (graph->zero_weight_succs[j], from);
5664 - bitmap_set_bit (graph->zero_weight_succs[j], to);
5666 + graph->indirect_cycles[to] = graph->indirect_cycles[from];
5668 - bitmap_ior_into (graph->zero_weight_preds[to],
5669 - graph->zero_weight_preds[from]);
5673 + unsigned int tonode = find (graph->indirect_cycles[to]);
5674 + unsigned int fromnode = find (graph->indirect_cycles[from]);
5676 - /* Merge all the zero weighted successor edges. */
5677 - if (graph->zero_weight_succs[from])
5679 - if (!graph->zero_weight_succs[to])
5680 - graph->zero_weight_succs[to] = BITMAP_ALLOC (&ptabitmap_obstack);
5681 - EXECUTE_IF_SET_IN_BITMAP (graph->zero_weight_succs[from], 0, j, bi)
5683 - bitmap_clear_bit (graph->zero_weight_preds[j], from);
5684 - bitmap_set_bit (graph->zero_weight_preds[j], to);
5685 + if (unite (tonode, fromnode))
5686 + unify_nodes (graph, tonode, fromnode, true);
5688 - bitmap_ior_into (graph->zero_weight_succs[to],
5689 - graph->zero_weight_succs[from]);
5692 - /* Merge all the nonzero weighted predecessor edges. */
5693 - for (i = 0; VEC_iterate (constraint_edge_t, predvec, i, c); i++)
5694 + /* Merge all the successor edges. */
5695 + if (graph->succs[from])
5697 - unsigned int d = c->dest;
5700 + if (!graph->succs[to])
5701 + graph->succs[to] = BITMAP_ALLOC (&pta_obstack);
5702 + bitmap_ior_into (graph->succs[to],
5703 + graph->succs[from]);
5706 - if (c->dest == from)
5708 + clear_edges_for_node (graph, from);
5711 - add_graph_edge (graph, to, d);
5713 - temp = *(get_graph_weights (graph, from, c->dest));
5716 - weights = get_graph_weights (graph, to, d);
5718 - *weights = allocate_graph_weights (graph, to, d);
5720 - bitmap_ior_into (*weights, temp);
5725 - /* Merge all the nonzero weighted successor edges. */
5726 - for (i = 0; VEC_iterate (constraint_edge_t, succvec, i, c); i++)
5728 - unsigned int d = c->dest;
5731 +/* Add an indirect graph edge to GRAPH, going from TO to FROM if
5732 + it doesn't exist in the graph already. */
5734 - if (c->dest == from)
5737 +add_implicit_graph_edge (constraint_graph_t graph, unsigned int to,
5738 + unsigned int from)
5743 - add_graph_edge (graph, d, to);
5744 + if (!graph->implicit_preds[to])
5745 + graph->implicit_preds[to] = BITMAP_ALLOC (&predbitmap_obstack);
5747 - temp = *(get_graph_weights (graph, c->dest, from));
5750 - weights = get_graph_weights (graph, d, to);
5752 - *weights = allocate_graph_weights (graph, d, to);
5753 - bitmap_ior_into (*weights, temp);
5755 + if (!bitmap_bit_p (graph->implicit_preds[to], from))
5757 + stats.num_implicit_edges++;
5758 + bitmap_set_bit (graph->implicit_preds[to], from);
5760 - clear_edges_for_node (graph, from);
5763 -/* Add a graph edge to GRAPH, going from TO to FROM, with WEIGHT, if
5764 +/* Add a predecessor graph edge to GRAPH, going from TO to FROM if
5765 it doesn't exist in the graph already.
5766 Return false if the edge already existed, true otherwise. */
5769 +add_pred_graph_edge (constraint_graph_t graph, unsigned int to,
5770 + unsigned int from)
5772 + if (!graph->preds[to])
5773 + graph->preds[to] = BITMAP_ALLOC (&predbitmap_obstack);
5774 + if (!bitmap_bit_p (graph->preds[to], from))
5775 + bitmap_set_bit (graph->preds[to], from);
5778 +/* Add a graph edge to GRAPH, going from FROM to TO if
5779 + it doesn't exist in the graph already.
5780 + Return false if the edge already existed, true otherwise. */
5783 -int_add_graph_edge (constraint_graph_t graph, unsigned int to,
5784 - unsigned int from, unsigned HOST_WIDE_INT weight)
5785 +add_graph_edge (constraint_graph_t graph, unsigned int to,
5786 + unsigned int from)
5788 - if (to == from && weight == 0)
5793 @@ -1125,41 +924,15 @@
5798 + if (!graph->succs[from])
5799 + graph->succs[from] = BITMAP_ALLOC (&pta_obstack);
5800 + if (!bitmap_bit_p (graph->succs[from], to))
5802 - if (!graph->zero_weight_preds[to])
5803 - graph->zero_weight_preds[to] = BITMAP_ALLOC (&predbitmap_obstack);
5804 - if (!graph->zero_weight_succs[from])
5805 - graph->zero_weight_succs[from] = BITMAP_ALLOC (&ptabitmap_obstack);
5806 - if (!bitmap_bit_p (graph->zero_weight_succs[from], to))
5808 - edge_added = true;
5810 - stats.num_edges++;
5811 - bitmap_set_bit (graph->zero_weight_preds[to], from);
5812 - bitmap_set_bit (graph->zero_weight_succs[from], to);
5815 + if (to < FIRST_REF_NODE && from < FIRST_REF_NODE)
5816 + stats.num_edges++;
5817 + bitmap_set_bit (graph->succs[from], to);
5823 - r = add_graph_edge (graph, to, from);
5824 - weights = get_graph_weights (graph, to, from);
5829 - *weights = allocate_graph_weights (graph, to, from);
5830 - bitmap_set_bit (*weights, weight);
5834 - r |= !bitmap_bit_p (*weights, weight);
5835 - bitmap_set_bit (*weights, weight);
5842 @@ -1168,46 +941,51 @@
5843 /* Return true if {DEST.SRC} is an existing graph edge in GRAPH. */
5846 -valid_graph_edge (constraint_graph_t graph, unsigned int src,
5847 +valid_graph_edge (constraint_graph_t graph, unsigned int src,
5850 - struct constraint_edge lookfor;
5851 - lookfor.dest = src;
5853 - return (graph->zero_weight_succs[dest]
5854 - && bitmap_bit_p (graph->zero_weight_succs[dest], src))
5855 - || constraint_edge_vec_find (graph->succs[dest], lookfor) != NULL;
5856 + return (graph->succs[dest]
5857 + && bitmap_bit_p (graph->succs[dest], src));
5860 -/* Return true if {DEST, SRC} is an existing weighted graph edge (IE has
5861 - a weight other than 0) in GRAPH. */
5863 -valid_weighted_graph_edge (constraint_graph_t graph, unsigned int src,
5864 - unsigned int dest)
5866 - struct constraint_edge lookfor;
5867 - lookfor.dest = src;
5869 - return graph->preds[src]
5870 - && constraint_edge_vec_find (graph->succs[dest], lookfor) != NULL;
5872 +/* Build the constraint graph, adding only predecessor edges right now. */
5875 -/* Build the constraint graph. */
5878 -build_constraint_graph (void)
5879 +build_pred_graph (void)
5886 graph = XNEW (struct constraint_graph);
5887 - graph_size = VEC_length (varinfo_t, varmap) + 1;
5888 - graph->succs = XCNEWVEC (VEC(constraint_edge_t,heap) *, graph_size);
5889 - graph->preds = XCNEWVEC (VEC(constraint_edge_t,heap) *, graph_size);
5890 - graph->zero_weight_succs = XCNEWVEC (bitmap, graph_size);
5891 - graph->zero_weight_preds = XCNEWVEC (bitmap, graph_size);
5892 + graph->size = (VEC_length (varinfo_t, varmap)) * 3;
5893 + graph->succs = XCNEWVEC (bitmap, graph->size);
5894 + graph->implicit_preds = XCNEWVEC (bitmap, graph->size);
5895 + graph->preds = XCNEWVEC (bitmap, graph->size);
5896 + graph->indirect_cycles = XNEWVEC (int, VEC_length (varinfo_t, varmap));
5897 + graph->label = XCNEWVEC (unsigned int, graph->size);
5898 + graph->rep = XNEWVEC (unsigned int, graph->size);
5899 + graph->eq_rep = XNEWVEC (int, graph->size);
5900 + graph->complex = XCNEWVEC (VEC(constraint_t, heap) *,
5901 + VEC_length (varinfo_t, varmap));
5902 + graph->direct_nodes = sbitmap_alloc (graph->size);
5903 + sbitmap_zero (graph->direct_nodes);
5905 + for (j = 0; j < FIRST_REF_NODE; j++)
5907 + if (!get_varinfo (j)->is_special_var)
5908 + SET_BIT (graph->direct_nodes, j);
5911 + for (j = 0; j < graph->size; j++)
5913 + graph->rep[j] = j;
5914 + graph->eq_rep[j] = -1;
5917 + for (j = 0; j < VEC_length (varinfo_t, varmap); j++)
5918 + graph->indirect_cycles[j] = -1;
5920 for (i = 0; VEC_iterate (constraint_t, constraints, i, c); i++)
5922 struct constraint_expr lhs = c->lhs;
5923 @@ -1217,31 +995,92 @@
5925 if (lhs.type == DEREF)
5927 - /* *x = y or *x = &y (complex) */
5928 - if (rhs.type == ADDRESSOF || rhsvar > anything_id)
5929 - insert_into_complex (lhsvar, c);
5931 + if (rhs.offset == 0 && lhs.offset == 0 && rhs.type == SCALAR)
5932 + add_pred_graph_edge (graph, FIRST_REF_NODE + lhsvar, rhsvar);
5933 + if (rhs.type == ADDRESSOF)
5934 + RESET_BIT (graph->direct_nodes, rhsvar);
5936 else if (rhs.type == DEREF)
5938 - /* !special var= *y */
5939 - if (!(get_varinfo (lhsvar)->is_special_var))
5940 - insert_into_complex (rhsvar, c);
5942 + if (rhs.offset == 0 && lhs.offset == 0 && lhs.type == SCALAR)
5943 + add_pred_graph_edge (graph, lhsvar, FIRST_REF_NODE + rhsvar);
5945 + RESET_BIT (graph->direct_nodes, lhsvar);
5947 else if (rhs.type == ADDRESSOF)
5950 + add_pred_graph_edge (graph, lhsvar, FIRST_ADDR_NODE + rhsvar);
5951 + /* Implicitly, *x = y */
5952 + add_implicit_graph_edge (graph, FIRST_REF_NODE + lhsvar, rhsvar);
5954 + RESET_BIT (graph->direct_nodes, rhsvar);
5956 + else if (lhsvar > anything_id
5957 + && lhsvar != rhsvar && lhs.offset == 0 && rhs.offset == 0)
5960 + add_pred_graph_edge (graph, lhsvar, rhsvar);
5961 + /* Implicitly, *x = *y */
5962 + add_implicit_graph_edge (graph, FIRST_REF_NODE + lhsvar,
5963 + FIRST_REF_NODE + rhsvar);
5965 + else if (lhs.offset != 0 || rhs.offset != 0)
5967 + if (rhs.offset != 0)
5968 + RESET_BIT (graph->direct_nodes, lhs.var);
5969 + if (lhs.offset != 0)
5970 + RESET_BIT (graph->direct_nodes, rhs.var);
5975 +/* Build the constraint graph, adding successor edges. */
5978 +build_succ_graph (void)
5983 + for (i = 0; VEC_iterate (constraint_t, constraints, i, c); i++)
5985 + struct constraint_expr lhs;
5986 + struct constraint_expr rhs;
5987 + unsigned int lhsvar;
5988 + unsigned int rhsvar;
5995 + lhsvar = find (get_varinfo_fc (lhs.var)->id);
5996 + rhsvar = find (get_varinfo_fc (rhs.var)->id);
5998 + if (lhs.type == DEREF)
6000 + if (rhs.offset == 0 && lhs.offset == 0 && rhs.type == SCALAR)
6001 + add_graph_edge (graph, FIRST_REF_NODE + lhsvar, rhsvar);
6003 + else if (rhs.type == DEREF)
6005 + if (rhs.offset == 0 && lhs.offset == 0 && lhs.type == SCALAR)
6006 + add_graph_edge (graph, lhsvar, FIRST_REF_NODE + rhsvar);
6008 + else if (rhs.type == ADDRESSOF)
6011 + gcc_assert (find (get_varinfo_fc (rhs.var)->id)
6012 + == get_varinfo_fc (rhs.var)->id);
6013 bitmap_set_bit (get_varinfo (lhsvar)->solution, rhsvar);
6015 - else if (lhsvar > anything_id)
6016 + else if (lhsvar > anything_id
6017 + && lhsvar != rhsvar && lhs.offset == 0 && rhs.offset == 0)
6019 - /* Ignore 0 weighted self edges, as they can't possibly contribute
6021 - if (lhsvar != rhsvar || rhs.offset != 0 || lhs.offset != 0)
6023 - /* x = y (simple) */
6024 - int_add_graph_edge (graph, lhs.var, rhs.var, rhs.offset);
6027 + add_graph_edge (graph, lhsvar, rhsvar);
6031 @@ -1260,20 +1099,20 @@
6035 - sbitmap in_component;
6037 + unsigned int *dfs;
6038 + unsigned int *node_mapping;
6040 - unsigned int *visited_index;
6041 VEC(unsigned,heap) *scc_stack;
6042 - VEC(unsigned,heap) *unification_queue;
6046 /* Recursive routine to find strongly connected components in GRAPH.
6047 SI is the SCC info to store the information in, and N is the id of current
6048 graph node we are processing.
6051 This is Tarjan's strongly connected component finding algorithm, as
6052 - modified by Nuutila to keep only non-root nodes on the stack.
6053 + modified by Nuutila to keep only non-root nodes on the stack.
6054 The algorithm can be found in "On finding the strongly connected
6055 connected components in a directed graph" by Esko Nuutila and Eljas
6056 Soisalon-Soininen, in Information Processing Letters volume 49,
6057 @@ -1284,188 +1123,144 @@
6061 + unsigned int my_dfs;
6063 - gcc_assert (get_varinfo (n)->node == n);
6064 SET_BIT (si->visited, n);
6065 - RESET_BIT (si->in_component, n);
6066 - si->visited_index[n] = si->current_index ++;
6068 + si->dfs[n] = si->current_index ++;
6069 + my_dfs = si->dfs[n];
6071 /* Visit all the successors. */
6072 - EXECUTE_IF_IN_NONNULL_BITMAP (graph->zero_weight_succs[n], 0, i, bi)
6073 + EXECUTE_IF_IN_NONNULL_BITMAP (graph->succs[n], 0, i, bi)
6075 - unsigned int w = i;
6078 + if (i > LAST_REF_NODE)
6082 + if (TEST_BIT (si->roots, w))
6085 if (!TEST_BIT (si->visited, w))
6086 scc_visit (graph, si, w);
6087 - if (!TEST_BIT (si->in_component, w))
6089 - unsigned int t = get_varinfo (w)->node;
6090 - unsigned int nnode = get_varinfo (n)->node;
6091 - if (si->visited_index[t] < si->visited_index[nnode])
6092 - get_varinfo (n)->node = t;
6095 + unsigned int t = find (w);
6096 + unsigned int nnode = find (n);
6097 + gcc_assert (nnode == n);
6099 + if (si->dfs[t] < si->dfs[nnode])
6100 + si->dfs[n] = si->dfs[t];
6105 /* See if any components have been identified. */
6106 - if (get_varinfo (n)->node == n)
6107 + if (si->dfs[n] == my_dfs)
6109 - unsigned int t = si->visited_index[n];
6110 - SET_BIT (si->in_component, n);
6111 - while (VEC_length (unsigned, si->scc_stack) != 0
6112 - && t < si->visited_index[VEC_last (unsigned, si->scc_stack)])
6113 + if (VEC_length (unsigned, si->scc_stack) > 0
6114 + && si->dfs[VEC_last (unsigned, si->scc_stack)] >= my_dfs)
6116 - unsigned int w = VEC_pop (unsigned, si->scc_stack);
6117 - get_varinfo (w)->node = n;
6118 - SET_BIT (si->in_component, w);
6119 - /* Mark this node for collapsing. */
6120 - VEC_safe_push (unsigned, heap, si->unification_queue, w);
6124 - VEC_safe_push (unsigned, heap, si->scc_stack, n);
6126 + bitmap scc = BITMAP_ALLOC (NULL);
6127 + bool have_ref_node = n >= FIRST_REF_NODE;
6128 + unsigned int lowest_node;
6129 + bitmap_iterator bi;
6131 + bitmap_set_bit (scc, n);
6133 -/* Collapse two variables into one variable. */
6134 + while (VEC_length (unsigned, si->scc_stack) != 0
6135 + && si->dfs[VEC_last (unsigned, si->scc_stack)] >= my_dfs)
6137 + unsigned int w = VEC_pop (unsigned, si->scc_stack);
6140 -collapse_nodes (constraint_graph_t graph, unsigned int to, unsigned int from)
6142 - bitmap tosol, fromsol;
6143 + bitmap_set_bit (scc, w);
6144 + if (w >= FIRST_REF_NODE)
6145 + have_ref_node = true;
6148 - condense_varmap_nodes (to, from);
6149 - tosol = get_varinfo (to)->solution;
6150 - fromsol = get_varinfo (from)->solution;
6151 - bitmap_ior_into (tosol, fromsol);
6152 - merge_graph_nodes (graph, to, from);
6154 - if (valid_graph_edge (graph, to, to))
6156 - if (graph->zero_weight_preds[to])
6158 - bitmap_clear_bit (graph->zero_weight_preds[to], to);
6159 - bitmap_clear_bit (graph->zero_weight_succs[to], to);
6160 + lowest_node = bitmap_first_set_bit (scc);
6161 + gcc_assert (lowest_node < FIRST_REF_NODE);
6162 + EXECUTE_IF_SET_IN_BITMAP (scc, 0, i, bi)
6164 + if (i < FIRST_REF_NODE)
6166 + /* Mark this node for collapsing. */
6167 + if (unite (lowest_node, i))
6168 + unify_nodes (graph, lowest_node, i, false);
6172 + unite (lowest_node, i);
6173 + graph->indirect_cycles[i - FIRST_REF_NODE] = lowest_node;
6177 - if (valid_weighted_graph_edge (graph, to, to))
6179 - bitmap weights = *(get_graph_weights (graph, to, to));
6180 - if (!weights || bitmap_empty_p (weights))
6181 - erase_graph_self_edge (graph, to);
6183 + SET_BIT (si->roots, n);
6185 - BITMAP_FREE (fromsol);
6186 - get_varinfo (to)->address_taken |= get_varinfo (from)->address_taken;
6187 - get_varinfo (to)->indirect_target |= get_varinfo (from)->indirect_target;
6189 + VEC_safe_push (unsigned, heap, si->scc_stack, n);
6192 +/* Unify node FROM into node TO, updating the changed count if
6193 + necessary when UPDATE_CHANGED is true. */
6195 -/* Unify nodes in GRAPH that we have found to be part of a cycle.
6196 - SI is the Strongly Connected Components information structure that tells us
6197 - what components to unify.
6198 - UPDATE_CHANGED should be set to true if the changed sbitmap and changed
6199 - count should be updated to reflect the unification. */
6202 -process_unification_queue (constraint_graph_t graph, struct scc_info *si,
6203 - bool update_changed)
6204 +unify_nodes (constraint_graph_t graph, unsigned int to, unsigned int from,
6205 + bool update_changed)
6208 - bitmap tmp = BITMAP_ALLOC (update_changed ? &iteration_obstack : NULL);
6209 - bitmap_clear (tmp);
6211 - /* We proceed as follows:
6212 + gcc_assert (to != from && find (to) == to);
6213 + if (dump_file && (dump_flags & TDF_DETAILS))
6214 + fprintf (dump_file, "Unifying %s to %s\n",
6215 + get_varinfo (from)->name,
6216 + get_varinfo (to)->name);
6218 - For each component in the queue (components are delineated by
6219 - when current_queue_element->node != next_queue_element->node):
6220 + if (update_changed)
6221 + stats.unified_vars_dynamic++;
6223 + stats.unified_vars_static++;
6225 - rep = representative node for component
6226 + merge_graph_nodes (graph, to, from);
6227 + merge_node_constraints (graph, to, from);
6229 - For each node (tounify) to be unified in the component,
6230 - merge the solution for tounify into tmp bitmap
6232 - clear solution for tounify
6234 - merge edges from tounify into rep
6236 - merge complex constraints from tounify into rep
6238 - update changed count to note that tounify will never change
6241 - Merge tmp into solution for rep, marking rep changed if this
6242 - changed rep's solution.
6244 - Delete any 0 weighted self-edges we now have for rep. */
6245 - while (i != VEC_length (unsigned, si->unification_queue))
6246 + if (update_changed && TEST_BIT (changed, from))
6248 - unsigned int tounify = VEC_index (unsigned, si->unification_queue, i);
6249 - unsigned int n = get_varinfo (tounify)->node;
6251 - if (dump_file && (dump_flags & TDF_DETAILS))
6252 - fprintf (dump_file, "Unifying %s to %s\n",
6253 - get_varinfo (tounify)->name,
6254 - get_varinfo (n)->name);
6255 - if (update_changed)
6256 - stats.unified_vars_dynamic++;
6257 + RESET_BIT (changed, from);
6258 + if (!TEST_BIT (changed, to))
6259 + SET_BIT (changed, to);
6261 - stats.unified_vars_static++;
6262 - bitmap_ior_into (tmp, get_varinfo (tounify)->solution);
6263 - merge_graph_nodes (graph, n, tounify);
6264 - condense_varmap_nodes (n, tounify);
6266 - if (update_changed && TEST_BIT (changed, tounify))
6268 - RESET_BIT (changed, tounify);
6269 - if (!TEST_BIT (changed, n))
6270 - SET_BIT (changed, n);
6273 - gcc_assert (changed_count > 0);
6276 + gcc_assert (changed_count > 0);
6281 - bitmap_clear (get_varinfo (tounify)->solution);
6284 - /* If we've either finished processing the entire queue, or
6285 - finished processing all nodes for component n, update the solution for
6287 - if (i == VEC_length (unsigned, si->unification_queue)
6288 - || get_varinfo (VEC_index (unsigned, si->unification_queue, i))->node != n)
6289 + /* If the solution changes because of the merging, we need to mark
6290 + the variable as changed. */
6291 + if (bitmap_ior_into (get_varinfo (to)->solution,
6292 + get_varinfo (from)->solution))
6294 + if (update_changed && !TEST_BIT (changed, to))
6296 - /* If the solution changes because of the merging, we need to mark
6297 - the variable as changed. */
6298 - if (bitmap_ior_into (get_varinfo (n)->solution, tmp))
6300 - if (update_changed && !TEST_BIT (changed, n))
6302 - SET_BIT (changed, n);
6306 - bitmap_clear (tmp);
6308 - if (valid_graph_edge (graph, n, n))
6310 - if (graph->zero_weight_succs[n])
6312 - if (graph->zero_weight_preds[n])
6313 - bitmap_clear_bit (graph->zero_weight_preds[n], n);
6314 - bitmap_clear_bit (graph->zero_weight_succs[n], n);
6316 - if (valid_weighted_graph_edge (graph, n, n))
6318 - bitmap weights = *(get_graph_weights (graph, n, n));
6319 - if (!weights || bitmap_empty_p (weights))
6320 - erase_graph_self_edge (graph, n);
6323 + SET_BIT (changed, to);
6327 - BITMAP_FREE (tmp);
6329 + BITMAP_FREE (get_varinfo (from)->solution);
6330 + BITMAP_FREE (get_varinfo (from)->oldsolution);
6332 + if (stats.iterations > 0)
6334 + BITMAP_FREE (get_varinfo (to)->oldsolution);
6335 + get_varinfo (to)->oldsolution = BITMAP_ALLOC (&oldpta_obstack);
6338 + if (valid_graph_edge (graph, to, to))
6340 + if (graph->succs[to])
6341 + bitmap_clear_bit (graph->succs[to], to);
6346 /* Information needed to compute the topological ordering of a graph. */
6349 @@ -1509,37 +1304,24 @@
6350 topo_visit (constraint_graph_t graph, struct topo_info *ti,
6353 - VEC(constraint_edge_t,heap) *succs = graph->succs[n];
6356 - constraint_edge_t c;
6360 SET_BIT (ti->visited, n);
6361 - if (VEC_length (constraint_edge_t, succs) != 0)
6363 - temp = BITMAP_ALLOC (&iteration_obstack);
6364 - if (graph->zero_weight_succs[n])
6365 - bitmap_ior_into (temp, graph->zero_weight_succs[n]);
6366 - for (i = 0; VEC_iterate (constraint_edge_t, succs, i, c); i++)
6367 - bitmap_set_bit (temp, c->dest);
6370 - temp = graph->zero_weight_succs[n];
6373 - EXECUTE_IF_SET_IN_BITMAP (temp, 0, j, bi)
6374 + if (graph->succs[n])
6375 + EXECUTE_IF_SET_IN_BITMAP (graph->succs[n], 0, j, bi)
6377 if (!TEST_BIT (ti->visited, j))
6378 topo_visit (graph, ti, j);
6381 VEC_safe_push (unsigned, heap, ti->topo_order, n);
6384 /* Return true if variable N + OFFSET is a legal field of N. */
6388 type_safe (unsigned int n, unsigned HOST_WIDE_INT *offset)
6390 varinfo_t ninfo = get_varinfo (n);
6391 @@ -1582,10 +1364,10 @@
6392 v = first_vi_for_offset (get_varinfo (j), fieldoffset);
6397 sol = get_varinfo (t)->solution;
6398 if (!bitmap_bit_p (sol, rhs))
6401 bitmap_set_bit (sol, rhs);
6402 if (!TEST_BIT (changed, t))
6404 @@ -1596,7 +1378,7 @@
6406 else if (0 && dump_file && !(get_varinfo (j)->is_special_var))
6407 fprintf (dump_file, "Untypesafe usage in do_da_constraint.\n");
6413 @@ -1607,7 +1389,7 @@
6414 do_sd_constraint (constraint_graph_t graph, constraint_t c,
6417 - unsigned int lhs = get_varinfo (c->lhs.var)->node;
6418 + unsigned int lhs = find (c->lhs.var);
6420 bitmap sol = get_varinfo (lhs)->solution;
6422 @@ -1620,7 +1402,7 @@
6423 bitmap_set_bit (sol, anything_id);
6426 - /* For each variable j in delta (Sol(y)), add
6427 + /* For each variable j in delta (Sol(y)), add
6428 an edge in the graph from j to x, and union Sol(j) into Sol(x). */
6429 EXECUTE_IF_SET_IN_BITMAP (delta, 0, j, bi)
6431 @@ -1634,18 +1416,18 @@
6432 v = first_vi_for_offset (get_varinfo (j), fieldoffset);
6438 /* Adding edges from the special vars is pointless.
6439 They don't have sets that can change. */
6440 if (get_varinfo (t) ->is_special_var)
6441 flag |= bitmap_ior_into (sol, get_varinfo (t)->solution);
6442 - else if (int_add_graph_edge (graph, lhs, t, 0))
6443 + else if (add_graph_edge (graph, lhs, t))
6444 flag |= bitmap_ior_into (sol, get_varinfo (t)->solution);
6446 else if (0 && dump_file && !(get_varinfo (j)->is_special_var))
6447 fprintf (dump_file, "Untypesafe usage in do_sd_constraint\n");
6453 @@ -1658,15 +1440,15 @@
6454 SET_BIT (changed, lhs);
6461 /* Process a constraint C that represents *x = y. */
6464 -do_ds_constraint (constraint_graph_t graph, constraint_t c, bitmap delta)
6465 +do_ds_constraint (constraint_t c, bitmap delta)
6467 - unsigned int rhs = get_varinfo (c->rhs.var)->node;
6468 + unsigned int rhs = find (c->rhs.var);
6469 unsigned HOST_WIDE_INT roff = c->rhs.offset;
6470 bitmap sol = get_varinfo (rhs)->solution;
6472 @@ -1685,8 +1467,8 @@
6473 v = first_vi_for_offset (get_varinfo (j), fieldoffset);
6480 if (!bitmap_bit_p (get_varinfo (t)->solution, anything_id))
6482 bitmap_set_bit (get_varinfo (t)->solution, anything_id);
6483 @@ -1705,40 +1487,39 @@
6484 EXECUTE_IF_SET_IN_BITMAP (delta, 0, j, bi)
6486 unsigned HOST_WIDE_INT loff = c->lhs.offset;
6487 - if (type_safe (j, &loff) && !(get_varinfo(j)->is_special_var))
6488 + if (type_safe (j, &loff) && !(get_varinfo (j)->is_special_var))
6492 unsigned HOST_WIDE_INT fieldoffset = get_varinfo (j)->offset + loff;
6495 v = first_vi_for_offset (get_varinfo (j), fieldoffset);
6499 - if (int_add_graph_edge (graph, t, rhs, roff))
6501 + tmp = get_varinfo (t)->solution;
6503 + if (set_union_with_increment (tmp, sol, roff))
6505 - bitmap tmp = get_varinfo (t)->solution;
6506 - if (set_union_with_increment (tmp, sol, roff))
6507 + get_varinfo (t)->solution = tmp;
6509 + sol = get_varinfo (rhs)->solution;
6510 + if (!TEST_BIT (changed, t))
6512 - get_varinfo (t)->solution = tmp;
6514 - sol = get_varinfo (rhs)->solution;
6515 - if (!TEST_BIT (changed, t))
6517 - SET_BIT (changed, t);
6520 + SET_BIT (changed, t);
6526 else if (0 && dump_file && !(get_varinfo (j)->is_special_var))
6527 fprintf (dump_file, "Untypesafe usage in do_ds_constraint\n");
6531 -/* Handle a non-simple (simple meaning requires no iteration), non-copy
6532 - constraint (IE *x = &y, x = *y, and *x = y). */
6534 +/* Handle a non-simple (simple meaning requires no iteration),
6535 + constraint (IE *x = &y, x = *y, *x = y, and x = y with offsets involved). */
6538 do_complex_constraint (constraint_graph_t graph, constraint_t c, bitmap delta)
6540 @@ -1752,33 +1533,62 @@
6544 - do_ds_constraint (graph, c, delta);
6545 + do_ds_constraint (c, delta);
6549 + else if (c->rhs.type == DEREF)
6552 if (!(get_varinfo (c->lhs.var)->is_special_var))
6553 do_sd_constraint (graph, c, delta);
6559 + bool flag = false;
6562 + gcc_assert (c->rhs.type == SCALAR && c->lhs.type == SCALAR);
6563 + t = find (c->rhs.var);
6564 + solution = get_varinfo (t)->solution;
6565 + t = find (c->lhs.var);
6566 + tmp = get_varinfo (t)->solution;
6568 + flag = set_union_with_increment (tmp, solution, c->rhs.offset);
6572 + get_varinfo (t)->solution = tmp;
6573 + if (!TEST_BIT (changed, t))
6575 + SET_BIT (changed, t);
6582 /* Initialize and return a new SCC info structure. */
6584 static struct scc_info *
6585 -init_scc_info (void)
6586 +init_scc_info (size_t size)
6588 struct scc_info *si = XNEW (struct scc_info);
6589 - size_t size = VEC_length (varinfo_t, varmap);
6592 si->current_index = 0;
6593 si->visited = sbitmap_alloc (size);
6594 sbitmap_zero (si->visited);
6595 - si->in_component = sbitmap_alloc (size);
6596 - sbitmap_ones (si->in_component);
6597 - si->visited_index = XCNEWVEC (unsigned int, size + 1);
6598 + si->roots = sbitmap_alloc (size);
6599 + sbitmap_zero (si->roots);
6600 + si->node_mapping = XNEWVEC (unsigned int, size);
6601 + si->dfs = XCNEWVEC (unsigned int, size);
6603 + for (i = 0; i < size; i++)
6604 + si->node_mapping[i] = i;
6606 si->scc_stack = VEC_alloc (unsigned, heap, 1);
6607 - si->unification_queue = VEC_alloc (unsigned, heap, 1);
6611 @@ -1786,209 +1596,430 @@
6614 free_scc_info (struct scc_info *si)
6617 sbitmap_free (si->visited);
6618 - sbitmap_free (si->in_component);
6619 - free (si->visited_index);
6620 + sbitmap_free (si->roots);
6621 + free (si->node_mapping);
6623 VEC_free (unsigned, heap, si->scc_stack);
6624 - VEC_free (unsigned, heap, si->unification_queue);
6630 -/* Find cycles in GRAPH that occur, using strongly connected components, and
6631 - collapse the cycles into a single representative node. if UPDATE_CHANGED
6632 - is true, then update the changed sbitmap to note those nodes whose
6633 - solutions have changed as a result of collapsing. */
6634 +/* Find indirect cycles in GRAPH that occur, using strongly connected
6635 + components, and note them in the indirect cycles map.
6637 + This technique comes from Ben Hardekopf and Calvin Lin,
6638 + "It Pays to be Lazy: Fast and Accurate Pointer Analysis for Millions of
6639 + Lines of Code", submitted to PLDI 2007. */
6642 -find_and_collapse_graph_cycles (constraint_graph_t graph, bool update_changed)
6643 +find_indirect_cycles (constraint_graph_t graph)
6646 - unsigned int size = VEC_length (varinfo_t, varmap);
6647 - struct scc_info *si = init_scc_info ();
6648 + unsigned int size = graph->size;
6649 + struct scc_info *si = init_scc_info (size);
6651 - for (i = 0; i != size; ++i)
6652 - if (!TEST_BIT (si->visited, i) && get_varinfo (i)->node == i)
6653 + for (i = 0; i < MIN (LAST_REF_NODE, size); i ++ )
6654 + if (!TEST_BIT (si->visited, i) && find (i) == i)
6655 scc_visit (graph, si, i);
6657 - process_unification_queue (graph, si, update_changed);
6662 /* Compute a topological ordering for GRAPH, and store the result in the
6663 topo_info structure TI. */
6667 compute_topo_order (constraint_graph_t graph,
6668 struct topo_info *ti)
6671 unsigned int size = VEC_length (varinfo_t, varmap);
6674 for (i = 0; i != size; ++i)
6675 - if (!TEST_BIT (ti->visited, i) && get_varinfo (i)->node == i)
6676 + if (!TEST_BIT (ti->visited, i) && find (i) == i)
6677 topo_visit (graph, ti, i);
6680 -/* Return true if bitmap B is empty, or a bitmap other than bit 0 is set. */
6681 +/* Perform offline variable substitution.
6684 -bitmap_other_than_zero_bit_set (bitmap b)
6687 - bitmap_iterator bi;
6689 - if (bitmap_empty_p (b))
6691 - EXECUTE_IF_SET_IN_BITMAP (b, 1, i, bi)
6696 -/* Perform offline variable substitution.
6698 This is a linear time way of identifying variables that must have
6699 equivalent points-to sets, including those caused by static cycles,
6700 and single entry subgraphs, in the constraint graph.
6702 The technique is described in "Off-line variable substitution for
6703 scaling points-to analysis" by Atanas Rountev and Satish Chandra,
6704 - in "ACM SIGPLAN Notices" volume 35, number 5, pages 47-56. */
6705 + in "ACM SIGPLAN Notices" volume 35, number 5, pages 47-56.
6707 + There is an optimal way to do this involving hash based value
6708 + numbering, once the technique is published i will implement it
6711 + The general method of finding equivalence classes is as follows:
6712 + Add fake nodes (REF nodes) and edges for *a = b and a = *b constraints.
6713 + Add fake nodes (ADDRESS nodes) and edges for a = &b constraints.
6714 + Initialize all non-REF/ADDRESS nodes to be direct nodes
6715 + For each SCC in the predecessor graph:
6716 + for each member (x) of the SCC
6717 + if x is not a direct node:
6718 + set rootnode(SCC) to be not a direct node
6719 + collapse node x into rootnode(SCC).
6720 + if rootnode(SCC) is not a direct node:
6721 + label rootnode(SCC) with a new equivalence class
6723 + if all labeled predecessors of rootnode(SCC) have the same
6725 + label rootnode(SCC) with this label
6727 + label rootnode(SCC) with a new equivalence class
6729 + All direct nodes with the same equivalence class can be replaced
6730 + with a single representative node.
6731 + All unlabeled nodes (label == 0) are not pointers and all edges
6732 + involving them can be eliminated.
6733 + We perform these optimizations during move_complex_constraints.
6736 +static int equivalence_class;
6738 +/* Recursive routine to find strongly connected components in GRAPH,
6739 + and label it's nodes with equivalence classes.
6740 + This is used during variable substitution to find cycles involving
6741 + the regular or implicit predecessors, and label them as equivalent.
6742 + The SCC finding algorithm used is the same as that for scc_visit. */
6745 -perform_var_substitution (constraint_graph_t graph)
6746 +label_visit (constraint_graph_t graph, struct scc_info *si, unsigned int n)
6748 - struct topo_info *ti = init_topo_info ();
6750 - bitmap_obstack_initialize (&iteration_obstack);
6751 - /* Compute the topological ordering of the graph, then visit each
6752 - node in topological order. */
6753 - compute_topo_order (graph, ti);
6755 - while (VEC_length (unsigned, ti->topo_order) != 0)
6757 + bitmap_iterator bi;
6758 + unsigned int my_dfs;
6760 + gcc_assert (si->node_mapping[n] == n);
6761 + SET_BIT (si->visited, n);
6762 + si->dfs[n] = si->current_index ++;
6763 + my_dfs = si->dfs[n];
6765 + /* Visit all the successors. */
6766 + EXECUTE_IF_IN_NONNULL_BITMAP (graph->preds[n], 0, i, bi)
6768 - unsigned int i = VEC_pop (unsigned, ti->topo_order);
6769 - unsigned int pred;
6770 - varinfo_t vi = get_varinfo (i);
6771 - bool okay_to_elim = false;
6772 - unsigned int root = VEC_length (varinfo_t, varmap);
6773 - VEC(constraint_edge_t,heap) *predvec = graph->preds[i];
6774 - constraint_edge_t ce = NULL;
6777 - bitmap_iterator bi;
6778 + unsigned int w = si->node_mapping[i];
6780 - /* We can't eliminate things whose address is taken, or which is
6781 - the target of a dereference. */
6782 - if (vi->address_taken || vi->indirect_target)
6783 + if (TEST_BIT (si->roots, w))
6786 - /* See if all predecessors of I are ripe for elimination */
6787 - EXECUTE_IF_IN_NONNULL_BITMAP (graph->zero_weight_preds[i], 0, k, bi)
6790 - w = get_varinfo (k)->node;
6791 + if (!TEST_BIT (si->visited, w))
6792 + label_visit (graph, si, w);
6794 + unsigned int t = si->node_mapping[w];
6795 + unsigned int nnode = si->node_mapping[n];
6796 + gcc_assert (nnode == n);
6798 - /* We can't eliminate the node if one of the predecessors is
6799 - part of a different strongly connected component. */
6800 - if (!okay_to_elim)
6803 - okay_to_elim = true;
6805 - else if (w != root)
6807 - okay_to_elim = false;
6810 + if (si->dfs[t] < si->dfs[nnode])
6811 + si->dfs[n] = si->dfs[t];
6815 - /* Theorem 4 in Rountev and Chandra: If i is a direct node,
6816 - then Solution(i) is a subset of Solution (w), where w is a
6817 - predecessor in the graph.
6818 - Corollary: If all predecessors of i have the same
6819 - points-to set, then i has that same points-to set as
6820 - those predecessors. */
6821 - tmp = BITMAP_ALLOC (NULL);
6822 - bitmap_and_compl (tmp, get_varinfo (i)->solution,
6823 - get_varinfo (w)->solution);
6824 - if (!bitmap_empty_p (tmp))
6826 - okay_to_elim = false;
6827 - BITMAP_FREE (tmp);
6830 - BITMAP_FREE (tmp);
6832 + /* Visit all the implicit predecessors. */
6833 + EXECUTE_IF_IN_NONNULL_BITMAP (graph->implicit_preds[n], 0, i, bi)
6835 + unsigned int w = si->node_mapping[i];
6839 - VEC_iterate (constraint_edge_t, predvec, pred, ce);
6844 - weight = *(get_graph_weights (graph, i, ce->dest));
6845 + if (TEST_BIT (si->roots, w))
6848 - /* We can't eliminate variables that have nonzero weighted
6849 - edges between them. */
6850 - if (weight && bitmap_other_than_zero_bit_set (weight))
6852 - okay_to_elim = false;
6855 - w = get_varinfo (ce->dest)->node;
6856 + if (!TEST_BIT (si->visited, w))
6857 + label_visit (graph, si, w);
6859 + unsigned int t = si->node_mapping[w];
6860 + unsigned int nnode = si->node_mapping[n];
6861 + gcc_assert (nnode == n);
6863 - /* We can't eliminate the node if one of the predecessors is
6864 - part of a different strongly connected component. */
6865 - if (!okay_to_elim)
6868 - okay_to_elim = true;
6870 - else if (w != root)
6872 - okay_to_elim = false;
6875 + if (si->dfs[t] < si->dfs[nnode])
6876 + si->dfs[n] = si->dfs[t];
6880 - /* Theorem 4 in Rountev and Chandra: If i is a direct node,
6881 - then Solution(i) is a subset of Solution (w), where w is a
6882 - predecessor in the graph.
6883 - Corollary: If all predecessors of i have the same
6884 - points-to set, then i has that same points-to set as
6885 - those predecessors. */
6886 - tmp = BITMAP_ALLOC (NULL);
6887 - bitmap_and_compl (tmp, get_varinfo (i)->solution,
6888 - get_varinfo (w)->solution);
6889 - if (!bitmap_empty_p (tmp))
6891 - okay_to_elim = false;
6892 - BITMAP_FREE (tmp);
6895 - BITMAP_FREE (tmp);
6897 + /* See if any components have been identified. */
6898 + if (si->dfs[n] == my_dfs)
6900 + while (VEC_length (unsigned, si->scc_stack) != 0
6901 + && si->dfs[VEC_last (unsigned, si->scc_stack)] >= my_dfs)
6903 + unsigned int w = VEC_pop (unsigned, si->scc_stack);
6904 + si->node_mapping[w] = n;
6906 - /* See if the root is different than the original node.
6907 - If so, we've found an equivalence. */
6908 - if (root != get_varinfo (i)->node && okay_to_elim)
6909 + if (!TEST_BIT (graph->direct_nodes, w))
6910 + RESET_BIT (graph->direct_nodes, n);
6912 + SET_BIT (si->roots, n);
6914 + if (!TEST_BIT (graph->direct_nodes, n))
6916 - /* Found an equivalence */
6917 - get_varinfo (i)->node = root;
6918 - collapse_nodes (graph, root, i);
6919 + graph->label[n] = equivalence_class++;
6923 + unsigned int size = 0;
6924 + unsigned int firstlabel = ~0;
6926 + EXECUTE_IF_IN_NONNULL_BITMAP (graph->preds[n], 0, i, bi)
6928 + unsigned int j = si->node_mapping[i];
6930 + if (j == n || graph->label[j] == 0)
6933 + if (firstlabel == (unsigned int)~0)
6935 + firstlabel = graph->label[j];
6938 + else if (graph->label[j] != firstlabel)
6943 + graph->label[n] = 0;
6944 + else if (size == 1)
6945 + graph->label[n] = firstlabel;
6947 + graph->label[n] = equivalence_class++;
6951 + VEC_safe_push (unsigned, heap, si->scc_stack, n);
6954 +/* Perform offline variable substitution, discovering equivalence
6955 + classes, and eliminating non-pointer variables. */
6957 +static struct scc_info *
6958 +perform_var_substitution (constraint_graph_t graph)
6961 + unsigned int size = graph->size;
6962 + struct scc_info *si = init_scc_info (size);
6964 + bitmap_obstack_initialize (&iteration_obstack);
6965 + equivalence_class = 0;
6967 + /* We only need to visit the non-address nodes for labeling
6968 + purposes, as the address nodes will never have any predecessors,
6969 + because &x never appears on the LHS of a constraint. */
6970 + for (i = 0; i < LAST_REF_NODE; i++)
6971 + if (!TEST_BIT (si->visited, si->node_mapping[i]))
6972 + label_visit (graph, si, si->node_mapping[i]);
6974 + if (dump_file && (dump_flags & TDF_DETAILS))
6975 + for (i = 0; i < FIRST_REF_NODE; i++)
6977 + bool direct_node = TEST_BIT (graph->direct_nodes, i);
6978 + fprintf (dump_file,
6979 + "Equivalence class for %s node id %d:%s is %d\n",
6980 + direct_node ? "Direct node" : "Indirect node", i,
6981 + get_varinfo (i)->name,
6982 + graph->label[si->node_mapping[i]]);
6985 + /* Quickly eliminate our non-pointer variables. */
6987 + for (i = 0; i < FIRST_REF_NODE; i++)
6989 + unsigned int node = si->node_mapping[i];
6991 + if (graph->label[node] == 0 && TEST_BIT (graph->direct_nodes, node))
6993 if (dump_file && (dump_flags & TDF_DETAILS))
6994 - fprintf (dump_file, "Collapsing %s into %s\n",
6995 - get_varinfo (i)->name,
6996 - get_varinfo (root)->name);
6997 - stats.collapsed_vars++;
6998 + fprintf (dump_file,
6999 + "%s is a non-pointer variable, eliminating edges.\n",
7000 + get_varinfo (node)->name);
7001 + stats.nonpointer_vars++;
7002 + clear_edges_for_node (graph, node);
7008 +/* Free information that was only necessary for variable
7012 +free_var_substitution_info (struct scc_info *si)
7014 + free_scc_info (si);
7015 + free (graph->label);
7016 + free (graph->eq_rep);
7017 + sbitmap_free (graph->direct_nodes);
7018 bitmap_obstack_release (&iteration_obstack);
7019 - free_topo_info (ti);
7022 +/* Return an existing node that is equivalent to NODE, which has
7023 + equivalence class LABEL, if one exists. Return NODE otherwise. */
7025 +static unsigned int
7026 +find_equivalent_node (constraint_graph_t graph,
7027 + unsigned int node, unsigned int label)
7029 + /* If the address version of this variable is unused, we can
7030 + substitute it for anything else with the same label.
7031 + Otherwise, we know the pointers are equivalent, but not the
7034 + if (graph->label[FIRST_ADDR_NODE + node] == 0)
7036 + gcc_assert (label < graph->size);
7038 + if (graph->eq_rep[label] != -1)
7040 + /* Unify the two variables since we know they are equivalent. */
7041 + if (unite (graph->eq_rep[label], node))
7042 + unify_nodes (graph, graph->eq_rep[label], node, false);
7043 + return graph->eq_rep[label];
7047 + graph->eq_rep[label] = node;
7053 +/* Move complex constraints to the appropriate nodes, and collapse
7054 + variables we've discovered are equivalent during variable
7055 + substitution. SI is the SCC_INFO that is the result of
7056 + perform_variable_substitution. */
7059 +move_complex_constraints (constraint_graph_t graph,
7060 + struct scc_info *si)
7066 + for (j = 0; j < graph->size; j++)
7067 + gcc_assert (find (j) == j);
7069 + for (i = 0; VEC_iterate (constraint_t, constraints, i, c); i++)
7071 + struct constraint_expr lhs = c->lhs;
7072 + struct constraint_expr rhs = c->rhs;
7073 + unsigned int lhsvar = find (get_varinfo_fc (lhs.var)->id);
7074 + unsigned int rhsvar = find (get_varinfo_fc (rhs.var)->id);
7075 + unsigned int lhsnode, rhsnode;
7076 + unsigned int lhslabel, rhslabel;
7078 + lhsnode = si->node_mapping[lhsvar];
7079 + rhsnode = si->node_mapping[rhsvar];
7080 + lhslabel = graph->label[lhsnode];
7081 + rhslabel = graph->label[rhsnode];
7083 + /* See if it is really a non-pointer variable, and if so, ignore
7084 + the constraint. */
7085 + if (lhslabel == 0)
7087 + if (!TEST_BIT (graph->direct_nodes, lhsnode))
7088 + lhslabel = graph->label[lhsnode] = equivalence_class++;
7091 + if (dump_file && (dump_flags & TDF_DETAILS))
7094 + fprintf (dump_file, "%s is a non-pointer variable,"
7095 + "ignoring constraint:",
7096 + get_varinfo (lhs.var)->name);
7097 + dump_constraint (dump_file, c);
7099 + VEC_replace (constraint_t, constraints, i, NULL);
7104 + if (rhslabel == 0)
7106 + if (!TEST_BIT (graph->direct_nodes, rhsnode))
7107 + rhslabel = graph->label[rhsnode] = equivalence_class++;
7110 + if (dump_file && (dump_flags & TDF_DETAILS))
7113 + fprintf (dump_file, "%s is a non-pointer variable,"
7114 + "ignoring constraint:",
7115 + get_varinfo (rhs.var)->name);
7116 + dump_constraint (dump_file, c);
7118 + VEC_replace (constraint_t, constraints, i, NULL);
7123 + lhsvar = find_equivalent_node (graph, lhsvar, lhslabel);
7124 + rhsvar = find_equivalent_node (graph, rhsvar, rhslabel);
7125 + c->lhs.var = lhsvar;
7126 + c->rhs.var = rhsvar;
7128 + if (lhs.type == DEREF)
7130 + if (rhs.type == ADDRESSOF || rhsvar > anything_id)
7131 + insert_into_complex (graph, lhsvar, c);
7133 + else if (rhs.type == DEREF)
7135 + if (!(get_varinfo (lhsvar)->is_special_var))
7136 + insert_into_complex (graph, rhsvar, c);
7138 + else if (rhs.type != ADDRESSOF && lhsvar > anything_id
7139 + && (lhs.offset != 0 || rhs.offset != 0))
7141 + insert_into_complex (graph, rhsvar, c);
7147 +/* Eliminate indirect cycles involving NODE. Return true if NODE was
7148 + part of an SCC, false otherwise. */
7151 +eliminate_indirect_cycles (unsigned int node)
7153 + if (graph->indirect_cycles[node] != -1
7154 + && !bitmap_empty_p (get_varinfo (node)->solution))
7157 + VEC(unsigned,heap) *queue = NULL;
7159 + unsigned int to = find (graph->indirect_cycles[node]);
7160 + bitmap_iterator bi;
7162 + /* We can't touch the solution set and call unify_nodes
7163 + at the same time, because unify_nodes is going to do
7164 + bitmap unions into it. */
7166 + EXECUTE_IF_SET_IN_BITMAP (get_varinfo (node)->solution, 0, i, bi)
7168 + if (find (i) == i && i != to)
7170 + if (unite (to, i))
7171 + VEC_safe_push (unsigned, heap, queue, i);
7175 + for (queuepos = 0;
7176 + VEC_iterate (unsigned, queue, queuepos, i);
7179 + unify_nodes (graph, to, i, true);
7181 + VEC_free (unsigned, heap, queue);
7187 /* Solve the constraint graph GRAPH using our worklist solver.
7188 This is based on the PW* family of solvers from the "Efficient Field
7189 Sensitive Pointer Analysis for C" paper.
7190 @@ -2001,17 +2032,28 @@
7192 unsigned int size = VEC_length (varinfo_t, varmap);
7196 - changed_count = size;
7197 + changed_count = 0;
7198 changed = sbitmap_alloc (size);
7199 - sbitmap_ones (changed);
7201 - /* The already collapsed/unreachable nodes will never change, so we
7202 - need to account for them in changed_count. */
7203 + sbitmap_zero (changed);
7205 + /* Mark all initial non-collapsed nodes as changed. */
7206 for (i = 0; i < size; i++)
7207 - if (get_varinfo (i)->node != i)
7211 + varinfo_t ivi = get_varinfo (i);
7212 + if (find (i) == i && !bitmap_empty_p (ivi->solution)
7213 + && ((graph->succs[i] && !bitmap_empty_p (graph->succs[i]))
7214 + || VEC_length (constraint_t, graph->complex[i]) > 0))
7216 + SET_BIT (changed, i);
7221 + /* Allocate a bitmap to be used to store the changed bits. */
7222 + pts = BITMAP_ALLOC (&pta_obstack);
7224 while (changed_count > 0)
7227 @@ -2019,41 +2061,45 @@
7230 bitmap_obstack_initialize (&iteration_obstack);
7234 - /* We already did cycle elimination once, when we did
7235 - variable substitution, so we don't need it again for the
7236 - first iteration. */
7237 - if (stats.iterations > 1)
7238 - find_and_collapse_graph_cycles (graph, true);
7240 - edge_added = false;
7243 compute_topo_order (graph, ti);
7245 while (VEC_length (unsigned, ti->topo_order) != 0)
7248 i = VEC_pop (unsigned, ti->topo_order);
7249 - gcc_assert (get_varinfo (i)->node == i);
7251 + /* If this variable is not a representative, skip it. */
7252 + if (find (i) != i)
7255 + /* In certain indirect cycle cases, we may merge this
7256 + variable to another. */
7257 + if (eliminate_indirect_cycles (i) && find (i) != i)
7260 /* If the node has changed, we need to process the
7261 complex constraints and outgoing edges again. */
7262 if (TEST_BIT (changed, i))
7266 - constraint_edge_t e = NULL;
7268 - bitmap_iterator bi;
7269 - VEC(constraint_t,heap) *complex = get_varinfo (i)->complex;
7270 - VEC(constraint_edge_t,heap) *succs;
7271 + VEC(constraint_t,heap) *complex = graph->complex[i];
7272 bool solution_empty;
7274 RESET_BIT (changed, i);
7277 + /* Compute the changed set of solution bits. */
7278 + bitmap_and_compl (pts, get_varinfo (i)->solution,
7279 + get_varinfo (i)->oldsolution);
7281 + if (bitmap_empty_p (pts))
7284 + bitmap_ior_into (get_varinfo (i)->oldsolution, pts);
7286 solution = get_varinfo (i)->solution;
7287 solution_empty = bitmap_empty_p (solution);
7289 @@ -2065,52 +2111,38 @@
7290 is a constraint where the lhs side is receiving
7291 some set from elsewhere. */
7292 if (!solution_empty || c->lhs.type != DEREF)
7293 - do_complex_constraint (graph, c, solution);
7294 + do_complex_constraint (graph, c, pts);
7297 solution_empty = bitmap_empty_p (solution);
7299 if (!solution_empty)
7301 + bitmap_iterator bi;
7303 /* Propagate solution to all successors. */
7304 - succs = graph->succs[i];
7306 - EXECUTE_IF_IN_NONNULL_BITMAP (graph->zero_weight_succs[i],
7307 + EXECUTE_IF_IN_NONNULL_BITMAP (graph->succs[i],
7310 - bitmap tmp = get_varinfo (j)->solution;
7311 - bool flag = false;
7313 - flag = set_union_with_increment (tmp, solution, 0);
7317 - get_varinfo (j)->solution = tmp;
7318 - if (!TEST_BIT (changed, j))
7320 - SET_BIT (changed, j);
7325 - for (j = 0; VEC_iterate (constraint_edge_t, succs, j, e); j++)
7327 - bitmap tmp = get_varinfo (e->dest)->solution;
7328 - bool flag = false;
7330 - bitmap weights = e->weights;
7331 - bitmap_iterator bi;
7335 - gcc_assert (weights && !bitmap_empty_p (weights));
7336 - EXECUTE_IF_SET_IN_BITMAP (weights, 0, k, bi)
7337 - flag |= set_union_with_increment (tmp, solution, k);
7338 + unsigned int to = find (j);
7339 + tmp = get_varinfo (to)->solution;
7342 + /* Don't try to propagate to ourselves. */
7346 + flag = set_union_with_increment (tmp, pts, 0);
7350 - get_varinfo (e->dest)->solution = tmp;
7351 - if (!TEST_BIT (changed, e->dest))
7352 + get_varinfo (to)->solution = tmp;
7353 + if (!TEST_BIT (changed, to))
7355 - SET_BIT (changed, e->dest);
7356 + SET_BIT (changed, to);
7360 @@ -2122,74 +2154,37 @@
7361 bitmap_obstack_release (&iteration_obstack);
7364 + BITMAP_FREE (pts);
7365 sbitmap_free (changed);
7366 + bitmap_obstack_release (&oldpta_obstack);
7369 +/* Map from trees to variable infos. */
7370 +static struct pointer_map_t *vi_for_tree;
7372 -/* CONSTRAINT AND VARIABLE GENERATION FUNCTIONS */
7374 -/* Map from trees to variable ids. */
7375 -static htab_t id_for_tree;
7376 +/* Insert ID as the variable id for tree T in the vi_for_tree map. */
7378 -typedef struct tree_id
7380 +insert_vi_for_tree (tree t, varinfo_t vi)
7386 -/* Hash a tree id structure. */
7389 -tree_id_hash (const void *p)
7391 - const tree_id_t ta = (tree_id_t) p;
7392 - return htab_hash_pointer (ta->t);
7395 -/* Return true if the tree in P1 and the tree in P2 are the same. */
7398 -tree_id_eq (const void *p1, const void *p2)
7400 - const tree_id_t ta1 = (tree_id_t) p1;
7401 - const tree_id_t ta2 = (tree_id_t) p2;
7402 - return ta1->t == ta2->t;
7405 -/* Insert ID as the variable id for tree T in the hashtable. */
7408 -insert_id_for_tree (tree t, int id)
7411 - struct tree_id finder;
7412 - tree_id_t new_pair;
7415 - slot = htab_find_slot (id_for_tree, &finder, INSERT);
7416 + void **slot = pointer_map_insert (vi_for_tree, t);
7418 gcc_assert (*slot == NULL);
7419 - new_pair = XNEW (struct tree_id);
7421 - new_pair->id = id;
7422 - *slot = (void *)new_pair;
7426 -/* Find the variable id for tree T in ID_FOR_TREE. If T does not
7427 - exist in the hash table, return false, otherwise, return true and
7428 - set *ID to the id we found. */
7429 +/* Find the variable info for tree T in VI_FOR_TREE. If T does not
7430 + exist in the map, return NULL, otherwise, return the varinfo we found. */
7433 -lookup_id_for_tree (tree t, unsigned int *id)
7435 +lookup_vi_for_tree (tree t)
7438 - struct tree_id finder;
7439 + void **slot = pointer_map_contains (vi_for_tree, t);
7444 - pair = htab_find (id_for_tree, &finder);
7449 + return (varinfo_t) *slot;
7452 /* Return a printable name for DECL */
7453 @@ -2210,7 +2205,7 @@
7455 if (TREE_CODE (decl) == SSA_NAME)
7457 - num_printed = asprintf (&temp, "%s_%u",
7458 + num_printed = asprintf (&temp, "%s_%u",
7459 alias_get_name (SSA_NAME_VAR (decl)),
7460 SSA_NAME_VERSION (decl));
7462 @@ -2226,21 +2221,17 @@
7466 -/* Find the variable id for tree T in the hashtable.
7467 - If T doesn't exist in the hash table, create an entry for it. */
7468 +/* Find the variable id for tree T in the map.
7469 + If T doesn't exist in the map, create an entry for it and return it. */
7471 -static unsigned int
7472 -get_id_for_tree (tree t)
7474 +get_vi_for_tree (tree t)
7477 - struct tree_id finder;
7478 + void **slot = pointer_map_contains (vi_for_tree, t);
7480 + return get_varinfo (create_variable_info_for (t, alias_get_name (t)));
7483 - pair = htab_find (id_for_tree, &finder);
7485 - return create_variable_info_for (t, alias_get_name (t));
7488 + return (varinfo_t) *slot;
7491 /* Get a constraint expression from an SSA_VAR_P node. */
7492 @@ -2254,14 +2245,14 @@
7494 /* For parameters, get at the points-to set for the actual parm
7496 - if (TREE_CODE (t) == SSA_NAME
7497 - && TREE_CODE (SSA_NAME_VAR (t)) == PARM_DECL
7498 + if (TREE_CODE (t) == SSA_NAME
7499 + && TREE_CODE (SSA_NAME_VAR (t)) == PARM_DECL
7500 && default_def (SSA_NAME_VAR (t)) == t)
7501 return get_constraint_exp_from_ssa_var (SSA_NAME_VAR (t));
7503 cexpr.type = SCALAR;
7505 - cexpr.var = get_id_for_tree (t);
7507 + cexpr.var = get_vi_for_tree (t)->id;
7508 /* If we determine the result is "anything", and we know this is readonly,
7509 say it points to readonly memory instead. */
7510 if (cexpr.var == anything_id && TREE_READONLY (t))
7511 @@ -2269,7 +2260,7 @@
7512 cexpr.type = ADDRESSOF;
7513 cexpr.var = readonly_id;
7520 @@ -2290,7 +2281,13 @@
7521 get_varinfo (lhs.var)->directly_dereferenced = true;
7522 if (rhs.type == DEREF)
7523 get_varinfo (rhs.var)->directly_dereferenced = true;
7526 + if (!use_field_sensitive)
7528 + t->rhs.offset = 0;
7529 + t->lhs.offset = 0;
7532 /* ANYTHING == ANYTHING is pointless. */
7533 if (lhs.var == anything_id && rhs.var == anything_id)
7535 @@ -2302,7 +2299,7 @@
7538 process_constraint (t);
7541 /* This can happen in our IR with things like n->a = *p */
7542 else if (rhs.type == DEREF && lhs.type == DEREF && rhs.var != anything_id)
7544 @@ -2312,33 +2309,19 @@
7545 tree pointedtotype = TREE_TYPE (pointertype);
7546 tree tmpvar = create_tmp_var_raw (pointedtotype, "doubledereftmp");
7547 struct constraint_expr tmplhs = get_constraint_exp_from_ssa_var (tmpvar);
7550 /* If this is an aggregate of known size, we should have passed
7551 this off to do_structure_copy, and it should have broken it
7553 - gcc_assert (!AGGREGATE_TYPE_P (pointedtotype)
7554 + gcc_assert (!AGGREGATE_TYPE_P (pointedtotype)
7555 || get_varinfo (rhs.var)->is_unknown_size_var);
7558 process_constraint (new_constraint (tmplhs, rhs));
7559 process_constraint (new_constraint (lhs, tmplhs));
7561 - else if (rhs.type == ADDRESSOF)
7564 - gcc_assert (rhs.offset == 0);
7566 - /* No need to mark address taken simply because of escaped vars
7568 - if (lhs.var != escaped_vars_id)
7569 - for (vi = get_varinfo (rhs.var); vi != NULL; vi = vi->next)
7570 - vi->address_taken = true;
7572 - VEC_safe_push (constraint_t, heap, constraints, t);
7576 - if (lhs.type != DEREF && rhs.type == DEREF)
7577 - get_varinfo (lhs.var)->indirect_target = true;
7578 + gcc_assert (rhs.type != ADDRESSOF || rhs.offset == 0);
7579 VEC_safe_push (constraint_t, heap, constraints, t);
7582 @@ -2350,10 +2333,12 @@
7583 could_have_pointers (tree t)
7585 tree type = TREE_TYPE (t);
7587 - if (POINTER_TYPE_P (type) || AGGREGATE_TYPE_P (type)
7589 + if (POINTER_TYPE_P (type)
7590 + || AGGREGATE_TYPE_P (type)
7591 || TREE_CODE (type) == COMPLEX_TYPE)
7597 @@ -2367,9 +2352,9 @@
7598 if (TREE_CODE (DECL_FIELD_OFFSET (fdecl)) != INTEGER_CST
7599 || TREE_CODE (DECL_FIELD_BIT_OFFSET (fdecl)) != INTEGER_CST)
7602 - return (tree_low_cst (DECL_FIELD_OFFSET (fdecl), 1) * 8)
7603 - + tree_low_cst (DECL_FIELD_BIT_OFFSET (fdecl), 1);
7605 + return (tree_low_cst (DECL_FIELD_OFFSET (fdecl), 1) * 8)
7606 + + tree_low_cst (DECL_FIELD_BIT_OFFSET (fdecl), 1);
7610 @@ -2388,7 +2373,7 @@
7612 if (accesspos < fieldpos && (accesspos + accesssize > fieldpos))
7619 @@ -2411,20 +2396,20 @@
7620 while (!SSA_VAR_P (forzero) && !CONSTANT_CLASS_P (forzero))
7621 forzero = TREE_OPERAND (forzero, 0);
7623 - if (CONSTANT_CLASS_P (forzero) && integer_zerop (forzero))
7624 + if (CONSTANT_CLASS_P (forzero) && integer_zerop (forzero))
7626 struct constraint_expr temp;
7630 temp.var = integer_id;
7632 VEC_safe_push (ce_s, heap, *results, &temp);
7637 t = get_ref_base_and_extent (t, &bitpos, &bitsize, &bitmaxsize);
7639 - /* String constants's are readonly, so there is nothing to really do
7640 + /* String constants are readonly, so there is nothing to really do
7642 if (TREE_CODE (t) == STRING_CST)
7644 @@ -2438,21 +2423,21 @@
7645 /* This can also happen due to weird offsetof type macros. */
7646 if (TREE_CODE (t) != ADDR_EXPR && result->type == ADDRESSOF)
7647 result->type = SCALAR;
7650 if (result->type == SCALAR)
7652 /* In languages like C, you can access one past the end of an
7653 array. You aren't allowed to dereference it, so we can
7654 ignore this constraint. When we handle pointer subtraction,
7655 we may have to do something cute here. */
7658 if (result->offset < get_varinfo (result->var)->fullsize
7661 /* It's also not true that the constraint will actually start at the
7662 right offset, it may start in some padding. We only care about
7663 setting the constraint to the first actual field it touches, so
7664 - walk to find it. */
7665 + walk to find it. */
7667 for (curr = get_varinfo (result->var); curr; curr = curr->next)
7669 @@ -2495,6 +2480,7 @@
7671 struct constraint_expr *c;
7674 for (i = 0; VEC_iterate (ce_s, *constraints, i, c); i++)
7676 if (c->type == SCALAR)
7677 @@ -2576,6 +2562,7 @@
7678 tree pttype = TREE_TYPE (TREE_TYPE (t));
7680 get_constraint_for (exp, results);
7682 /* Make sure we capture constraints to all elements
7684 if ((handled_component_p (exp)
7685 @@ -2588,7 +2575,7 @@
7687 if (VEC_length (ce_s, *results) == 0)
7691 gcc_assert (VEC_length (ce_s, *results) == 1);
7692 origrhs = VEC_last (ce_s, *results);
7694 @@ -2619,12 +2606,12 @@
7695 VEC_safe_push (ce_s, heap, *results, &tmp);
7700 for (i = 0; VEC_iterate (ce_s, *results, i, c); i++)
7702 if (c->type == DEREF)
7706 c->type = ADDRESSOF;
7709 @@ -2638,9 +2625,9 @@
7712 tree heapvar = heapvar_lookup (t);
7715 if (heapvar == NULL)
7718 heapvar = create_tmp_var_raw (ptr_type_node, "HEAP");
7719 DECL_EXTERNAL (heapvar) = 1;
7720 if (referenced_vars)
7721 @@ -2650,7 +2637,7 @@
7723 temp.var = create_variable_info_for (heapvar,
7724 alias_get_name (heapvar));
7727 vi = get_varinfo (temp.var);
7728 vi->is_artificial_var = 1;
7729 vi->is_heap_var = 1;
7730 @@ -2712,7 +2699,7 @@
7731 case NON_LVALUE_EXPR:
7733 tree op = TREE_OPERAND (t, 0);
7736 /* Cast from non-pointer to pointers are bad news for us.
7737 Anything else, we see through */
7738 if (!(POINTER_TYPE_P (TREE_TYPE (t))
7739 @@ -2738,7 +2725,7 @@
7741 switch (TREE_CODE (t))
7746 get_constraint_for (PHI_RESULT (t), results);
7748 @@ -2782,8 +2769,8 @@
7751 /* Handle the structure copy case where we have a simple structure copy
7752 - between LHS and RHS that is of SIZE (in bits)
7754 + between LHS and RHS that is of SIZE (in bits)
7756 For each field of the lhs variable (lhsfield)
7757 For each field of the rhs variable at lhsfield.offset (rhsfield)
7758 add the constraint lhsfield = rhsfield
7759 @@ -2808,7 +2795,7 @@
7760 struct constraint_expr temprhs = rhs;
7761 unsigned HOST_WIDE_INT fieldoffset;
7763 - templhs.var = p->id;
7764 + templhs.var = p->id;
7765 q = get_varinfo (temprhs.var);
7766 fieldoffset = p->offset - pstart;
7767 q = first_vi_for_offset (q, q->offset + fieldoffset);
7768 @@ -2823,8 +2810,8 @@
7770 /* Handle the structure copy case where we have a structure copy between a
7771 aggregate on the LHS and a dereference of a pointer on the RHS
7772 - that is of SIZE (in bits)
7774 + that is of SIZE (in bits)
7776 For each field of the lhs variable (lhsfield)
7777 rhs.offset = lhsfield->offset
7778 add the constraint lhsfield = rhs
7779 @@ -2849,12 +2836,12 @@
7782 if (templhs.type == SCALAR)
7783 - templhs.var = p->id;
7784 + templhs.var = p->id;
7786 templhs.offset = p->offset;
7789 q = get_varinfo (temprhs.var);
7790 - fieldoffset = p->offset - pstart;
7791 + fieldoffset = p->offset - pstart;
7792 temprhs.offset += fieldoffset;
7793 process_constraint (new_constraint (templhs, temprhs));
7795 @@ -2862,7 +2849,7 @@
7797 /* Handle the structure copy case where we have a structure copy
7798 between a aggregate on the RHS and a dereference of a pointer on
7799 - the LHS that is of SIZE (in bits)
7800 + the LHS that is of SIZE (in bits)
7802 For each field of the rhs variable (rhsfield)
7803 lhs.offset = rhsfield->offset
7804 @@ -2888,12 +2875,12 @@
7807 if (temprhs.type == SCALAR)
7808 - temprhs.var = p->id;
7809 + temprhs.var = p->id;
7811 temprhs.offset = p->offset;
7814 q = get_varinfo (templhs.var);
7815 - fieldoffset = p->offset - pstart;
7816 + fieldoffset = p->offset - pstart;
7817 templhs.offset += fieldoffset;
7818 process_constraint (new_constraint (templhs, temprhs));
7820 @@ -2901,7 +2888,7 @@
7822 /* Sometimes, frontends like to give us bad type information. This
7823 function will collapse all the fields from VAR to the end of VAR,
7824 - into VAR, so that we treat those fields as a single variable.
7825 + into VAR, so that we treat those fields as a single variable.
7826 We return the variable they were collapsed into. */
7829 @@ -2913,16 +2900,16 @@
7830 for (field = currvar->next; field; field = field->next)
7833 - fprintf (dump_file, "Type safety: Collapsing var %s into %s\n",
7834 + fprintf (dump_file, "Type safety: Collapsing var %s into %s\n",
7835 field->name, currvar->name);
7838 gcc_assert (!field->collapsed_to);
7839 field->collapsed_to = currvar;
7842 currvar->next = NULL;
7843 currvar->size = currvar->fullsize - currvar->offset;
7849 @@ -2944,7 +2931,7 @@
7850 gcc_assert (VEC_length (ce_s, rhsc) == 1);
7851 lhs = *(VEC_last (ce_s, lhsc));
7852 rhs = *(VEC_last (ce_s, rhsc));
7855 VEC_free (ce_s, heap, lhsc);
7856 VEC_free (ce_s, heap, rhsc);
7858 @@ -2955,7 +2942,7 @@
7864 /* This is fairly conservative for the RHS == ADDRESSOF case, in that it's
7865 possible it's something we could handle. However, most cases falling
7866 into this are dealing with transparent unions, which are slightly
7867 @@ -3021,11 +3008,11 @@
7869 lhssize = TREE_INT_CST_LOW (lhstypesize);
7872 - if (rhs.type == SCALAR && lhs.type == SCALAR)
7874 + if (rhs.type == SCALAR && lhs.type == SCALAR)
7876 if (!do_simple_structure_copy (lhs, rhs, MIN (lhssize, rhssize)))
7879 lhs.var = collapse_rest_of_var (lhs.var);
7880 rhs.var = collapse_rest_of_var (rhs.var);
7882 @@ -3042,7 +3029,7 @@
7885 tree pointedtotype = lhstype;
7889 gcc_assert (rhs.type == DEREF && lhs.type == DEREF);
7890 tmpvar = create_tmp_var_raw (pointedtotype, "structcopydereftmp");
7891 @@ -3052,6 +3039,7 @@
7896 /* Update related alias information kept in AI. This is used when
7897 building name tags, alias sets and deciding grouping heuristics.
7898 STMT is the statement to process. This function also updates
7899 @@ -3261,7 +3249,6 @@
7904 /* Handle pointer arithmetic EXPR when creating aliasing constraints.
7905 Expressions of the type PTR + CST can be handled in two ways:
7907 @@ -3288,7 +3275,7 @@
7910 VEC (ce_s, heap) *temp = NULL;
7911 - unsigned int rhsoffset = 0;
7912 + unsigned HOST_WIDE_INT rhsoffset = 0;
7914 if (TREE_CODE (expr) != PLUS_EXPR
7915 && TREE_CODE (expr) != MINUS_EXPR)
7916 @@ -3299,14 +3286,18 @@
7918 get_constraint_for (op0, &temp);
7919 if (POINTER_TYPE_P (TREE_TYPE (op0))
7920 - && TREE_CODE (op1) == INTEGER_CST
7921 + && host_integerp (op1, 1)
7922 && TREE_CODE (expr) == PLUS_EXPR)
7924 + if ((TREE_INT_CST_LOW (op1) * BITS_PER_UNIT) / BITS_PER_UNIT
7925 + != TREE_INT_CST_LOW (op1))
7927 rhsoffset = TREE_INT_CST_LOW (op1) * BITS_PER_UNIT;
7933 for (i = 0; VEC_iterate (ce_s, lhsc, i, c); i++)
7934 for (j = 0; VEC_iterate (ce_s, temp, j, c2); j++)
7936 @@ -3360,12 +3351,12 @@
7942 /* For a phi node, assign all the arguments to
7944 get_constraint_for (PHI_RESULT (t), &lhsc);
7945 for (i = 0; i < PHI_NUM_ARGS (t); i++)
7949 tree strippedrhs = PHI_ARG_DEF (t, i);
7951 @@ -3401,7 +3392,6 @@
7955 - unsigned int varid;
7959 @@ -3423,17 +3413,16 @@
7960 we should still be able to handle. */
7963 - varid = get_id_for_tree (decl);
7964 + fi = get_vi_for_tree (decl);
7968 decl = TREE_OPERAND (rhsop, 0);
7969 - varid = get_id_for_tree (decl);
7970 + fi = get_vi_for_tree (decl);
7973 /* Assign all the passed arguments to the appropriate incoming
7974 parameters of the function. */
7975 - fi = get_varinfo (varid);
7976 arglist = TREE_OPERAND (rhsop, 1);
7978 for (;arglist; arglist = TREE_CHAIN (arglist))
7979 @@ -3463,13 +3452,14 @@
7984 /* If we are returning a value, assign it to the result. */
7987 struct constraint_expr rhs;
7988 struct constraint_expr *lhsp;
7992 get_constraint_for (lhsop, &lhsc);
7993 if (TREE_CODE (decl) != FUNCTION_DECL)
7995 @@ -3485,7 +3475,7 @@
7997 for (j = 0; VEC_iterate (ce_s, lhsc, j, lhsp); j++)
7998 process_constraint (new_constraint (*lhsp, rhs));
8002 /* Otherwise, just a regular assignment statement. */
8003 else if (TREE_CODE (t) == MODIFY_EXPR)
8004 @@ -3494,7 +3484,7 @@
8005 tree rhsop = TREE_OPERAND (t, 1);
8008 - if ((AGGREGATE_TYPE_P (TREE_TYPE (lhsop))
8009 + if ((AGGREGATE_TYPE_P (TREE_TYPE (lhsop))
8010 || TREE_CODE (TREE_TYPE (lhsop)) == COMPLEX_TYPE)
8011 && (AGGREGATE_TYPE_P (TREE_TYPE (rhsop))
8012 || TREE_CODE (TREE_TYPE (lhsop)) == COMPLEX_TYPE))
8013 @@ -3513,7 +3503,7 @@
8015 /* RHS that consist of unary operations,
8016 exceptional types, or bare decls/constants, get
8017 - handled directly by get_constraint_for. */
8018 + handled directly by get_constraint_for. */
8020 case tcc_declaration:
8022 @@ -3528,7 +3518,7 @@
8024 struct constraint_expr *c2;
8028 for (k = 0; VEC_iterate (ce_s, rhsc, k, c2); k++)
8029 process_constraint (new_constraint (*c, *c2));
8031 @@ -3570,7 +3560,7 @@
8040 @@ -3578,7 +3568,7 @@
8041 /* After promoting variables and computing aliasing we will
8042 need to re-scan most statements. FIXME: Try to minimize the
8043 number of statements re-scanned. It's not really necessary to
8044 - re-scan *all* statements. */
8045 + re-scan *all* statements. */
8046 mark_stmt_modified (origt);
8047 VEC_free (ce_s, heap, rhsc);
8048 VEC_free (ce_s, heap, lhsc);
8049 @@ -3591,7 +3581,7 @@
8050 first field that overlaps with OFFSET.
8051 Return NULL if we can't find one. */
8055 first_vi_for_offset (varinfo_t start, unsigned HOST_WIDE_INT offset)
8057 varinfo_t curr = start;
8058 @@ -3617,7 +3607,7 @@
8060 varinfo_t prev = base;
8061 varinfo_t curr = base->next;
8067 @@ -3630,7 +3620,7 @@
8069 varinfo_t prev = base;
8070 varinfo_t curr = base->next;
8076 @@ -3652,13 +3642,13 @@
8078 /* qsort comparison function for two fieldoff's PA and PB */
8082 fieldoff_compare (const void *pa, const void *pb)
8084 const fieldoff_s *foa = (const fieldoff_s *)pa;
8085 const fieldoff_s *fob = (const fieldoff_s *)pb;
8086 HOST_WIDE_INT foasize, fobsize;
8089 if (foa->offset != fob->offset)
8090 return foa->offset - fob->offset;
8092 @@ -3671,8 +3661,8 @@
8094 sort_fieldstack (VEC(fieldoff_s,heap) *fieldstack)
8096 - qsort (VEC_address (fieldoff_s, fieldstack),
8097 - VEC_length (fieldoff_s, fieldstack),
8098 + qsort (VEC_address (fieldoff_s, fieldstack),
8099 + VEC_length (fieldoff_s, fieldstack),
8100 sizeof (fieldoff_s),
8103 @@ -3686,12 +3676,13 @@
8107 -push_fields_onto_fieldstack (tree type, VEC(fieldoff_s,heap) **fieldstack,
8108 +push_fields_onto_fieldstack (tree type, VEC(fieldoff_s,heap) **fieldstack,
8109 HOST_WIDE_INT offset, bool *has_union)
8114 + unsigned HOST_WIDE_INT minoffset = -1;
8116 if (TREE_CODE (type) == COMPLEX_TYPE)
8118 fieldoff_s *real_part, *img_part;
8119 @@ -3700,13 +3691,13 @@
8120 real_part->size = TYPE_SIZE (TREE_TYPE (type));
8121 real_part->offset = offset;
8122 real_part->decl = NULL_TREE;
8125 img_part = VEC_safe_push (fieldoff_s, heap, *fieldstack, NULL);
8126 img_part->type = TREE_TYPE (type);
8127 img_part->size = TYPE_SIZE (TREE_TYPE (type));
8128 img_part->offset = offset + TREE_INT_CST_LOW (TYPE_SIZE (TREE_TYPE (type)));
8129 img_part->decl = NULL_TREE;
8135 @@ -3733,12 +3724,12 @@
8143 && (TREE_CODE (TREE_TYPE (type)) == QUAL_UNION_TYPE
8144 || TREE_CODE (TREE_TYPE (type)) == UNION_TYPE))
8148 if (!AGGREGATE_TYPE_P (TREE_TYPE (type))) /* var_can_have_subvars */
8150 else if (!(pushed = push_fields_onto_fieldstack
8151 @@ -3772,12 +3763,12 @@
8159 && (TREE_CODE (TREE_TYPE (field)) == QUAL_UNION_TYPE
8160 || TREE_CODE (TREE_TYPE (field)) == UNION_TYPE))
8164 if (!var_can_have_subvars (field))
8166 else if (!(pushed = push_fields_onto_fieldstack
8167 @@ -3789,7 +3780,7 @@
8168 see if we didn't push any subfields and the size is
8169 nonzero, push the field onto the stack */
8176 @@ -3803,8 +3794,25 @@
8181 + if (bitpos_of_field (field) < minoffset)
8182 + minoffset = bitpos_of_field (field);
8185 + /* We need to create a fake subvar for empty bases. But _only_ for non-empty
8187 + if (minoffset != 0 && count != 0)
8191 + pair = VEC_safe_push (fieldoff_s, heap, *fieldstack, NULL);
8192 + pair->type = void_type_node;
8193 + pair->size = build_int_cst (size_type_node, minoffset);
8194 + pair->decl = NULL;
8195 + pair->offset = offset;
8202 @@ -3848,15 +3856,15 @@
8206 - for (t = TYPE_ARG_TYPES (TREE_TYPE (decl));
8207 + for (t = TYPE_ARG_TYPES (TREE_TYPE (decl));
8212 if (TREE_VALUE (t) == void_type_node)
8221 @@ -3870,19 +3878,19 @@
8223 unsigned int index = VEC_length (varinfo_t, varmap);
8228 bool is_varargs = false;
8230 /* Create the variable info. */
8232 - vi = new_var_info (decl, index, name, index);
8233 + vi = new_var_info (decl, index, name);
8238 vi->fullsize = count_num_arguments (decl, &is_varargs) + 1;
8239 - insert_id_for_tree (vi->decl, index);
8240 + insert_vi_for_tree (vi->decl, vi);
8241 VEC_safe_push (varinfo_t, heap, varmap, vi);
8244 @@ -3898,12 +3906,12 @@
8250 arg = DECL_ARGUMENTS (decl);
8252 /* Set up variables for each argument. */
8253 for (i = 1; i < vi->fullsize; i++)
8257 const char *newname;
8259 @@ -3912,13 +3920,13 @@
8265 newindex = VEC_length (varinfo_t, varmap);
8266 asprintf (&tempname, "%s.arg%d", name, i-1);
8267 newname = ggc_strdup (tempname);
8270 - argvi = new_var_info (argdecl, newindex,newname, newindex);
8271 + argvi = new_var_info (argdecl, newindex, newname);
8272 argvi->decl = argdecl;
8273 VEC_safe_push (varinfo_t, heap, varmap, argvi);
8275 @@ -3929,7 +3937,7 @@
8276 stats.total_vars ++;
8279 - insert_id_for_tree (arg, newindex);
8280 + insert_vi_for_tree (arg, argvi);
8281 arg = TREE_CHAIN (arg);
8284 @@ -3948,13 +3956,13 @@
8286 if (DECL_RESULT (decl))
8287 resultdecl = DECL_RESULT (decl);
8290 newindex = VEC_length (varinfo_t, varmap);
8291 asprintf (&tempname, "%s.result", name);
8292 newname = ggc_strdup (tempname);
8295 - resultvi = new_var_info (resultdecl, newindex, newname, newindex);
8296 + resultvi = new_var_info (resultdecl, newindex, newname);
8297 resultvi->decl = resultdecl;
8298 VEC_safe_push (varinfo_t, heap, varmap, resultvi);
8299 resultvi->offset = i;
8300 @@ -3964,13 +3972,13 @@
8301 insert_into_field_list_sorted (vi, resultvi);
8302 stats.total_vars ++;
8303 if (DECL_RESULT (decl))
8304 - insert_id_for_tree (DECL_RESULT (decl), newindex);
8305 + insert_vi_for_tree (DECL_RESULT (decl), resultvi);
8312 -/* Return true if FIELDSTACK contains fields that overlap.
8313 +/* Return true if FIELDSTACK contains fields that overlap.
8314 FIELDSTACK is assumed to be sorted by offset. */
8317 @@ -4057,12 +4065,12 @@
8319 bool is_global = DECL_P (decl) ? is_global_var (decl) : false;
8320 VEC (fieldoff_s,heap) *fieldstack = NULL;
8323 if (TREE_CODE (decl) == FUNCTION_DECL && in_ipa_mode)
8324 return create_function_info_for (decl, name);
8326 hasunion = TREE_CODE (decltype) == UNION_TYPE
8327 - || TREE_CODE (decltype) == QUAL_UNION_TYPE;
8328 + || TREE_CODE (decltype) == QUAL_UNION_TYPE;
8329 if (var_can_have_subvars (decl) && use_field_sensitive && !hasunion)
8331 push_fields_onto_fieldstack (decltype, &fieldstack, 0, &hasunion);
8332 @@ -4072,12 +4080,12 @@
8339 /* If the variable doesn't have subvars, we may end up needing to
8340 sort the field list and create fake variables for all the
8342 - vi = new_var_info (decl, index, name, index);
8343 + vi = new_var_info (decl, index, name);
8346 vi->has_union = hasunion;
8347 @@ -4095,8 +4103,8 @@
8348 vi->fullsize = TREE_INT_CST_LOW (declsize);
8349 vi->size = vi->fullsize;
8352 - insert_id_for_tree (vi->decl, index);
8354 + insert_vi_for_tree (vi->decl, vi);
8355 VEC_safe_push (varinfo_t, heap, varmap, vi);
8356 if (is_global && (!flag_whole_program || !in_ipa_mode))
8358 @@ -4122,9 +4130,9 @@
8362 - if (use_field_sensitive
8364 - && !vi->is_unknown_size_var
8365 + if (use_field_sensitive
8367 + && !vi->is_unknown_size_var
8368 && var_can_have_subvars (decl)
8369 && VEC_length (fieldoff_s, fieldstack) <= MAX_FIELDS_FOR_FIELD_SENSITIVE)
8371 @@ -4148,7 +4156,7 @@
8372 without creating varinfos for the fields anyway, so sorting them is a
8377 sort_fieldstack (fieldstack);
8378 /* Due to some C++ FE issues, like PR 22488, we might end up
8379 what appear to be overlapping fields even though they,
8380 @@ -4156,8 +4164,8 @@
8381 we will simply disable field-sensitivity for these cases. */
8382 notokay = check_for_overlaps (fieldstack);
8388 if (VEC_length (fieldoff_s, fieldstack) != 0)
8389 fo = VEC_index (fieldoff_s, fieldstack, 0);
8391 @@ -4169,11 +4177,11 @@
8392 VEC_free (fieldoff_s, heap, fieldstack);
8397 vi->size = TREE_INT_CST_LOW (fo->size);
8398 vi->offset = fo->offset;
8399 - for (i = VEC_length (fieldoff_s, fieldstack) - 1;
8400 - i >= 1 && VEC_iterate (fieldoff_s, fieldstack, i, fo);
8401 + for (i = VEC_length (fieldoff_s, fieldstack) - 1;
8402 + i >= 1 && VEC_iterate (fieldoff_s, fieldstack, i, fo);
8406 @@ -4184,15 +4192,15 @@
8410 - asprintf (&tempname, "%s.%s",
8411 + asprintf (&tempname, "%s.%s",
8412 vi->name, alias_get_name (fo->decl));
8414 - asprintf (&tempname, "%s." HOST_WIDE_INT_PRINT_DEC,
8415 + asprintf (&tempname, "%s." HOST_WIDE_INT_PRINT_DEC,
8416 vi->name, fo->offset);
8417 newname = ggc_strdup (tempname);
8420 - newvi = new_var_info (decl, newindex, newname, newindex);
8421 + newvi = new_var_info (decl, newindex, newname);
8422 newvi->offset = fo->offset;
8423 newvi->size = TREE_INT_CST_LOW (fo->size);
8424 newvi->fullsize = vi->fullsize;
8425 @@ -4228,14 +4236,22 @@
8427 varinfo_t vi = get_varinfo (var);
8429 - bitmap_iterator bi;
8431 - fprintf (file, "%s = { ", vi->name);
8432 - EXECUTE_IF_SET_IN_BITMAP (get_varinfo (vi->node)->solution, 0, i, bi)
8433 + bitmap_iterator bi;
8435 + if (find (var) != var)
8437 - fprintf (file, "%s ", get_varinfo (i)->name);
8438 + varinfo_t vipt = get_varinfo (find (var));
8439 + fprintf (file, "%s = same as %s\n", vi->name, vipt->name);
8441 - fprintf (file, "}\n");
8444 + fprintf (file, "%s = { ", vi->name);
8445 + EXECUTE_IF_SET_IN_BITMAP (vi->solution, 0, i, bi)
8447 + fprintf (file, "%s ", get_varinfo (i)->name);
8449 + fprintf (file, "}\n");
8453 /* Print the points-to solution for VAR to stdout. */
8454 @@ -4266,7 +4282,7 @@
8455 if (!could_have_pointers (t))
8458 - arg_id = get_id_for_tree (t);
8459 + arg_id = get_vi_for_tree (t)->id;
8461 /* With flag_argument_noalias greater than two means that the incoming
8462 argument cannot alias anything except for itself so create a HEAP
8463 @@ -4276,11 +4292,10 @@
8466 tree heapvar = heapvar_lookup (t);
8471 - lhs.var = get_id_for_tree (t);
8472 + lhs.var = get_vi_for_tree (t)->id;
8474 if (heapvar == NULL_TREE)
8476 @@ -4291,11 +4306,11 @@
8477 add_referenced_var (heapvar);
8478 heapvar_insert (t, heapvar);
8480 - id = get_id_for_tree (heapvar);
8481 - vi = get_varinfo (id);
8483 + vi = get_vi_for_tree (heapvar);
8484 vi->is_artificial_var = 1;
8485 vi->is_heap_var = 1;
8488 rhs.type = ADDRESSOF;
8490 for (p = get_varinfo (lhs.var); p; p = p->next)
8491 @@ -4366,7 +4381,8 @@
8492 bitmap_set_bit (into, DECL_UID (sv->var));
8494 else if (TREE_CODE (vi->decl) == VAR_DECL
8495 - || TREE_CODE (vi->decl) == PARM_DECL)
8496 + || TREE_CODE (vi->decl) == PARM_DECL
8497 + || TREE_CODE (vi->decl) == RESULT_DECL)
8499 if (var_can_have_subvars (vi->decl)
8500 && get_subvars_for_var (vi->decl))
8501 @@ -4409,8 +4425,8 @@
8503 find_what_p_points_to (tree p)
8505 - unsigned int id = 0;
8509 if (!have_alias_info)
8511 @@ -4422,10 +4438,10 @@
8512 && default_def (SSA_NAME_VAR (p)) == p)
8513 lookup_p = SSA_NAME_VAR (p);
8515 - if (lookup_id_for_tree (lookup_p, &id))
8516 + vi = lookup_vi_for_tree (lookup_p);
8519 - varinfo_t vi = get_varinfo (id);
8522 if (vi->is_artificial_var)
8525 @@ -4447,7 +4463,7 @@
8527 /* This variable may have been collapsed, let's get the real
8529 - vi = get_varinfo (vi->node);
8530 + vi = get_varinfo (find (vi->id));
8532 /* Translate artificial variables into SSA_NAME_PTR_INFO
8534 @@ -4506,13 +4522,16 @@
8536 fprintf (outfile, "Stats:\n");
8537 fprintf (outfile, "Total vars: %d\n", stats.total_vars);
8538 + fprintf (outfile, "Non-pointer vars: %d\n",
8539 + stats.nonpointer_vars);
8540 fprintf (outfile, "Statically unified vars: %d\n",
8541 stats.unified_vars_static);
8542 - fprintf (outfile, "Collapsed vars: %d\n", stats.collapsed_vars);
8543 fprintf (outfile, "Dynamically unified vars: %d\n",
8544 stats.unified_vars_dynamic);
8545 fprintf (outfile, "Iterations: %d\n", stats.iterations);
8546 fprintf (outfile, "Number of edges: %d\n", stats.num_edges);
8547 + fprintf (outfile, "Number of implicit edges: %d\n",
8548 + stats.num_implicit_edges);
8551 for (i = 0; i < VEC_length (varinfo_t, varmap); i++)
8552 @@ -4540,8 +4559,8 @@
8553 /* Create the NULL variable, used to represent that a variable points
8555 nothing_tree = create_tmp_var_raw (void_type_node, "NULL");
8556 - var_nothing = new_var_info (nothing_tree, 0, "NULL", 0);
8557 - insert_id_for_tree (nothing_tree, 0);
8558 + var_nothing = new_var_info (nothing_tree, 0, "NULL");
8559 + insert_vi_for_tree (nothing_tree, var_nothing);
8560 var_nothing->is_artificial_var = 1;
8561 var_nothing->offset = 0;
8562 var_nothing->size = ~0;
8563 @@ -4553,8 +4572,8 @@
8564 /* Create the ANYTHING variable, used to represent that a variable
8565 points to some unknown piece of memory. */
8566 anything_tree = create_tmp_var_raw (void_type_node, "ANYTHING");
8567 - var_anything = new_var_info (anything_tree, 1, "ANYTHING", 1);
8568 - insert_id_for_tree (anything_tree, 1);
8569 + var_anything = new_var_info (anything_tree, 1, "ANYTHING");
8570 + insert_vi_for_tree (anything_tree, var_anything);
8571 var_anything->is_artificial_var = 1;
8572 var_anything->size = ~0;
8573 var_anything->offset = 0;
8574 @@ -4573,7 +4592,6 @@
8575 rhs.type = ADDRESSOF;
8576 rhs.var = anything_id;
8578 - var_anything->address_taken = true;
8580 /* This specifically does not use process_constraint because
8581 process_constraint ignores all anything = anything constraints, since all
8582 @@ -4583,14 +4601,14 @@
8583 /* Create the READONLY variable, used to represent that a variable
8584 points to readonly memory. */
8585 readonly_tree = create_tmp_var_raw (void_type_node, "READONLY");
8586 - var_readonly = new_var_info (readonly_tree, 2, "READONLY", 2);
8587 + var_readonly = new_var_info (readonly_tree, 2, "READONLY");
8588 var_readonly->is_artificial_var = 1;
8589 var_readonly->offset = 0;
8590 var_readonly->size = ~0;
8591 var_readonly->fullsize = ~0;
8592 var_readonly->next = NULL;
8593 var_readonly->is_special_var = 1;
8594 - insert_id_for_tree (readonly_tree, 2);
8595 + insert_vi_for_tree (readonly_tree, var_readonly);
8597 VEC_safe_push (varinfo_t, heap, varmap, var_readonly);
8599 @@ -4610,8 +4628,8 @@
8600 /* Create the INTEGER variable, used to represent that a variable points
8602 integer_tree = create_tmp_var_raw (void_type_node, "INTEGER");
8603 - var_integer = new_var_info (integer_tree, 3, "INTEGER", 3);
8604 - insert_id_for_tree (integer_tree, 3);
8605 + var_integer = new_var_info (integer_tree, 3, "INTEGER");
8606 + insert_vi_for_tree (integer_tree, var_integer);
8607 var_integer->is_artificial_var = 1;
8608 var_integer->size = ~0;
8609 var_integer->fullsize = ~0;
8610 @@ -4634,8 +4652,8 @@
8611 /* Create the ESCAPED_VARS variable used to represent variables that
8612 escape this function. */
8613 escaped_vars_tree = create_tmp_var_raw (void_type_node, "ESCAPED_VARS");
8614 - var_escaped_vars = new_var_info (escaped_vars_tree, 4, "ESCAPED_VARS", 4);
8615 - insert_id_for_tree (escaped_vars_tree, 4);
8616 + var_escaped_vars = new_var_info (escaped_vars_tree, 4, "ESCAPED_VARS");
8617 + insert_vi_for_tree (escaped_vars_tree, var_escaped_vars);
8618 var_escaped_vars->is_artificial_var = 1;
8619 var_escaped_vars->size = ~0;
8620 var_escaped_vars->fullsize = ~0;
8621 @@ -4660,21 +4678,19 @@
8623 init_alias_vars (void)
8625 - bitmap_obstack_initialize (&ptabitmap_obstack);
8626 + bitmap_obstack_initialize (&pta_obstack);
8627 + bitmap_obstack_initialize (&oldpta_obstack);
8628 bitmap_obstack_initialize (&predbitmap_obstack);
8630 - constraint_pool = create_alloc_pool ("Constraint pool",
8631 + constraint_pool = create_alloc_pool ("Constraint pool",
8632 sizeof (struct constraint), 30);
8633 variable_info_pool = create_alloc_pool ("Variable info pool",
8634 sizeof (struct variable_info), 30);
8635 - constraint_edge_pool = create_alloc_pool ("Constraint edges",
8636 - sizeof (struct constraint_edge), 30);
8638 constraints = VEC_alloc (constraint_t, heap, 8);
8639 varmap = VEC_alloc (varinfo_t, heap, 8);
8640 - id_for_tree = htab_create (10, tree_id_hash, tree_id_eq, free);
8641 + vi_for_tree = pointer_map_create ();
8643 memset (&stats, 0, sizeof (stats));
8648 @@ -4777,6 +4793,43 @@
8649 VEC_free (ce_s, heap, rhsc);
8653 +/* Remove the REF and ADDRESS edges from GRAPH, as well as all the
8654 + predecessor edges. */
8657 +remove_preds_and_fake_succs (constraint_graph_t graph)
8661 + /* Clear the implicit ref and address nodes from the successor
8663 + for (i = 0; i < FIRST_REF_NODE; i++)
8665 + if (graph->succs[i])
8666 + bitmap_clear_range (graph->succs[i], FIRST_REF_NODE,
8667 + FIRST_REF_NODE * 2);
8670 + /* Free the successor list for the non-ref nodes. */
8671 + for (i = FIRST_REF_NODE; i < graph->size; i++)
8673 + if (graph->succs[i])
8674 + BITMAP_FREE (graph->succs[i]);
8677 + /* Now reallocate the size of the successor list as, and blow away
8678 + the predecessor bitmaps. */
8679 + graph->size = VEC_length (varinfo_t, varmap);
8680 + graph->succs = xrealloc (graph->succs, graph->size * sizeof (bitmap));
8682 + free (graph->implicit_preds);
8683 + graph->implicit_preds = NULL;
8684 + free (graph->preds);
8685 + graph->preds = NULL;
8686 + bitmap_obstack_release (&predbitmap_obstack);
8689 /* Create points-to sets for the current function. See the comments
8690 at the start of the file for an algorithmic overview. */
8692 @@ -4784,11 +4837,13 @@
8693 compute_points_to_sets (struct alias_info *ai)
8696 + struct scc_info *si;
8698 timevar_push (TV_TREE_PTA);
8702 + init_alias_heapvars ();
8704 intra_create_variable_infos ();
8706 /* Now walk all statements and derive aliases. */
8707 @@ -4824,36 +4879,42 @@
8711 - build_constraint_graph ();
8715 fprintf (dump_file, "Points-to analysis\n\nConstraints:\n\n");
8716 dump_constraints (dump_file);
8722 "\nCollapsing static cycles and doing variable "
8725 - find_and_collapse_graph_cycles (graph, false);
8726 - perform_var_substitution (graph);
8729 + build_pred_graph ();
8730 + si = perform_var_substitution (graph);
8731 + move_complex_constraints (graph, si);
8732 + free_var_substitution_info (si);
8734 + build_succ_graph ();
8735 + find_indirect_cycles (graph);
8737 + /* Implicit nodes and predecessors are no longer necessary at this
8739 + remove_preds_and_fake_succs (graph);
8742 fprintf (dump_file, "\nSolving graph:\n");
8745 solve_graph (graph);
8749 dump_sa_points_to_info (dump_file);
8751 have_alias_info = true;
8753 timevar_pop (TV_TREE_PTA);
8757 /* Delete created points-to sets. */
8760 @@ -4861,33 +4922,27 @@
8765 - htab_delete (id_for_tree);
8766 - bitmap_obstack_release (&ptabitmap_obstack);
8767 - bitmap_obstack_release (&predbitmap_obstack);
8769 + if (dump_file && (dump_flags & TDF_STATS))
8770 + fprintf (dump_file, "Points to sets created:%d\n",
8771 + stats.points_to_sets_created);
8773 + pointer_map_destroy (vi_for_tree);
8774 + bitmap_obstack_release (&pta_obstack);
8775 VEC_free (constraint_t, heap, constraints);
8778 for (i = 0; VEC_iterate (varinfo_t, varmap, i, v); i++)
8780 - /* Nonlocal vars may add more varinfos. */
8781 - if (i >= graph_size)
8783 + VEC_free (constraint_t, heap, graph->complex[i]);
8784 + free (graph->complex);
8786 - VEC_free (constraint_edge_t, heap, graph->succs[i]);
8787 - VEC_free (constraint_edge_t, heap, graph->preds[i]);
8788 - VEC_free (constraint_t, heap, v->complex);
8790 - free (graph->zero_weight_preds);
8791 - free (graph->zero_weight_succs);
8792 + free (graph->rep);
8793 free (graph->succs);
8794 - free (graph->preds);
8795 + free (graph->indirect_cycles);
8798 VEC_free (varinfo_t, heap, varmap);
8799 free_alloc_pool (variable_info_pool);
8800 - free_alloc_pool (constraint_pool);
8801 - free_alloc_pool (constraint_edge_pool);
8803 + free_alloc_pool (constraint_pool);
8804 have_alias_info = false;
8807 @@ -4905,6 +4960,7 @@
8809 ipa_pta_execute (void)
8812 struct cgraph_node *node;
8814 init_alias_heapvars ();
8815 @@ -4994,6 +5050,7 @@
8817 delete_alias_heapvars ();
8818 delete_points_to_sets ();
8823 @@ -5018,8 +5075,9 @@
8825 init_alias_heapvars (void)
8827 - heapvar_for_stmt = htab_create_ggc (11, tree_map_hash, tree_map_eq,
8829 + if (!heapvar_for_stmt)
8830 + heapvar_for_stmt = htab_create_ggc (11, tree_map_hash, tree_map_eq,
8832 nonlocal_all = NULL_TREE;
8835 @@ -5028,7 +5086,7 @@
8837 nonlocal_all = NULL_TREE;
8838 htab_delete (heapvar_for_stmt);
8839 + heapvar_for_stmt = NULL;
8843 #include "gt-tree-ssa-structalias.h"
8844 Index: gcc/config/sparc/sparc.c
8845 ===================================================================
8846 --- gcc/config/sparc/sparc.c (.../tags/gcc_4_2_0_release) (revision 126002)
8847 +++ gcc/config/sparc/sparc.c (.../branches/gcc-4_2-branch) (revision 126002)
8849 error ("-mcmodel= is not supported on 32 bit systems");
8852 - fpu = TARGET_FPU; /* save current -mfpu status */
8853 + fpu = target_flags & MASK_FPU; /* save current -mfpu status */
8855 /* Set the default CPU. */
8856 for (def = &cpu_default[0]; def->name; ++def)
8857 @@ -7968,8 +7968,10 @@
8858 Expand builtin functions for sparc intrinsics. */
8861 -sparc_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED,
8862 - enum machine_mode tmode, int ignore ATTRIBUTE_UNUSED)
8863 +sparc_expand_builtin (tree exp, rtx target,
8864 + rtx subtarget ATTRIBUTE_UNUSED,
8865 + enum machine_mode tmode ATTRIBUTE_UNUSED,
8866 + int ignore ATTRIBUTE_UNUSED)
8869 tree fndecl = TREE_OPERAND (TREE_OPERAND (exp, 0), 0);
8870 @@ -7978,14 +7980,13 @@
8871 enum machine_mode mode[4];
8874 - mode[arg_count] = tmode;
8877 - || GET_MODE (target) != tmode
8878 - || ! (*insn_data[icode].operand[0].predicate) (target, tmode))
8879 - op[arg_count] = gen_reg_rtx (tmode);
8880 + mode[0] = insn_data[icode].operand[0].mode;
8882 + || GET_MODE (target) != mode[0]
8883 + || ! (*insn_data[icode].operand[0].predicate) (target, mode[0]))
8884 + op[0] = gen_reg_rtx (mode[0]);
8886 - op[arg_count] = target;
8889 for (arglist = TREE_OPERAND (exp, 1); arglist;
8890 arglist = TREE_CHAIN (arglist))
8891 @@ -8101,11 +8102,11 @@
8893 tree arg0, arg1, arg2;
8894 tree rtype = TREE_TYPE (TREE_TYPE (fndecl));
8897 - if (ignore && DECL_FUNCTION_CODE (fndecl) != CODE_FOR_alignaddrsi_vis
8899 + && DECL_FUNCTION_CODE (fndecl) != CODE_FOR_alignaddrsi_vis
8900 && DECL_FUNCTION_CODE (fndecl) != CODE_FOR_alignaddrdi_vis)
8901 - return build_int_cst (rtype, 0);
8902 + return fold_convert (rtype, integer_zero_node);
8904 switch (DECL_FUNCTION_CODE (fndecl))
8906 @@ -8219,6 +8220,7 @@
8914 Index: gcc/config/i386/i386.h
8915 ===================================================================
8916 --- gcc/config/i386/i386.h (.../tags/gcc_4_2_0_release) (revision 126002)
8917 +++ gcc/config/i386/i386.h (.../branches/gcc-4_2-branch) (revision 126002)
8918 @@ -2164,7 +2164,8 @@
8920 enum ix86_stack_slot
8928 Index: gcc/config/i386/i386.md
8929 ===================================================================
8930 --- gcc/config/i386/i386.md (.../tags/gcc_4_2_0_release) (revision 126002)
8931 +++ gcc/config/i386/i386.md (.../branches/gcc-4_2-branch) (revision 126002)
8932 @@ -3716,7 +3716,7 @@
8936 - rtx temp = assign_386_stack_local (SFmode, SLOT_TEMP);
8937 + rtx temp = assign_386_stack_local (SFmode, SLOT_VIRTUAL);
8938 emit_insn (gen_truncdfsf2_with_temp (operands[0], operands[1], temp));
8941 @@ -3868,7 +3868,7 @@
8945 - operands[2] = assign_386_stack_local (SFmode, SLOT_TEMP);
8946 + operands[2] = assign_386_stack_local (SFmode, SLOT_VIRTUAL);
8949 (define_insn "*truncxfsf2_mixed"
8950 @@ -3966,7 +3966,7 @@
8954 - operands[2] = assign_386_stack_local (DFmode, SLOT_TEMP);
8955 + operands[2] = assign_386_stack_local (DFmode, SLOT_VIRTUAL);
8958 (define_insn "*truncxfdf2_mixed"
8959 @@ -4749,7 +4749,7 @@
8960 (define_insn "*addti3_1"
8961 [(set (match_operand:TI 0 "nonimmediate_operand" "=r,o")
8962 (plus:TI (match_operand:TI 1 "nonimmediate_operand" "%0,0")
8963 - (match_operand:TI 2 "general_operand" "roiF,riF")))
8964 + (match_operand:TI 2 "x86_64_general_operand" "roe,re")))
8965 (clobber (reg:CC FLAGS_REG))]
8966 "TARGET_64BIT && ix86_binary_operator_ok (PLUS, TImode, operands)"
8968 @@ -4757,7 +4757,7 @@
8970 [(set (match_operand:TI 0 "nonimmediate_operand" "")
8971 (plus:TI (match_operand:TI 1 "nonimmediate_operand" "")
8972 - (match_operand:TI 2 "general_operand" "")))
8973 + (match_operand:TI 2 "x86_64_general_operand" "")))
8974 (clobber (reg:CC FLAGS_REG))]
8975 "TARGET_64BIT && reload_completed"
8976 [(parallel [(set (reg:CC FLAGS_REG) (unspec:CC [(match_dup 1) (match_dup 2)]
8977 @@ -6483,7 +6483,7 @@
8978 (define_insn "*subti3_1"
8979 [(set (match_operand:TI 0 "nonimmediate_operand" "=r,o")
8980 (minus:TI (match_operand:TI 1 "nonimmediate_operand" "0,0")
8981 - (match_operand:TI 2 "general_operand" "roiF,riF")))
8982 + (match_operand:TI 2 "x86_64_general_operand" "roe,re")))
8983 (clobber (reg:CC FLAGS_REG))]
8984 "TARGET_64BIT && ix86_binary_operator_ok (MINUS, TImode, operands)"
8986 @@ -6491,7 +6491,7 @@
8988 [(set (match_operand:TI 0 "nonimmediate_operand" "")
8989 (minus:TI (match_operand:TI 1 "nonimmediate_operand" "")
8990 - (match_operand:TI 2 "general_operand" "")))
8991 + (match_operand:TI 2 "x86_64_general_operand" "")))
8992 (clobber (reg:CC FLAGS_REG))]
8993 "TARGET_64BIT && reload_completed"
8994 [(parallel [(set (reg:CC FLAGS_REG) (compare:CC (match_dup 1) (match_dup 2)))
8995 @@ -9326,7 +9326,7 @@
8997 (define_insn "*negti2_1"
8998 [(set (match_operand:TI 0 "nonimmediate_operand" "=ro")
8999 - (neg:TI (match_operand:TI 1 "general_operand" "0")))
9000 + (neg:TI (match_operand:TI 1 "nonimmediate_operand" "0")))
9001 (clobber (reg:CC FLAGS_REG))]
9003 && ix86_unary_operator_ok (NEG, TImode, operands)"
9004 @@ -9334,7 +9334,7 @@
9007 [(set (match_operand:TI 0 "nonimmediate_operand" "")
9008 - (neg:TI (match_operand:TI 1 "general_operand" "")))
9009 + (neg:TI (match_operand:TI 1 "nonimmediate_operand" "")))
9010 (clobber (reg:CC FLAGS_REG))]
9011 "TARGET_64BIT && reload_completed"
9013 Index: gcc/config/i386/sse.md
9014 ===================================================================
9015 --- gcc/config/i386/sse.md (.../tags/gcc_4_2_0_release) (revision 126002)
9016 +++ gcc/config/i386/sse.md (.../branches/gcc-4_2-branch) (revision 126002)
9017 @@ -2055,11 +2055,11 @@
9019 (parallel [(const_int 0)
9021 - "TARGET_SSE3 && !(MEM_P (operands[1]) && MEM_P (operands[2]))"
9022 + "TARGET_SSE3 && !(MEM_P (operands[0]) && MEM_P (operands[1]))"
9024 movddup\t{%1, %0|%0, %1}
9026 - [(set_attr "type" "sselog,ssemov")
9027 + [(set_attr "type" "sselog1,ssemov")
9028 (set_attr "mode" "V2DF")])
9031 @@ -3494,9 +3494,10 @@
9032 "TARGET_SSE2 && !(MEM_P (operands[0]) && MEM_P (operands[1]))"
9034 movhps\t{%1, %0|%0, %1}
9035 - psrldq\t{$4, %0|%0, 4}
9036 + psrldq\t{$8, %0|%0, 8}
9037 movq\t{%H1, %0|%0, %H1}"
9038 [(set_attr "type" "ssemov,sseishft,ssemov")
9039 + (set_attr "memory" "*,none,*")
9040 (set_attr "mode" "V2SF,TI,TI")])
9042 ;; Not sure this is ever used, but it doesn't hurt to have it. -aoliva
9043 Index: gcc/config/i386/i386.c
9044 ===================================================================
9045 --- gcc/config/i386/i386.c (.../tags/gcc_4_2_0_release) (revision 126002)
9046 +++ gcc/config/i386/i386.c (.../branches/gcc-4_2-branch) (revision 126002)
9047 @@ -13478,6 +13478,9 @@
9049 gcc_assert (n < MAX_386_STACK_LOCALS);
9051 + /* Virtual slot is valid only before vregs are instantiated. */
9052 + gcc_assert ((n == SLOT_VIRTUAL) == !virtuals_instantiated);
9054 for (s = ix86_stack_locals; s; s = s->next)
9055 if (s->mode == mode && s->n == n)
9057 @@ -14567,6 +14570,7 @@
9058 IX86_BUILTIN_VEC_EXT_V4SF,
9059 IX86_BUILTIN_VEC_EXT_V4SI,
9060 IX86_BUILTIN_VEC_EXT_V8HI,
9061 + IX86_BUILTIN_VEC_EXT_V16QI,
9062 IX86_BUILTIN_VEC_EXT_V2SI,
9063 IX86_BUILTIN_VEC_EXT_V4HI,
9064 IX86_BUILTIN_VEC_SET_V8HI,
9065 @@ -15539,13 +15543,13 @@
9066 /* Access to the vec_extract patterns. */
9067 ftype = build_function_type_list (double_type_node, V2DF_type_node,
9068 integer_type_node, NULL_TREE);
9069 - def_builtin (MASK_SSE, "__builtin_ia32_vec_ext_v2df",
9070 + def_builtin (MASK_SSE2, "__builtin_ia32_vec_ext_v2df",
9071 ftype, IX86_BUILTIN_VEC_EXT_V2DF);
9073 ftype = build_function_type_list (long_long_integer_type_node,
9074 V2DI_type_node, integer_type_node,
9076 - def_builtin (MASK_SSE, "__builtin_ia32_vec_ext_v2di",
9077 + def_builtin (MASK_SSE2, "__builtin_ia32_vec_ext_v2di",
9078 ftype, IX86_BUILTIN_VEC_EXT_V2DI);
9080 ftype = build_function_type_list (float_type_node, V4SF_type_node,
9081 @@ -15555,12 +15559,12 @@
9083 ftype = build_function_type_list (intSI_type_node, V4SI_type_node,
9084 integer_type_node, NULL_TREE);
9085 - def_builtin (MASK_SSE, "__builtin_ia32_vec_ext_v4si",
9086 + def_builtin (MASK_SSE2, "__builtin_ia32_vec_ext_v4si",
9087 ftype, IX86_BUILTIN_VEC_EXT_V4SI);
9089 ftype = build_function_type_list (intHI_type_node, V8HI_type_node,
9090 integer_type_node, NULL_TREE);
9091 - def_builtin (MASK_SSE, "__builtin_ia32_vec_ext_v8hi",
9092 + def_builtin (MASK_SSE2, "__builtin_ia32_vec_ext_v8hi",
9093 ftype, IX86_BUILTIN_VEC_EXT_V8HI);
9095 ftype = build_function_type_list (intHI_type_node, V4HI_type_node,
9096 @@ -15573,11 +15577,15 @@
9097 def_builtin (MASK_MMX, "__builtin_ia32_vec_ext_v2si",
9098 ftype, IX86_BUILTIN_VEC_EXT_V2SI);
9100 + ftype = build_function_type_list (intQI_type_node, V16QI_type_node,
9101 + integer_type_node, NULL_TREE);
9102 + def_builtin (MASK_SSE2, "__builtin_ia32_vec_ext_v16qi", ftype, IX86_BUILTIN_VEC_EXT_V16QI);
9104 /* Access to the vec_set patterns. */
9105 ftype = build_function_type_list (V8HI_type_node, V8HI_type_node,
9107 integer_type_node, NULL_TREE);
9108 - def_builtin (MASK_SSE, "__builtin_ia32_vec_set_v8hi",
9109 + def_builtin (MASK_SSE2, "__builtin_ia32_vec_set_v8hi",
9110 ftype, IX86_BUILTIN_VEC_SET_V8HI);
9112 ftype = build_function_type_list (V4HI_type_node, V4HI_type_node,
9113 @@ -16121,13 +16129,13 @@
9115 case IX86_BUILTIN_LDMXCSR:
9116 op0 = expand_normal (TREE_VALUE (arglist));
9117 - target = assign_386_stack_local (SImode, SLOT_TEMP);
9118 + target = assign_386_stack_local (SImode, SLOT_VIRTUAL);
9119 emit_move_insn (target, op0);
9120 emit_insn (gen_sse_ldmxcsr (target));
9123 case IX86_BUILTIN_STMXCSR:
9124 - target = assign_386_stack_local (SImode, SLOT_TEMP);
9125 + target = assign_386_stack_local (SImode, SLOT_VIRTUAL);
9126 emit_insn (gen_sse_stmxcsr (target));
9127 return copy_to_mode_reg (SImode, target);
9129 @@ -16489,6 +16497,7 @@
9130 case IX86_BUILTIN_VEC_EXT_V4SF:
9131 case IX86_BUILTIN_VEC_EXT_V4SI:
9132 case IX86_BUILTIN_VEC_EXT_V8HI:
9133 + case IX86_BUILTIN_VEC_EXT_V16QI:
9134 case IX86_BUILTIN_VEC_EXT_V2SI:
9135 case IX86_BUILTIN_VEC_EXT_V4HI:
9136 return ix86_expand_vec_ext_builtin (arglist, target);
9137 Index: gcc/config/sh/sh.c
9138 ===================================================================
9139 --- gcc/config/sh/sh.c (.../tags/gcc_4_2_0_release) (revision 126002)
9140 +++ gcc/config/sh/sh.c (.../branches/gcc-4_2-branch) (revision 126002)
9141 @@ -5295,7 +5295,13 @@
9142 temp = scavenge_reg (&temps);
9144 if (temp < 0 && live_regs_mask)
9145 - temp = scavenge_reg (live_regs_mask);
9147 + HARD_REG_SET temps;
9149 + COPY_HARD_REG_SET (temps, *live_regs_mask);
9150 + CLEAR_HARD_REG_BIT (temps, REGNO (reg));
9151 + temp = scavenge_reg (&temps);
9155 rtx adj_reg, tmp_reg, mem;
9156 @@ -5344,6 +5350,9 @@
9157 emit_move_insn (adj_reg, mem);
9158 mem = gen_tmp_stack_mem (Pmode, gen_rtx_POST_INC (Pmode, reg));
9159 emit_move_insn (tmp_reg, mem);
9160 + /* Tell flow the insns that pop r4/r5 aren't dead. */
9161 + emit_insn (gen_rtx_USE (VOIDmode, tmp_reg));
9162 + emit_insn (gen_rtx_USE (VOIDmode, adj_reg));
9165 const_reg = gen_rtx_REG (GET_MODE (reg), temp);
9166 @@ -8618,7 +8627,7 @@
9168 && get_attr_type (insn) == TYPE_DYN_SHIFT
9169 && get_attr_any_int_load (dep_insn) == ANY_INT_LOAD_YES
9170 - && reg_overlap_mentioned_p (SET_DEST (PATTERN (dep_insn)),
9171 + && reg_overlap_mentioned_p (SET_DEST (single_set (dep_insn)),
9172 XEXP (SET_SRC (single_set (insn)),
9175 Index: gcc/config/sh/sh.md
9176 ===================================================================
9177 --- gcc/config/sh/sh.md (.../tags/gcc_4_2_0_release) (revision 126002)
9178 +++ gcc/config/sh/sh.md (.../branches/gcc-4_2-branch) (revision 126002)
9179 @@ -413,10 +413,12 @@
9180 (eq_attr "type" "jump")
9181 (cond [(eq_attr "med_branch_p" "yes")
9183 - (and (eq (symbol_ref "GET_CODE (prev_nonnote_insn (insn))")
9184 - (symbol_ref "INSN"))
9185 - (eq (symbol_ref "INSN_CODE (prev_nonnote_insn (insn))")
9186 - (symbol_ref "code_for_indirect_jump_scratch")))
9187 + (and (ne (symbol_ref "prev_nonnote_insn (insn)")
9189 + (and (eq (symbol_ref "GET_CODE (prev_nonnote_insn (insn))")
9190 + (symbol_ref "INSN"))
9191 + (eq (symbol_ref "INSN_CODE (prev_nonnote_insn (insn))")
9192 + (symbol_ref "code_for_indirect_jump_scratch"))))
9193 (cond [(eq_attr "braf_branch_p" "yes")
9195 (eq (symbol_ref "flag_pic") (const_int 0))
9196 @@ -750,54 +752,6 @@
9197 (set_attr "type" "arith3")])
9199 (define_insn "cmpeqsi_media"
9200 - [(set (match_operand:DI 0 "register_operand" "=r")
9201 - (eq:DI (match_operand:SI 1 "logical_operand" "%r")
9202 - (match_operand:SI 2 "cmp_operand" "Nr")))]
9204 - "cmpeq %1, %N2, %0"
9205 - [(set_attr "type" "cmp_media")])
9207 -(define_insn "cmpeqdi_media"
9208 - [(set (match_operand:DI 0 "register_operand" "=r")
9209 - (eq:DI (match_operand:DI 1 "register_operand" "%r")
9210 - (match_operand:DI 2 "cmp_operand" "Nr")))]
9212 - "cmpeq %1, %N2, %0"
9213 - [(set_attr "type" "cmp_media")])
9215 -(define_insn "cmpgtsi_media"
9216 - [(set (match_operand:DI 0 "register_operand" "=r")
9217 - (gt:DI (match_operand:SI 1 "cmp_operand" "Nr")
9218 - (match_operand:SI 2 "cmp_operand" "rN")))]
9220 - "cmpgt %N1, %N2, %0"
9221 - [(set_attr "type" "cmp_media")])
9223 -(define_insn "cmpgtdi_media"
9224 - [(set (match_operand:DI 0 "register_operand" "=r")
9225 - (gt:DI (match_operand:DI 1 "arith_reg_or_0_operand" "Nr")
9226 - (match_operand:DI 2 "arith_reg_or_0_operand" "rN")))]
9228 - "cmpgt %N1, %N2, %0"
9229 - [(set_attr "type" "cmp_media")])
9231 -(define_insn "cmpgtusi_media"
9232 - [(set (match_operand:DI 0 "register_operand" "=r")
9233 - (gtu:DI (match_operand:SI 1 "cmp_operand" "Nr")
9234 - (match_operand:SI 2 "cmp_operand" "rN")))]
9236 - "cmpgtu %N1, %N2, %0"
9237 - [(set_attr "type" "cmp_media")])
9239 -(define_insn "cmpgtudi_media"
9240 - [(set (match_operand:DI 0 "register_operand" "=r")
9241 - (gtu:DI (match_operand:DI 1 "arith_reg_or_0_operand" "Nr")
9242 - (match_operand:DI 2 "arith_reg_or_0_operand" "rN")))]
9244 - "cmpgtu %N1, %N2, %0"
9245 - [(set_attr "type" "cmp_media")])
9247 -(define_insn "cmpsieqsi_media"
9248 [(set (match_operand:SI 0 "register_operand" "=r")
9249 (eq:SI (match_operand:SI 1 "logical_operand" "%r")
9250 (match_operand:SI 2 "cmp_operand" "Nr")))]
9253 [(set_attr "type" "cmp_media")])
9255 -(define_insn "cmpsieqdi_media"
9256 +(define_insn "cmpeqdi_media"
9257 [(set (match_operand:SI 0 "register_operand" "=r")
9258 (eq:SI (match_operand:DI 1 "register_operand" "%r")
9259 (match_operand:DI 2 "cmp_operand" "Nr")))]
9262 [(set_attr "type" "cmp_media")])
9264 -(define_insn "cmpsigtsi_media"
9265 +(define_insn "cmpgtsi_media"
9266 [(set (match_operand:SI 0 "register_operand" "=r")
9267 (gt:SI (match_operand:SI 1 "cmp_operand" "Nr")
9268 (match_operand:SI 2 "cmp_operand" "rN")))]
9270 "cmpgt %N1, %N2, %0"
9271 [(set_attr "type" "cmp_media")])
9273 -(define_insn "cmpsigtdi_media"
9274 +(define_insn "cmpgtdi_media"
9275 [(set (match_operand:SI 0 "register_operand" "=r")
9276 (gt:SI (match_operand:DI 1 "arith_reg_or_0_operand" "Nr")
9277 (match_operand:DI 2 "arith_reg_or_0_operand" "rN")))]
9279 "cmpgt %N1, %N2, %0"
9280 [(set_attr "type" "cmp_media")])
9282 -(define_insn "cmpsigtusi_media"
9283 +(define_insn "cmpgtusi_media"
9284 [(set (match_operand:SI 0 "register_operand" "=r")
9285 (gtu:SI (match_operand:SI 1 "cmp_operand" "Nr")
9286 (match_operand:SI 2 "cmp_operand" "rN")))]
9288 "cmpgtu %N1, %N2, %0"
9289 [(set_attr "type" "cmp_media")])
9291 -(define_insn "cmpsigtudi_media"
9292 +(define_insn "cmpgtudi_media"
9293 [(set (match_operand:SI 0 "register_operand" "=r")
9294 (gtu:SI (match_operand:DI 1 "arith_reg_or_0_operand" "Nr")
9295 (match_operand:DI 2 "arith_reg_or_0_operand" "rN")))]
9296 @@ -846,13 +800,6 @@
9297 [(set_attr "type" "cmp_media")])
9299 ; These two patterns are for combine.
9300 -(define_insn "*cmpne0si_media"
9301 - [(set (match_operand:DI 0 "register_operand" "=r")
9302 - (ne:DI (match_operand:SI 1 "arith_reg_operand" "r") (const_int 0)))]
9304 - "cmpgtu %1,r63,%0"
9305 - [(set_attr "type" "cmp_media")])
9307 (define_insn "*cmpne0sisi_media"
9308 [(set (match_operand:SI 0 "register_operand" "=r")
9309 (ne:SI (match_operand:SI 1 "arith_reg_operand" "r") (const_int 0)))]
9310 @@ -1177,7 +1124,7 @@
9312 emit_insn (gen_movsicc_false (operands[0], operands[1], operands[2],
9314 - emit_insn (gen_cmpsigtusi_media (operands[5], operands[4], operands[0]));
9315 + emit_insn (gen_cmpgtusi_media (operands[5], operands[4], operands[0]));
9316 emit_insn (gen_movsicc_false (operands[0], operands[5], operands[4],
9319 @@ -7200,7 +7147,7 @@
9322 (define_expand "bunordered"
9323 - [(set (match_dup 1) (unordered:DI (match_dup 2) (match_dup 3)))
9324 + [(set (match_dup 1) (unordered:SI (match_dup 2) (match_dup 3)))
9326 (if_then_else (ne (match_dup 1) (const_int 0))
9327 (match_operand 0 "" "")
9328 @@ -7209,7 +7156,7 @@
9331 operands[0] = gen_rtx_LABEL_REF (Pmode, operands[0]);
9332 - operands[1] = gen_reg_rtx (DImode);
9333 + operands[1] = gen_reg_rtx (SImode);
9334 operands[2] = force_reg (GET_MODE (sh_compare_op0), sh_compare_op0);
9335 operands[3] = force_reg (GET_MODE (sh_compare_op1), sh_compare_op1);
9337 @@ -8397,6 +8344,20 @@
9339 gen_rtx_REG (Pmode, PIC_REG)));
9341 + /* When stack protector inserts codes after the result is set to
9342 + R0, @(rX, r12) will cause a spill failure for R0. Don't schedule
9343 + insns to avoid combining (set A (plus rX r12)) and (set op0 (mem A))
9344 + when rX is a GOT address for the guard symbol. Ugly but doesn't
9345 + matter because this is a rare situation. */
9346 + if (!TARGET_SHMEDIA
9347 + && flag_stack_protect
9348 + && GET_CODE (operands[1]) == CONST
9349 + && GET_CODE (XEXP (operands[1], 0)) == UNSPEC
9350 + && GET_CODE (XVECEXP (XEXP (operands[1], 0), 0, 0)) == SYMBOL_REF
9351 + && strcmp (XSTR (XVECEXP (XEXP (operands[1], 0), 0, 0), 0),
9352 + \"__stack_chk_guard\") == 0)
9353 + emit_insn (gen_blockage ());
9355 /* N.B. This is not constant for a GOTPLT relocation. */
9356 mem = gen_rtx_MEM (Pmode, operands[3]);
9357 MEM_NOTRAP_P (mem) = 1;
9358 @@ -9112,6 +9073,8 @@
9364 sh_compare_op0 = force_reg (GET_MODE (sh_compare_op0), sh_compare_op0);
9365 if (sh_compare_op1 != const0_rtx)
9366 sh_compare_op1 = force_reg (GET_MODE (sh_compare_op1) == VOIDmode
9367 @@ -9126,26 +9089,26 @@
9368 switch (GET_MODE (sh_compare_op0))
9371 - emit_insn (gen_cmpsieqsi_media (operands[0],
9372 + emit_insn (gen_cmpeqsi_media (operands[0],
9373 sh_compare_op0, sh_compare_op1));
9377 - emit_insn (gen_cmpsieqdi_media (operands[0],
9378 + emit_insn (gen_cmpeqdi_media (operands[0],
9379 sh_compare_op0, sh_compare_op1));
9383 if (! TARGET_SHMEDIA_FPU)
9385 - emit_insn (gen_cmpsieqsf_media (operands[0],
9386 + emit_insn (gen_cmpeqsf_media (operands[0],
9387 sh_compare_op0, sh_compare_op1));
9391 if (! TARGET_SHMEDIA_FPU)
9393 - emit_insn (gen_cmpsieqdf_media (operands[0],
9394 + emit_insn (gen_cmpeqdf_media (operands[0],
9395 sh_compare_op0, sh_compare_op1));
9398 @@ -9155,38 +9118,44 @@
9402 - if (GET_MODE (operands[0]) != DImode)
9403 - operands[0] = gen_rtx_SUBREG (DImode, operands[0], 0);
9404 + reg = operands[0];
9405 + if (GET_MODE (operands[0]) != SImode)
9406 + reg = no_new_pseudos ? gen_rtx_SUBREG (SImode, operands[0], 0)
9407 + : gen_reg_rtx (SImode);
9409 switch (GET_MODE (sh_compare_op0))
9412 - emit_insn (gen_cmpeqsi_media (operands[0],
9413 + emit_insn (gen_cmpeqsi_media (reg,
9414 sh_compare_op0, sh_compare_op1));
9418 - emit_insn (gen_cmpeqdi_media (operands[0],
9419 + emit_insn (gen_cmpeqdi_media (reg,
9420 sh_compare_op0, sh_compare_op1));
9424 if (! TARGET_SHMEDIA_FPU)
9426 - emit_insn (gen_cmpeqsf_media (operands[0],
9427 + emit_insn (gen_cmpeqsf_media (reg,
9428 sh_compare_op0, sh_compare_op1));
9432 if (! TARGET_SHMEDIA_FPU)
9434 - emit_insn (gen_cmpeqdf_media (operands[0],
9435 + emit_insn (gen_cmpeqdf_media (reg,
9436 sh_compare_op0, sh_compare_op1));
9443 + if (GET_MODE (operands[0]) == DImode)
9444 + emit_insn (gen_extendsidi2 (operands[0], reg));
9448 if (sh_expand_t_scc (EQ, operands[0]))
9449 @@ -9204,8 +9173,8 @@
9453 - if (GET_MODE (operands[0]) != DImode)
9454 - operands[0] = gen_rtx_SUBREG (DImode, operands[0], 0);
9457 sh_compare_op0 = force_reg (GET_MODE (sh_compare_op0), sh_compare_op0);
9458 if (sh_compare_op1 != const0_rtx)
9459 sh_compare_op1 = force_reg (GET_MODE (sh_compare_op1) == VOIDmode
9460 @@ -9213,35 +9182,44 @@
9461 : GET_MODE (sh_compare_op1),
9464 + reg = operands[0];
9465 + if (GET_MODE (operands[0]) != SImode)
9466 + reg = no_new_pseudos ? gen_rtx_SUBREG (SImode, operands[0], 0)
9467 + : gen_reg_rtx (SImode);
9469 switch (GET_MODE (sh_compare_op0))
9472 - emit_insn (gen_cmpgtsi_media (operands[0],
9473 + emit_insn (gen_cmpgtsi_media (reg,
9474 sh_compare_op1, sh_compare_op0));
9478 - emit_insn (gen_cmpgtdi_media (operands[0],
9479 + emit_insn (gen_cmpgtdi_media (reg,
9480 sh_compare_op1, sh_compare_op0));
9484 if (! TARGET_SHMEDIA_FPU)
9486 - emit_insn (gen_cmpgtsf_media (operands[0],
9487 + emit_insn (gen_cmpgtsf_media (reg,
9488 sh_compare_op1, sh_compare_op0));
9492 if (! TARGET_SHMEDIA_FPU)
9494 - emit_insn (gen_cmpgtdf_media (operands[0],
9495 + emit_insn (gen_cmpgtdf_media (reg,
9496 sh_compare_op1, sh_compare_op0));
9503 + if (GET_MODE (operands[0]) == DImode)
9504 + emit_insn (gen_extendsidi2 (operands[0], reg));
9508 if (! currently_expanding_to_rtl)
9509 @@ -9258,8 +9236,8 @@
9513 - if (GET_MODE (operands[0]) != DImode)
9514 - operands[0] = gen_rtx_SUBREG (DImode, operands[0], 0);
9517 sh_compare_op0 = force_reg (GET_MODE (sh_compare_op0), sh_compare_op0);
9518 if (sh_compare_op1 != const0_rtx)
9519 sh_compare_op1 = force_reg (GET_MODE (sh_compare_op1) == VOIDmode
9520 @@ -9267,45 +9245,54 @@
9521 : GET_MODE (sh_compare_op1),
9524 + reg = operands[0];
9525 + if (GET_MODE (operands[0]) != SImode)
9526 + reg = no_new_pseudos ? gen_rtx_SUBREG (SImode, operands[0], 0)
9527 + : gen_reg_rtx (SImode);
9529 switch (GET_MODE (sh_compare_op0))
9533 - tmp = no_new_pseudos ? operands[0] : gen_reg_rtx (DImode);
9534 + tmp = no_new_pseudos ? reg : gen_reg_rtx (SImode);
9536 emit_insn (gen_cmpgtsi_media (tmp,
9537 sh_compare_op0, sh_compare_op1));
9538 - emit_insn (gen_cmpeqdi_media (operands[0], tmp, const0_rtx));
9539 + emit_insn (gen_cmpeqdi_media (reg, tmp, const0_rtx));
9545 - tmp = no_new_pseudos ? operands[0] : gen_reg_rtx (DImode);
9546 + tmp = no_new_pseudos ? reg : gen_reg_rtx (SImode);
9548 emit_insn (gen_cmpgtdi_media (tmp,
9549 sh_compare_op0, sh_compare_op1));
9550 - emit_insn (gen_cmpeqdi_media (operands[0], tmp, const0_rtx));
9551 + emit_insn (gen_cmpeqdi_media (reg, tmp, const0_rtx));
9556 if (! TARGET_SHMEDIA_FPU)
9558 - emit_insn (gen_cmpgesf_media (operands[0],
9559 + emit_insn (gen_cmpgesf_media (reg,
9560 sh_compare_op1, sh_compare_op0));
9564 if (! TARGET_SHMEDIA_FPU)
9566 - emit_insn (gen_cmpgedf_media (operands[0],
9567 + emit_insn (gen_cmpgedf_media (reg,
9568 sh_compare_op1, sh_compare_op0));
9575 + if (GET_MODE (operands[0]) == DImode)
9576 + emit_insn (gen_extendsidi2 (operands[0], reg));
9581 @@ -9323,8 +9310,12 @@
9585 - if (GET_MODE (operands[0]) != DImode)
9586 - operands[0] = gen_rtx_SUBREG (DImode, operands[0], 0);
9589 + reg = operands[0];
9590 + if (GET_MODE (operands[0]) != SImode)
9591 + reg = no_new_pseudos ? gen_rtx_SUBREG (SImode, operands[0], 0)
9592 + : gen_reg_rtx (SImode);
9593 sh_compare_op0 = force_reg (GET_MODE (sh_compare_op0), sh_compare_op0);
9594 if (sh_compare_op1 != const0_rtx)
9595 sh_compare_op1 = force_reg (GET_MODE (sh_compare_op1) == VOIDmode
9596 @@ -9335,32 +9326,36 @@
9597 switch (GET_MODE (sh_compare_op0))
9600 - emit_insn (gen_cmpgtsi_media (operands[0],
9601 + emit_insn (gen_cmpgtsi_media (reg,
9602 sh_compare_op0, sh_compare_op1));
9606 - emit_insn (gen_cmpgtdi_media (operands[0],
9607 + emit_insn (gen_cmpgtdi_media (reg,
9608 sh_compare_op0, sh_compare_op1));
9612 if (! TARGET_SHMEDIA_FPU)
9614 - emit_insn (gen_cmpgtsf_media (operands[0],
9615 + emit_insn (gen_cmpgtsf_media (reg,
9616 sh_compare_op0, sh_compare_op1));
9620 if (! TARGET_SHMEDIA_FPU)
9622 - emit_insn (gen_cmpgtdf_media (operands[0],
9623 + emit_insn (gen_cmpgtdf_media (reg,
9624 sh_compare_op0, sh_compare_op1));
9631 + if (GET_MODE (operands[0]) == DImode)
9632 + emit_insn (gen_extendsidi2 (operands[0], reg));
9636 if (! currently_expanding_to_rtl)
9637 @@ -9376,12 +9371,15 @@
9642 enum machine_mode mode = GET_MODE (sh_compare_op0);
9644 if ((mode) == VOIDmode)
9645 mode = GET_MODE (sh_compare_op1);
9646 - if (GET_MODE (operands[0]) != DImode)
9647 - operands[0] = gen_rtx_SUBREG (DImode, operands[0], 0);
9648 + reg = operands[0];
9649 + if (GET_MODE (operands[0]) != SImode)
9650 + reg = no_new_pseudos ? gen_rtx_SUBREG (SImode, operands[0], 0)
9651 + : gen_reg_rtx (SImode);
9652 sh_compare_op0 = force_reg (mode, sh_compare_op0);
9653 if (sh_compare_op1 != const0_rtx)
9654 sh_compare_op1 = force_reg (mode, sh_compare_op1);
9655 @@ -9390,41 +9388,45 @@
9659 - rtx tmp = no_new_pseudos ? operands[0] : gen_reg_rtx (DImode);
9660 + rtx tmp = no_new_pseudos ? reg : gen_reg_rtx (SImode);
9662 emit_insn (gen_cmpgtsi_media (tmp,
9663 sh_compare_op1, sh_compare_op0));
9664 - emit_insn (gen_cmpeqdi_media (operands[0], tmp, const0_rtx));
9665 + emit_insn (gen_cmpeqdi_media (reg, tmp, const0_rtx));
9671 - rtx tmp = no_new_pseudos ? operands[0] : gen_reg_rtx (DImode);
9672 + rtx tmp = no_new_pseudos ? reg : gen_reg_rtx (SImode);
9674 emit_insn (gen_cmpgtdi_media (tmp,
9675 sh_compare_op1, sh_compare_op0));
9676 - emit_insn (gen_cmpeqdi_media (operands[0], tmp, const0_rtx));
9677 + emit_insn (gen_cmpeqdi_media (reg, tmp, const0_rtx));
9682 if (! TARGET_SHMEDIA_FPU)
9684 - emit_insn (gen_cmpgesf_media (operands[0],
9685 + emit_insn (gen_cmpgesf_media (reg,
9686 sh_compare_op0, sh_compare_op1));
9690 if (! TARGET_SHMEDIA_FPU)
9692 - emit_insn (gen_cmpgedf_media (operands[0],
9693 + emit_insn (gen_cmpgedf_media (reg,
9694 sh_compare_op0, sh_compare_op1));
9701 + if (GET_MODE (operands[0]) == DImode)
9702 + emit_insn (gen_extendsidi2 (operands[0], reg));
9707 @@ -9456,8 +9458,12 @@
9711 - if (GET_MODE (operands[0]) != DImode)
9712 - operands[0] = gen_rtx_SUBREG (DImode, operands[0], 0);
9715 + reg = operands[0];
9716 + if (GET_MODE (operands[0]) == DImode)
9717 + reg = no_new_pseudos ? gen_rtx_SUBREG (SImode, operands[0], 0)
9718 + : gen_reg_rtx (SImode);
9719 sh_compare_op0 = force_reg (GET_MODE (sh_compare_op0), sh_compare_op0);
9720 if (sh_compare_op1 != const0_rtx)
9721 sh_compare_op1 = force_reg (GET_MODE (sh_compare_op1) == VOIDmode
9722 @@ -9465,8 +9471,11 @@
9723 : GET_MODE (sh_compare_op1),
9726 - emit_insn (gen_cmpgtudi_media (operands[0],
9727 + emit_insn (gen_cmpgtudi_media (reg,
9728 sh_compare_op0, sh_compare_op1));
9729 + if (GET_MODE (operands[0]) == DImode)
9730 + emit_insn (gen_extendsidi2 (operands[0], reg));
9734 if (! currently_expanding_to_rtl)
9735 @@ -9482,8 +9491,12 @@
9739 - if (GET_MODE (operands[0]) != DImode)
9740 - operands[0] = gen_rtx_SUBREG (DImode, operands[0], 0);
9743 + reg = operands[0];
9744 + if (GET_MODE (operands[0]) == DImode)
9745 + reg = no_new_pseudos ? gen_rtx_SUBREG (SImode, operands[0], 0)
9746 + : gen_reg_rtx (SImode);
9747 sh_compare_op0 = force_reg (GET_MODE (sh_compare_op0), sh_compare_op0);
9748 if (sh_compare_op1 != const0_rtx)
9749 sh_compare_op1 = force_reg (GET_MODE (sh_compare_op1) == VOIDmode
9750 @@ -9491,8 +9504,11 @@
9751 : GET_MODE (sh_compare_op1),
9754 - emit_insn (gen_cmpgtudi_media (operands[0],
9755 + emit_insn (gen_cmpgtudi_media (reg,
9756 sh_compare_op1, sh_compare_op0));
9757 + if (GET_MODE (operands[0]) == DImode)
9758 + emit_insn (gen_extendsidi2 (operands[0], reg));
9762 if (! currently_expanding_to_rtl)
9763 @@ -9508,10 +9524,12 @@
9770 - if (GET_MODE (operands[0]) != DImode)
9771 - operands[0] = gen_rtx_SUBREG (DImode, operands[0], 0);
9772 + reg = operands[0];
9773 + if (GET_MODE (operands[0]) != SImode)
9774 + reg = no_new_pseudos ? gen_rtx_SUBREG (SImode, operands[0], 0)
9775 + : gen_reg_rtx (SImode);
9776 sh_compare_op0 = force_reg (GET_MODE (sh_compare_op0), sh_compare_op0);
9777 if (sh_compare_op1 != const0_rtx)
9778 sh_compare_op1 = force_reg (GET_MODE (sh_compare_op1) == VOIDmode
9779 @@ -9519,10 +9537,12 @@
9780 : GET_MODE (sh_compare_op1),
9783 - tmp = no_new_pseudos ? operands[0] : gen_reg_rtx (DImode);
9784 + tmp = no_new_pseudos ? reg : gen_reg_rtx (SImode);
9786 emit_insn (gen_cmpgtudi_media (tmp, sh_compare_op0, sh_compare_op1));
9787 - emit_insn (gen_cmpeqdi_media (operands[0], tmp, const0_rtx));
9788 + emit_insn (gen_cmpeqdi_media (reg, tmp, const0_rtx));
9789 + if (GET_MODE (operands[0]) == DImode)
9790 + emit_insn (gen_extendsidi2 (operands[0], reg));
9794 @@ -9539,10 +9559,12 @@
9801 - if (GET_MODE (operands[0]) != DImode)
9802 - operands[0] = gen_rtx_SUBREG (DImode, operands[0], 0);
9803 + reg = operands[0];
9804 + if (GET_MODE (operands[0]) != SImode)
9805 + reg = no_new_pseudos ? gen_rtx_SUBREG (SImode, operands[0], 0)
9806 + : gen_reg_rtx (SImode);
9807 sh_compare_op0 = force_reg (GET_MODE (sh_compare_op0), sh_compare_op0);
9808 if (sh_compare_op1 != const0_rtx)
9809 sh_compare_op1 = force_reg (GET_MODE (sh_compare_op1) == VOIDmode
9810 @@ -9550,10 +9572,12 @@
9811 : GET_MODE (sh_compare_op1),
9814 - tmp = no_new_pseudos ? operands[0] : gen_reg_rtx (DImode);
9815 + tmp = no_new_pseudos ? operands[0] : gen_reg_rtx (SImode);
9817 emit_insn (gen_cmpgtudi_media (tmp, sh_compare_op1, sh_compare_op0));
9818 - emit_insn (gen_cmpeqdi_media (operands[0], tmp, const0_rtx));
9819 + emit_insn (gen_cmpeqdi_media (reg, tmp, const0_rtx));
9820 + if (GET_MODE (operands[0]) == DImode)
9821 + emit_insn (gen_extendsidi2 (operands[0], reg));
9825 @@ -9584,11 +9608,12 @@
9832 - if (GET_MODE (operands[0]) != DImode)
9833 - operands[0] = gen_rtx_SUBREG (DImode, operands[0], 0);
9835 + reg = operands[0];
9836 + if (GET_MODE (operands[0]) != SImode)
9837 + reg = no_new_pseudos ? gen_rtx_SUBREG (SImode, operands[0], 0)
9838 + : gen_reg_rtx (SImode);
9839 if (! TARGET_SHMEDIA_FPU
9840 && GET_MODE (sh_compare_op0) != DImode
9841 && GET_MODE (sh_compare_op0) != SImode)
9842 @@ -9601,10 +9626,12 @@
9843 : GET_MODE (sh_compare_op1),
9846 - tmp = no_new_pseudos ? operands[0] : gen_reg_rtx (DImode);
9847 + tmp = no_new_pseudos ? reg : gen_reg_rtx (SImode);
9849 emit_insn (gen_seq (tmp));
9850 - emit_insn (gen_cmpeqdi_media (operands[0], tmp, const0_rtx));
9851 + emit_insn (gen_cmpeqdi_media (reg, tmp, const0_rtx));
9852 + if (GET_MODE (operands[0]) == DImode)
9853 + emit_insn (gen_extendsidi2 (operands[0], reg));
9857 @@ -9618,8 +9645,8 @@
9860 (define_expand "sunordered"
9861 - [(set (match_operand:DI 0 "arith_reg_operand" "")
9862 - (unordered:DI (match_dup 1) (match_dup 2)))]
9863 + [(set (match_operand:SI 0 "arith_reg_operand" "")
9864 + (unordered:SI (match_dup 1) (match_dup 2)))]
9865 "TARGET_SHMEDIA_FPU"
9868 @@ -10378,14 +10405,6 @@
9869 (set_attr "fp_mode" "single")])
9871 (define_insn "cmpeqsf_media"
9872 - [(set (match_operand:DI 0 "register_operand" "=r")
9873 - (eq:DI (match_operand:SF 1 "fp_arith_reg_operand" "f")
9874 - (match_operand:SF 2 "fp_arith_reg_operand" "f")))]
9875 - "TARGET_SHMEDIA_FPU"
9876 - "fcmpeq.s %1, %2, %0"
9877 - [(set_attr "type" "fcmp_media")])
9879 -(define_insn "cmpsieqsf_media"
9880 [(set (match_operand:SI 0 "register_operand" "=r")
9881 (eq:SI (match_operand:SF 1 "fp_arith_reg_operand" "f")
9882 (match_operand:SF 2 "fp_arith_reg_operand" "f")))]
9883 @@ -10394,24 +10413,24 @@
9884 [(set_attr "type" "fcmp_media")])
9886 (define_insn "cmpgtsf_media"
9887 - [(set (match_operand:DI 0 "register_operand" "=r")
9888 - (gt:DI (match_operand:SF 1 "fp_arith_reg_operand" "f")
9889 + [(set (match_operand:SI 0 "register_operand" "=r")
9890 + (gt:SI (match_operand:SF 1 "fp_arith_reg_operand" "f")
9891 (match_operand:SF 2 "fp_arith_reg_operand" "f")))]
9892 "TARGET_SHMEDIA_FPU"
9893 "fcmpgt.s %1, %2, %0"
9894 [(set_attr "type" "fcmp_media")])
9896 (define_insn "cmpgesf_media"
9897 - [(set (match_operand:DI 0 "register_operand" "=r")
9898 - (ge:DI (match_operand:SF 1 "fp_arith_reg_operand" "f")
9899 + [(set (match_operand:SI 0 "register_operand" "=r")
9900 + (ge:SI (match_operand:SF 1 "fp_arith_reg_operand" "f")
9901 (match_operand:SF 2 "fp_arith_reg_operand" "f")))]
9902 "TARGET_SHMEDIA_FPU"
9903 "fcmpge.s %1, %2, %0"
9904 [(set_attr "type" "fcmp_media")])
9906 (define_insn "cmpunsf_media"
9907 - [(set (match_operand:DI 0 "register_operand" "=r")
9908 - (unordered:DI (match_operand:SF 1 "fp_arith_reg_operand" "f")
9909 + [(set (match_operand:SI 0 "register_operand" "=r")
9910 + (unordered:SI (match_operand:SF 1 "fp_arith_reg_operand" "f")
9911 (match_operand:SF 2 "fp_arith_reg_operand" "f")))]
9912 "TARGET_SHMEDIA_FPU"
9913 "fcmpun.s %1, %2, %0"
9914 @@ -10884,14 +10903,6 @@
9915 (set_attr "fp_mode" "double")])
9917 (define_insn "cmpeqdf_media"
9918 - [(set (match_operand:DI 0 "register_operand" "=r")
9919 - (eq:DI (match_operand:DF 1 "fp_arith_reg_operand" "f")
9920 - (match_operand:DF 2 "fp_arith_reg_operand" "f")))]
9921 - "TARGET_SHMEDIA_FPU"
9922 - "fcmpeq.d %1,%2,%0"
9923 - [(set_attr "type" "fcmp_media")])
9925 -(define_insn "cmpsieqdf_media"
9926 [(set (match_operand:SI 0 "register_operand" "=r")
9927 (eq:SI (match_operand:DF 1 "fp_arith_reg_operand" "f")
9928 (match_operand:DF 2 "fp_arith_reg_operand" "f")))]
9929 @@ -10900,24 +10911,24 @@
9930 [(set_attr "type" "fcmp_media")])
9932 (define_insn "cmpgtdf_media"
9933 - [(set (match_operand:DI 0 "register_operand" "=r")
9934 - (gt:DI (match_operand:DF 1 "fp_arith_reg_operand" "f")
9935 + [(set (match_operand:SI 0 "register_operand" "=r")
9936 + (gt:SI (match_operand:DF 1 "fp_arith_reg_operand" "f")
9937 (match_operand:DF 2 "fp_arith_reg_operand" "f")))]
9938 "TARGET_SHMEDIA_FPU"
9940 [(set_attr "type" "fcmp_media")])
9942 (define_insn "cmpgedf_media"
9943 - [(set (match_operand:DI 0 "register_operand" "=r")
9944 - (ge:DI (match_operand:DF 1 "fp_arith_reg_operand" "f")
9945 + [(set (match_operand:SI 0 "register_operand" "=r")
9946 + (ge:SI (match_operand:DF 1 "fp_arith_reg_operand" "f")
9947 (match_operand:DF 2 "fp_arith_reg_operand" "f")))]
9948 "TARGET_SHMEDIA_FPU"
9950 [(set_attr "type" "fcmp_media")])
9952 (define_insn "cmpundf_media"
9953 - [(set (match_operand:DI 0 "register_operand" "=r")
9954 - (unordered:DI (match_operand:DF 1 "fp_arith_reg_operand" "f")
9955 + [(set (match_operand:SI 0 "register_operand" "=r")
9956 + (unordered:SI (match_operand:DF 1 "fp_arith_reg_operand" "f")
9957 (match_operand:DF 2 "fp_arith_reg_operand" "f")))]
9958 "TARGET_SHMEDIA_FPU"
9960 Index: gcc/config/score/predicates.md
9961 ===================================================================
9962 --- gcc/config/score/predicates.md (.../tags/gcc_4_2_0_release) (revision 126002)
9963 +++ gcc/config/score/predicates.md (.../branches/gcc-4_2-branch) (revision 126002)
9965 return IMM_IN_RANGE (INTVAL (op), 15, 1);
9968 -(define_predicate "const_pow2"
9969 - (match_code "const_int")
9971 - return IMM_IS_POW_OF_2 ((unsigned HOST_WIDE_INT) INTVAL (op), 0, 31);
9974 -(define_predicate "const_npow2"
9975 - (match_code "const_int")
9977 - return IMM_IS_POW_OF_2 (~(unsigned HOST_WIDE_INT) INTVAL (op), 0, 31);
9979 Index: gcc/config/score/misc.md
9980 ===================================================================
9981 --- gcc/config/score/misc.md (.../tags/gcc_4_2_0_release) (revision 126002)
9982 +++ gcc/config/score/misc.md (.../branches/gcc-4_2-branch) (revision 126002)
9983 @@ -380,38 +380,3 @@
9984 [(set_attr "type" "arith")
9985 (set_attr "mode" "SI")])
9987 -(define_insn "bitclr_c"
9988 - [(set (match_operand:SI 0 "register_operand" "=e,d")
9989 - (and:SI (match_operand:SI 1 "register_operand" "0,d")
9990 - (match_operand:SI 2 "const_npow2")))
9991 - (clobber (reg:CC CC_REGNUM))]
9995 - bitclr.c %0, %1, %F2"
9996 - [(set_attr "type" "arith")
9997 - (set_attr "mode" "SI")])
9999 -(define_insn "bitset_c"
10000 - [(set (match_operand:SI 0 "register_operand" "=e,d")
10001 - (ior:SI (match_operand:SI 1 "register_operand" "0,d")
10002 - (match_operand:SI 2 "const_pow2")))
10003 - (clobber (reg:CC CC_REGNUM))]
10007 - bitset.c %0, %1, %E2"
10008 - [(set_attr "type" "arith")
10009 - (set_attr "mode" "SI")])
10011 -(define_insn "bittgl_c"
10012 - [(set (match_operand:SI 0 "register_operand" "=e,d")
10013 - (xor:SI (match_operand:SI 1 "register_operand" "0,d")
10014 - (match_operand:SI 2 "const_pow2")))
10015 - (clobber (reg:CC CC_REGNUM))]
10019 - bittgl.c %0, %1, %E2"
10020 - [(set_attr "type" "arith")
10021 - (set_attr "mode" "SI")])
10022 Index: gcc/config/score/score.c
10023 ===================================================================
10024 --- gcc/config/score/score.c (.../tags/gcc_4_2_0_release) (revision 126002)
10025 +++ gcc/config/score/score.c (.../branches/gcc-4_2-branch) (revision 126002)
10026 @@ -1168,7 +1168,7 @@
10028 gcc_assert (code == CONST_INT);
10029 fprintf (file, HOST_WIDE_INT_PRINT_HEX,
10030 - (unsigned HOST_WIDE_INT) INTVAL (op) >> 16);
10031 + (INTVAL (op) >> 16) & 0xffff);
10035 @@ -1176,7 +1176,7 @@
10037 rtx temp = gen_lowpart (SImode, op);
10038 gcc_assert (GET_MODE (op) == SFmode);
10039 - fprintf (file, HOST_WIDE_INT_PRINT_HEX, INTVAL (temp));
10040 + fprintf (file, HOST_WIDE_INT_PRINT_HEX, INTVAL (temp) & 0xffffffff);
10043 output_addr_const (file, op);
10044 Index: gcc/config/score/score.h
10045 ===================================================================
10046 --- gcc/config/score/score.h (.../tags/gcc_4_2_0_release) (revision 126002)
10047 +++ gcc/config/score/score.h (.../branches/gcc-4_2-branch) (revision 126002)
10048 @@ -785,6 +785,7 @@
10049 output anything and let undefined symbol become external. However
10050 the assembler uses length information on externals to allocate in
10051 data/sdata bss/sbss, thereby saving exec time. */
10052 +#undef ASM_OUTPUT_EXTERNAL
10053 #define ASM_OUTPUT_EXTERNAL(STREAM, DECL, NAME) \
10054 score_output_external (STREAM, DECL, NAME)
10056 Index: gcc/config/pa/pa.md
10057 ===================================================================
10058 --- gcc/config/pa/pa.md (.../tags/gcc_4_2_0_release) (revision 126002)
10059 +++ gcc/config/pa/pa.md (.../branches/gcc-4_2-branch) (revision 126002)
10061 (UNSPEC_TLSLDBASE 7)
10064 + (UNSPEC_TLSGD_PIC 10)
10065 + (UNSPEC_TLSLDM_PIC 11)
10066 + (UNSPEC_TLSIE_PIC 12)
10069 ;; UNSPEC_VOLATILE:
10070 @@ -9890,33 +9893,55 @@
10071 (define_insn "tgd_load"
10072 [(set (match_operand:SI 0 "register_operand" "=r")
10073 (unspec:SI [(match_operand 1 "tgd_symbolic_operand" "")] UNSPEC_TLSGD))
10074 - (clobber (reg:SI 1))]
10075 + (clobber (reg:SI 1))
10076 + (use (reg:SI 27))]
10081 - return \"addil LT'%1-$tls_gdidx$,%%r19\;ldo RT'%1-$tls_gdidx$(%%r1),%0\";
10083 - return \"addil LR'%1-$tls_gdidx$,%%r27\;ldo RR'%1-$tls_gdidx$(%%r1),%0\";
10084 + return \"addil LR'%1-$tls_gdidx$,%%r27\;ldo RR'%1-$tls_gdidx$(%%r1),%0\";
10086 [(set_attr "type" "multi")
10087 (set_attr "length" "8")])
10089 +(define_insn "tgd_load_pic"
10090 + [(set (match_operand:SI 0 "register_operand" "=r")
10091 + (unspec:SI [(match_operand 1 "tgd_symbolic_operand" "")] UNSPEC_TLSGD_PIC))
10092 + (clobber (reg:SI 1))
10093 + (use (reg:SI 19))]
10097 + return \"addil LT'%1-$tls_gdidx$,%%r19\;ldo RT'%1-$tls_gdidx$(%%r1),%0\";
10099 + [(set_attr "type" "multi")
10100 + (set_attr "length" "8")])
10102 (define_insn "tld_load"
10103 [(set (match_operand:SI 0 "register_operand" "=r")
10104 (unspec:SI [(match_operand 1 "tld_symbolic_operand" "")] UNSPEC_TLSLDM))
10105 - (clobber (reg:SI 1))]
10106 + (clobber (reg:SI 1))
10107 + (use (reg:SI 27))]
10112 - return \"addil LT'%1-$tls_ldidx$,%%r19\;ldo RT'%1-$tls_ldidx$(%%r1),%0\";
10114 - return \"addil LR'%1-$tls_ldidx$,%%r27\;ldo RR'%1-$tls_ldidx$(%%r1),%0\";
10115 + return \"addil LR'%1-$tls_ldidx$,%%r27\;ldo RR'%1-$tls_ldidx$(%%r1),%0\";
10117 [(set_attr "type" "multi")
10118 (set_attr "length" "8")])
10120 +(define_insn "tld_load_pic"
10121 + [(set (match_operand:SI 0 "register_operand" "=r")
10122 + (unspec:SI [(match_operand 1 "tld_symbolic_operand" "")] UNSPEC_TLSLDM_PIC))
10123 + (clobber (reg:SI 1))
10124 + (use (reg:SI 19))]
10128 + return \"addil LT'%1-$tls_ldidx$,%%r19\;ldo RT'%1-$tls_ldidx$(%%r1),%0\";
10130 + [(set_attr "type" "multi")
10131 + (set_attr "length" "8")])
10133 (define_insn "tld_offset_load"
10134 [(set (match_operand:SI 0 "register_operand" "=r")
10135 (plus:SI (unspec:SI [(match_operand 1 "tld_symbolic_operand" "")]
10136 @@ -9942,18 +9967,29 @@
10137 (define_insn "tie_load"
10138 [(set (match_operand:SI 0 "register_operand" "=r")
10139 (unspec:SI [(match_operand 1 "tie_symbolic_operand" "")] UNSPEC_TLSIE))
10140 - (clobber (reg:SI 1))]
10141 + (clobber (reg:SI 1))
10142 + (use (reg:SI 27))]
10147 - return \"addil LT'%1-$tls_ieoff$,%%r19\;ldw RT'%1-$tls_ieoff$(%%r1),%0\";
10149 - return \"addil LR'%1-$tls_ieoff$,%%r27\;ldw RR'%1-$tls_ieoff$(%%r1),%0\";
10150 + return \"addil LR'%1-$tls_ieoff$,%%r27\;ldw RR'%1-$tls_ieoff$(%%r1),%0\";
10152 [(set_attr "type" "multi")
10153 (set_attr "length" "8")])
10155 +(define_insn "tie_load_pic"
10156 + [(set (match_operand:SI 0 "register_operand" "=r")
10157 + (unspec:SI [(match_operand 1 "tie_symbolic_operand" "")] UNSPEC_TLSIE_PIC))
10158 + (clobber (reg:SI 1))
10159 + (use (reg:SI 19))]
10163 + return \"addil LT'%1-$tls_ieoff$,%%r19\;ldw RT'%1-$tls_ieoff$(%%r1),%0\";
10165 + [(set_attr "type" "multi")
10166 + (set_attr "length" "8")])
10168 (define_insn "tle_load"
10169 [(set (match_operand:SI 0 "register_operand" "=r")
10170 (plus:SI (unspec:SI [(match_operand 1 "tle_symbolic_operand" "")]
10171 Index: gcc/config/pa/pa.c
10172 ===================================================================
10173 --- gcc/config/pa/pa.c (.../tags/gcc_4_2_0_release) (revision 126002)
10174 +++ gcc/config/pa/pa.c (.../branches/gcc-4_2-branch) (revision 126002)
10175 @@ -726,7 +726,10 @@
10177 case TLS_MODEL_GLOBAL_DYNAMIC:
10178 tmp = gen_reg_rtx (Pmode);
10179 - emit_insn (gen_tgd_load (tmp, addr));
10181 + emit_insn (gen_tgd_load_pic (tmp, addr));
10183 + emit_insn (gen_tgd_load (tmp, addr));
10184 ret = hppa_tls_call (tmp);
10187 @@ -734,7 +737,10 @@
10188 ret = gen_reg_rtx (Pmode);
10189 tmp = gen_reg_rtx (Pmode);
10191 - emit_insn (gen_tld_load (tmp, addr));
10193 + emit_insn (gen_tld_load_pic (tmp, addr));
10195 + emit_insn (gen_tld_load (tmp, addr));
10196 t1 = hppa_tls_call (tmp);
10197 insn = get_insns ();
10199 @@ -750,7 +756,10 @@
10200 tmp = gen_reg_rtx (Pmode);
10201 ret = gen_reg_rtx (Pmode);
10202 emit_insn (gen_tp_load (tp));
10203 - emit_insn (gen_tie_load (tmp, addr));
10205 + emit_insn (gen_tie_load_pic (tmp, addr));
10207 + emit_insn (gen_tie_load (tmp, addr));
10208 emit_move_insn (ret, gen_rtx_PLUS (Pmode, tp, tmp));
10211 Index: gcc/config/soft-fp/quad.h
10212 ===================================================================
10213 --- gcc/config/soft-fp/quad.h (.../tags/gcc_4_2_0_release) (revision 126002)
10214 +++ gcc/config/soft-fp/quad.h (.../branches/gcc-4_2-branch) (revision 126002)
10216 /* Software floating-point emulation.
10217 Definitions for IEEE Quad Precision.
10218 - Copyright (C) 1997,1998,1999,2006 Free Software Foundation, Inc.
10219 + Copyright (C) 1997,1998,1999,2006,2007 Free Software Foundation, Inc.
10220 This file is part of the GNU C Library.
10221 Contributed by Richard Henderson (rth@cygnus.com),
10222 Jakub Jelinek (jj@ultra.linux.cz),
10223 @@ -176,15 +176,15 @@
10226 #if __BYTE_ORDER == __BIG_ENDIAN
10227 - unsigned sign : 1;
10228 - unsigned exp : _FP_EXPBITS_Q;
10229 - unsigned long frac1 : _FP_FRACBITS_Q-(_FP_IMPLBIT_Q != 0)-_FP_W_TYPE_SIZE;
10230 - unsigned long frac0 : _FP_W_TYPE_SIZE;
10231 + unsigned sign : 1;
10232 + unsigned exp : _FP_EXPBITS_Q;
10233 + _FP_W_TYPE frac1 : _FP_FRACBITS_Q - (_FP_IMPLBIT_Q != 0) - _FP_W_TYPE_SIZE;
10234 + _FP_W_TYPE frac0 : _FP_W_TYPE_SIZE;
10236 - unsigned long frac0 : _FP_W_TYPE_SIZE;
10237 - unsigned long frac1 : _FP_FRACBITS_Q-(_FP_IMPLBIT_Q != 0)-_FP_W_TYPE_SIZE;
10238 - unsigned exp : _FP_EXPBITS_Q;
10239 - unsigned sign : 1;
10240 + _FP_W_TYPE frac0 : _FP_W_TYPE_SIZE;
10241 + _FP_W_TYPE frac1 : _FP_FRACBITS_Q - (_FP_IMPLBIT_Q != 0) - _FP_W_TYPE_SIZE;
10242 + unsigned exp : _FP_EXPBITS_Q;
10243 + unsigned sign : 1;
10247 Index: gcc/config/soft-fp/floatunsidf.c
10248 ===================================================================
10249 --- gcc/config/soft-fp/floatunsidf.c (.../tags/gcc_4_2_0_release) (revision 126002)
10250 +++ gcc/config/soft-fp/floatunsidf.c (.../branches/gcc-4_2-branch) (revision 126002)
10252 /* Software floating-point emulation.
10253 Convert a 32bit unsigned integer to IEEE double
10254 - Copyright (C) 1997,1999, 2006 Free Software Foundation, Inc.
10255 + Copyright (C) 1997, 1999, 2006, 2007 Free Software Foundation, Inc.
10256 This file is part of the GNU C Library.
10257 Contributed by Richard Henderson (rth@cygnus.com) and
10258 Jakub Jelinek (jj@ultra.linux.cz).
10260 #include "soft-fp.h"
10261 #include "double.h"
10264 -__floatunsidf(USItype i)
10265 +DFtype __floatunsidf(USItype i)
10269 Index: gcc/config/soft-fp/floatundidf.c
10270 ===================================================================
10271 --- gcc/config/soft-fp/floatundidf.c (.../tags/gcc_4_2_0_release) (revision 126002)
10272 +++ gcc/config/soft-fp/floatundidf.c (.../branches/gcc-4_2-branch) (revision 126002)
10274 /* Software floating-point emulation.
10275 Convert a 64bit unsigned integer to IEEE double
10276 - Copyright (C) 1997,1999, 2006 Free Software Foundation, Inc.
10277 + Copyright (C) 1997, 1999, 2006, 2007 Free Software Foundation, Inc.
10278 This file is part of the GNU C Library.
10279 Contributed by Richard Henderson (rth@cygnus.com) and
10280 Jakub Jelinek (jj@ultra.linux.cz).
10282 #include "soft-fp.h"
10283 #include "double.h"
10286 -__floatundidf(UDItype i)
10287 +DFtype __floatundidf(UDItype i)
10291 Index: gcc/config/soft-fp/extended.h
10292 ===================================================================
10293 --- gcc/config/soft-fp/extended.h (.../tags/gcc_4_2_0_release) (revision 126002)
10294 +++ gcc/config/soft-fp/extended.h (.../branches/gcc-4_2-branch) (revision 126002)
10296 /* Software floating-point emulation.
10297 Definitions for IEEE Extended Precision.
10298 - Copyright (C) 1999,2006 Free Software Foundation, Inc.
10299 + Copyright (C) 1999,2006,2007 Free Software Foundation, Inc.
10300 This file is part of the GNU C Library.
10301 Contributed by Jakub Jelinek (jj@ultra.linux.cz).
10304 X##_f[1] = _flo.bits.frac1; \
10305 X##_e = _flo.bits.exp; \
10306 X##_s = _flo.bits.sign; \
10307 - if (!X##_e && (X##_f[1] || X##_f[0]) \
10308 - && !(X##_f[1] & _FP_IMPLBIT_E)) \
10311 - FP_SET_EXCEPTION(FP_EX_DENORM); \
10315 #define FP_UNPACK_RAW_EP(X, val) \
10316 @@ -112,12 +106,6 @@
10317 X##_f[1] = _flo->bits.frac1; \
10318 X##_e = _flo->bits.exp; \
10319 X##_s = _flo->bits.sign; \
10320 - if (!X##_e && (X##_f[1] || X##_f[0]) \
10321 - && !(X##_f[1] & _FP_IMPLBIT_E)) \
10324 - FP_SET_EXCEPTION(FP_EX_DENORM); \
10328 #define FP_PACK_RAW_E(val, X) \
10329 @@ -164,13 +152,13 @@
10331 #define FP_UNPACK_SEMIRAW_E(X,val) \
10333 - _FP_UNPACK_RAW_E(X,val); \
10334 + FP_UNPACK_RAW_E(X,val); \
10335 _FP_UNPACK_SEMIRAW(E,4,X); \
10338 #define FP_UNPACK_SEMIRAW_EP(X,val) \
10340 - _FP_UNPACK_RAW_EP(X,val); \
10341 + FP_UNPACK_RAW_EP(X,val); \
10342 _FP_UNPACK_SEMIRAW(E,4,X); \
10345 @@ -189,13 +177,13 @@
10346 #define FP_PACK_SEMIRAW_E(val,X) \
10348 _FP_PACK_SEMIRAW(E,4,X); \
10349 - _FP_PACK_RAW_E(val,X); \
10350 + FP_PACK_RAW_E(val,X); \
10353 #define FP_PACK_SEMIRAW_EP(val,X) \
10355 _FP_PACK_SEMIRAW(E,4,X); \
10356 - _FP_PACK_RAW_EP(val,X); \
10357 + FP_PACK_RAW_EP(val,X); \
10360 #define FP_ISSIGNAN_E(X) _FP_ISSIGNAN(E,4,X)
10361 @@ -277,14 +265,14 @@
10364 #if __BYTE_ORDER == __BIG_ENDIAN
10365 - unsigned long pad : (_FP_W_TYPE_SIZE - 1 - _FP_EXPBITS_E);
10366 - unsigned sign : 1;
10367 - unsigned exp : _FP_EXPBITS_E;
10368 - unsigned long frac : _FP_W_TYPE_SIZE;
10369 + _FP_W_TYPE pad : (_FP_W_TYPE_SIZE - 1 - _FP_EXPBITS_E);
10370 + unsigned sign : 1;
10371 + unsigned exp : _FP_EXPBITS_E;
10372 + _FP_W_TYPE frac : _FP_W_TYPE_SIZE;
10374 - unsigned long frac : _FP_W_TYPE_SIZE;
10375 - unsigned exp : _FP_EXPBITS_E;
10376 - unsigned sign : 1;
10377 + _FP_W_TYPE frac : _FP_W_TYPE_SIZE;
10378 + unsigned exp : _FP_EXPBITS_E;
10379 + unsigned sign : 1;
10383 @@ -299,11 +287,6 @@
10385 X##_e = _flo.bits.exp; \
10386 X##_s = _flo.bits.sign; \
10387 - if (!X##_e && X##_f0 && !(X##_f0 & _FP_IMPLBIT_E)) \
10390 - FP_SET_EXCEPTION(FP_EX_DENORM); \
10394 #define FP_UNPACK_RAW_EP(X, val) \
10395 @@ -315,11 +298,6 @@
10397 X##_e = _flo->bits.exp; \
10398 X##_s = _flo->bits.sign; \
10399 - if (!X##_e && X##_f0 && !(X##_f0 & _FP_IMPLBIT_E)) \
10402 - FP_SET_EXCEPTION(FP_EX_DENORM); \
10406 #define FP_PACK_RAW_E(val, X) \
10407 @@ -365,13 +343,13 @@
10409 #define FP_UNPACK_SEMIRAW_E(X,val) \
10411 - _FP_UNPACK_RAW_E(X,val); \
10412 + FP_UNPACK_RAW_E(X,val); \
10413 _FP_UNPACK_SEMIRAW(E,2,X); \
10416 #define FP_UNPACK_SEMIRAW_EP(X,val) \
10418 - _FP_UNPACK_RAW_EP(X,val); \
10419 + FP_UNPACK_RAW_EP(X,val); \
10420 _FP_UNPACK_SEMIRAW(E,2,X); \
10423 @@ -390,13 +368,13 @@
10424 #define FP_PACK_SEMIRAW_E(val,X) \
10426 _FP_PACK_SEMIRAW(E,2,X); \
10427 - _FP_PACK_RAW_E(val,X); \
10428 + FP_PACK_RAW_E(val,X); \
10431 #define FP_PACK_SEMIRAW_EP(val,X) \
10433 _FP_PACK_SEMIRAW(E,2,X); \
10434 - _FP_PACK_RAW_EP(val,X); \
10435 + FP_PACK_RAW_EP(val,X); \
10438 #define FP_ISSIGNAN_E(X) _FP_ISSIGNAN(E,2,X)
10439 Index: gcc/config/soft-fp/floatunsisf.c
10440 ===================================================================
10441 --- gcc/config/soft-fp/floatunsisf.c (.../tags/gcc_4_2_0_release) (revision 126002)
10442 +++ gcc/config/soft-fp/floatunsisf.c (.../branches/gcc-4_2-branch) (revision 126002)
10444 /* Software floating-point emulation.
10445 Convert a 32bit unsigned integer to IEEE single
10446 - Copyright (C) 1997,1999, 2006 Free Software Foundation, Inc.
10447 + Copyright (C) 1997, 1999, 2006, 2007 Free Software Foundation, Inc.
10448 This file is part of the GNU C Library.
10449 Contributed by Richard Henderson (rth@cygnus.com) and
10450 Jakub Jelinek (jj@ultra.linux.cz).
10452 #include "soft-fp.h"
10453 #include "single.h"
10456 -__floatunsisf(USItype i)
10457 +SFtype __floatunsisf(USItype i)
10461 Index: gcc/config/soft-fp/op-common.h
10462 ===================================================================
10463 --- gcc/config/soft-fp/op-common.h (.../tags/gcc_4_2_0_release) (revision 126002)
10464 +++ gcc/config/soft-fp/op-common.h (.../branches/gcc-4_2-branch) (revision 126002)
10465 @@ -1153,7 +1153,8 @@
10466 if (_FP_FRACBITS_##dfs < _FP_FRACBITS_##sfs \
10467 || (_FP_EXPMAX_##dfs - _FP_EXPBIAS_##dfs \
10468 < _FP_EXPMAX_##sfs - _FP_EXPBIAS_##sfs) \
10469 - || _FP_EXPBIAS_##dfs < _FP_EXPBIAS_##sfs + _FP_FRACBITS_##sfs - 1) \
10470 + || (_FP_EXPBIAS_##dfs < _FP_EXPBIAS_##sfs + _FP_FRACBITS_##sfs - 1 \
10471 + && _FP_EXPBIAS_##dfs != _FP_EXPBIAS_##sfs)) \
10474 _FP_FRAC_COPY_##dwc##_##swc(D, S); \
10475 @@ -1168,6 +1169,14 @@
10477 if (_FP_FRAC_ZEROP_##swc(S)) \
10479 + else if (_FP_EXPBIAS_##dfs \
10480 + < _FP_EXPBIAS_##sfs + _FP_FRACBITS_##sfs - 1) \
10482 + FP_SET_EXCEPTION(FP_EX_DENORM); \
10483 + _FP_FRAC_SLL_##dwc(D, (_FP_FRACBITS_##dfs \
10484 + - _FP_FRACBITS_##sfs)); \
10490 @@ -1199,7 +1208,8 @@
10491 #define FP_TRUNC(dfs,sfs,dwc,swc,D,S) \
10493 if (_FP_FRACBITS_##sfs < _FP_FRACBITS_##dfs \
10494 - || _FP_EXPBIAS_##sfs < _FP_EXPBIAS_##dfs + _FP_FRACBITS_##dfs - 1) \
10495 + || (_FP_EXPBIAS_##sfs < _FP_EXPBIAS_##dfs + _FP_FRACBITS_##dfs - 1 \
10496 + && _FP_EXPBIAS_##sfs != _FP_EXPBIAS_##dfs)) \
10499 if (_FP_EXP_NORMAL(sfs, swc, S)) \
10500 @@ -1211,8 +1221,11 @@
10504 - if (D##_e <= 1 - _FP_FRACBITS_##dfs) \
10505 - _FP_FRAC_SET_##swc(S, _FP_ZEROFRAC_##swc); \
10506 + if (D##_e < 1 - _FP_FRACBITS_##dfs) \
10508 + _FP_FRAC_SET_##swc(S, _FP_ZEROFRAC_##swc); \
10509 + _FP_FRAC_LOW_##swc(S) |= 1; \
10513 _FP_FRAC_HIGH_##sfs(S) |= _FP_IMPLBIT_SH_##sfs; \
10514 @@ -1234,11 +1247,24 @@
10518 - _FP_FRAC_SET_##dwc(D, _FP_ZEROFRAC_##dwc); \
10519 - if (!_FP_FRAC_ZEROP_##swc(S)) \
10520 + if (_FP_FRAC_ZEROP_##swc(S)) \
10521 + _FP_FRAC_SET_##dwc(D, _FP_ZEROFRAC_##dwc); \
10524 FP_SET_EXCEPTION(FP_EX_DENORM); \
10525 - FP_SET_EXCEPTION(FP_EX_INEXACT); \
10526 + if (_FP_EXPBIAS_##sfs \
10527 + < _FP_EXPBIAS_##dfs + _FP_FRACBITS_##dfs - 1) \
10529 + _FP_FRAC_SRS_##swc(S, (_FP_WFRACBITS_##sfs \
10530 + - _FP_WFRACBITS_##dfs), \
10531 + _FP_WFRACBITS_##sfs); \
10532 + _FP_FRAC_COPY_##dwc##_##swc(D, S); \
10536 + _FP_FRAC_SET_##dwc(D, _FP_ZEROFRAC_##dwc); \
10537 + _FP_FRAC_LOW_##dwc(D) |= 1; \
10542 Index: gcc/config/soft-fp/floatundisf.c
10543 ===================================================================
10544 --- gcc/config/soft-fp/floatundisf.c (.../tags/gcc_4_2_0_release) (revision 126002)
10545 +++ gcc/config/soft-fp/floatundisf.c (.../branches/gcc-4_2-branch) (revision 126002)
10547 /* Software floating-point emulation.
10548 Convert a 64bit unsigned integer to IEEE single
10549 - Copyright (C) 1997,1999, 2006 Free Software Foundation, Inc.
10550 + Copyright (C) 1997, 1999, 2006, 2007 Free Software Foundation, Inc.
10551 This file is part of the GNU C Library.
10552 Contributed by Richard Henderson (rth@cygnus.com) and
10553 Jakub Jelinek (jj@ultra.linux.cz).
10555 #include "soft-fp.h"
10556 #include "single.h"
10559 -__floatundisf(UDItype i)
10560 +SFtype __floatundisf(UDItype i)
10564 Index: gcc/config/soft-fp/op-2.h
10565 ===================================================================
10566 --- gcc/config/soft-fp/op-2.h (.../tags/gcc_4_2_0_release) (revision 126002)
10567 +++ gcc/config/soft-fp/op-2.h (.../branches/gcc-4_2-branch) (revision 126002)
10569 /* Software floating-point emulation.
10570 Basic two-word fraction declaration and manipulation.
10571 - Copyright (C) 1997,1998,1999,2006 Free Software Foundation, Inc.
10572 + Copyright (C) 1997,1998,1999,2006,2007 Free Software Foundation, Inc.
10573 This file is part of the GNU C Library.
10574 Contributed by Richard Henderson (rth@cygnus.com),
10575 Jakub Jelinek (jj@ultra.linux.cz),
10576 @@ -613,3 +613,5 @@
10577 #define _FP_FRAC_COPY_1_2(D, S) (D##_f = S##_f0)
10579 #define _FP_FRAC_COPY_2_1(D, S) ((D##_f0 = S##_f), (D##_f1 = 0))
10581 +#define _FP_FRAC_COPY_2_2(D,S) _FP_FRAC_COPY_2(D,S)
10582 Index: gcc/config/soft-fp/op-4.h
10583 ===================================================================
10584 --- gcc/config/soft-fp/op-4.h (.../tags/gcc_4_2_0_release) (revision 126002)
10585 +++ gcc/config/soft-fp/op-4.h (.../branches/gcc-4_2-branch) (revision 126002)
10587 /* Software floating-point emulation.
10588 Basic four-word fraction declaration and manipulation.
10589 - Copyright (C) 1997,1998,1999,2006 Free Software Foundation, Inc.
10590 + Copyright (C) 1997,1998,1999,2006,2007 Free Software Foundation, Inc.
10591 This file is part of the GNU C Library.
10592 Contributed by Richard Henderson (rth@cygnus.com),
10593 Jakub Jelinek (jj@ultra.linux.cz),
10594 @@ -684,3 +684,5 @@
10595 D##_f[1] = S##_f1; \
10596 D##_f[2] = D##_f[3] = 0; \
10599 +#define _FP_FRAC_COPY_4_4(D,S) _FP_FRAC_COPY_4(D,S)
10600 Index: gcc/config/soft-fp/double.h
10601 ===================================================================
10602 --- gcc/config/soft-fp/double.h (.../tags/gcc_4_2_0_release) (revision 126002)
10603 +++ gcc/config/soft-fp/double.h (.../branches/gcc-4_2-branch) (revision 126002)
10605 /* Software floating-point emulation.
10606 Definitions for IEEE Double Precision
10607 - Copyright (C) 1997,1998,1999,2006 Free Software Foundation, Inc.
10608 + Copyright (C) 1997,1998,1999,2006,2007 Free Software Foundation, Inc.
10609 This file is part of the GNU C Library.
10610 Contributed by Richard Henderson (rth@cygnus.com),
10611 Jakub Jelinek (jj@ultra.linux.cz),
10612 @@ -168,13 +168,13 @@
10615 #if __BYTE_ORDER == __BIG_ENDIAN
10616 - unsigned sign : 1;
10617 - unsigned exp : _FP_EXPBITS_D;
10618 - unsigned long frac : _FP_FRACBITS_D - (_FP_IMPLBIT_D != 0);
10619 + unsigned sign : 1;
10620 + unsigned exp : _FP_EXPBITS_D;
10621 + _FP_W_TYPE frac : _FP_FRACBITS_D - (_FP_IMPLBIT_D != 0);
10623 - unsigned long frac : _FP_FRACBITS_D - (_FP_IMPLBIT_D != 0);
10624 - unsigned exp : _FP_EXPBITS_D;
10625 - unsigned sign : 1;
10626 + _FP_W_TYPE frac : _FP_FRACBITS_D - (_FP_IMPLBIT_D != 0);
10627 + unsigned exp : _FP_EXPBITS_D;
10628 + unsigned sign : 1;
10630 } bits __attribute__((packed));
10632 Index: gcc/tree-ssa-operands.c
10633 ===================================================================
10634 --- gcc/tree-ssa-operands.c (.../tags/gcc_4_2_0_release) (revision 126002)
10635 +++ gcc/tree-ssa-operands.c (.../branches/gcc-4_2-branch) (revision 126002)
10636 @@ -2162,9 +2162,14 @@
10638 stmt_ann_t ann = get_stmt_ann (stmt);
10640 - /* Initially assume that the statement has no volatile operands. */
10641 + /* Initially assume that the statement has no volatile operands and
10642 + does not take the address of any symbols. */
10644 - ann->has_volatile_ops = false;
10646 + ann->has_volatile_ops = false;
10647 + if (ann->addresses_taken)
10648 + ann->addresses_taken = NULL;
10651 start_ssa_stmt_operands ();
10653 Index: libstdc++-v3/configure
10654 ===================================================================
10655 --- libstdc++-v3/configure (.../tags/gcc_4_2_0_release) (revision 126002)
10656 +++ libstdc++-v3/configure (.../branches/gcc-4_2-branch) (revision 126002)
10657 @@ -5764,8 +5764,6 @@
10661 - echo "$as_me:$LINENO: checking for C locale to use" >&5
10662 -echo $ECHO_N "checking for C locale to use... $ECHO_C" >&6
10663 # Check whether --enable-clocale or --disable-clocale was given.
10664 if test "${enable_clocale+set}" = set; then
10665 enableval="$enable_clocale"
10666 @@ -5782,32 +5780,53 @@
10670 - # If they didn't use this option switch, or if they specified --enable
10671 - # with no specific model, we'll have to look for one. If they
10672 - # specified --disable (???), do likewise.
10673 + # Deal with gettext issues. Default to not using it (=no) until we detect
10674 + # support for it later. Let the user turn it off via --e/d, but let that
10675 + # default to on for easier handling.
10677 + # Check whether --enable-nls or --disable-nls was given.
10678 +if test "${enable_nls+set}" = set; then
10679 + enableval="$enable_nls"
10685 + # Either a known packaage, or "auto"
10686 if test $enable_clocale = no || test $enable_clocale = yes; then
10687 enable_clocale=auto
10690 - # Either a known package, or "auto"
10691 enable_clocale_flag=$enable_clocale
10693 - # Probe for locale support if no specific model is specified.
10694 + # Probe for locale model to use if none specified.
10695 # Default to "generic".
10696 if test $enable_clocale_flag = auto; then
10697 case ${target_os} in
10698 linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
10699 - cat >conftest.$ac_ext <<_ACEOF
10700 + enable_clocale_flag=gnu
10702 + darwin* | freebsd*)
10703 + enable_clocale_flag=darwin
10706 + enable_clocale_flag=generic
10711 + # Sanity check model, and test for special functionality.
10712 + if test $enable_clocale_flag = gnu; then
10713 + cat >conftest.$ac_ext <<_ACEOF
10716 cat confdefs.h >>conftest.$ac_ext
10717 cat >>conftest.$ac_ext <<_ACEOF
10718 /* end confdefs.h. */
10720 - #include <features.h>
10721 - #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
10724 + #include <features.h>
10725 + #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
10730 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10731 @@ -5819,9 +5838,8 @@
10735 - # Test for bugs early in glibc-2.2.x series
10736 - if test $enable_clocale_flag = gnu; then
10737 - if test "$cross_compiling" = yes; then
10738 + # Test for bugs early in glibc-2.2.x series
10739 + if test "$cross_compiling" = yes; then
10740 enable_clocale_flag=generic
10742 cat >conftest.$ac_ext <<_ACEOF
10743 @@ -5831,28 +5849,28 @@
10744 cat >>conftest.$ac_ext <<_ACEOF
10745 /* end confdefs.h. */
10747 - #define _GNU_SOURCE 1
10748 - #include <locale.h>
10749 - #include <string.h>
10750 - #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
10751 - extern __typeof(newlocale) __newlocale;
10752 - extern __typeof(duplocale) __duplocale;
10753 - extern __typeof(strcoll_l) __strcoll_l;
10757 - const char __one[] = "Äuglein Augmen";
10758 - const char __two[] = "Äuglein";
10762 - __locale_t loc_dup;
10763 - loc = __newlocale(1 << LC_ALL, "de_DE", 0);
10764 - loc_dup = __duplocale(loc);
10765 - i = __strcoll_l(__one, __two, loc);
10766 - j = __strcoll_l(__one, __two, loc_dup);
10769 + #define _GNU_SOURCE 1
10770 + #include <locale.h>
10771 + #include <string.h>
10772 + #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
10773 + extern __typeof(newlocale) __newlocale;
10774 + extern __typeof(duplocale) __duplocale;
10775 + extern __typeof(strcoll_l) __strcoll_l;
10779 + const char __one[] = "Äuglein Augmen";
10780 + const char __two[] = "Äuglein";
10784 + __locale_t loc_dup;
10785 + loc = __newlocale(1 << LC_ALL, "de_DE", 0);
10786 + loc_dup = __duplocale(loc);
10787 + i = __strcoll_l(__one, __two, loc);
10788 + j = __strcoll_l(__one, __two, loc_dup);
10793 rm -f conftest$ac_exeext
10794 @@ -5877,32 +5895,176 @@
10796 rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
10800 - # ... at some point put __strxfrm_l tests in as well.
10802 - darwin* | freebsd*)
10803 - enable_clocale_flag=darwin
10806 - enable_clocale_flag=generic
10809 + # Set it to scream when it hurts.
10810 + ac_save_CFLAGS="$CFLAGS"
10811 + CFLAGS="-Wimplicit-function-declaration -Werror"
10813 + # Use strxfrm_l if available.
10814 + cat >conftest.$ac_ext <<_ACEOF
10817 +cat confdefs.h >>conftest.$ac_ext
10818 +cat >>conftest.$ac_ext <<_ACEOF
10819 +/* end confdefs.h. */
10820 +#define _GNU_SOURCE 1
10821 + #include <string.h>
10822 + #include <locale.h>
10826 +char s[128]; __locale_t loc; strxfrm_l(s, "C", 5, loc);
10831 +rm -f conftest.$ac_objext
10832 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
10833 + (eval $ac_compile) 2>conftest.er1
10835 + grep -v '^ *+' conftest.er1 >conftest.err
10836 + rm -f conftest.er1
10837 + cat conftest.err >&5
10838 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
10839 + (exit $ac_status); } &&
10840 + { ac_try='test -z "$ac_c_werror_flag"
10841 + || test ! -s conftest.err'
10842 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
10843 + (eval $ac_try) 2>&5
10845 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
10846 + (exit $ac_status); }; } &&
10847 + { ac_try='test -s conftest.$ac_objext'
10848 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
10849 + (eval $ac_try) 2>&5
10851 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
10852 + (exit $ac_status); }; }; then
10854 +cat >>confdefs.h <<\_ACEOF
10855 +#define HAVE_STRXFRM_L 1
10859 + echo "$as_me: failed program was:" >&5
10860 +sed 's/^/| /' conftest.$ac_ext >&5
10863 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
10865 + # Use strerror_l if available.
10866 + cat >conftest.$ac_ext <<_ACEOF
10869 +cat confdefs.h >>conftest.$ac_ext
10870 +cat >>conftest.$ac_ext <<_ACEOF
10871 +/* end confdefs.h. */
10872 +#define _GNU_SOURCE 1
10873 + #include <string.h>
10874 + #include <locale.h>
10878 +__locale_t loc; strerror_l(5, loc);
10883 +rm -f conftest.$ac_objext
10884 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
10885 + (eval $ac_compile) 2>conftest.er1
10887 + grep -v '^ *+' conftest.er1 >conftest.err
10888 + rm -f conftest.er1
10889 + cat conftest.err >&5
10890 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
10891 + (exit $ac_status); } &&
10892 + { ac_try='test -z "$ac_c_werror_flag"
10893 + || test ! -s conftest.err'
10894 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
10895 + (eval $ac_try) 2>&5
10897 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
10898 + (exit $ac_status); }; } &&
10899 + { ac_try='test -s conftest.$ac_objext'
10900 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
10901 + (eval $ac_try) 2>&5
10903 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
10904 + (exit $ac_status); }; }; then
10906 +cat >>confdefs.h <<\_ACEOF
10907 +#define HAVE_STRERROR_L 1
10911 + echo "$as_me: failed program was:" >&5
10912 +sed 's/^/| /' conftest.$ac_ext >&5
10915 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
10917 + CFLAGS="$ac_save_CFLAGS"
10920 - # Deal with gettext issues. Default to not using it (=no) until we detect
10921 - # support for it later. Let the user turn it off via --e/d, but let that
10922 - # default to on for easier handling.
10924 - # Check whether --enable-nls or --disable-nls was given.
10925 -if test "${enable_nls+set}" = set; then
10926 - enableval="$enable_nls"
10927 + # Perhaps use strerror_r if available, and strerror_l isn't.
10928 + ac_save_CFLAGS="$CFLAGS"
10929 + CFLAGS="-Wimplicit-function-declaration -Werror"
10930 + cat >conftest.$ac_ext <<_ACEOF
10933 +cat confdefs.h >>conftest.$ac_ext
10934 +cat >>conftest.$ac_ext <<_ACEOF
10935 +/* end confdefs.h. */
10936 +#define _GNU_SOURCE 1
10937 + #include <string.h>
10938 + #include <locale.h>
10942 +char s[128]; strerror_r(5, s, 128);
10947 +rm -f conftest.$ac_objext
10948 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
10949 + (eval $ac_compile) 2>conftest.er1
10951 + grep -v '^ *+' conftest.er1 >conftest.err
10952 + rm -f conftest.er1
10953 + cat conftest.err >&5
10954 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
10955 + (exit $ac_status); } &&
10956 + { ac_try='test -z "$ac_c_werror_flag"
10957 + || test ! -s conftest.err'
10958 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
10959 + (eval $ac_try) 2>&5
10961 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
10962 + (exit $ac_status); }; } &&
10963 + { ac_try='test -s conftest.$ac_objext'
10964 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
10965 + (eval $ac_try) 2>&5
10967 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
10968 + (exit $ac_status); }; }; then
10970 +cat >>confdefs.h <<\_ACEOF
10971 +#define HAVE_STRERROR_R 1
10977 + echo "$as_me: failed program was:" >&5
10978 +sed 's/^/| /' conftest.$ac_ext >&5
10981 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
10982 + CFLAGS="$ac_save_CFLAGS"
10984 # Set configure bits for specified locale package
10985 + echo "$as_me:$LINENO: checking for C locale to use" >&5
10986 +echo $ECHO_N "checking for C locale to use... $ECHO_C" >&6
10987 case ${enable_clocale_flag} in
10989 echo "$as_me:$LINENO: result: generic" >&5
10990 @@ -8015,7 +8177,7 @@
10992 # Fake what AC_TRY_COMPILE does. XXX Look at redoing this new-style.
10993 cat > conftest.$ac_ext << EOF
10994 -#line 8018 "configure"
10995 +#line 8180 "configure"
10998 // NB: _Atomic_word not necessarily int.
10999 @@ -8395,11 +8557,9 @@
11000 # NB: This flag only works reliably after 2.16.1. Configure tests
11001 # for this are difficult, so hard wire a value that should work.
11003 - # All these tests are for C++, but run with the "C" compiler driver.
11004 - # Need to do this so that g++ won't try to link in libstdc++/libsupc++.
11005 ac_test_CFLAGS="${CFLAGS+set}"
11006 ac_save_CFLAGS="$CFLAGS"
11007 - CFLAGS='-x c++ -Wl,--gc-sections'
11008 + CFLAGS='-Wl,--gc-sections'
11010 # Check for -Wl,--gc-sections
11011 echo "$as_me:$LINENO: checking for ld that supports -Wl,--gc-sections" >&5
11012 @@ -54307,11 +54467,9 @@
11013 # NB: This flag only works reliably after 2.16.1. Configure tests
11014 # for this are difficult, so hard wire a value that should work.
11016 - # All these tests are for C++, but run with the "C" compiler driver.
11017 - # Need to do this so that g++ won't try to link in libstdc++/libsupc++.
11018 ac_test_CFLAGS="${CFLAGS+set}"
11019 ac_save_CFLAGS="$CFLAGS"
11020 - CFLAGS='-x c++ -Wl,--gc-sections'
11021 + CFLAGS='-Wl,--gc-sections'
11023 # Check for -Wl,--gc-sections
11024 echo "$as_me:$LINENO: checking for ld that supports -Wl,--gc-sections" >&5
11025 @@ -75669,11 +75827,9 @@
11026 # NB: This flag only works reliably after 2.16.1. Configure tests
11027 # for this are difficult, so hard wire a value that should work.
11029 - # All these tests are for C++, but run with the "C" compiler driver.
11030 - # Need to do this so that g++ won't try to link in libstdc++/libsupc++.
11031 ac_test_CFLAGS="${CFLAGS+set}"
11032 ac_save_CFLAGS="$CFLAGS"
11033 - CFLAGS='-x c++ -Wl,--gc-sections'
11034 + CFLAGS='-Wl,--gc-sections'
11036 # Check for -Wl,--gc-sections
11037 echo "$as_me:$LINENO: checking for ld that supports -Wl,--gc-sections" >&5
11038 @@ -77194,11 +77350,9 @@
11039 # NB: This flag only works reliably after 2.16.1. Configure tests
11040 # for this are difficult, so hard wire a value that should work.
11042 - # All these tests are for C++, but run with the "C" compiler driver.
11043 - # Need to do this so that g++ won't try to link in libstdc++/libsupc++.
11044 ac_test_CFLAGS="${CFLAGS+set}"
11045 ac_save_CFLAGS="$CFLAGS"
11046 - CFLAGS='-x c++ -Wl,--gc-sections'
11047 + CFLAGS='-Wl,--gc-sections'
11049 # Check for -Wl,--gc-sections
11050 echo "$as_me:$LINENO: checking for ld that supports -Wl,--gc-sections" >&5
11051 @@ -78687,11 +78841,9 @@
11052 # NB: This flag only works reliably after 2.16.1. Configure tests
11053 # for this are difficult, so hard wire a value that should work.
11055 - # All these tests are for C++, but run with the "C" compiler driver.
11056 - # Need to do this so that g++ won't try to link in libstdc++/libsupc++.
11057 ac_test_CFLAGS="${CFLAGS+set}"
11058 ac_save_CFLAGS="$CFLAGS"
11059 - CFLAGS='-x c++ -Wl,--gc-sections'
11060 + CFLAGS='-Wl,--gc-sections'
11062 # Check for -Wl,--gc-sections
11063 echo "$as_me:$LINENO: checking for ld that supports -Wl,--gc-sections" >&5
11064 @@ -100579,11 +100731,9 @@
11065 # NB: This flag only works reliably after 2.16.1. Configure tests
11066 # for this are difficult, so hard wire a value that should work.
11068 - # All these tests are for C++, but run with the "C" compiler driver.
11069 - # Need to do this so that g++ won't try to link in libstdc++/libsupc++.
11070 ac_test_CFLAGS="${CFLAGS+set}"
11071 ac_save_CFLAGS="$CFLAGS"
11072 - CFLAGS='-x c++ -Wl,--gc-sections'
11073 + CFLAGS='-Wl,--gc-sections'
11075 # Check for -Wl,--gc-sections
11076 echo "$as_me:$LINENO: checking for ld that supports -Wl,--gc-sections" >&5
11077 @@ -101426,11 +101576,9 @@
11078 # NB: This flag only works reliably after 2.16.1. Configure tests
11079 # for this are difficult, so hard wire a value that should work.
11081 - # All these tests are for C++, but run with the "C" compiler driver.
11082 - # Need to do this so that g++ won't try to link in libstdc++/libsupc++.
11083 ac_test_CFLAGS="${CFLAGS+set}"
11084 ac_save_CFLAGS="$CFLAGS"
11085 - CFLAGS='-x c++ -Wl,--gc-sections'
11086 + CFLAGS='-Wl,--gc-sections'
11088 # Check for -Wl,--gc-sections
11089 echo "$as_me:$LINENO: checking for ld that supports -Wl,--gc-sections" >&5
11090 @@ -102829,11 +102977,9 @@
11091 # NB: This flag only works reliably after 2.16.1. Configure tests
11092 # for this are difficult, so hard wire a value that should work.
11094 - # All these tests are for C++, but run with the "C" compiler driver.
11095 - # Need to do this so that g++ won't try to link in libstdc++/libsupc++.
11096 ac_test_CFLAGS="${CFLAGS+set}"
11097 ac_save_CFLAGS="$CFLAGS"
11098 - CFLAGS='-x c++ -Wl,--gc-sections'
11099 + CFLAGS='-Wl,--gc-sections'
11101 # Check for -Wl,--gc-sections
11102 echo "$as_me:$LINENO: checking for ld that supports -Wl,--gc-sections" >&5
11103 @@ -104624,11 +104770,9 @@
11104 # NB: This flag only works reliably after 2.16.1. Configure tests
11105 # for this are difficult, so hard wire a value that should work.
11107 - # All these tests are for C++, but run with the "C" compiler driver.
11108 - # Need to do this so that g++ won't try to link in libstdc++/libsupc++.
11109 ac_test_CFLAGS="${CFLAGS+set}"
11110 ac_save_CFLAGS="$CFLAGS"
11111 - CFLAGS='-x c++ -Wl,--gc-sections'
11112 + CFLAGS='-Wl,--gc-sections'
11114 # Check for -Wl,--gc-sections
11115 echo "$as_me:$LINENO: checking for ld that supports -Wl,--gc-sections" >&5
11116 @@ -105869,11 +106013,9 @@
11117 # NB: This flag only works reliably after 2.16.1. Configure tests
11118 # for this are difficult, so hard wire a value that should work.
11120 - # All these tests are for C++, but run with the "C" compiler driver.
11121 - # Need to do this so that g++ won't try to link in libstdc++/libsupc++.
11122 ac_test_CFLAGS="${CFLAGS+set}"
11123 ac_save_CFLAGS="$CFLAGS"
11124 - CFLAGS='-x c++ -Wl,--gc-sections'
11125 + CFLAGS='-Wl,--gc-sections'
11127 # Check for -Wl,--gc-sections
11128 echo "$as_me:$LINENO: checking for ld that supports -Wl,--gc-sections" >&5
11129 @@ -106898,11 +107040,9 @@
11130 # NB: This flag only works reliably after 2.16.1. Configure tests
11131 # for this are difficult, so hard wire a value that should work.
11133 - # All these tests are for C++, but run with the "C" compiler driver.
11134 - # Need to do this so that g++ won't try to link in libstdc++/libsupc++.
11135 ac_test_CFLAGS="${CFLAGS+set}"
11136 ac_save_CFLAGS="$CFLAGS"
11137 - CFLAGS='-x c++ -Wl,--gc-sections'
11138 + CFLAGS='-Wl,--gc-sections'
11140 # Check for -Wl,--gc-sections
11141 echo "$as_me:$LINENO: checking for ld that supports -Wl,--gc-sections" >&5
11142 Index: libstdc++-v3/include/bits/ostream.tcc
11143 ===================================================================
11144 --- libstdc++-v3/include/bits/ostream.tcc (.../tags/gcc_4_2_0_release) (revision 126002)
11145 +++ libstdc++-v3/include/bits/ostream.tcc (.../branches/gcc-4_2-branch) (revision 126002)
11146 @@ -334,7 +334,6 @@
11147 extern template ostream& operator<<(ostream&, const char*);
11148 extern template ostream& operator<<(ostream&, const unsigned char*);
11149 extern template ostream& operator<<(ostream&, const signed char*);
11150 - extern template ostream& __ostream_insert(ostream&, const char*, streamsize);
11152 extern template ostream& ostream::_M_insert(long);
11153 extern template ostream& ostream::_M_insert(unsigned long);
11154 @@ -356,8 +355,6 @@
11155 extern template wostream& operator<<(wostream&, char);
11156 extern template wostream& operator<<(wostream&, const wchar_t*);
11157 extern template wostream& operator<<(wostream&, const char*);
11158 - extern template wostream& __ostream_insert(wostream&, const wchar_t*,
11161 extern template wostream& wostream::_M_insert(long);
11162 extern template wostream& wostream::_M_insert(unsigned long);
11163 Index: libstdc++-v3/include/bits/ostream_insert.h
11164 ===================================================================
11165 --- libstdc++-v3/include/bits/ostream_insert.h (.../tags/gcc_4_2_0_release) (revision 126002)
11166 +++ libstdc++-v3/include/bits/ostream_insert.h (.../branches/gcc-4_2-branch) (revision 126002)
11167 @@ -109,6 +109,18 @@
11171 + // Inhibit implicit instantiations for required instantiations,
11172 + // which are defined via explicit instantiations elsewhere.
11173 + // NB: This syntax is a GNU extension.
11174 +#if _GLIBCXX_EXTERN_TEMPLATE
11175 + extern template ostream& __ostream_insert(ostream&, const char*, streamsize);
11177 +#ifdef _GLIBCXX_USE_WCHAR_T
11178 + extern template wostream& __ostream_insert(wostream&, const wchar_t*,
11183 _GLIBCXX_END_NAMESPACE
11185 #endif /* _OSTREAM_INSERT_H */
11186 Index: libstdc++-v3/include/std/std_fstream.h
11187 ===================================================================
11188 --- libstdc++-v3/include/std/std_fstream.h (.../tags/gcc_4_2_0_release) (revision 126002)
11189 +++ libstdc++-v3/include/std/std_fstream.h (.../branches/gcc-4_2-branch) (revision 126002)
11191 // File based streams -*- C++ -*-
11193 -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
11194 +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
11196 // Free Software Foundation, Inc.
11198 // This file is part of the GNU ISO C++ Library. This library is free
11199 @@ -257,9 +258,30 @@
11200 * Otherwise it tries to open the file named @a s using the flags
11201 * given in @a mode.
11203 - * [Table 92 gives the relation between openmode combinations and the
11204 - * equivalent fopen() flags, but the table has not been copied yet.]
11206 + * Table 92, adapted here, gives the relation between openmode
11207 + * combinations and the equivalent fopen() flags.
11208 + * (NB: lines in|out|app and binary|in|out|app per DR 596)
11209 + * +---------------------------------------------------------+
11210 + * | ios_base Flag combination stdio equivalent |
11211 + * |binary in out trunc app |
11212 + * +---------------------------------------------------------+
11220 + * +---------------------------------------------------------+
11225 + * | + + + "r+b" |
11226 + * | + + + + "w+b" |
11227 + * | + + + + "a+b" |
11228 + * +---------------------------------------------------------+
11231 open(const char* __s, ios_base::openmode __mode);
11233 Index: libstdc++-v3/ChangeLog
11234 ===================================================================
11235 --- libstdc++-v3/ChangeLog (.../tags/gcc_4_2_0_release) (revision 126002)
11236 +++ libstdc++-v3/ChangeLog (.../branches/gcc-4_2-branch) (revision 126002)
11238 +2007-06-08 Paolo Carlini <pcarlini@suse.de>
11240 + * docs/html/install.html: Adjust consistently with libstdc++/31717.
11242 +2007-06-08 Francesco Palagi <palagi@arcetri.astro.it>
11244 + * include/std/std_fstream.h: Add Table 92 in comment.
11246 +2007-06-06 Benjamin Kosnik <bkoz@redhat.com>
11247 + Frank Mori Hess <frank.hess@nist.gov>
11249 + * docs/html/debug.html: Correct link.
11251 +2007-05-28 Benjamin Kosnik <bkoz@redhat.com>
11253 + PR libstdc++/31717
11254 + * acinclude.m4 (GLIBCXX_ENABLE_CLOCALE): Re-organize. Sanity check
11255 + gnu locale model requests to make sure it will work for the requested
11256 + target. Add checks for strxfrm_l, strerror_l when in gnu locale,
11257 + and strerror_r everywhere.
11258 + * aclocal.m4: Regenerated.
11259 + * configure: Regenerated.
11260 + * config.h.in: Regenerated.
11262 +2007-05-24 Paolo Carlini <pcarlini@suse.de>
11264 + * include/bits/ostream.tcc: Do not inhibit implicit instantiation
11265 + of __ostream_insert here...
11266 + * include/bits/ostream_insert.h: ... do it here.
11268 +2007-05-21 Paolo Carlini <pcarlini@suse.de>
11270 + PR libstdc++/31621
11271 + * acinclude.m4 ([GLIBCXX_CHECK_LINKER_FEATURES]): Use the C compiler.
11272 + * configure: Regenerate.
11274 2007-05-13 Release Manager
11276 * GCC 4.2.0 released.
11277 Index: libstdc++-v3/docs/html/debug.html
11278 ===================================================================
11279 --- libstdc++-v3/docs/html/debug.html (.../tags/gcc_4_2_0_release) (revision 126002)
11280 +++ libstdc++-v3/docs/html/debug.html (.../branches/gcc-4_2-branch) (revision 126002)
11281 @@ -420,7 +420,7 @@
11284 <h3 class="left"><a name="verbterm">Tracking uncaught exceptions</a></h3>
11285 -<p>The <a href="19_diagnostics/howto.html#4">verbose termination handler</a>
11286 +<p>The <a href="18_support/howto.html#4">verbose termination handler</a>
11287 gives information about uncaught exceptions which are killing the
11288 program. It is described in the linked-to page.
11290 Index: libstdc++-v3/docs/html/install.html
11291 ===================================================================
11292 --- libstdc++-v3/docs/html/install.html (.../tags/gcc_4_2_0_release) (revision 126002)
11293 +++ libstdc++-v3/docs/html/install.html (.../branches/gcc-4_2-branch) (revision 126002)
11295 information must be installed.
11298 - The configure option --enable-clocale can be used force a
11299 - particular behavior.
11300 + Note that those sanity checks are also perfomed when an explicit
11301 + --enable-clocale=gnu configure option is used: this behavior is
11302 + new in gcc 4.2.1 and defends against misconfigurations.
11306 Index: libstdc++-v3/config.h.in
11307 ===================================================================
11308 --- libstdc++-v3/config.h.in (.../tags/gcc_4_2_0_release) (revision 126002)
11309 +++ libstdc++-v3/config.h.in (.../branches/gcc-4_2-branch) (revision 126002)
11310 @@ -298,6 +298,12 @@
11311 /* Define to 1 if you have the <stdlib.h> header file. */
11312 #undef HAVE_STDLIB_H
11314 +/* Define if strerror_l is available in <string.h>. */
11315 +#undef HAVE_STRERROR_L
11317 +/* Define if strerror_r is available in <string.h>. */
11318 +#undef HAVE_STRERROR_R
11320 /* Define to 1 if you have the <strings.h> header file. */
11321 #undef HAVE_STRINGS_H
11323 @@ -310,6 +316,9 @@
11324 /* Define to 1 if you have the `strtold' function. */
11325 #undef HAVE_STRTOLD
11327 +/* Define if strxfrm_l is available in <string.h>. */
11328 +#undef HAVE_STRXFRM_L
11330 /* Define to 1 if you have the <sys/filio.h> header file. */
11331 #undef HAVE_SYS_FILIO_H
11333 Index: libstdc++-v3/acinclude.m4
11334 ===================================================================
11335 --- libstdc++-v3/acinclude.m4 (.../tags/gcc_4_2_0_release) (revision 126002)
11336 +++ libstdc++-v3/acinclude.m4 (.../branches/gcc-4_2-branch) (revision 126002)
11337 @@ -251,11 +251,9 @@
11338 # NB: This flag only works reliably after 2.16.1. Configure tests
11339 # for this are difficult, so hard wire a value that should work.
11341 - # All these tests are for C++, but run with the "C" compiler driver.
11342 - # Need to do this so that g++ won't try to link in libstdc++/libsupc++.
11343 ac_test_CFLAGS="${CFLAGS+set}"
11344 ac_save_CFLAGS="$CFLAGS"
11345 - CFLAGS='-x c++ -Wl,--gc-sections'
11346 + CFLAGS='-Wl,--gc-sections'
11348 # Check for -Wl,--gc-sections
11349 AC_MSG_CHECKING([for ld that supports -Wl,--gc-sections])
11350 @@ -1334,64 +1332,31 @@
11351 dnl Default is generic.
11353 AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
11354 - AC_MSG_CHECKING([for C locale to use])
11355 GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@],
11356 [use MODEL for target locale package],
11357 [permit generic|gnu|ieee_1003.1-2001|yes|no|auto])
11359 + # Deal with gettext issues. Default to not using it (=no) until we detect
11360 + # support for it later. Let the user turn it off via --e/d, but let that
11361 + # default to on for easier handling.
11363 + AC_ARG_ENABLE(nls,
11364 + AC_HELP_STRING([--enable-nls],[use Native Language Support (default)]),
11366 + [enable_nls=yes])
11368 - # If they didn't use this option switch, or if they specified --enable
11369 - # with no specific model, we'll have to look for one. If they
11370 - # specified --disable (???), do likewise.
11371 + # Either a known packaage, or "auto"
11372 if test $enable_clocale = no || test $enable_clocale = yes; then
11373 enable_clocale=auto
11376 - # Either a known package, or "auto"
11377 enable_clocale_flag=$enable_clocale
11379 - # Probe for locale support if no specific model is specified.
11380 + # Probe for locale model to use if none specified.
11381 # Default to "generic".
11382 if test $enable_clocale_flag = auto; then
11383 case ${target_os} in
11384 linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
11385 - AC_EGREP_CPP([_GLIBCXX_ok], [
11386 - #include <features.h>
11387 - #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
11390 - ], enable_clocale_flag=gnu, enable_clocale_flag=generic)
11392 - # Test for bugs early in glibc-2.2.x series
11393 - if test $enable_clocale_flag = gnu; then
11395 - #define _GNU_SOURCE 1
11396 - #include <locale.h>
11397 - #include <string.h>
11398 - #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
11399 - extern __typeof(newlocale) __newlocale;
11400 - extern __typeof(duplocale) __duplocale;
11401 - extern __typeof(strcoll_l) __strcoll_l;
11405 - const char __one[] = "Äuglein Augmen";
11406 - const char __two[] = "Äuglein";
11410 - __locale_t loc_dup;
11411 - loc = __newlocale(1 << LC_ALL, "de_DE", 0);
11412 - loc_dup = __duplocale(loc);
11413 - i = __strcoll_l(__one, __two, loc);
11414 - j = __strcoll_l(__one, __two, loc_dup);
11418 - [enable_clocale_flag=gnu],[enable_clocale_flag=generic],
11419 - [enable_clocale_flag=generic])
11422 - # ... at some point put __strxfrm_l tests in as well.
11423 + enable_clocale_flag=gnu
11425 darwin* | freebsd*)
11426 enable_clocale_flag=darwin
11427 @@ -1402,16 +1367,79 @@
11431 - # Deal with gettext issues. Default to not using it (=no) until we detect
11432 - # support for it later. Let the user turn it off via --e/d, but let that
11433 - # default to on for easier handling.
11435 - AC_ARG_ENABLE(nls,
11436 - AC_HELP_STRING([--enable-nls],[use Native Language Support (default)]),
11438 - [enable_nls=yes])
11439 + # Sanity check model, and test for special functionality.
11440 + if test $enable_clocale_flag = gnu; then
11441 + AC_EGREP_CPP([_GLIBCXX_ok], [
11442 + #include <features.h>
11443 + #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
11446 + ], enable_clocale_flag=gnu, enable_clocale_flag=generic)
11448 + # Test for bugs early in glibc-2.2.x series
11450 + #define _GNU_SOURCE 1
11451 + #include <locale.h>
11452 + #include <string.h>
11453 + #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
11454 + extern __typeof(newlocale) __newlocale;
11455 + extern __typeof(duplocale) __duplocale;
11456 + extern __typeof(strcoll_l) __strcoll_l;
11460 + const char __one[] = "Äuglein Augmen";
11461 + const char __two[] = "Äuglein";
11465 + __locale_t loc_dup;
11466 + loc = __newlocale(1 << LC_ALL, "de_DE", 0);
11467 + loc_dup = __duplocale(loc);
11468 + i = __strcoll_l(__one, __two, loc);
11469 + j = __strcoll_l(__one, __two, loc_dup);
11473 + [enable_clocale_flag=gnu],[enable_clocale_flag=generic],
11474 + [enable_clocale_flag=generic])
11476 + # Set it to scream when it hurts.
11477 + ac_save_CFLAGS="$CFLAGS"
11478 + CFLAGS="-Wimplicit-function-declaration -Werror"
11480 + # Use strxfrm_l if available.
11481 + AC_TRY_COMPILE([#define _GNU_SOURCE 1
11482 + #include <string.h>
11483 + #include <locale.h>],
11484 + [char s[128]; __locale_t loc; strxfrm_l(s, "C", 5, loc);],
11485 + AC_DEFINE(HAVE_STRXFRM_L, 1,
11486 + [Define if strxfrm_l is available in <string.h>.]),)
11488 + # Use strerror_l if available.
11489 + AC_TRY_COMPILE([#define _GNU_SOURCE 1
11490 + #include <string.h>
11491 + #include <locale.h>],
11492 + [__locale_t loc; strerror_l(5, loc);],
11493 + AC_DEFINE(HAVE_STRERROR_L, 1,
11494 + [Define if strerror_l is available in <string.h>.]),)
11496 + CFLAGS="$ac_save_CFLAGS"
11499 + # Perhaps use strerror_r if available, and strerror_l isn't.
11500 + ac_save_CFLAGS="$CFLAGS"
11501 + CFLAGS="-Wimplicit-function-declaration -Werror"
11502 + AC_TRY_COMPILE([#define _GNU_SOURCE 1
11503 + #include <string.h>
11504 + #include <locale.h>],
11505 + [char s[128]; strerror_r(5, s, 128);],
11506 + AC_DEFINE(HAVE_STRERROR_R, 1,
11507 + [Define if strerror_r is available in <string.h>.]),)
11508 + CFLAGS="$ac_save_CFLAGS"
11510 # Set configure bits for specified locale package
11511 + AC_MSG_CHECKING([for C locale to use])
11512 case ${enable_clocale_flag} in
11514 AC_MSG_RESULT(generic)
11515 Index: libgfortran/runtime/environ.c
11516 ===================================================================
11517 --- libgfortran/runtime/environ.c (.../tags/gcc_4_2_0_release) (revision 126002)
11518 +++ libgfortran/runtime/environ.c (.../branches/gcc-4_2-branch) (revision 126002)
11519 @@ -861,14 +861,13 @@
11526 int continue_ulist;
11534 /* Parse the string. First, let's look for a default. */
11535 @@ -923,6 +922,7 @@
11543 @@ -939,6 +939,18 @@
11544 tok = next_token ();
11548 + if (next_token () != ':')
11550 + endian = CONVERT_NATIVE;
11554 + if (next_token () != ':')
11556 + endian = CONVERT_SWAP;
11560 if (next_token () != ':')
11562 Index: libgfortran/intrinsics/reshape_generic.c
11563 ===================================================================
11564 --- libgfortran/intrinsics/reshape_generic.c (.../tags/gcc_4_2_0_release) (revision 126002)
11565 +++ libgfortran/intrinsics/reshape_generic.c (.../branches/gcc-4_2-branch) (revision 126002)
11566 @@ -266,7 +266,7 @@
11570 - sptr += sstride[n] * size;
11571 + src += sstride[n] * size;
11575 Index: libgfortran/intrinsics/ishftc.c
11576 ===================================================================
11577 --- libgfortran/intrinsics/ishftc.c (.../tags/gcc_4_2_0_release) (revision 126002)
11578 +++ libgfortran/intrinsics/ishftc.c (.../branches/gcc-4_2-branch) (revision 126002)
11581 ishftc4 (GFC_INTEGER_4 i, GFC_INTEGER_4 shift, GFC_INTEGER_4 size)
11583 - GFC_INTEGER_4 mask;
11584 - GFC_UINTEGER_4 bits;
11585 + GFC_UINTEGER_4 mask, bits;
11588 shift = shift + size;
11590 if (shift == 0 || shift == size)
11593 - mask = (~(GFC_INTEGER_4)0) << size;
11594 - bits = i & ~mask;
11595 - return (i & mask) | (bits >> (size - shift)) | ((i << shift) & ~mask);
11596 + /* In C, the result of the shift operator is undefined if the right operand
11597 + is greater than or equal to the number of bits in the left operand. So we
11598 + have to special case it for fortran. */
11599 + mask = ~((size == 32) ? 0 : (~0 << size));
11603 + return (i & ~mask) | ((bits << shift) & mask) | (bits >> (size - shift));
11606 extern GFC_INTEGER_8 ishftc8 (GFC_INTEGER_8, GFC_INTEGER_4, GFC_INTEGER_4);
11609 ishftc8 (GFC_INTEGER_8 i, GFC_INTEGER_4 shift, GFC_INTEGER_4 size)
11611 - GFC_INTEGER_8 mask;
11612 - GFC_UINTEGER_8 bits;
11613 + GFC_UINTEGER_8 mask, bits;
11616 shift = shift + size;
11618 if (shift == 0 || shift == size)
11621 - mask = (~(GFC_INTEGER_8)0) << size;
11622 - bits = i & ~mask;
11623 - return (i & mask) | (bits >> (size - shift)) | ((i << shift) & ~mask);
11624 + /* In C, the result of the shift operator is undefined if the right operand
11625 + is greater than or equal to the number of bits in the left operand. So we
11626 + have to special case it for fortran. */
11627 + mask = ~((size == 64) ? 0 : (~0 << size));
11631 + return (i & ~mask) | ((bits << shift) & mask) | (bits >> (size - shift));
11634 #ifdef HAVE_GFC_INTEGER_16
11637 ishftc16 (GFC_INTEGER_16 i, GFC_INTEGER_4 shift, GFC_INTEGER_4 size)
11639 - GFC_INTEGER_16 mask;
11640 - GFC_UINTEGER_16 bits;
11641 + GFC_UINTEGER_16 mask, bits;
11644 shift = shift + size;
11646 if (shift == 0 || shift == size)
11649 - mask = (~(GFC_INTEGER_16)0) << size;
11650 - bits = i & ~mask;
11651 - return (i & mask) | (bits >> (size - shift)) | ((i << shift) & ~mask);
11652 + /* In C, the result of the shift operator is undefined if the right operand
11653 + is greater than or equal to the number of bits in the left operand. So we
11654 + have to special case it for fortran. */
11655 + mask = ~((size == 128) ? 0 : (~0 << size));
11659 + return (i & ~mask) | ((bits << shift) & mask) | (bits >> (size - shift));
11662 Index: libgfortran/ChangeLog
11663 ===================================================================
11664 --- libgfortran/ChangeLog (.../tags/gcc_4_2_0_release) (revision 126002)
11665 +++ libgfortran/ChangeLog (.../branches/gcc-4_2-branch) (revision 126002)
11667 +2007-05-23 Jerry DeLisle <jvdelisle@gcc.gnu.org>
11669 + PR libfortran/31964
11670 + Backport from trunk.
11671 + * intrinsics/ishftc.c (ishftc4, ishftc8, ishftc16): Fix mask to handle
11672 + shift of bit-size number of bits.
11674 +2007-05-23 Tobias Burnus <burnus@net-b.de>
11677 + Backport from trunk.
11678 + * runtime/environ.c (mark_range): Fix setting default convert unit.
11680 +2007-05-22 Jerry DeLisle <jvdelisle@gcc.gnu.org>
11682 + PR libfortran/31051
11683 + Backport from trunk.
11684 + * io/transfer.c (formatted_transfer_scalar): Adjust position for pending
11685 + spaces when in writing mode. Clean up some formatting.
11687 +2007-05-22 Tobias Burnus <burnus@net-b.de>
11689 + PR libfortran/31915
11690 + Backport from trunk.
11691 + * io/transfer.c (unformatted_read): Use proper size for real(10).
11692 + (unformatted_write): Ditto.
11694 +2007-05-20 Jerry DeLisle <jvdelisle@gcc.gnu.org>
11696 + PR libfortran/31395
11697 + Backport from 4.3.
11698 + * io/format.c (parse_format_list): Fix parsing. Regression against g77.
11700 +2007-05-20 Thomas Koenig <tkoenig@gcc.gnu.org>
11703 + Backport from trunk.
11704 + * io/transfer.c (read_block_direct): Instead of calling us_read,
11705 + set dtp->u.p.current_unit->current_record = 0 so that pre_position
11706 + will read the record marker.
11707 + (data_transfer_init): For different error conditions, call
11708 + generate_error, then return.
11710 +2007-05-20 Thomas Koenig <tkoenig@gcc.gnu.org>
11712 + PR libfortran/31196
11713 + Backport from trunk.
11714 + * intrinsics/reshape_generic.c (reshape_internal): Increment
11715 + correct variable.
11717 2007-05-13 Release Manager
11719 * GCC 4.2.0 released.
11720 Index: libgfortran/io/transfer.c
11721 ===================================================================
11722 --- libgfortran/io/transfer.c (.../tags/gcc_4_2_0_release) (revision 126002)
11723 +++ libgfortran/io/transfer.c (.../branches/gcc-4_2-branch) (revision 126002)
11724 @@ -493,11 +493,11 @@
11728 - /* Let's make sure the file position is correctly set for the
11729 - next read statement. */
11730 + /* Let's make sure the file position is correctly pre-positioned
11731 + for the next read statement. */
11733 + dtp->u.p.current_unit->current_record = 0;
11734 next_record_r_unf (dtp, 0);
11735 - us_read (dtp, 0);
11736 generate_error (&dtp->common, ERROR_SHORT_RECORD, NULL);
11739 @@ -722,7 +722,11 @@
11740 of the padding. If we hit a short record, then sz is
11741 adjusted accordingly, making later reads no-ops. */
11744 + if (type == BT_REAL || type == BT_COMPLEX)
11745 + sz = size_from_real_kind (kind);
11749 for (i=0; i<nelems; i++)
11751 read_block_direct (dtp, buffer, &sz);
11752 @@ -767,7 +771,11 @@
11753 read kind bytes. We don't care about the contents
11757 + if (type == BT_REAL || type == BT_COMPLEX)
11758 + sz = size_from_real_kind (kind);
11762 for (i=0; i<nelems; i++)
11764 reverse_memcpy(buffer, p, size);
11765 @@ -1144,7 +1152,7 @@
11766 /* Format codes that don't transfer data. */
11769 - consume_data_flag = 0 ;
11770 + consume_data_flag = 0;
11772 pos = bytes_used + f->u.n + dtp->u.p.skips;
11773 dtp->u.p.skips = f->u.n + dtp->u.p.skips;
11774 @@ -1160,6 +1168,7 @@
11775 write_x (dtp, dtp->u.p.skips, dtp->u.p.pending_spaces);
11776 dtp->u.p.skips = dtp->u.p.pending_spaces = 0;
11779 if (dtp->u.p.mode == READING)
11780 read_x (dtp, f->u.n);
11782 @@ -1167,6 +1176,8 @@
11786 + consume_data_flag = 0;
11788 if (f->format == FMT_TL)
11791 @@ -1185,8 +1196,10 @@
11795 - consume_data_flag = 0;
11796 - pos = f->u.n - 1;
11797 + if (dtp->u.p.mode == READING)
11798 + pos = f->u.n - 1;
11800 + pos = f->u.n - dtp->u.p.pending_spaces - 1;
11803 /* Standard 10.6.1.1: excessive left tabbing is reset to the
11804 @@ -1753,16 +1766,19 @@
11805 /* Check the action. */
11807 if (read_flag && dtp->u.p.current_unit->flags.action == ACTION_WRITE)
11808 - generate_error (&dtp->common, ERROR_BAD_ACTION,
11809 - "Cannot read from file opened for WRITE");
11811 + generate_error (&dtp->common, ERROR_BAD_ACTION,
11812 + "Cannot read from file opened for WRITE");
11816 if (!read_flag && dtp->u.p.current_unit->flags.action == ACTION_READ)
11817 - generate_error (&dtp->common, ERROR_BAD_ACTION,
11818 - "Cannot write to file opened for READ");
11820 + generate_error (&dtp->common, ERROR_BAD_ACTION,
11821 + "Cannot write to file opened for READ");
11825 - if ((dtp->common.flags & IOPARM_LIBRETURN_MASK) != IOPARM_LIBRETURN_OK)
11828 dtp->u.p.first_item = 1;
11830 /* Check the format. */
11831 @@ -1770,14 +1786,14 @@
11832 if ((cf & IOPARM_DT_HAS_FORMAT) != 0)
11833 parse_format (dtp);
11835 - if ((dtp->common.flags & IOPARM_LIBRETURN_MASK) != IOPARM_LIBRETURN_OK)
11838 if (dtp->u.p.current_unit->flags.form == FORM_UNFORMATTED
11839 && (cf & (IOPARM_DT_HAS_FORMAT | IOPARM_DT_LIST_FORMAT))
11841 - generate_error (&dtp->common, ERROR_OPTION_CONFLICT,
11842 - "Format present for UNFORMATTED data transfer");
11844 + generate_error (&dtp->common, ERROR_OPTION_CONFLICT,
11845 + "Format present for UNFORMATTED data transfer");
11849 if ((cf & IOPARM_DT_HAS_NAMELIST_NAME) != 0 && dtp->u.p.ionml != NULL)
11851 @@ -1787,13 +1803,19 @@
11853 else if (dtp->u.p.current_unit->flags.form == FORM_FORMATTED &&
11854 !(cf & (IOPARM_DT_HAS_FORMAT | IOPARM_DT_LIST_FORMAT)))
11855 - generate_error (&dtp->common, ERROR_OPTION_CONFLICT,
11856 - "Missing format for FORMATTED data transfer");
11858 + generate_error (&dtp->common, ERROR_OPTION_CONFLICT,
11859 + "Missing format for FORMATTED data transfer");
11862 if (is_internal_unit (dtp)
11863 && dtp->u.p.current_unit->flags.form == FORM_UNFORMATTED)
11864 - generate_error (&dtp->common, ERROR_OPTION_CONFLICT,
11865 - "Internal file cannot be accessed by UNFORMATTED data transfer");
11867 + generate_error (&dtp->common, ERROR_OPTION_CONFLICT,
11868 + "Internal file cannot be accessed by UNFORMATTED "
11869 + "data transfer");
11873 /* Check the record or position number. */
11875 @@ -1823,49 +1845,71 @@
11876 if (dtp->u.p.advance_status != ADVANCE_UNSPECIFIED)
11878 if (dtp->u.p.current_unit->flags.access == ACCESS_DIRECT)
11879 - generate_error (&dtp->common, ERROR_OPTION_CONFLICT,
11880 - "ADVANCE specification conflicts with sequential access");
11882 + generate_error (&dtp->common, ERROR_OPTION_CONFLICT,
11883 + "ADVANCE specification conflicts with sequential access");
11887 if (is_internal_unit (dtp))
11888 - generate_error (&dtp->common, ERROR_OPTION_CONFLICT,
11889 - "ADVANCE specification conflicts with internal file");
11891 + generate_error (&dtp->common, ERROR_OPTION_CONFLICT,
11892 + "ADVANCE specification conflicts with internal file");
11896 if ((cf & (IOPARM_DT_HAS_FORMAT | IOPARM_DT_LIST_FORMAT))
11897 != IOPARM_DT_HAS_FORMAT)
11898 - generate_error (&dtp->common, ERROR_OPTION_CONFLICT,
11899 - "ADVANCE specification requires an explicit format");
11901 + generate_error (&dtp->common, ERROR_OPTION_CONFLICT,
11902 + "ADVANCE specification requires an explicit format");
11909 if ((cf & IOPARM_EOR) != 0 && dtp->u.p.advance_status != ADVANCE_NO)
11910 - generate_error (&dtp->common, ERROR_MISSING_OPTION,
11911 - "EOR specification requires an ADVANCE specification of NO");
11913 + generate_error (&dtp->common, ERROR_MISSING_OPTION,
11914 + "EOR specification requires an ADVANCE specification "
11919 if ((cf & IOPARM_DT_HAS_SIZE) != 0 && dtp->u.p.advance_status != ADVANCE_NO)
11920 - generate_error (&dtp->common, ERROR_MISSING_OPTION,
11921 - "SIZE specification requires an ADVANCE specification of NO");
11924 + generate_error (&dtp->common, ERROR_MISSING_OPTION,
11925 + "SIZE specification requires an ADVANCE specification of NO");
11930 { /* Write constraints. */
11931 if ((cf & IOPARM_END) != 0)
11932 - generate_error (&dtp->common, ERROR_OPTION_CONFLICT,
11933 - "END specification cannot appear in a write statement");
11935 + generate_error (&dtp->common, ERROR_OPTION_CONFLICT,
11936 + "END specification cannot appear in a write statement");
11940 if ((cf & IOPARM_EOR) != 0)
11941 - generate_error (&dtp->common, ERROR_OPTION_CONFLICT,
11942 - "EOR specification cannot appear in a write statement");
11944 + generate_error (&dtp->common, ERROR_OPTION_CONFLICT,
11945 + "EOR specification cannot appear in a write statement");
11949 if ((cf & IOPARM_DT_HAS_SIZE) != 0)
11950 - generate_error (&dtp->common, ERROR_OPTION_CONFLICT,
11951 - "SIZE specification cannot appear in a write statement");
11953 + generate_error (&dtp->common, ERROR_OPTION_CONFLICT,
11954 + "SIZE specification cannot appear in a write statement");
11959 if (dtp->u.p.advance_status == ADVANCE_UNSPECIFIED)
11960 dtp->u.p.advance_status = ADVANCE_YES;
11961 - if ((dtp->common.flags & IOPARM_LIBRETURN_MASK) != IOPARM_LIBRETURN_OK)
11964 /* Sanity checks on the record number. */
11965 if ((cf & IOPARM_DT_HAS_REC) != 0)
11966 Index: libgfortran/io/format.c
11967 ===================================================================
11968 --- libgfortran/io/format.c (.../tags/gcc_4_2_0_release) (revision 126002)
11969 +++ libgfortran/io/format.c (.../branches/gcc-4_2-branch) (revision 126002)
11970 @@ -860,10 +860,11 @@
11972 get_fnode (fmt, &head, &tail, FMT_SLASH);
11974 + goto optional_comma;
11976 - /* Fall Through */
11979 + get_fnode (fmt, &head, &tail, FMT_COLON);
11980 + tail->repeat = 1;
11981 goto optional_comma;
11984 Index: boehm-gc/darwin_stop_world.c
11985 ===================================================================
11986 --- boehm-gc/darwin_stop_world.c (.../tags/gcc_4_2_0_release) (revision 126002)
11987 +++ boehm-gc/darwin_stop_world.c (.../branches/gcc-4_2-branch) (revision 126002)
11989 be allocated, is called the red zone. This area as shown in Figure 3-2 may
11990 be used for any purpose as long as a new stack frame does not need to be
11991 added to the stack."
11994 Page 50: "If a leaf procedure's red zone usage would exceed 224 bytes, then
11995 it must set up a stack frame just like routines that call other routines."
11998 # define PPC_RED_ZONE_SIZE 320
12001 -/* Try to work out the right way to access thread state structure members.
12002 - The structure has changed its definition in different Darwin versions. */
12003 -#if defined(__ppc__)
12004 -# define THREAD_STATE ppc_thread_state_t
12005 -# if defined (HAS_PPC_THREAD_STATE_R0)
12006 -# define THREAD_FLD(x) x
12007 -# elif defined (HAS_PPC_THREAD_STATE___R0)
12008 -# define THREAD_FLD(x) __ ## x
12010 -# error can not work out how to access fields of ppc_thread_state_t
12012 -#elif defined(__ppc64__)
12013 -# define THREAD_STATE ppc_thread_state64_t
12014 -# if defined (HAS_PPC_THREAD_STATE64_R0)
12015 -# define THREAD_FLD(x) x
12016 -# elif defined (HAS_PPC_THREAD_STATE64___R0)
12017 -# define THREAD_FLD(x) __ ## x
12019 -# error can not work out how to access fields of ppc_thread_state64_t
12021 -#elif defined(__i386__)
12022 -# define THREAD_STATE i386_thread_state_t
12023 -# if defined (HAS_I386_THREAD_STATE_EAX)
12024 -# define THREAD_FLD(x) x
12025 -# elif defined (HAS_I386_THREAD_STATE___EAX)
12026 -# define THREAD_FLD(x) __ ## x
12028 -# error can not work out how to access fields of i386_thread_state_t
12030 -#elif defined(__x86_64__)
12031 -# define THREAD_STATE i386_thread_state_t
12032 -# if defined (HAS_I386_THREAD_STATE_EAX)
12033 -# define THREAD_FLD(x) x
12034 -# elif defined (HAS_I386_THREAD_STATE___EAX)
12035 -# define THREAD_FLD(x) __ ## x
12037 -# error can not work out how to access fields of i386_thread_state_t
12040 -# error unknown architecture
12043 typedef struct StackFrame {
12044 unsigned long savedSP;
12045 unsigned long savedCR;
12050 - THREAD_STATE state;
12051 - mach_msg_type_number_t thread_state_count = MACHINE_THREAD_STATE_COUNT;
12052 + GC_THREAD_STATE_T state;
12053 + mach_msg_type_number_t thread_state_count = GC_MACH_THREAD_STATE_COUNT;
12055 me = pthread_self();
12056 if (!GC_thr_initialized) GC_thr_init();
12057 @@ -128,11 +86,8 @@
12058 lo = GC_approx_sp();
12060 /* Get the thread state (registers, etc) */
12061 - r = thread_get_state(
12062 - p->stop_info.mach_thread,
12063 - MACHINE_THREAD_STATE,
12064 - (natural_t*)&state,
12065 - &thread_state_count);
12066 + r = thread_get_state(p->stop_info.mach_thread, GC_MACH_THREAD_STATE,
12067 + (natural_t*)&state, &thread_state_count);
12068 if(r != KERN_SUCCESS) ABORT("thread_get_state failed");
12071 @@ -144,7 +99,33 @@
12072 GC_push_one(state . THREAD_FLD (edx));
12073 GC_push_one(state . THREAD_FLD (edi));
12074 GC_push_one(state . THREAD_FLD (esi));
12075 - GC_push_one(state . THREAD_FLD (ebp));
12076 + GC_push_one(state . THREAD_FLD (ebp));
12078 +#elif defined(X86_64)
12079 + lo = (void*)state . THREAD_FLD (rsp);
12081 + GC_push_one(state . THREAD_FLD (rax));
12082 + GC_push_one(state . THREAD_FLD (rbx));
12083 + GC_push_one(state . THREAD_FLD (rcx));
12084 + GC_push_one(state . THREAD_FLD (rdx));
12085 + GC_push_one(state . THREAD_FLD (rdi));
12086 + GC_push_one(state . THREAD_FLD (rsi));
12087 + GC_push_one(state . THREAD_FLD (rbp));
12088 + GC_push_one(state . THREAD_FLD (rsp));
12089 + GC_push_one(state . THREAD_FLD (r8));
12090 + GC_push_one(state . THREAD_FLD (r9));
12091 + GC_push_one(state . THREAD_FLD (r10));
12092 + GC_push_one(state . THREAD_FLD (r11));
12093 + GC_push_one(state . THREAD_FLD (r12));
12094 + GC_push_one(state . THREAD_FLD (r13));
12095 + GC_push_one(state . THREAD_FLD (r14));
12096 + GC_push_one(state . THREAD_FLD (r15));
12097 + GC_push_one(state . THREAD_FLD (rip));
12098 + GC_push_one(state . THREAD_FLD (rflags));
12099 + GC_push_one(state . THREAD_FLD (cs));
12100 + GC_push_one(state . THREAD_FLD (fs));
12101 + GC_push_one(state . THREAD_FLD (gs));
12103 #elif defined(POWERPC)
12104 lo = (void*)(state . THREAD_FLD (r1) - PPC_RED_ZONE_SIZE);
12106 @@ -221,9 +202,9 @@
12107 hi = (ptr_t)FindTopOfStack(0);
12109 # if defined(__ppc__) || defined(__ppc64__)
12110 - THREAD_STATE info;
12111 + GC_THREAD_STATE_T info;
12112 mach_msg_type_number_t outCount = THREAD_STATE_MAX;
12113 - r = thread_get_state(thread, MACHINE_THREAD_STATE,
12114 + r = thread_get_state(thread, GC_MACH_THREAD_STATE,
12115 (natural_t *)&info, &outCount);
12116 if(r != KERN_SUCCESS) ABORT("task_get_state failed");
12118 @@ -264,10 +245,10 @@
12120 /* FIXME: Remove after testing: */
12121 WARN("This is completely untested and likely will not work\n", 0);
12122 - THREAD_STATE info;
12123 + GC_THREAD_STATE_T info;
12124 mach_msg_type_number_t outCount = THREAD_STATE_MAX;
12125 - r = thread_get_state(thread, MACHINE_THREAD_STATE,
12126 - (natural_t *)&info, &outCount);
12127 + r = thread_get_state(thread, GC_MACH_THREAD_STATE, (natural_t *)&info,
12129 if(r != KERN_SUCCESS) ABORT("task_get_state failed");
12131 lo = (void*)info . THREAD_FLD (esp);
12132 Index: boehm-gc/Makefile.in
12133 ===================================================================
12134 --- boehm-gc/Makefile.in (.../tags/gcc_4_2_0_release) (revision 126002)
12135 +++ boehm-gc/Makefile.in (.../branches/gcc-4_2-branch) (revision 126002)
12136 @@ -224,6 +224,7 @@
12137 build_vendor = @build_vendor@
12138 datadir = @datadir@
12139 exec_prefix = @exec_prefix@
12140 +extra_ldflags_libgc = @extra_ldflags_libgc@
12142 host_alias = @host_alias@
12143 host_cpu = @host_cpu@
12144 @@ -280,7 +281,7 @@
12145 # linuxthread semaphore functions get linked:
12146 libgcjgc_la_LIBADD = @addobjs@ $(THREADLIBS) $(UNWINDLIBS)
12147 libgcjgc_la_DEPENDENCIES = @addobjs@
12148 -libgcjgc_la_LDFLAGS = -version-info 1:2:0 -rpath $(toolexeclibdir)
12149 +libgcjgc_la_LDFLAGS = $(extra_ldflags_libgc) -version-info 1:2:0 -rpath $(toolexeclibdir)
12150 libgcjgc_convenience_la_LIBADD = @addobjs@
12151 libgcjgc_convenience_la_DEPENDENCIES = @addobjs@
12152 AM_CXXFLAGS = @GC_CFLAGS@
12153 Index: boehm-gc/configure.ac
12154 ===================================================================
12155 --- boehm-gc/configure.ac (.../tags/gcc_4_2_0_release) (revision 126002)
12156 +++ boehm-gc/configure.ac (.../branches/gcc-4_2-branch) (revision 126002)
12157 @@ -248,33 +248,46 @@
12159 powerpc*-*-darwin*)
12160 AC_CHECK_MEMBER(ppc_thread_state_t.r0,
12161 - AC_DEFINE(HAS_PPC_THREAD_STATE_R0,,[ppc_thread_state_t has field r0]),,
12162 + AC_DEFINE(HAS_PPC_THREAD_STATE_R0,1,
12163 + [ppc_thread_state_t has field r0]),,
12164 [#include <mach/thread_status.h>])
12165 AC_CHECK_MEMBER(ppc_thread_state_t.__r0,
12166 - AC_DEFINE(HAS_PPC_THREAD_STATE___R0,,dnl
12167 - [ppc_thread_state_t has field __r0]),,
12168 + AC_DEFINE(HAS_PPC_THREAD_STATE___R0,1,dnl
12169 + [ppc_thread_state_t has field __r0]),,
12170 [#include <mach/thread_status.h>])
12171 AC_CHECK_MEMBER(ppc_thread_state64_t.r0,
12172 - AC_DEFINE(HAS_PPC_THREAD_STATE64_R0,,dnl
12173 - [ppc_thread_state64_t has field r0]),,
12174 + AC_DEFINE(HAS_PPC_THREAD_STATE64_R0,1,dnl
12175 + [ppc_thread_state64_t has field r0]),,
12176 [#include <mach/thread_status.h>])
12177 AC_CHECK_MEMBER(ppc_thread_state64_t.__r0,
12178 - AC_DEFINE(HAS_PPC_THREAD_STATE64___R0,,dnl
12179 - [ppc_thread_state64_t has field __r0]),,
12180 + AC_DEFINE(HAS_PPC_THREAD_STATE64___R0,1,dnl
12181 + [ppc_thread_state64_t has field __r0]),,
12182 [#include <mach/thread_status.h>])
12185 - AC_CHECK_MEMBER(i386_thread_state_t.eax,
12186 - AC_DEFINE(HAS_I386_THREAD_STATE_EAX,,dnl
12187 - [i386_thread_state_t has field eax]),,
12188 + AC_CHECK_MEMBER(x86_thread_state32_t.eax,
12189 + AC_DEFINE(HAS_X86_THREAD_STATE32_EAX,1,dnl
12190 + [x86_thread_state32_t has field eax]),,
12191 [#include <sys/cdefs.h>
12192 -#include <mach/thread_status.h>])
12193 - AC_CHECK_MEMBER(i386_thread_state_t.__eax,
12194 - AC_DEFINE(HAS_I386_THREAD_STATE___EAX,,dnl
12195 - [i386_thread_state_t has field __eax]),,
12196 + #include <mach/thread_status.h>])
12197 + AC_CHECK_MEMBER(x86_thread_state32_t.__eax,
12198 + AC_DEFINE(HAS_X86_THREAD_STATE32___EAX,1,dnl
12199 + [x86_thread_state32_t has field __eax]),,
12200 [#include <sys/cdefs.h>
12201 -#include <mach/thread_status.h>])
12202 + #include <mach/thread_status.h>])
12204 + x86_64-*-darwin*)
12205 + AC_CHECK_MEMBER(x86_thread_state64_t.rax,
12206 + AC_DEFINE(HAS_X86_THREAD_STATE64_RAX,1,dnl
12207 + [x86_thread_state64_t has field rax]),,
12208 + [#include <sys/cdefs.h>
12209 + #include <mach/thread_status.h>])
12210 + AC_CHECK_MEMBER(x86_thread_state64_t.__rax,
12211 + AC_DEFINE(HAS_X86_THREAD_STATE64___RAX,1,dnl
12212 + [x86_thread_state64_t has field __rax]),,
12213 + [#include <sys/cdefs.h>
12214 + #include <mach/thread_status.h>])
12219 @@ -287,6 +300,14 @@
12223 +# extra LD Flags which are required for targets
12226 + extra_ldflags_libgc=-Wl,-single_module
12229 +AC_SUBST(extra_ldflags_libgc)
12231 AC_SUBST(EXTRA_TEST_LIBS)
12233 target_all=libgcjgc.la
12234 Index: boehm-gc/include/Makefile.in
12235 ===================================================================
12236 --- boehm-gc/include/Makefile.in (.../tags/gcc_4_2_0_release) (revision 126002)
12237 +++ boehm-gc/include/Makefile.in (.../branches/gcc-4_2-branch) (revision 126002)
12238 @@ -149,6 +149,7 @@
12239 build_vendor = @build_vendor@
12240 datadir = @datadir@
12241 exec_prefix = @exec_prefix@
12242 +extra_ldflags_libgc = @extra_ldflags_libgc@
12244 host_alias = @host_alias@
12245 host_cpu = @host_cpu@
12246 Index: boehm-gc/include/gc_config.h.in
12247 ===================================================================
12248 --- boehm-gc/include/gc_config.h.in (.../tags/gcc_4_2_0_release) (revision 126002)
12249 +++ boehm-gc/include/gc_config.h.in (.../branches/gcc-4_2-branch) (revision 126002)
12251 /* support for win32 threads */
12252 #undef GC_WIN32_THREADS
12254 -/* i386_thread_state_t has field eax */
12255 -#undef HAS_I386_THREAD_STATE_EAX
12257 -/* i386_thread_state_t has field __eax */
12258 -#undef HAS_I386_THREAD_STATE___EAX
12260 /* ppc_thread_state64_t has field r0 */
12261 #undef HAS_PPC_THREAD_STATE64_R0
12264 /* ppc_thread_state_t has field __r0 */
12265 #undef HAS_PPC_THREAD_STATE___R0
12267 +/* x86_thread_state32_t has field eax */
12268 +#undef HAS_X86_THREAD_STATE32_EAX
12270 +/* x86_thread_state32_t has field __eax */
12271 +#undef HAS_X86_THREAD_STATE32___EAX
12273 +/* x86_thread_state64_t has field rax */
12274 +#undef HAS_X86_THREAD_STATE64_RAX
12276 +/* x86_thread_state64_t has field __rax */
12277 +#undef HAS_X86_THREAD_STATE64___RAX
12279 /* Define to 1 if you have the <inttypes.h> header file. */
12280 #undef HAVE_INTTYPES_H
12282 Index: boehm-gc/include/private/gc_priv.h
12283 ===================================================================
12284 --- boehm-gc/include/private/gc_priv.h (.../tags/gcc_4_2_0_release) (revision 126002)
12285 +++ boehm-gc/include/private/gc_priv.h (.../branches/gcc-4_2-branch) (revision 126002)
12286 @@ -286,6 +286,53 @@
12290 +#if defined(DARWIN)
12291 +# if defined(POWERPC)
12292 +# if CPP_WORDSZ == 32
12293 +# define GC_THREAD_STATE_T ppc_thread_state_t
12294 +# define GC_MACH_THREAD_STATE PPC_THREAD_STATE
12295 +# define GC_MACH_THREAD_STATE_COUNT PPC_THREAD_STATE_COUNT
12296 +# define GC_MACH_HEADER mach_header
12297 +# define GC_MACH_SECTION section
12299 +# define GC_THREAD_STATE_T ppc_thread_state64_t
12300 +# define GC_MACH_THREAD_STATE PPC_THREAD_STATE64
12301 +# define GC_MACH_THREAD_STATE_COUNT PPC_THREAD_STATE64_COUNT
12302 +# define GC_MACH_HEADER mach_header_64
12303 +# define GC_MACH_SECTION section_64
12305 +# elif defined(I386) || defined(X86_64)
12306 +# if CPP_WORDSZ == 32
12307 +# define GC_THREAD_STATE_T x86_thread_state32_t
12308 +# define GC_MACH_THREAD_STATE x86_THREAD_STATE32
12309 +# define GC_MACH_THREAD_STATE_COUNT x86_THREAD_STATE32_COUNT
12310 +# define GC_MACH_HEADER mach_header
12311 +# define GC_MACH_SECTION section
12313 +# define GC_THREAD_STATE_T x86_thread_state64_t
12314 +# define GC_MACH_THREAD_STATE x86_THREAD_STATE64
12315 +# define GC_MACH_THREAD_STATE_COUNT x86_THREAD_STATE64_COUNT
12316 +# define GC_MACH_HEADER mach_header_64
12317 +# define GC_MACH_SECTION section_64
12320 +# error define GC_THREAD_STATE_T
12321 +# define GC_MACH_THREAD_STATE MACHINE_THREAD_STATE
12322 +# define GC_MACH_THREAD_STATE_COUNT MACHINE_THREAD_STATE_COUNT
12324 +/* Try to work out the right way to access thread state structure members.
12325 + The structure has changed its definition in different Darwin versions.
12326 + This now defaults to the (older) names without __, thus hopefully,
12327 + not breaking any existing Makefile.direct builds. */
12328 +# if defined (HAS_PPC_THREAD_STATE___R0) \
12329 + || defined (HAS_PPC_THREAD_STATE64___R0) \
12330 + || defined (HAS_X86_THREAD_STATE32___EAX) \
12331 + || defined (HAS_X86_THREAD_STATE64___RAX)
12332 +# define THREAD_FLD(x) __ ## x
12334 +# define THREAD_FLD(x) x
12337 /*********************************/
12339 /* OS interface routines */
12340 @@ -468,6 +515,53 @@
12341 # define GETENV(name) 0
12344 +#if defined(DARWIN)
12345 +# if defined(POWERPC)
12346 +# if CPP_WORDSZ == 32
12347 +# define GC_THREAD_STATE_T ppc_thread_state_t
12348 +# define GC_MACH_THREAD_STATE PPC_THREAD_STATE
12349 +# define GC_MACH_THREAD_STATE_COUNT PPC_THREAD_STATE_COUNT
12350 +# define GC_MACH_HEADER mach_header
12351 +# define GC_MACH_SECTION section
12353 +# define GC_THREAD_STATE_T ppc_thread_state64_t
12354 +# define GC_MACH_THREAD_STATE PPC_THREAD_STATE64
12355 +# define GC_MACH_THREAD_STATE_COUNT PPC_THREAD_STATE64_COUNT
12356 +# define GC_MACH_HEADER mach_header_64
12357 +# define GC_MACH_SECTION section_64
12359 +# elif defined(I386) || defined(X86_64)
12360 +# if CPP_WORDSZ == 32
12361 +# define GC_THREAD_STATE_T x86_thread_state32_t
12362 +# define GC_MACH_THREAD_STATE x86_THREAD_STATE32
12363 +# define GC_MACH_THREAD_STATE_COUNT x86_THREAD_STATE32_COUNT
12364 +# define GC_MACH_HEADER mach_header
12365 +# define GC_MACH_SECTION section
12367 +# define GC_THREAD_STATE_T x86_thread_state64_t
12368 +# define GC_MACH_THREAD_STATE x86_THREAD_STATE64
12369 +# define GC_MACH_THREAD_STATE_COUNT x86_THREAD_STATE64_COUNT
12370 +# define GC_MACH_HEADER mach_header_64
12371 +# define GC_MACH_SECTION section_64
12374 +# error define GC_THREAD_STATE_T
12375 +# define GC_MACH_THREAD_STATE MACHINE_THREAD_STATE
12376 +# define GC_MACH_THREAD_STATE_COUNT MACHINE_THREAD_STATE_COUNT
12378 +/* Try to work out the right way to access thread state structure members.
12379 + The structure has changed its definition in different Darwin versions.
12380 + This now defaults to the (older) names without __, thus hopefully,
12381 + not breaking any existing Makefile.direct builds. */
12382 +# if defined (HAS_PPC_THREAD_STATE___R0) \
12383 + || defined (HAS_PPC_THREAD_STATE64___R0) \
12384 + || defined (HAS_X86_THREAD_STATE32___EAX) \
12385 + || defined (HAS_X86_THREAD_STATE64___RAX)
12386 +# define THREAD_FLD(x) __ ## x
12388 +# define THREAD_FLD(x) x
12391 /*********************************/
12393 /* Word-size-dependent defines */
12394 Index: boehm-gc/include/private/gcconfig.h
12395 ===================================================================
12396 --- boehm-gc/include/private/gcconfig.h (.../tags/gcc_4_2_0_release) (revision 126002)
12397 +++ boehm-gc/include/private/gcconfig.h (.../branches/gcc-4_2-branch) (revision 126002)
12398 @@ -302,7 +302,10 @@
12399 # if defined(__ppc__) || defined(__ppc64__)
12401 # define mach_type_known
12402 -# elif defined(__i386__) || defined(__x86_64)
12403 +# elif defined(__x86_64__)
12405 +# define mach_type_known
12406 +# elif defined(__i386__)
12408 # define mach_type_known
12410 @@ -791,26 +794,29 @@
12411 # define DATAEND (_end)
12414 -# if defined(__ppc64__) || defined(__x86_64)
12415 +# define OS_TYPE "DARWIN"
12416 +# define DYNAMIC_LOADING
12417 +# if defined(__ppc64__)
12418 # define ALIGNMENT 8
12419 # define CPP_WORDSZ 64
12420 +# define STACKBOTTOM ((ptr_t) 0x7fff5fc00000)
12421 +# define CACHE_LINE_SIZE 64
12423 +# define HBLKSIZE 4096
12426 # define ALIGNMENT 4
12427 +# define STACKBOTTOM ((ptr_t) 0xc0000000)
12429 -# define OS_TYPE "DARWIN"
12430 -# define DYNAMIC_LOADING
12431 /* XXX: see get_end(3), get_etext() and get_end() should not be used.
12432 - These aren't used when dyld support is enabled (it is by default) */
12433 + These aren't used when dyld support is enabled (it is by default) */
12434 # define DATASTART ((ptr_t) get_etext())
12435 # define DATAEND ((ptr_t) get_end())
12436 -# define STACKBOTTOM ((ptr_t) 0xc0000000)
12438 # define USE_MMAP_ANON
12439 # define USE_ASM_PUSH_REGS
12440 - /* This is potentially buggy. It needs more testing. See the comments in
12441 - os_dep.c. It relies on threads to track writes. */
12442 # ifdef GC_DARWIN_THREADS
12443 -/* # define MPROTECT_VDB -- diabled for now. May work for some apps. */
12444 +# define MPROTECT_VDB
12446 # include <unistd.h>
12447 # define GETPAGESIZE() getpagesize()
12448 @@ -822,7 +828,7 @@
12449 __asm__ __volatile__ ("dcbtst 0,%0" : : "r" ((const void *) (x)))
12451 /* There seems to be some issues with trylock hanging on darwin. This
12452 - should be looked into some more */
12453 + should be looked into some more */
12454 # define NO_PTHREAD_TRYLOCK
12457 @@ -1317,23 +1323,21 @@
12458 # define DARWIN_DONT_PARSE_STACK
12459 # define DYNAMIC_LOADING
12460 /* XXX: see get_end(3), get_etext() and get_end() should not be used.
12461 - These aren't used when dyld support is enabled (it is by default) */
12462 + These aren't used when dyld support is enabled (it is by default) */
12463 # define DATASTART ((ptr_t) get_etext())
12464 # define DATAEND ((ptr_t) get_end())
12465 # define STACKBOTTOM ((ptr_t) 0xc0000000)
12467 # define USE_MMAP_ANON
12468 # define USE_ASM_PUSH_REGS
12469 - /* This is potentially buggy. It needs more testing. See the comments in
12470 - os_dep.c. It relies on threads to track writes. */
12471 # ifdef GC_DARWIN_THREADS
12472 -/* # define MPROTECT_VDB -- disabled for now. May work for some apps. */
12473 +# define MPROTECT_VDB
12475 # include <unistd.h>
12476 # define GETPAGESIZE() getpagesize()
12477 /* There seems to be some issues with trylock hanging on darwin. This
12478 - should be looked into some more */
12479 -# define NO_PTHREAD_TRYLOCK
12480 + should be looked into some more */
12481 +# define NO_PTHREAD_TRYLOCK
12482 # endif /* DARWIN */
12485 @@ -1986,6 +1990,26 @@
12486 # define PREFETCH_FOR_WRITE(x) __builtin_prefetch((x), 1)
12490 +# define OS_TYPE "DARWIN"
12491 +# define DARWIN_DONT_PARSE_STACK
12492 +# define DYNAMIC_LOADING
12493 + /* XXX: see get_end(3), get_etext() and get_end() should not be used.
12494 + These aren't used when dyld support is enabled (it is by default) */
12495 +# define DATASTART ((ptr_t) get_etext())
12496 +# define DATAEND ((ptr_t) get_end())
12497 +# define STACKBOTTOM ((ptr_t) 0x7fff5fc00000)
12499 +# define USE_MMAP_ANON
12500 +# ifdef GC_DARWIN_THREADS
12501 +# define MPROTECT_VDB
12503 +# include <unistd.h>
12504 +# define GETPAGESIZE() getpagesize()
12505 + /* There seems to be some issues with trylock hanging on darwin. This
12506 + should be looked into some more */
12507 +# define NO_PTHREAD_TRYLOCK
12510 # define OS_TYPE "FREEBSD"
12511 # ifndef GC_FREEBSD_THREADS
12512 Index: boehm-gc/ChangeLog
12513 ===================================================================
12514 --- boehm-gc/ChangeLog (.../tags/gcc_4_2_0_release) (revision 126002)
12515 +++ boehm-gc/ChangeLog (.../branches/gcc-4_2-branch) (revision 126002)
12517 +2007-06-22 Jakub Jelinek <jakub@redhat.com>
12519 + * pthread_support.c (GC_get_thread_stack_base): Handle
12520 + pthread_getattr_np failures.
12522 +2007-05-22 Andreas Tobler <a.tobler@schweiz.org>
12524 + * Backport r124870 from main.
12526 + 2007-05-20 Andreas Tobler <a.tobler@schweiz.org>
12528 + * configure.ac: Introduce extra_ldflags_libgc. Use it for Darwin.
12529 + * configure: Regenerate.
12530 + * Makefile.am (libgc_la_LDFLAGS): Use extra_ldflags_libgc.
12531 + * Makefile.in: Regenerate.
12532 + * include/Makefile.in: Regenerate.
12533 + * include/private/gcconfig.h: Enable MPROTECT_VDB for all Darwin
12534 + targets. Remove comments. Prepare ppc64 support for Darwin.
12536 +2007-05-19 Andreas Tobler <a.tobler@schweiz.org>
12538 + * Backport r120684, 120801, 120853, 120874 and 120977 from main.
12540 + 2007-01-19 Andreas Tobler <a.tobler@schweiz.org>
12542 + * os_dep.c (defined(MPROTECT_VDB) && defined(DARWIN)): Moved recently
12543 + added defines to include/private/gc_priv.h
12544 + * darwin_stop_world.c: Removed the above defines.
12545 + (catch_exception_raise): Added THREAD_FLD in exc_state for POWERPC too.
12546 + * include/private/gc_priv.h: Moved definitions from darwin_stop_world.c
12547 + and os_dep.c to here. Fixed THREAD definition fixes for ppc64.
12549 + 2007-01-17 Mike Stump <mrs@apple.com>
12551 + * os_dep.c: Fix i686-apple-darwin9 builds.
12553 + 2007-01-17 Andreas Tobler <a.tobler@schweiz.org>
12555 + * include/gc_config.h.in: Regenerate.
12557 + 2007-01-15 Andreas Tobler <a.tobler@schweiz.org>
12559 + * os_dep.c (defined(MPROTECT_VDB) && defined(DARWIN)): Adjust mail
12561 + (catch_exception_raise): Fix typo in the I386 exc_state.
12563 + 2007-01-11 Andreas Tobler <a.tobler@schweiz.org>
12565 + * configure.ac: Replaced HAS_I386_THREAD_STATE_* with
12566 + HAS_X86_THREAD_STATE32_* and HAS_X86_THREAD_STATE64_* respectively.
12567 + * configure: Regenerated.
12568 + * include/private/gcconfig.h (DARWIN): Added X86_64 define for Darwin.
12569 + Added base definitions for the X86_64 Darwin port.
12570 + * include/private/gc_priv.h: Added definitions for Darwin MACH thread
12571 + operations. Moved existing THREAD_STATE info from darwin_stop_world.c.
12572 + * darwin_stop_world.c: Removed THREAD_STATE info. Added
12573 + HAS_X86_THREAD_STATE64___RAX. And replaced HAS_I386_THREAD_STATE___EAX
12574 + with HAS_X86_THREAD_STATE32___EAX.
12575 + (GC_push_all_stacks): Use GC_MACH_THREAD_STATE_COUNT. Add code for
12577 + * dyn_load.c (GC_dyld_name_for_hdr): Use GC_MACH_HEADER.
12578 + (GC_dyld_image_add): Use GC_MACH_HEADER and GC_MACH_SECTION.
12579 + Distinguish between getsectbynamefromheader_64 and
12580 + getsectbynamefromheader.
12581 + (GC_dyld_image_remove): Likewise.
12582 + * os_dep.c (GC_dirty_init): Use GC_MACH_THREAD_STATE.
12583 + (catch_exception_raise): Introduce exception information for I386 and
12584 + X86_64 Darwin. Add X86_64 for exc_state.faultvaddr.
12586 2007-05-13 Release Manager
12588 * GCC 4.2.0 released.
12589 Index: boehm-gc/configure
12590 ===================================================================
12591 --- boehm-gc/configure (.../tags/gcc_4_2_0_release) (revision 126002)
12592 +++ boehm-gc/configure (.../branches/gcc-4_2-branch) (revision 126002)
12593 @@ -309,7 +309,7 @@
12594 # include <unistd.h>
12597 -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS multi_basedir build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical mkinstalldirs INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar CC ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CXX ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CFLAGS CXXFLAGS CCAS CCASFLAGS AS ac_ct_AS AR ac_ct_AR RANLIB ac_ct_RANLIB MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT GC_CFLAGS LN_S LIBTOOL CXXCPP CPPFLAGS THREADLIBS POWERPC_DARWIN_TRUE POWERPC_DARWIN_FALSE EXTRA_TEST_LIBS target_all CPLUSPLUS_TRUE CPLUSPLUS_FALSE AM_CPPFLAGS addobjs addincludes addlibs addtests CPP EGREP MY_CFLAGS toolexecdir toolexeclibdir LIBOBJS LTLIBOBJS'
12598 +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS multi_basedir build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical mkinstalldirs INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar CC ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CXX ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CFLAGS CXXFLAGS CCAS CCASFLAGS AS ac_ct_AS AR ac_ct_AR RANLIB ac_ct_RANLIB MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT GC_CFLAGS LN_S LIBTOOL CXXCPP CPPFLAGS THREADLIBS POWERPC_DARWIN_TRUE POWERPC_DARWIN_FALSE extra_ldflags_libgc EXTRA_TEST_LIBS target_all CPLUSPLUS_TRUE CPLUSPLUS_FALSE AM_CPPFLAGS addobjs addincludes addlibs addtests CPP EGREP MY_CFLAGS toolexecdir toolexeclibdir LIBOBJS LTLIBOBJS'
12601 # Initialize some variables set by options.
12602 @@ -5741,7 +5741,7 @@
12603 if test $ac_cv_member_ppc_thread_state_t_r0 = yes; then
12605 cat >>confdefs.h <<\_ACEOF
12606 -#define HAS_PPC_THREAD_STATE_R0
12607 +#define HAS_PPC_THREAD_STATE_R0 1
12611 @@ -5852,7 +5852,7 @@
12612 if test $ac_cv_member_ppc_thread_state_t___r0 = yes; then
12614 cat >>confdefs.h <<\_ACEOF
12615 -#define HAS_PPC_THREAD_STATE___R0
12616 +#define HAS_PPC_THREAD_STATE___R0 1
12620 @@ -5963,7 +5963,7 @@
12621 if test $ac_cv_member_ppc_thread_state64_t_r0 = yes; then
12623 cat >>confdefs.h <<\_ACEOF
12624 -#define HAS_PPC_THREAD_STATE64_R0
12625 +#define HAS_PPC_THREAD_STATE64_R0 1
12629 @@ -6074,16 +6074,16 @@
12630 if test $ac_cv_member_ppc_thread_state64_t___r0 = yes; then
12632 cat >>confdefs.h <<\_ACEOF
12633 -#define HAS_PPC_THREAD_STATE64___R0
12634 +#define HAS_PPC_THREAD_STATE64___R0 1
12641 - echo "$as_me:$LINENO: checking for i386_thread_state_t.eax" >&5
12642 -echo $ECHO_N "checking for i386_thread_state_t.eax... $ECHO_C" >&6
12643 -if test "${ac_cv_member_i386_thread_state_t_eax+set}" = set; then
12644 + echo "$as_me:$LINENO: checking for x86_thread_state32_t.eax" >&5
12645 +echo $ECHO_N "checking for x86_thread_state32_t.eax... $ECHO_C" >&6
12646 +if test "${ac_cv_member_x86_thread_state32_t_eax+set}" = set; then
12647 echo $ECHO_N "(cached) $ECHO_C" >&6
12649 cat >conftest.$ac_ext <<_ACEOF
12650 @@ -6093,12 +6093,12 @@
12651 cat >>conftest.$ac_ext <<_ACEOF
12652 /* end confdefs.h. */
12653 #include <sys/cdefs.h>
12654 -#include <mach/thread_status.h>
12655 + #include <mach/thread_status.h>
12660 -static i386_thread_state_t ac_aggr;
12661 +static x86_thread_state32_t ac_aggr;
12665 @@ -6127,7 +6127,7 @@
12667 echo "$as_me:$LINENO: \$? = $ac_status" >&5
12668 (exit $ac_status); }; }; then
12669 - ac_cv_member_i386_thread_state_t_eax=yes
12670 + ac_cv_member_x86_thread_state32_t_eax=yes
12672 echo "$as_me: failed program was:" >&5
12673 sed 's/^/| /' conftest.$ac_ext >&5
12674 @@ -6139,12 +6139,12 @@
12675 cat >>conftest.$ac_ext <<_ACEOF
12676 /* end confdefs.h. */
12677 #include <sys/cdefs.h>
12678 -#include <mach/thread_status.h>
12679 + #include <mach/thread_status.h>
12684 -static i386_thread_state_t ac_aggr;
12685 +static x86_thread_state32_t ac_aggr;
12686 if (sizeof ac_aggr.eax)
12689 @@ -6173,30 +6173,30 @@
12691 echo "$as_me:$LINENO: \$? = $ac_status" >&5
12692 (exit $ac_status); }; }; then
12693 - ac_cv_member_i386_thread_state_t_eax=yes
12694 + ac_cv_member_x86_thread_state32_t_eax=yes
12696 echo "$as_me: failed program was:" >&5
12697 sed 's/^/| /' conftest.$ac_ext >&5
12699 -ac_cv_member_i386_thread_state_t_eax=no
12700 +ac_cv_member_x86_thread_state32_t_eax=no
12702 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
12704 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
12706 -echo "$as_me:$LINENO: result: $ac_cv_member_i386_thread_state_t_eax" >&5
12707 -echo "${ECHO_T}$ac_cv_member_i386_thread_state_t_eax" >&6
12708 -if test $ac_cv_member_i386_thread_state_t_eax = yes; then
12709 +echo "$as_me:$LINENO: result: $ac_cv_member_x86_thread_state32_t_eax" >&5
12710 +echo "${ECHO_T}$ac_cv_member_x86_thread_state32_t_eax" >&6
12711 +if test $ac_cv_member_x86_thread_state32_t_eax = yes; then
12713 cat >>confdefs.h <<\_ACEOF
12714 -#define HAS_I386_THREAD_STATE_EAX
12715 +#define HAS_X86_THREAD_STATE32_EAX 1
12720 - echo "$as_me:$LINENO: checking for i386_thread_state_t.__eax" >&5
12721 -echo $ECHO_N "checking for i386_thread_state_t.__eax... $ECHO_C" >&6
12722 -if test "${ac_cv_member_i386_thread_state_t___eax+set}" = set; then
12723 + echo "$as_me:$LINENO: checking for x86_thread_state32_t.__eax" >&5
12724 +echo $ECHO_N "checking for x86_thread_state32_t.__eax... $ECHO_C" >&6
12725 +if test "${ac_cv_member_x86_thread_state32_t___eax+set}" = set; then
12726 echo $ECHO_N "(cached) $ECHO_C" >&6
12728 cat >conftest.$ac_ext <<_ACEOF
12729 @@ -6206,12 +6206,12 @@
12730 cat >>conftest.$ac_ext <<_ACEOF
12731 /* end confdefs.h. */
12732 #include <sys/cdefs.h>
12733 -#include <mach/thread_status.h>
12734 + #include <mach/thread_status.h>
12739 -static i386_thread_state_t ac_aggr;
12740 +static x86_thread_state32_t ac_aggr;
12744 @@ -6240,7 +6240,7 @@
12746 echo "$as_me:$LINENO: \$? = $ac_status" >&5
12747 (exit $ac_status); }; }; then
12748 - ac_cv_member_i386_thread_state_t___eax=yes
12749 + ac_cv_member_x86_thread_state32_t___eax=yes
12751 echo "$as_me: failed program was:" >&5
12752 sed 's/^/| /' conftest.$ac_ext >&5
12753 @@ -6252,12 +6252,12 @@
12754 cat >>conftest.$ac_ext <<_ACEOF
12755 /* end confdefs.h. */
12756 #include <sys/cdefs.h>
12757 -#include <mach/thread_status.h>
12758 + #include <mach/thread_status.h>
12763 -static i386_thread_state_t ac_aggr;
12764 +static x86_thread_state32_t ac_aggr;
12765 if (sizeof ac_aggr.__eax)
12768 @@ -6286,28 +6286,256 @@
12770 echo "$as_me:$LINENO: \$? = $ac_status" >&5
12771 (exit $ac_status); }; }; then
12772 - ac_cv_member_i386_thread_state_t___eax=yes
12773 + ac_cv_member_x86_thread_state32_t___eax=yes
12775 echo "$as_me: failed program was:" >&5
12776 sed 's/^/| /' conftest.$ac_ext >&5
12778 -ac_cv_member_i386_thread_state_t___eax=no
12779 +ac_cv_member_x86_thread_state32_t___eax=no
12781 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
12783 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
12785 -echo "$as_me:$LINENO: result: $ac_cv_member_i386_thread_state_t___eax" >&5
12786 -echo "${ECHO_T}$ac_cv_member_i386_thread_state_t___eax" >&6
12787 -if test $ac_cv_member_i386_thread_state_t___eax = yes; then
12788 +echo "$as_me:$LINENO: result: $ac_cv_member_x86_thread_state32_t___eax" >&5
12789 +echo "${ECHO_T}$ac_cv_member_x86_thread_state32_t___eax" >&6
12790 +if test $ac_cv_member_x86_thread_state32_t___eax = yes; then
12792 cat >>confdefs.h <<\_ACEOF
12793 -#define HAS_I386_THREAD_STATE___EAX
12794 +#define HAS_X86_THREAD_STATE32___EAX 1
12800 + x86_64-*-darwin*)
12801 + echo "$as_me:$LINENO: checking for x86_thread_state64_t.rax" >&5
12802 +echo $ECHO_N "checking for x86_thread_state64_t.rax... $ECHO_C" >&6
12803 +if test "${ac_cv_member_x86_thread_state64_t_rax+set}" = set; then
12804 + echo $ECHO_N "(cached) $ECHO_C" >&6
12806 + cat >conftest.$ac_ext <<_ACEOF
12809 +cat confdefs.h >>conftest.$ac_ext
12810 +cat >>conftest.$ac_ext <<_ACEOF
12811 +/* end confdefs.h. */
12812 +#include <sys/cdefs.h>
12813 + #include <mach/thread_status.h>
12818 +static x86_thread_state64_t ac_aggr;
12825 +rm -f conftest.$ac_objext
12826 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
12827 + (eval $ac_compile) 2>conftest.er1
12829 + grep -v '^ *+' conftest.er1 >conftest.err
12830 + rm -f conftest.er1
12831 + cat conftest.err >&5
12832 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
12833 + (exit $ac_status); } &&
12834 + { ac_try='test -z "$ac_c_werror_flag"
12835 + || test ! -s conftest.err'
12836 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
12837 + (eval $ac_try) 2>&5
12839 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
12840 + (exit $ac_status); }; } &&
12841 + { ac_try='test -s conftest.$ac_objext'
12842 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
12843 + (eval $ac_try) 2>&5
12845 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
12846 + (exit $ac_status); }; }; then
12847 + ac_cv_member_x86_thread_state64_t_rax=yes
12849 + echo "$as_me: failed program was:" >&5
12850 +sed 's/^/| /' conftest.$ac_ext >&5
12852 +cat >conftest.$ac_ext <<_ACEOF
12855 +cat confdefs.h >>conftest.$ac_ext
12856 +cat >>conftest.$ac_ext <<_ACEOF
12857 +/* end confdefs.h. */
12858 +#include <sys/cdefs.h>
12859 + #include <mach/thread_status.h>
12864 +static x86_thread_state64_t ac_aggr;
12865 +if (sizeof ac_aggr.rax)
12871 +rm -f conftest.$ac_objext
12872 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
12873 + (eval $ac_compile) 2>conftest.er1
12875 + grep -v '^ *+' conftest.er1 >conftest.err
12876 + rm -f conftest.er1
12877 + cat conftest.err >&5
12878 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
12879 + (exit $ac_status); } &&
12880 + { ac_try='test -z "$ac_c_werror_flag"
12881 + || test ! -s conftest.err'
12882 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
12883 + (eval $ac_try) 2>&5
12885 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
12886 + (exit $ac_status); }; } &&
12887 + { ac_try='test -s conftest.$ac_objext'
12888 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
12889 + (eval $ac_try) 2>&5
12891 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
12892 + (exit $ac_status); }; }; then
12893 + ac_cv_member_x86_thread_state64_t_rax=yes
12895 + echo "$as_me: failed program was:" >&5
12896 +sed 's/^/| /' conftest.$ac_ext >&5
12898 +ac_cv_member_x86_thread_state64_t_rax=no
12900 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
12902 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
12904 +echo "$as_me:$LINENO: result: $ac_cv_member_x86_thread_state64_t_rax" >&5
12905 +echo "${ECHO_T}$ac_cv_member_x86_thread_state64_t_rax" >&6
12906 +if test $ac_cv_member_x86_thread_state64_t_rax = yes; then
12908 +cat >>confdefs.h <<\_ACEOF
12909 +#define HAS_X86_THREAD_STATE64_RAX 1
12914 + echo "$as_me:$LINENO: checking for x86_thread_state64_t.__rax" >&5
12915 +echo $ECHO_N "checking for x86_thread_state64_t.__rax... $ECHO_C" >&6
12916 +if test "${ac_cv_member_x86_thread_state64_t___rax+set}" = set; then
12917 + echo $ECHO_N "(cached) $ECHO_C" >&6
12919 + cat >conftest.$ac_ext <<_ACEOF
12922 +cat confdefs.h >>conftest.$ac_ext
12923 +cat >>conftest.$ac_ext <<_ACEOF
12924 +/* end confdefs.h. */
12925 +#include <sys/cdefs.h>
12926 + #include <mach/thread_status.h>
12931 +static x86_thread_state64_t ac_aggr;
12932 +if (ac_aggr.__rax)
12938 +rm -f conftest.$ac_objext
12939 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
12940 + (eval $ac_compile) 2>conftest.er1
12942 + grep -v '^ *+' conftest.er1 >conftest.err
12943 + rm -f conftest.er1
12944 + cat conftest.err >&5
12945 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
12946 + (exit $ac_status); } &&
12947 + { ac_try='test -z "$ac_c_werror_flag"
12948 + || test ! -s conftest.err'
12949 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
12950 + (eval $ac_try) 2>&5
12952 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
12953 + (exit $ac_status); }; } &&
12954 + { ac_try='test -s conftest.$ac_objext'
12955 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
12956 + (eval $ac_try) 2>&5
12958 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
12959 + (exit $ac_status); }; }; then
12960 + ac_cv_member_x86_thread_state64_t___rax=yes
12962 + echo "$as_me: failed program was:" >&5
12963 +sed 's/^/| /' conftest.$ac_ext >&5
12965 +cat >conftest.$ac_ext <<_ACEOF
12968 +cat confdefs.h >>conftest.$ac_ext
12969 +cat >>conftest.$ac_ext <<_ACEOF
12970 +/* end confdefs.h. */
12971 +#include <sys/cdefs.h>
12972 + #include <mach/thread_status.h>
12977 +static x86_thread_state64_t ac_aggr;
12978 +if (sizeof ac_aggr.__rax)
12984 +rm -f conftest.$ac_objext
12985 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
12986 + (eval $ac_compile) 2>conftest.er1
12988 + grep -v '^ *+' conftest.er1 >conftest.err
12989 + rm -f conftest.er1
12990 + cat conftest.err >&5
12991 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
12992 + (exit $ac_status); } &&
12993 + { ac_try='test -z "$ac_c_werror_flag"
12994 + || test ! -s conftest.err'
12995 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
12996 + (eval $ac_try) 2>&5
12998 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
12999 + (exit $ac_status); }; } &&
13000 + { ac_try='test -s conftest.$ac_objext'
13001 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
13002 + (eval $ac_try) 2>&5
13004 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
13005 + (exit $ac_status); }; }; then
13006 + ac_cv_member_x86_thread_state64_t___rax=yes
13008 + echo "$as_me: failed program was:" >&5
13009 +sed 's/^/| /' conftest.$ac_ext >&5
13011 +ac_cv_member_x86_thread_state64_t___rax=no
13013 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
13015 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
13017 +echo "$as_me:$LINENO: result: $ac_cv_member_x86_thread_state64_t___rax" >&5
13018 +echo "${ECHO_T}$ac_cv_member_x86_thread_state64_t___rax" >&6
13019 +if test $ac_cv_member_x86_thread_state64_t___rax = yes; then
13021 +cat >>confdefs.h <<\_ACEOF
13022 +#define HAS_X86_THREAD_STATE64___RAX 1
13031 @@ -6392,8 +6620,16 @@
13035 +# extra LD Flags which are required for targets
13038 + extra_ldflags_libgc=-Wl,-single_module
13045 target_all=libgcjgc.la
13048 @@ -8246,6 +8482,7 @@
13049 s,@THREADLIBS@,$THREADLIBS,;t t
13050 s,@POWERPC_DARWIN_TRUE@,$POWERPC_DARWIN_TRUE,;t t
13051 s,@POWERPC_DARWIN_FALSE@,$POWERPC_DARWIN_FALSE,;t t
13052 +s,@extra_ldflags_libgc@,$extra_ldflags_libgc,;t t
13053 s,@EXTRA_TEST_LIBS@,$EXTRA_TEST_LIBS,;t t
13054 s,@target_all@,$target_all,;t t
13055 s,@CPLUSPLUS_TRUE@,$CPLUSPLUS_TRUE,;t t
13056 Index: boehm-gc/pthread_support.c
13057 ===================================================================
13058 --- boehm-gc/pthread_support.c (.../tags/gcc_4_2_0_release) (revision 126002)
13059 +++ boehm-gc/pthread_support.c (.../branches/gcc-4_2-branch) (revision 126002)
13060 @@ -1135,7 +1135,13 @@
13063 my_pthread = pthread_self();
13064 - pthread_getattr_np (my_pthread, &attr);
13065 + if (pthread_getattr_np (my_pthread, &attr) != 0)
13067 +# ifdef DEBUG_THREADS
13068 + GC_printf1("Can not determine stack base for attached thread");
13072 pthread_attr_getstack (&attr, (void **) &stack_addr, &stack_size);
13073 pthread_attr_destroy (&attr);
13075 Index: boehm-gc/os_dep.c
13076 ===================================================================
13077 --- boehm-gc/os_dep.c (.../tags/gcc_4_2_0_release) (revision 126002)
13078 +++ boehm-gc/os_dep.c (.../branches/gcc-4_2-branch) (revision 126002)
13079 @@ -3371,7 +3371,7 @@
13080 1. Apple's mach/xnu documentation
13081 2. Timothy J. Wood's "Mach Exception Handlers 101" post to the
13082 omnigroup's macosx-dev list.
13083 - www.omnigroup.com/mailman/archive/macosx-dev/2000-June/002030.html
13084 + www.omnigroup.com/mailman/archive/macosx-dev/2000-June/014178.html
13085 3. macosx-nat.c from Apple's GDB source code.
13088 @@ -3683,7 +3683,7 @@
13090 GC_ports.exception,
13092 - MACHINE_THREAD_STATE
13093 + GC_MACH_THREAD_STATE
13095 if(r != KERN_SUCCESS) ABORT("task_set_exception_ports failed");
13097 @@ -3802,10 +3802,16 @@
13098 mach_msg_type_number_t exc_state_count = PPC_EXCEPTION_STATE64_COUNT;
13099 ppc_exception_state64_t exc_state;
13101 -# elif defined(I386)
13102 - thread_state_flavor_t flavor = i386_EXCEPTION_STATE;
13103 - mach_msg_type_number_t exc_state_count = i386_EXCEPTION_STATE_COUNT;
13104 - i386_exception_state_t exc_state;
13105 +# elif defined(I386) || defined(X86_64)
13106 +# if CPP_WORDSZ == 32
13107 + thread_state_flavor_t flavor = x86_EXCEPTION_STATE32;
13108 + mach_msg_type_number_t exc_state_count = x86_EXCEPTION_STATE32_COUNT;
13109 + x86_exception_state32_t exc_state;
13111 + thread_state_flavor_t flavor = x86_EXCEPTION_STATE64;
13112 + mach_msg_type_number_t exc_state_count = x86_EXCEPTION_STATE64_COUNT;
13113 + x86_exception_state64_t exc_state;
13116 # error FIXME for non-ppc darwin
13118 @@ -3838,9 +3844,9 @@
13120 /* This is the address that caused the fault */
13121 #if defined(POWERPC)
13122 - addr = (char*) exc_state.dar;
13123 -#elif defined (I386)
13124 - addr = (char*) exc_state.faultvaddr;
13125 + addr = (char*) exc_state. THREAD_FLD(dar);
13126 +#elif defined (I386) || defined (X86_64)
13127 + addr = (char*) exc_state. THREAD_FLD(faultvaddr);
13129 # error FIXME for non POWERPC/I386
13131 Index: boehm-gc/Makefile.am
13132 ===================================================================
13133 --- boehm-gc/Makefile.am (.../tags/gcc_4_2_0_release) (revision 126002)
13134 +++ boehm-gc/Makefile.am (.../branches/gcc-4_2-branch) (revision 126002)
13135 @@ -33,11 +33,13 @@
13136 rs6000_mach_dep.s sparc_mach_dep.S sparc_netbsd_mach_dep.s \
13137 sparc_sunos4_mach_dep.s ia64_save_regs_in_stack.s
13139 +extra_ldflags_libgc = @extra_ldflags_libgc@
13141 # Include THREADLIBS here to ensure that the correct versions of
13142 # linuxthread semaphore functions get linked:
13143 libgcjgc_la_LIBADD = @addobjs@ $(THREADLIBS) $(UNWINDLIBS)
13144 libgcjgc_la_DEPENDENCIES = @addobjs@
13145 -libgcjgc_la_LDFLAGS = -version-info 1:2:0 -rpath $(toolexeclibdir)
13146 +libgcjgc_la_LDFLAGS = $(extra_ldflags_libgc) -version-info 1:2:0 -rpath $(toolexeclibdir)
13148 libgcjgc_convenience_la_LIBADD = @addobjs@
13149 libgcjgc_convenience_la_DEPENDENCIES = @addobjs@
13150 Index: boehm-gc/dyn_load.c
13151 ===================================================================
13152 --- boehm-gc/dyn_load.c (.../tags/gcc_4_2_0_release) (revision 126002)
13153 +++ boehm-gc/dyn_load.c (.../branches/gcc-4_2-branch) (revision 126002)
13154 @@ -1152,7 +1152,7 @@
13157 #ifdef DARWIN_DEBUG
13158 -static const char *GC_dyld_name_for_hdr(struct mach_header *hdr) {
13159 +static const char *GC_dyld_name_for_hdr(const struct GC_MACH_HEADER *hdr) {
13161 c = _dyld_image_count();
13162 for(i=0;i<c;i++) if(_dyld_get_image_header(i) == hdr)
13163 @@ -1162,12 +1162,17 @@
13166 /* This should never be called by a thread holding the lock */
13167 -static void GC_dyld_image_add(struct mach_header* hdr, unsigned long slide) {
13168 +static void GC_dyld_image_add(const struct GC_MACH_HEADER *hdr, intptr_t slide)
13170 unsigned long start,end,i;
13171 - const struct section *sec;
13172 + const struct GC_MACH_SECTION *sec;
13173 if (GC_no_dls) return;
13174 for(i=0;i<sizeof(GC_dyld_sections)/sizeof(GC_dyld_sections[0]);i++) {
13175 - sec = getsectbynamefromheader(
13176 +# if defined (__LP64__)
13177 + sec = getsectbynamefromheader_64(
13179 + sec = getsectbynamefromheader(
13181 hdr,GC_dyld_sections[i].seg,GC_dyld_sections[i].sect);
13182 if(sec == NULL || sec->size == 0) continue;
13183 start = slide + sec->addr;
13184 @@ -1184,11 +1189,16 @@
13187 /* This should never be called by a thread holding the lock */
13188 -static void GC_dyld_image_remove(struct mach_header* hdr, unsigned long slide) {
13189 +static void GC_dyld_image_remove(const struct GC_MACH_HEADER *hdr,
13190 + intptr_t slide) {
13191 unsigned long start,end,i;
13192 - const struct section *sec;
13193 + const struct GC_MACH_SECTION *sec;
13194 for(i=0;i<sizeof(GC_dyld_sections)/sizeof(GC_dyld_sections[0]);i++) {
13195 - sec = getsectbynamefromheader(
13196 +# if defined (__LP64__)
13197 + sec = getsectbynamefromheader_64(
13199 + sec = getsectbynamefromheader(
13201 hdr,GC_dyld_sections[i].seg,GC_dyld_sections[i].sect);
13202 if(sec == NULL || sec->size == 0) continue;
13203 start = slide + sec->addr;
13204 Index: configure.in
13205 ===================================================================
13206 --- configure.in (.../tags/gcc_4_2_0_release) (revision 126002)
13207 +++ configure.in (.../branches/gcc-4_2-branch) (revision 126002)
13208 @@ -2419,7 +2419,13 @@
13209 # Pass -fkeep-inline-functions for stage 1 if the GCC version supports it.
13210 CFLAGS="$CFLAGS -fkeep-inline-functions"
13211 AC_MSG_CHECKING([whether -fkeep-inline-functions is supported])
13212 - AC_TRY_COMPILE(,,
13214 +#if (__GNUC__ < 3) \
13215 + || (__GNUC__ == 3 && (__GNUC_MINOR__ < 3 \
13216 + || (__GNUC_MINOR__ == 3 && __GNUC_PATCHLEVEL__ < 1)))
13217 +#error http://gcc.gnu.org/PR29382
13220 [AC_MSG_RESULT([yes]); stage1_cflags="$stage1_cflags -fkeep-inline-functions"],
13221 [AC_MSG_RESULT([no])])
13224 ===================================================================
13225 --- ChangeLog (.../tags/gcc_4_2_0_release) (revision 126002)
13226 +++ ChangeLog (.../branches/gcc-4_2-branch) (revision 126002)
13228 +2007-05-30 Jakub Jelinek <jakub@redhat.com>
13230 + PR bootstrap/29382
13231 + * configure.in: Don't use -fkeep-inline-functions for GCC < 3.3.1.
13232 + * configure: Rebuilt.
13234 2007-05-13 Release Manager
13236 * GCC 4.2.0 released.
13237 Index: config/ChangeLog
13238 ===================================================================
13239 --- config/ChangeLog (.../tags/gcc_4_2_0_release) (revision 126002)
13240 +++ config/ChangeLog (.../branches/gcc-4_2-branch) (revision 126002)
13242 +2007-06-20 Mike Stump <mrs@apple.com>
13244 + * acx.m4 (NCN_STRICT_CHECK_TARGET_TOOLS): Fix incremental builds.
13245 + (ACX_HAVE_GCC_FOR_TARGET): Likewise.
13247 2007-05-13 Release Manager
13249 * GCC 4.2.0 released.
13250 Index: config/acx.m4
13251 ===================================================================
13252 --- config/acx.m4 (.../tags/gcc_4_2_0_release) (revision 126002)
13253 +++ config/acx.m4 (.../branches/gcc-4_2-branch) (revision 126002)
13254 @@ -183,6 +183,8 @@
13256 $1="${ncn_target_tool_prefix}[$]2"
13259 + $1="$ac_cv_prog_$1"
13261 ]) []dnl # NCN_STRICT_CHECK_TARGET_TOOLS
13263 @@ -297,7 +299,7 @@
13264 elif test $build != $host && test $have_gcc_for_target = yes; then
13265 $1=`$GCC_FOR_TARGET --print-prog-name=$2`
13266 test [$]$1=$2 && $1=
13267 - ac_cv_path_$1=[$]$1
13268 + test -n "[$]$1" && ac_cv_path_$1=[$]$1
13271 if test -z "$ac_cv_path_$1" ; then
13272 Index: libjava/java/lang/natClassLoader.cc
13273 ===================================================================
13274 --- libjava/java/lang/natClassLoader.cc (.../tags/gcc_4_2_0_release) (revision 126002)
13275 +++ libjava/java/lang/natClassLoader.cc (.../branches/gcc-4_2-branch) (revision 126002)
13276 @@ -235,6 +235,15 @@
13278 new_class->engine = &_Jv_soleIndirectCompiledEngine;
13280 + /* FIXME: Way back before the dawn of time, we overloaded the
13281 + SYNTHETIC class access modifier to mean INTERPRETED. This was a
13282 + Bad Thing, but it didn't matter then because classes were never
13283 + marked synthetic. However, it is possible to redeem the
13284 + situation: _Jv_NewClassFromInitializer is only called from
13285 + compiled classes, so we clear the INTERPRETED flag. This is a
13287 + new_class->accflags &= ~java::lang::reflect::Modifier::INTERPRETED;
13289 if (_Jv_CheckABIVersion ((unsigned long) new_class->next_or_version))
13290 (*_Jv_RegisterClassHook) (new_class);
13292 Index: libjava/ChangeLog
13293 ===================================================================
13294 --- libjava/ChangeLog (.../tags/gcc_4_2_0_release) (revision 126002)
13295 +++ libjava/ChangeLog (.../branches/gcc-4_2-branch) (revision 126002)
13297 +2007-05-31 Andrew Haley <aph@redhat.com>
13299 + * java/lang/natClassLoader.cc (_Jv_NewClassFromInitializer): Clear
13300 + INTERPRETED access modifier.
13302 2007-05-13 Release Manager
13304 * GCC 4.2.0 released.
13305 Index: maintainer-scripts/ChangeLog
13306 ===================================================================
13307 --- maintainer-scripts/ChangeLog (.../tags/gcc_4_2_0_release) (revision 126002)
13308 +++ maintainer-scripts/ChangeLog (.../branches/gcc-4_2-branch) (revision 126002)
13310 +2007-05-28 Mark Mitchell <mark@codesourcery.com>
13312 + * gcc_release: Adjust placement of release candidates.
13314 2007-05-13 Release Manager
13316 * GCC 4.2.0 released.
13317 Index: maintainer-scripts/gcc_release
13318 ===================================================================
13319 --- maintainer-scripts/gcc_release (.../tags/gcc_4_2_0_release) (revision 126002)
13320 +++ maintainer-scripts/gcc_release (.../branches/gcc-4_2-branch) (revision 126002)
13321 @@ -699,10 +699,10 @@
13322 # and minor release numbers.
13323 SVNBRANCH="branches/gcc-${RELEASE_MAJOR}_${RELEASE_MINOR}-branch"
13325 - # If this is not a final release, set various parameters acordingly.
13326 + # If this is not a final release, set various parameters accordingly.
13327 if [ ${FINAL} -ne 1 ]; then
13328 - RELEASE="${RELEASE}-${DATE}"
13329 - FTP_PATH="${FTP_PATH}/prerelease-${RELEASE}/"
13330 + RELEASE="${RELEASE}-RC-${DATE}"
13331 + FTP_PATH="${SNAPSHOTS_DIR}/${RELEASE}"
13333 FTP_PATH="${FTP_PATH}/releases/gcc-${RELEASE}/"