1
# DP: updates from the 4.8 branch upto 20120623 (r200352).
5
cat > ${dir}LAST_UPDATED <<EOF
6
Sun Jun 23 21:25:34 CEST 2013
7
Sun Jun 23 19:25:34 UTC 2013 (revision 200352)
11
LANG=C svn diff svn://gcc.gnu.org/svn/gcc/tags/gcc_4_8_1_release svn://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch \
12
| sed -r 's,^--- (\S+)\t(\S+)(.*)$,--- a/src/\1\t\2,;s,^\+\+\+ (\S+)\t(\S+)(.*)$,+++ b/src/\1\t\2,' \
13
| awk '/^Index:.*\.(class|texi)/ {skip=1; next} /^Index:/ { skip=0 } skip==0'
15
Index: libstdc++-v3/configure.host
16
===================================================================
17
--- a/src/libstdc++-v3/configure.host (.../tags/gcc_4_8_1_release)
18
+++ b/src/libstdc++-v3/configure.host (.../branches/gcc-4_8-branch)
21
abi_baseline_pair=mips64-linux-gnu
25
abi_baseline_pair=powerpc64-linux-gnu
28
Index: libstdc++-v3/include/Makefile.in
29
===================================================================
30
--- a/src/libstdc++-v3/include/Makefile.in (.../tags/gcc_4_8_1_release)
31
+++ b/src/libstdc++-v3/include/Makefile.in (.../branches/gcc-4_8-branch)
33
${bits_srcdir}/valarray_array.tcc \
34
${bits_srcdir}/valarray_before.h \
35
${bits_srcdir}/valarray_after.h \
36
- ${bits_srcdir}/vector.tcc \
37
- ${bits_host_headers}
38
+ ${bits_srcdir}/vector.tcc
41
${glibcxx_srcdir}/${CPU_OPT_BITS_RANDOM}
43
${ext_srcdir}/vstring.tcc \
44
${ext_srcdir}/vstring_fwd.h \
45
${ext_srcdir}/vstring_util.h \
46
- ${ext_compat_headers} \
48
+ ${ext_compat_headers}
50
ext_compat_headers = \
51
${backward_srcdir}/hash_set \
52
@@ -1461,13 +1459,14 @@
55
@-mkdir -p ${host_builddir}
56
+ @-mkdir -p ${host_builddir}/../ext
57
@$(STAMP) stamp-${host_alias}
59
# Host includes static.
60
# XXX Missing dependency info for {host_headers_extra}
61
-stamp-host: ${host_headers} ${host_headers_noinst} stamp-${host_alias}
62
+stamp-host: ${host_headers} ${bits_host_headers} ${ext_host_headers} ${host_headers_noinst} stamp-${host_alias}
63
@cd ${host_builddir} && {\
64
- $(LN_S) ${host_headers} . || true ;\
65
+ $(LN_S) ${host_headers} ${bits_host_headers} . || true ;\
66
$(LN_S) ${glibcxx_srcdir}/$(BASIC_FILE_H) basic_file.h || true ;\
67
$(LN_S) ${glibcxx_srcdir}/$(ALLOCATOR_H) c++allocator.h || true ;\
68
$(LN_S) ${glibcxx_srcdir}/$(CSTDIO_H) c++io.h || true ;\
70
$(LN_S) ${glibcxx_srcdir}/$(CMESSAGES_H) messages_members.h || true ;\
71
$(LN_S) ${glibcxx_srcdir}/$(CTIME_H) time_members.h || true;\
73
+ @cd ${host_builddir}/../ext && {\
74
+ $(LN_S) ${ext_host_headers} . || true ;\
78
# Host includes dynamic.
79
@@ -1688,9 +1690,12 @@
80
for file in ${profile_impl_headers}; do \
81
$(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${profile_impl_builddir}; done
82
$(mkinstalldirs) $(DESTDIR)${host_installdir}
83
- for file in ${host_headers} ${host_headers_extra} \
84
+ for file in ${host_headers} ${bits_host_headers} ${host_headers_extra} \
85
${thread_host_headers}; do \
86
$(INSTALL_DATA) $${file} $(DESTDIR)${host_installdir}; done
87
+ $(mkinstalldirs) $(DESTDIR)${host_installdir}/../ext
88
+ for file in ${ext_host_headers}; do \
89
+ $(INSTALL_DATA) $${file} $(DESTDIR)${host_installdir}/../ext; done
91
# To remove directories.
93
Index: libstdc++-v3/include/std/valarray
94
===================================================================
95
--- a/src/libstdc++-v3/include/std/valarray (.../tags/gcc_4_8_1_release)
96
+++ b/src/libstdc++-v3/include/std/valarray (.../branches/gcc-4_8-branch)
99
valarray<_Tp>::operator=(const _Expr<_Dom, _Tp>& __e)
101
- _GLIBCXX_DEBUG_ASSERT(_M_size == __e.size());
102
- std::__valarray_copy(__e, _M_size, _Array<_Tp>(_M_data));
103
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
104
+ // 630. arrays of valarray.
105
+ if (_M_size == __e.size())
106
+ std::__valarray_copy(__e, _M_size, _Array<_Tp>(_M_data));
111
+ std::__valarray_destroy_elements(_M_data, _M_data + _M_size);
112
+ std::__valarray_release_memory(_M_data);
114
+ _M_size = __e.size();
115
+ _M_data = __valarray_get_storage<_Tp>(_M_size);
116
+ std::__valarray_copy_construct(__e, _M_size, _Array<_Tp>(_M_data));
121
Index: libstdc++-v3/include/std/complex
122
===================================================================
123
--- a/src/libstdc++-v3/include/std/complex (.../tags/gcc_4_8_1_release)
124
+++ b/src/libstdc++-v3/include/std/complex (.../branches/gcc-4_8-branch)
125
@@ -142,11 +142,11 @@
126
#if __cplusplus >= 201103L
127
// _GLIBCXX_RESOLVE_LIB_DEFECTS
128
// DR 387. std::complex over-encapsulated.
129
- __attribute ((__abi_tag__ ("cxx11")))
130
+ _GLIBCXX_ABI_TAG_CXX11
132
real() { return _M_real; }
134
- __attribute ((__abi_tag__ ("cxx11")))
135
+ _GLIBCXX_ABI_TAG_CXX11
137
imag() { return _M_imag; }
139
Index: libstdc++-v3/include/ext/random
140
===================================================================
141
--- a/src/libstdc++-v3/include/ext/random (.../tags/gcc_4_8_1_release)
142
+++ b/src/libstdc++-v3/include/ext/random (.../branches/gcc-4_8-branch)
143
@@ -2848,7 +2848,7 @@
144
_GLIBCXX_END_NAMESPACE_VERSION
145
} // namespace __gnu_cxx
147
-#include "opt_random.h"
148
+#include "ext/opt_random.h"
149
#include "random.tcc"
151
#endif // _GLIBCXX_USE_C99_STDINT_TR1
152
Index: libstdc++-v3/include/bits/stl_map.h
153
===================================================================
154
--- a/src/libstdc++-v3/include/bits/stl_map.h (.../tags/gcc_4_8_1_release)
155
+++ b/src/libstdc++-v3/include/bits/stl_map.h (.../branches/gcc-4_8-branch)
157
erase(const_iterator __position)
158
{ return _M_t.erase(__position); }
162
+ _GLIBCXX_ABI_TAG_CXX11
164
erase(iterator __position)
165
{ return _M_t.erase(__position); }
166
Index: libstdc++-v3/include/bits/stl_set.h
167
===================================================================
168
--- a/src/libstdc++-v3/include/bits/stl_set.h (.../tags/gcc_4_8_1_release)
169
+++ b/src/libstdc++-v3/include/bits/stl_set.h (.../branches/gcc-4_8-branch)
171
* touched in any way. Managing the pointer is the user's
174
+ _GLIBCXX_ABI_TAG_CXX11
176
erase(const_iterator __position)
177
{ return _M_t.erase(__position); }
179
* the element is itself a pointer, the pointed-to memory is not touched
180
* in any way. Managing the pointer is the user's responsibility.
182
+ _GLIBCXX_ABI_TAG_CXX11
184
erase(const_iterator __first, const_iterator __last)
185
{ return _M_t.erase(__first, __last); }
186
Index: libstdc++-v3/include/bits/stl_multimap.h
187
===================================================================
188
--- a/src/libstdc++-v3/include/bits/stl_multimap.h (.../tags/gcc_4_8_1_release)
189
+++ b/src/libstdc++-v3/include/bits/stl_multimap.h (.../branches/gcc-4_8-branch)
191
{ return _M_t.erase(__position); }
194
+ _GLIBCXX_ABI_TAG_CXX11
196
erase(iterator __position)
197
{ return _M_t.erase(__position); }
198
Index: libstdc++-v3/include/bits/unordered_map.h
199
===================================================================
200
--- a/src/libstdc++-v3/include/bits/unordered_map.h (.../tags/gcc_4_8_1_release)
201
+++ b/src/libstdc++-v3/include/bits/unordered_map.h (.../branches/gcc-4_8-branch)
203
_Pair&&>::value>::type>
204
std::pair<iterator, bool>
206
- { return _M_h.insert(std::move(__x)); }
207
+ { return _M_h.insert(std::forward<_Pair>(__x)); }
212
_Pair&&>::value>::type>
214
insert(const_iterator __hint, _Pair&& __x)
215
- { return _M_h.insert(__hint, std::move(__x)); }
216
+ { return _M_h.insert(__hint, std::forward<_Pair>(__x)); }
220
@@ -1032,7 +1032,7 @@
221
_Pair&&>::value>::type>
224
- { return _M_h.insert(std::move(__x)); }
225
+ { return _M_h.insert(std::forward<_Pair>(__x)); }
229
@@ -1064,7 +1064,7 @@
230
_Pair&&>::value>::type>
232
insert(const_iterator __hint, _Pair&& __x)
233
- { return _M_h.insert(__hint, std::move(__x)); }
234
+ { return _M_h.insert(__hint, std::forward<_Pair>(__x)); }
238
Index: libstdc++-v3/include/bits/stl_multiset.h
239
===================================================================
240
--- a/src/libstdc++-v3/include/bits/stl_multiset.h (.../tags/gcc_4_8_1_release)
241
+++ b/src/libstdc++-v3/include/bits/stl_multiset.h (.../branches/gcc-4_8-branch)
243
* not touched in any way. Managing the pointer is the user's
246
+ _GLIBCXX_ABI_TAG_CXX11
248
erase(const_iterator __position)
249
{ return _M_t.erase(__position); }
251
* touched in any way. Managing the pointer is the user's
254
+ _GLIBCXX_ABI_TAG_CXX11
256
erase(const_iterator __first, const_iterator __last)
257
{ return _M_t.erase(__first, __last); }
258
Index: libstdc++-v3/include/bits/c++config
259
===================================================================
260
--- a/src/libstdc++-v3/include/bits/c++config (.../tags/gcc_4_8_1_release)
261
+++ b/src/libstdc++-v3/include/bits/c++config (.../branches/gcc-4_8-branch)
263
# define _GLIBCXX_DEPRECATED
266
+// Macros for ABI tag attributes.
267
+#ifndef _GLIBCXX_ABI_TAG_CXX11
268
+# define _GLIBCXX_ABI_TAG_CXX11 __attribute ((__abi_tag__ ("cxx11")))
274
// Macro for constexpr, to support in mixed 03/0x mode.
275
Index: libstdc++-v3/include/bits/random.tcc
276
===================================================================
277
--- a/src/libstdc++-v3/include/bits/random.tcc (.../tags/gcc_4_8_1_release)
278
+++ b/src/libstdc++-v3/include/bits/random.tcc (.../branches/gcc-4_8-branch)
279
@@ -1648,7 +1648,8 @@
280
template<typename _UniformRandomNumberGenerator>
281
typename binomial_distribution<_IntType>::result_type
282
binomial_distribution<_IntType>::
283
- _M_waiting(_UniformRandomNumberGenerator& __urng, _IntType __t)
284
+ _M_waiting(_UniformRandomNumberGenerator& __urng,
285
+ _IntType __t, double __q)
289
@@ -1663,7 +1664,7 @@
290
__sum += __e / (__t - __x);
293
- while (__sum <= _M_param._M_q);
294
+ while (__sum <= __q);
298
@@ -1784,12 +1785,13 @@
302
- const _IntType __z = _M_waiting(__urng, __t - _IntType(__x));
303
+ const _IntType __z = _M_waiting(__urng, __t - _IntType(__x),
305
__ret = _IntType(__x) + __z;
309
- __ret = _M_waiting(__urng, __t);
310
+ __ret = _M_waiting(__urng, __t, __param._M_q);
314
Index: libstdc++-v3/include/bits/random.h
315
===================================================================
316
--- a/src/libstdc++-v3/include/bits/random.h (.../tags/gcc_4_8_1_release)
317
+++ b/src/libstdc++-v3/include/bits/random.h (.../branches/gcc-4_8-branch)
318
@@ -3978,7 +3978,8 @@
320
template<typename _UniformRandomNumberGenerator>
322
- _M_waiting(_UniformRandomNumberGenerator& __urng, _IntType __t);
323
+ _M_waiting(_UniformRandomNumberGenerator& __urng,
324
+ _IntType __t, double __q);
328
Index: libstdc++-v3/include/bits/stl_tree.h
329
===================================================================
330
--- a/src/libstdc++-v3/include/bits/stl_tree.h (.../tags/gcc_4_8_1_release)
331
+++ b/src/libstdc++-v3/include/bits/stl_tree.h (.../branches/gcc-4_8-branch)
332
@@ -336,21 +336,21 @@
336
- typedef _Rb_tree_node_base* _Base_ptr;
337
- typedef const _Rb_tree_node_base* _Const_Base_ptr;
338
+ typedef _Rb_tree_node_base* _Base_ptr;
339
+ typedef const _Rb_tree_node_base* _Const_Base_ptr;
342
- typedef _Key key_type;
343
- typedef _Val value_type;
344
- typedef value_type* pointer;
345
- typedef const value_type* const_pointer;
346
- typedef value_type& reference;
347
- typedef const value_type& const_reference;
348
- typedef _Rb_tree_node<_Val>* _Link_type;
349
- typedef const _Rb_tree_node<_Val>* _Const_Link_type;
350
- typedef size_t size_type;
351
- typedef ptrdiff_t difference_type;
352
- typedef _Alloc allocator_type;
353
+ typedef _Key key_type;
354
+ typedef _Val value_type;
355
+ typedef value_type* pointer;
356
+ typedef const value_type* const_pointer;
357
+ typedef value_type& reference;
358
+ typedef const value_type& const_reference;
359
+ typedef _Rb_tree_node<_Val>* _Link_type;
360
+ typedef const _Rb_tree_node<_Val>* _Const_Link_type;
361
+ typedef size_t size_type;
362
+ typedef ptrdiff_t difference_type;
363
+ typedef _Alloc allocator_type;
366
_M_get_Node_allocator() _GLIBCXX_NOEXCEPT
368
#if __cplusplus >= 201103L
369
// _GLIBCXX_RESOLVE_LIB_DEFECTS
370
// DR 130. Associative erase should return an iterator.
371
+ _GLIBCXX_ABI_TAG_CXX11
373
erase(const_iterator __position)
379
+ _GLIBCXX_ABI_TAG_CXX11
381
erase(iterator __position)
384
#if __cplusplus >= 201103L
385
// _GLIBCXX_RESOLVE_LIB_DEFECTS
386
// DR 130. Associative erase should return an iterator.
387
+ _GLIBCXX_ABI_TAG_CXX11
389
erase(const_iterator __first, const_iterator __last)
391
Index: libstdc++-v3/include/Makefile.am
392
===================================================================
393
--- a/src/libstdc++-v3/include/Makefile.am (.../tags/gcc_4_8_1_release)
394
+++ b/src/libstdc++-v3/include/Makefile.am (.../branches/gcc-4_8-branch)
396
${bits_srcdir}/valarray_array.tcc \
397
${bits_srcdir}/valarray_before.h \
398
${bits_srcdir}/valarray_after.h \
399
- ${bits_srcdir}/vector.tcc \
400
- ${bits_host_headers}
401
+ ${bits_srcdir}/vector.tcc
403
bits_host_headers = \
404
${glibcxx_srcdir}/${CPU_OPT_BITS_RANDOM}
406
${ext_srcdir}/vstring.tcc \
407
${ext_srcdir}/vstring_fwd.h \
408
${ext_srcdir}/vstring_util.h \
409
- ${ext_compat_headers} \
410
- ${ext_host_headers}
411
+ ${ext_compat_headers}
413
ext_compat_headers = \
414
${backward_srcdir}/hash_set \
415
@@ -1048,13 +1046,14 @@
418
@-mkdir -p ${host_builddir}
419
+ @-mkdir -p ${host_builddir}/../ext
420
@$(STAMP) stamp-${host_alias}
422
# Host includes static.
423
# XXX Missing dependency info for {host_headers_extra}
424
-stamp-host: ${host_headers} ${host_headers_noinst} stamp-${host_alias}
425
+stamp-host: ${host_headers} ${bits_host_headers} ${ext_host_headers} ${host_headers_noinst} stamp-${host_alias}
426
@cd ${host_builddir} && {\
427
- $(LN_S) ${host_headers} . || true ;\
428
+ $(LN_S) ${host_headers} ${bits_host_headers} . || true ;\
429
$(LN_S) ${glibcxx_srcdir}/$(BASIC_FILE_H) basic_file.h || true ;\
430
$(LN_S) ${glibcxx_srcdir}/$(ALLOCATOR_H) c++allocator.h || true ;\
431
$(LN_S) ${glibcxx_srcdir}/$(CSTDIO_H) c++io.h || true ;\
432
@@ -1064,6 +1063,9 @@
433
$(LN_S) ${glibcxx_srcdir}/$(CMESSAGES_H) messages_members.h || true ;\
434
$(LN_S) ${glibcxx_srcdir}/$(CTIME_H) time_members.h || true;\
436
+ @cd ${host_builddir}/../ext && {\
437
+ $(LN_S) ${ext_host_headers} . || true ;\
441
# Host includes dynamic.
442
@@ -1290,9 +1292,12 @@
443
for file in ${profile_impl_headers}; do \
444
$(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${profile_impl_builddir}; done
445
$(mkinstalldirs) $(DESTDIR)${host_installdir}
446
- for file in ${host_headers} ${host_headers_extra} \
447
+ for file in ${host_headers} ${bits_host_headers} ${host_headers_extra} \
448
${thread_host_headers}; do \
449
$(INSTALL_DATA) $${file} $(DESTDIR)${host_installdir}; done
450
+ $(mkinstalldirs) $(DESTDIR)${host_installdir}/../ext
451
+ for file in ${ext_host_headers}; do \
452
+ $(INSTALL_DATA) $${file} $(DESTDIR)${host_installdir}/../ext; done
454
# By adding these files here, automake will remove them for 'make clean'
455
CLEANFILES = ${pch_output} ${pch_output_anchors} stamp-host
456
Index: libstdc++-v3/ChangeLog
457
===================================================================
458
--- a/src/libstdc++-v3/ChangeLog (.../tags/gcc_4_8_1_release)
459
+++ b/src/libstdc++-v3/ChangeLog (.../branches/gcc-4_8-branch)
461
+2013-06-22 Paolo Carlini <paolo.carlini@oracle.com>
464
+ * include/bits/random.h (binomial_distribution<>::_M_waiting):
465
+ Add double parameter.
466
+ * include/bits/random.tcc (binomial_distribution<>::operator()
467
+ (_UniformRandomNumberGenerator&, const param_type&)): Pass
468
+ __param._M_q to _M_waiting.
469
+ (_M_waiting): Adjust.
470
+ * testsuite/26_numerics/random/binomial_distribution/
471
+ operators/values.cc: Add tests.
473
+2013-06-21 Paolo Carlini <paolo.carlini@oracle.com>
476
+ * include/std/valarray (valarray<>::operator=(const _Expr<>&)):
477
+ Implement correctly C++11 26.6.2.3/1.
478
+ * testsuite/26_numerics/valarray/dr630-3.C: New.
480
+2013-06-19 Alan Modra <amodra@gmail.com>
482
+ Apply mainline patch
483
+ 2013-06-14 Alan Modra <amodra@gmail.com>
484
+ * configure.host (abi_baseline_pair): Match powerpc64*.
486
+2013-06-15 Paolo Carlini <paolo.carlini@oracle.com>
489
+ * include/bits/unordered_map.h (unordered_map<>::insert,
490
+ unordered_multimap<>::insert): Use std::forward, not std::move.
491
+ * testsuite/23_containers/unordered_map/insert/57619.C: New.
492
+ * testsuite/23_containers/unordered_multimap/insert/57619.C: Likewise.
494
+2013-06-12 Benjamin Kosnik <bkoz@redhat.com>
496
+ * include/bits/c++config (_GLIBCXX_ABI_TAG_CXX11): Add.
497
+ * include/bits/stl_map.h (erase): Use abi_tag when C++11.
498
+ * include/bits/stl_multimap.h: Same.
499
+ * include/bits/stl_multiset.h: Same.
500
+ * include/bits/stl_set.h: Same.
501
+ * include/bits/stl_tree.h: Same.
502
+ * include/std/complex (real, imag): Use macro for abi_tag.
504
+ * testsuite/lib/libstdc++.exp: Disable inlinling with -fno-inline.
505
+ * testsuite/util/testsuite_containers.h (erase_external): New
507
+ (erase_external_iterators): Same.
508
+ (linkage_check_cxx98_cxx11_erase): Same.
509
+ (linkage_check_cxx98_cxx11_erase_iterators): Same.
510
+ * testsuite/util/testsuite_shared.cc: Define.
511
+ * testsuite/23_containers/map/modifiers/erase/abi_tag.cc: New.
512
+ * testsuite/23_containers/map/modifiers/erase/
513
+ dr130-linkage-check.cc: New.
514
+ * testsuite/23_containers/multimap/modifiers/erase/abi_tag.cc: New.
515
+ * testsuite/23_containers/multimap/modifiers/erase/
516
+ dr130-linkage-check.cc: New.
517
+ * testsuite/23_containers/multiset/modifiers/erase/abi_tag.cc: New.
518
+ * testsuite/23_containers/multiset/modifiers/erase/
519
+ dr130-linkage-check.cc: New.
520
+ * testsuite/23_containers/set/modifiers/erase/abi_tag.cc: New.
521
+ * testsuite/23_containers/set/modifiers/erase/dr130-linkage-check.cc:
523
+ * testsuite/ext/profile/mutex_extensions_neg.cc: Adjust line number.
525
+ * testsuite/23_containers/map/dr130.cc: Move...
526
+ * testsuite/23_containers/map/modifiers/dr130.cc: ...here.
527
+ * testsuite/23_containers/multimap/dr130.cc: Move ...
528
+ * testsuite/23_containers/multimap/modifiers/dr130.cc: ...here.
529
+ * testsuite/23_containers/multiset/dr130.cc: Move...
530
+ * testsuite/23_containers/multiset/modifiers/dr130.cc: ...here.
531
+ * testsuite/23_containers/set/dr130.cc: Move...
532
+ * testsuite/23_containers/set/modifiers/dr130.cc: ...here.
534
+2013-06-11 Matthias Klose <doko@ubuntu.com>
536
+ * include/Makefile.am (bits_headers): Remove ${bits_host_headers}.
537
+ (ext_headers): Remove ${ext_host_headers}.
538
+ (stamp-${host_alias}): Create ${host_builddir}/../ext.
539
+ (stamp-host): Link ${bits_host_headers} and ${ext_host_headers}.
540
+ (install-headers): Install ${bits_host_headers} and ${ext_host_headers}.
541
+ * include/Makefile.in: Regenerate.
542
+ * include/ext/random: Include ext/opt_random.h.
544
+2013-06-07 Uros Bizjak <ubizjak@gmail.com>
546
+ * config/abi/post/alpha-linux-gnu/baseline_symbols.txt: Update.
548
2013-05-31 Release Manager
550
* GCC 4.8.1 released.
551
Index: libstdc++-v3/testsuite/26_numerics/random/binomial_distribution/operators/values.cc
552
===================================================================
553
--- a/src/libstdc++-v3/testsuite/26_numerics/random/binomial_distribution/operators/values.cc (.../tags/gcc_4_8_1_release)
554
+++ b/src/libstdc++-v3/testsuite/26_numerics/random/binomial_distribution/operators/values.cc (.../branches/gcc-4_8-branch)
556
std::binomial_distribution<> bd3(10, 0.75);
557
auto bbd3 = std::bind(bd3, eng);
558
testDiscreteDist(bbd3, [](int n) { return binomial_pdf(n, 10, 0.75); } );
561
+ std::binomial_distribution<> bd4(1, 0.8);
562
+ const std::binomial_distribution<>::param_type pm4(1, 0.3);
563
+ auto bbd4 = std::bind(bd4, eng, pm4);
564
+ testDiscreteDist(bbd4, [](int n) { return binomial_pdf(n, 1, 0.3); } );
566
+ std::binomial_distribution<> bd5(100, 0.3);
567
+ const std::binomial_distribution<>::param_type pm5(100, 0.8);
568
+ auto bbd5 = std::bind(bd5, eng, pm5);
569
+ testDiscreteDist(bbd5, [](int n) { return binomial_pdf(n, 100, 0.8); } );
573
Index: libstdc++-v3/testsuite/26_numerics/valarray/dr630-3.C
574
===================================================================
575
--- a/src/libstdc++-v3/testsuite/26_numerics/valarray/dr630-3.C (.../tags/gcc_4_8_1_release)
576
+++ b/src/libstdc++-v3/testsuite/26_numerics/valarray/dr630-3.C (.../branches/gcc-4_8-branch)
578
+// Copyright (C) 2013 Free Software Foundation, Inc.
580
+// This file is part of the GNU ISO C++ Library. This library is free
581
+// software; you can redistribute it and/or modify it under the
582
+// terms of the GNU General Public License as published by the
583
+// Free Software Foundation; either version 3, or (at your option)
584
+// any later version.
586
+// This library is distributed in the hope that it will be useful,
587
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
588
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
589
+// GNU General Public License for more details.
591
+// You should have received a copy of the GNU General Public License along
592
+// with this library; see the file COPYING3. If not see
593
+// <http://www.gnu.org/licenses/>.
596
+#include <testsuite_hooks.h>
601
+ bool test __attribute__((unused)) = true;
603
+ std::valarray<int> a(3), b(3), d1, d2;
605
+ VERIFY( d1.size() == 3 );
607
+ VERIFY( d2.size() == 3 );
615
Index: libstdc++-v3/testsuite/ext/profile/mutex_extensions_neg.cc
616
===================================================================
617
--- a/src/libstdc++-v3/testsuite/ext/profile/mutex_extensions_neg.cc (.../tags/gcc_4_8_1_release)
618
+++ b/src/libstdc++-v3/testsuite/ext/profile/mutex_extensions_neg.cc (.../branches/gcc-4_8-branch)
623
-// { dg-error "multiple inlined namespaces" "" { target *-*-* } 269 }
624
+// { dg-error "multiple inlined namespaces" "" { target *-*-* } 275 }
625
Index: libstdc++-v3/testsuite/lib/libstdc++.exp
626
===================================================================
627
--- a/src/libstdc++-v3/testsuite/lib/libstdc++.exp (.../tags/gcc_4_8_1_release)
628
+++ b/src/libstdc++-v3/testsuite/lib/libstdc++.exp (.../branches/gcc-4_8-branch)
630
# Compile with "-w" so that warnings issued by the compiler
631
# do not prevent compilation.
632
if { [v3_target_compile $srcdir/util/$f $object_file "sharedlib" \
633
- [list "incdir=$srcdir" "additional_flags=-w -shared -fPIC -DPIC"]]
634
+ [list "incdir=$srcdir" "additional_flags=-fno-inline -w -shared -fPIC -DPIC"]]
636
error "could not compile $f"
638
Index: libstdc++-v3/testsuite/23_containers/unordered_map/insert/57619.C
639
===================================================================
640
--- a/src/libstdc++-v3/testsuite/23_containers/unordered_map/insert/57619.C (.../tags/gcc_4_8_1_release)
641
+++ b/src/libstdc++-v3/testsuite/23_containers/unordered_map/insert/57619.C (.../branches/gcc-4_8-branch)
643
+// { dg-options "-std=gnu++11" }
645
+// Copyright (C) 2013 Free Software Foundation, Inc.
647
+// This file is part of the GNU ISO C++ Library. This library is free
648
+// software; you can redistribute it and/or modify it under the
649
+// terms of the GNU General Public License as published by the
650
+// Free Software Foundation; either version 3, or (at your option)
651
+// any later version.
653
+// This library is distributed in the hope that it will be useful,
654
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
655
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
656
+// GNU General Public License for more details.
658
+// You should have received a copy of the GNU General Public License along
659
+// with this library; see the file COPYING3. If not see
660
+// <http://www.gnu.org/licenses/>.
662
+#include <unordered_map>
664
+#include <testsuite_hooks.h>
668
+ bool test __attribute__((unused)) = true;
671
+ std::unordered_map<std::string, std::string> mymap;
672
+ std::pair<std::string, std::string> mypair{std::string("key"),
673
+ std::string("value")};
674
+ mymap.insert(mypair);
676
+ VERIFY( mypair.first.length() && mypair.second.length() );
680
+ std::unordered_map<std::string, std::string> mymap;
681
+ std::pair<std::string, std::string> mypair{std::string("key"),
682
+ std::string("value")};
683
+ mymap.insert(mymap.begin(), mypair);
685
+ VERIFY( mypair.first.length() && mypair.second.length() );
694
Index: libstdc++-v3/testsuite/23_containers/multimap/dr130.cc
695
===================================================================
696
--- a/src/libstdc++-v3/testsuite/23_containers/multimap/dr130.cc (.../tags/gcc_4_8_1_release)
697
+++ b/src/libstdc++-v3/testsuite/23_containers/multimap/dr130.cc (.../branches/gcc-4_8-branch)
699
-// { dg-options "-std=gnu++0x" }
701
-// Copyright (C) 2009-2013 Free Software Foundation, Inc.
703
-// This file is part of the GNU ISO C++ Library. This library is free
704
-// software; you can redistribute it and/or modify it under the
705
-// terms of the GNU General Public License as published by the
706
-// Free Software Foundation; either version 3, or (at your option)
707
-// any later version.
709
-// This library is distributed in the hope that it will be useful,
710
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
711
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
712
-// GNU General Public License for more details.
714
-// You should have received a copy of the GNU General Public License along
715
-// with this library; see the file COPYING3. If not see
716
-// <http://www.gnu.org/licenses/>.
719
-// NOTE: This makes use of the fact that we know how moveable
720
-// is implemented on multiset (via swap). If the implementation changed
721
-// this test may begin to fail.
725
-#include <testsuite_hooks.h>
727
-using namespace std;
732
- bool test __attribute__((unused)) = true;
733
- using namespace std;
735
- multimap<int, int> mm0;
736
- typedef multimap<int, int>::iterator iterator;
737
- typedef multimap<int, int>::const_iterator const_iterator;
738
- typedef multimap<int, int>::value_type value_type;
739
- typedef iterator insert_return_type;
741
- vector<insert_return_type> irt;
742
- for (int i = 1; i <= 4; ++i)
743
- for (int j = 1; j <= i; ++j)
744
- irt.push_back( mm0.insert( value_type( i, i ) ) );
746
- iterator pos1 = mm0.erase(irt[1]);
747
- VERIFY( pos1 == irt[2] );
749
- iterator pos2 = mm0.erase(irt[2]);
750
- VERIFY( pos2 == irt[3] );
752
- iterator pos3 = mm0.erase(irt[9]);
753
- VERIFY( pos3 == mm0.end() );
759
- bool test __attribute__((unused)) = true;
760
- using namespace std;
762
- multimap<int, int> mm0;
763
- typedef multimap<int, int>::iterator iterator;
764
- typedef multimap<int, int>::const_iterator const_iterator;
765
- typedef multimap<int, int>::value_type value_type;
766
- typedef iterator insert_return_type;
768
- vector<insert_return_type> irt;
769
- for (int i = 1; i <= 4; ++i)
770
- for (int j = 1; j <= i; ++j)
771
- irt.push_back( mm0.insert( value_type( i, i ) ) );
773
- iterator pos1 = mm0.erase(irt[3], irt[6]);
774
- VERIFY( pos1 == irt[6] );
776
- iterator pos2 = mm0.erase(irt[6], ++irt[9]);
777
- VERIFY( pos2 == mm0.end() );
786
Index: libstdc++-v3/testsuite/23_containers/multimap/modifiers/erase/dr130-linkage-check.cc
787
===================================================================
788
--- a/src/libstdc++-v3/testsuite/23_containers/multimap/modifiers/erase/dr130-linkage-check.cc (.../tags/gcc_4_8_1_release)
789
+++ b/src/libstdc++-v3/testsuite/23_containers/multimap/modifiers/erase/dr130-linkage-check.cc (.../branches/gcc-4_8-branch)
791
+// { dg-require-effective-target ia32 }
792
+// { dg-require-sharedlib "" }
793
+// { dg-options "-fno-inline -std=gnu++11 ./testsuite_shared.so" }
794
+// 2013-06-03 Benjamin Kosnik <bkoz@redhat..com>
796
+// Copyright (C) 2013 Free Software Foundation, Inc.
798
+// This file is part of the GNU ISO C++ Library. This library is free
799
+// software; you can redistribute it and/or modify it under the
800
+// terms of the GNU General Public License as published by the
801
+// Free Software Foundation; either version 3, or (at your option)
802
+// any later version.
804
+// This library is distributed in the hope that it will be useful,
805
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
806
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
807
+// GNU General Public License for more details.
809
+// You should have received a copy of the GNU General Public License along
810
+// with this library; see the file COPYING3. If not see
811
+// <http://www.gnu.org/licenses/>.
813
+#include <testsuite_containers.h>
817
+ typedef std::multimap<int, int> container_type;
820
+ container_type s { {0,0} , {1,1} , {2,2} };
821
+ __gnu_test::linkage_check_cxx98_cxx11_erase(s);
825
+ container_type s { {0,0} , {1,1} , {2,2} };
826
+ __gnu_test::linkage_check_cxx98_cxx11_erase_iterators(s);
831
Index: libstdc++-v3/testsuite/23_containers/multimap/modifiers/erase/abi_tag.cc
832
===================================================================
833
--- a/src/libstdc++-v3/testsuite/23_containers/multimap/modifiers/erase/abi_tag.cc (.../tags/gcc_4_8_1_release)
834
+++ b/src/libstdc++-v3/testsuite/23_containers/multimap/modifiers/erase/abi_tag.cc (.../branches/gcc-4_8-branch)
836
+// { dg-do compile }
837
+// { dg-options -std=c++11 }
839
+// Copyright (C) 2013 Free Software Foundation, Inc.
841
+// This file is part of the GNU ISO C++ Library. This library is free
842
+// software; you can redistribute it and/or modify it under the
843
+// terms of the GNU General Public License as published by the
844
+// Free Software Foundation; either version 3, or (at your option)
845
+// any later version.
847
+// This library is distributed in the hope that it will be useful,
848
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
849
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
850
+// GNU General Public License for more details.
852
+// Under Section 7 of GPL version 3, you are granted additional
853
+// permissions described in the GCC Runtime Library Exception, version
854
+// 3.1, as published by the Free Software Foundation.
856
+// You should have received a copy of the GNU General Public License and
857
+// a copy of the GCC Runtime Library Exception along with this program;
858
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
859
+// <http://www.gnu.org/licenses/>.
861
+// Test that the C++11 variants have an ABI tag
865
+using container = std::multimap<int, int>;
866
+using iterator = typename container::iterator;
867
+using const_iterator = typename container::const_iterator;
869
+// { dg-final { scan-assembler "_ZNSt8multimapIiiSt4lessIiESaISt4pairIKiiEEE5eraseB5cxx11ESt17_Rb_tree_iteratorIS4_E" } }
870
+iterator (container::*p1)(iterator) = &container::erase;
871
Index: libstdc++-v3/testsuite/23_containers/multimap/modifiers/dr130.cc
872
===================================================================
873
--- a/src/libstdc++-v3/testsuite/23_containers/multimap/modifiers/dr130.cc (.../tags/gcc_4_8_1_release)
874
+++ b/src/libstdc++-v3/testsuite/23_containers/multimap/modifiers/dr130.cc (.../branches/gcc-4_8-branch)
876
+// { dg-options "-std=gnu++0x" }
878
+// Copyright (C) 2009-2013 Free Software Foundation, Inc.
880
+// This file is part of the GNU ISO C++ Library. This library is free
881
+// software; you can redistribute it and/or modify it under the
882
+// terms of the GNU General Public License as published by the
883
+// Free Software Foundation; either version 3, or (at your option)
884
+// any later version.
886
+// This library is distributed in the hope that it will be useful,
887
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
888
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
889
+// GNU General Public License for more details.
891
+// You should have received a copy of the GNU General Public License along
892
+// with this library; see the file COPYING3. If not see
893
+// <http://www.gnu.org/licenses/>.
896
+// NOTE: This makes use of the fact that we know how moveable
897
+// is implemented on multiset (via swap). If the implementation changed
898
+// this test may begin to fail.
902
+#include <testsuite_hooks.h>
904
+using namespace std;
909
+ bool test __attribute__((unused)) = true;
910
+ using namespace std;
912
+ multimap<int, int> mm0;
913
+ typedef multimap<int, int>::iterator iterator;
914
+ typedef multimap<int, int>::const_iterator const_iterator;
915
+ typedef multimap<int, int>::value_type value_type;
916
+ typedef iterator insert_return_type;
918
+ vector<insert_return_type> irt;
919
+ for (int i = 1; i <= 4; ++i)
920
+ for (int j = 1; j <= i; ++j)
921
+ irt.push_back( mm0.insert( value_type( i, i ) ) );
923
+ iterator pos1 = mm0.erase(irt[1]);
924
+ VERIFY( pos1 == irt[2] );
926
+ iterator pos2 = mm0.erase(irt[2]);
927
+ VERIFY( pos2 == irt[3] );
929
+ iterator pos3 = mm0.erase(irt[9]);
930
+ VERIFY( pos3 == mm0.end() );
936
+ bool test __attribute__((unused)) = true;
937
+ using namespace std;
939
+ multimap<int, int> mm0;
940
+ typedef multimap<int, int>::iterator iterator;
941
+ typedef multimap<int, int>::const_iterator const_iterator;
942
+ typedef multimap<int, int>::value_type value_type;
943
+ typedef iterator insert_return_type;
945
+ vector<insert_return_type> irt;
946
+ for (int i = 1; i <= 4; ++i)
947
+ for (int j = 1; j <= i; ++j)
948
+ irt.push_back( mm0.insert( value_type( i, i ) ) );
950
+ iterator pos1 = mm0.erase(irt[3], irt[6]);
951
+ VERIFY( pos1 == irt[6] );
953
+ iterator pos2 = mm0.erase(irt[6], ++irt[9]);
954
+ VERIFY( pos2 == mm0.end() );
963
Index: libstdc++-v3/testsuite/23_containers/set/dr130.cc
964
===================================================================
965
--- a/src/libstdc++-v3/testsuite/23_containers/set/dr130.cc (.../tags/gcc_4_8_1_release)
966
+++ b/src/libstdc++-v3/testsuite/23_containers/set/dr130.cc (.../branches/gcc-4_8-branch)
968
-// { dg-options "-std=gnu++0x" }
969
-// 2008-07-22 Edward Smith-Rowland <3dw4rd@verizon.net>
971
-// Copyright (C) 2009-2013 Free Software Foundation, Inc.
973
-// This file is part of the GNU ISO C++ Library. This library is free
974
-// software; you can redistribute it and/or modify it under the
975
-// terms of the GNU General Public License as published by the
976
-// Free Software Foundation; either version 3, or (at your option)
977
-// any later version.
979
-// This library is distributed in the hope that it will be useful,
980
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
981
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
982
-// GNU General Public License for more details.
984
-// You should have received a copy of the GNU General Public License along
985
-// with this library; see the file COPYING3. If not see
986
-// <http://www.gnu.org/licenses/>.
989
-#include <testsuite_hooks.h>
991
-// DR 130. Associative erase should return an iterator.
995
- bool test __attribute__((unused)) = true;
996
- using namespace std;
999
- typedef set<int>::iterator iterator;
1000
- typedef set<int>::const_iterator const_iterator;
1001
- typedef pair<iterator, bool> insert_return_type;
1004
- insert_return_type irt1 = s0.insert(2);
1005
- insert_return_type irt2 = s0.insert(3);
1007
- iterator pos1 = s0.erase(irt1.first);
1008
- VERIFY( pos1 == irt2.first );
1010
- iterator pos2 = s0.erase(irt2.first);
1011
- VERIFY( pos2 == s0.end() );
1017
- bool test __attribute__((unused)) = true;
1018
- using namespace std;
1021
- typedef set<int>::iterator iterator;
1022
- typedef set<int>::const_iterator const_iterator;
1023
- typedef pair<iterator, bool> insert_return_type;
1025
- insert_return_type irt0 = s0.insert(1);
1027
- insert_return_type irt2 = s0.insert(3);
1028
- insert_return_type irt3 = s0.insert(4);
1030
- iterator pos1 = s0.erase(irt0.first, irt2.first);
1031
- VERIFY( pos1 == irt2.first );
1033
- iterator pos2 = s0.erase(irt2.first, ++irt3.first);
1034
- VERIFY( pos2 == s0.end() );
1043
Index: libstdc++-v3/testsuite/23_containers/set/modifiers/erase/dr130-linkage-check.cc
1044
===================================================================
1045
--- a/src/libstdc++-v3/testsuite/23_containers/set/modifiers/erase/dr130-linkage-check.cc (.../tags/gcc_4_8_1_release)
1046
+++ b/src/libstdc++-v3/testsuite/23_containers/set/modifiers/erase/dr130-linkage-check.cc (.../branches/gcc-4_8-branch)
1048
+// { dg-require-effective-target ia32 }
1049
+// { dg-require-sharedlib "" }
1050
+// { dg-options "-fno-inline -std=gnu++11 ./testsuite_shared.so" }
1051
+// 2013-06-03 Benjamin Kosnik <bkoz@redhat..com>
1053
+// Copyright (C) 2013 Free Software Foundation, Inc.
1055
+// This file is part of the GNU ISO C++ Library. This library is free
1056
+// software; you can redistribute it and/or modify it under the
1057
+// terms of the GNU General Public License as published by the
1058
+// Free Software Foundation; either version 3, or (at your option)
1059
+// any later version.
1061
+// This library is distributed in the hope that it will be useful,
1062
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
1063
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1064
+// GNU General Public License for more details.
1066
+// You should have received a copy of the GNU General Public License along
1067
+// with this library; see the file COPYING3. If not see
1068
+// <http://www.gnu.org/licenses/>.
1070
+#include <testsuite_containers.h>
1074
+ typedef std::set<int> container_type;
1077
+ container_type s { 0, 1, 2 };
1078
+ __gnu_test::linkage_check_cxx98_cxx11_erase(s);
1082
+ container_type s { 0, 1, 2 };
1083
+ __gnu_test::linkage_check_cxx98_cxx11_erase_iterators(s);
1088
Index: libstdc++-v3/testsuite/23_containers/set/modifiers/erase/abi_tag.cc
1089
===================================================================
1090
--- a/src/libstdc++-v3/testsuite/23_containers/set/modifiers/erase/abi_tag.cc (.../tags/gcc_4_8_1_release)
1091
+++ b/src/libstdc++-v3/testsuite/23_containers/set/modifiers/erase/abi_tag.cc (.../branches/gcc-4_8-branch)
1093
+// { dg-do compile }
1094
+// { dg-options -std=c++11 }
1096
+// Copyright (C) 2013 Free Software Foundation, Inc.
1098
+// This file is part of the GNU ISO C++ Library. This library is free
1099
+// software; you can redistribute it and/or modify it under the
1100
+// terms of the GNU General Public License as published by the
1101
+// Free Software Foundation; either version 3, or (at your option)
1102
+// any later version.
1104
+// This library is distributed in the hope that it will be useful,
1105
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
1106
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1107
+// GNU General Public License for more details.
1109
+// Under Section 7 of GPL version 3, you are granted additional
1110
+// permissions described in the GCC Runtime Library Exception, version
1111
+// 3.1, as published by the Free Software Foundation.
1113
+// You should have received a copy of the GNU General Public License and
1114
+// a copy of the GCC Runtime Library Exception along with this program;
1115
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
1116
+// <http://www.gnu.org/licenses/>.
1118
+// Test that the C++11 variants have an ABI tag
1122
+using container = std::set<int>;
1123
+using iterator = typename container::iterator;
1124
+using const_iterator = typename container::const_iterator;
1126
+// { dg-final { scan-assembler "_ZNSt3setIiSt4lessIiESaIiEE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIiE" } }
1127
+iterator (container::*p1)(const_iterator) = &container::erase;
1129
+// { dg-final { scan-assembler "_ZNSt3setIiSt4lessIiESaIiEE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIiES5_" } }
1130
+iterator (container::*p2)(const_iterator, const_iterator) = &container::erase;
1131
Index: libstdc++-v3/testsuite/23_containers/set/modifiers/dr130.cc
1132
===================================================================
1133
--- a/src/libstdc++-v3/testsuite/23_containers/set/modifiers/dr130.cc (.../tags/gcc_4_8_1_release)
1134
+++ b/src/libstdc++-v3/testsuite/23_containers/set/modifiers/dr130.cc (.../branches/gcc-4_8-branch)
1136
+// { dg-options "-std=gnu++0x" }
1137
+// 2008-07-22 Edward Smith-Rowland <3dw4rd@verizon.net>
1139
+// Copyright (C) 2009-2013 Free Software Foundation, Inc.
1141
+// This file is part of the GNU ISO C++ Library. This library is free
1142
+// software; you can redistribute it and/or modify it under the
1143
+// terms of the GNU General Public License as published by the
1144
+// Free Software Foundation; either version 3, or (at your option)
1145
+// any later version.
1147
+// This library is distributed in the hope that it will be useful,
1148
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
1149
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1150
+// GNU General Public License for more details.
1152
+// You should have received a copy of the GNU General Public License along
1153
+// with this library; see the file COPYING3. If not see
1154
+// <http://www.gnu.org/licenses/>.
1157
+#include <testsuite_hooks.h>
1159
+// DR 130. Associative erase should return an iterator.
1163
+ bool test __attribute__((unused)) = true;
1164
+ using namespace std;
1167
+ typedef set<int>::iterator iterator;
1168
+ typedef set<int>::const_iterator const_iterator;
1169
+ typedef pair<iterator, bool> insert_return_type;
1172
+ insert_return_type irt1 = s0.insert(2);
1173
+ insert_return_type irt2 = s0.insert(3);
1175
+ iterator pos1 = s0.erase(irt1.first);
1176
+ VERIFY( pos1 == irt2.first );
1178
+ iterator pos2 = s0.erase(irt2.first);
1179
+ VERIFY( pos2 == s0.end() );
1185
+ bool test __attribute__((unused)) = true;
1186
+ using namespace std;
1189
+ typedef set<int>::iterator iterator;
1190
+ typedef set<int>::const_iterator const_iterator;
1191
+ typedef pair<iterator, bool> insert_return_type;
1193
+ insert_return_type irt0 = s0.insert(1);
1195
+ insert_return_type irt2 = s0.insert(3);
1196
+ insert_return_type irt3 = s0.insert(4);
1198
+ iterator pos1 = s0.erase(irt0.first, irt2.first);
1199
+ VERIFY( pos1 == irt2.first );
1201
+ iterator pos2 = s0.erase(irt2.first, ++irt3.first);
1202
+ VERIFY( pos2 == s0.end() );
1211
Index: libstdc++-v3/testsuite/23_containers/unordered_multimap/insert/57619.C
1212
===================================================================
1213
--- a/src/libstdc++-v3/testsuite/23_containers/unordered_multimap/insert/57619.C (.../tags/gcc_4_8_1_release)
1214
+++ b/src/libstdc++-v3/testsuite/23_containers/unordered_multimap/insert/57619.C (.../branches/gcc-4_8-branch)
1216
+// { dg-options "-std=gnu++11" }
1218
+// Copyright (C) 2013 Free Software Foundation, Inc.
1220
+// This file is part of the GNU ISO C++ Library. This library is free
1221
+// software; you can redistribute it and/or modify it under the
1222
+// terms of the GNU General Public License as published by the
1223
+// Free Software Foundation; either version 3, or (at your option)
1224
+// any later version.
1226
+// This library is distributed in the hope that it will be useful,
1227
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
1228
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1229
+// GNU General Public License for more details.
1231
+// You should have received a copy of the GNU General Public License along
1232
+// with this library; see the file COPYING3. If not see
1233
+// <http://www.gnu.org/licenses/>.
1235
+#include <unordered_map>
1237
+#include <testsuite_hooks.h>
1241
+ bool test __attribute__((unused)) = true;
1244
+ std::unordered_multimap<std::string, std::string> mymmap;
1245
+ std::pair<std::string, std::string> mypair{std::string("key"),
1246
+ std::string("value")};
1247
+ mymmap.insert(mypair);
1249
+ VERIFY( mypair.first.length() && mypair.second.length() );
1253
+ std::unordered_multimap<std::string, std::string> mymmap;
1254
+ std::pair<std::string, std::string> mypair{std::string("key"),
1255
+ std::string("value")};
1256
+ mymmap.insert(mymmap.begin(), mypair);
1258
+ VERIFY( mypair.first.length() && mypair.second.length() );
1267
Index: libstdc++-v3/testsuite/23_containers/multiset/dr130.cc
1268
===================================================================
1269
--- a/src/libstdc++-v3/testsuite/23_containers/multiset/dr130.cc (.../tags/gcc_4_8_1_release)
1270
+++ b/src/libstdc++-v3/testsuite/23_containers/multiset/dr130.cc (.../branches/gcc-4_8-branch)
1272
-// { dg-options "-std=gnu++0x" }
1274
-// Copyright (C) 2009-2013 Free Software Foundation, Inc.
1276
-// This file is part of the GNU ISO C++ Library. This library is free
1277
-// software; you can redistribute it and/or modify it under the
1278
-// terms of the GNU General Public License as published by the
1279
-// Free Software Foundation; either version 3, or (at your option)
1280
-// any later version.
1282
-// This library is distributed in the hope that it will be useful,
1283
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
1284
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1285
-// GNU General Public License for more details.
1287
-// You should have received a copy of the GNU General Public License along
1288
-// with this library; see the file COPYING3. If not see
1289
-// <http://www.gnu.org/licenses/>.
1292
-// NOTE: This makes use of the fact that we know how moveable
1293
-// is implemented on multiset (via swap). If the implementation changed
1294
-// this test may begin to fail.
1298
-#include <testsuite_hooks.h>
1300
-using namespace std;
1305
- bool test __attribute__((unused)) = true;
1306
- using namespace std;
1308
- multiset<int> ms0;
1309
- typedef multiset<int>::iterator iterator;
1310
- typedef multiset<int>::const_iterator const_iterator;
1311
- typedef iterator insert_return_type;
1313
- vector<insert_return_type> irt;
1314
- for ( int i = 1; i <= 4; ++i )
1315
- for (int j = 1; j <= i; ++j)
1316
- irt.push_back( ms0.insert( i ) );
1318
- iterator pos1 = ms0.erase(irt[1]);
1319
- VERIFY( pos1 == irt[2] );
1321
- iterator pos2 = ms0.erase(irt[2]);
1322
- VERIFY( pos2 == irt[3] );
1324
- iterator pos3 = ms0.erase(irt[9]);
1325
- VERIFY( pos3 == ms0.end() );
1331
- bool test __attribute__((unused)) = true;
1332
- using namespace std;
1334
- multiset<int> ms0;
1335
- typedef multiset<int>::iterator iterator;
1336
- typedef multiset<int>::const_iterator const_iterator;
1337
- typedef iterator insert_return_type;
1339
- vector<insert_return_type> irt;
1340
- for ( int i = 1; i <= 4; ++i )
1341
- for (int j = 1; j <= i; ++j)
1342
- irt.push_back( ms0.insert( i ) );
1344
- iterator pos1 = ms0.erase(irt[3], irt[6]);
1345
- VERIFY( pos1 == irt[6] );
1347
- iterator pos2 = ms0.erase(irt[6], ++irt[9]);
1348
- VERIFY( pos2 == ms0.end() );
1357
Index: libstdc++-v3/testsuite/23_containers/multiset/modifiers/erase/dr130-linkage-check.cc
1358
===================================================================
1359
--- a/src/libstdc++-v3/testsuite/23_containers/multiset/modifiers/erase/dr130-linkage-check.cc (.../tags/gcc_4_8_1_release)
1360
+++ b/src/libstdc++-v3/testsuite/23_containers/multiset/modifiers/erase/dr130-linkage-check.cc (.../branches/gcc-4_8-branch)
1362
+// { dg-require-effective-target ia32 }
1363
+// { dg-require-sharedlib "" }
1364
+// { dg-options "-fno-inline -std=gnu++11 ./testsuite_shared.so" }
1365
+// 2013-06-03 Benjamin Kosnik <bkoz@redhat..com>
1367
+// Copyright (C) 2013 Free Software Foundation, Inc.
1369
+// This file is part of the GNU ISO C++ Library. This library is free
1370
+// software; you can redistribute it and/or modify it under the
1371
+// terms of the GNU General Public License as published by the
1372
+// Free Software Foundation; either version 3, or (at your option)
1373
+// any later version.
1375
+// This library is distributed in the hope that it will be useful,
1376
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
1377
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1378
+// GNU General Public License for more details.
1380
+// You should have received a copy of the GNU General Public License along
1381
+// with this library; see the file COPYING3. If not see
1382
+// <http://www.gnu.org/licenses/>.
1384
+#include <testsuite_containers.h>
1388
+ typedef std::multiset<int> container_type;
1391
+ container_type s { 0, 1, 2 };
1392
+ __gnu_test::linkage_check_cxx98_cxx11_erase(s);
1396
+ container_type s { 0, 1, 2 };
1397
+ __gnu_test::linkage_check_cxx98_cxx11_erase_iterators(s);
1402
Index: libstdc++-v3/testsuite/23_containers/multiset/modifiers/erase/abi_tag.cc
1403
===================================================================
1404
--- a/src/libstdc++-v3/testsuite/23_containers/multiset/modifiers/erase/abi_tag.cc (.../tags/gcc_4_8_1_release)
1405
+++ b/src/libstdc++-v3/testsuite/23_containers/multiset/modifiers/erase/abi_tag.cc (.../branches/gcc-4_8-branch)
1407
+// { dg-do compile }
1408
+// { dg-options -std=c++11 }
1410
+// Copyright (C) 2013 Free Software Foundation, Inc.
1412
+// This file is part of the GNU ISO C++ Library. This library is free
1413
+// software; you can redistribute it and/or modify it under the
1414
+// terms of the GNU General Public License as published by the
1415
+// Free Software Foundation; either version 3, or (at your option)
1416
+// any later version.
1418
+// This library is distributed in the hope that it will be useful,
1419
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
1420
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1421
+// GNU General Public License for more details.
1423
+// Under Section 7 of GPL version 3, you are granted additional
1424
+// permissions described in the GCC Runtime Library Exception, version
1425
+// 3.1, as published by the Free Software Foundation.
1427
+// You should have received a copy of the GNU General Public License and
1428
+// a copy of the GCC Runtime Library Exception along with this program;
1429
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
1430
+// <http://www.gnu.org/licenses/>.
1432
+// Test that the C++11 variants have an ABI tag
1436
+using container = std::multiset<int>;
1437
+using iterator = typename container::iterator;
1438
+using const_iterator = typename container::const_iterator;
1440
+// { dg-final { scan-assembler "_ZNSt8multisetIiSt4lessIiESaIiEE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIiE" } }
1441
+iterator (container::*p1)(const_iterator) = &container::erase;
1443
+// { dg-final { scan-assembler "_ZNSt8multisetIiSt4lessIiESaIiEE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIiES5_" } }
1444
+iterator (container::*p2)(const_iterator, const_iterator) = &container::erase;
1445
Index: libstdc++-v3/testsuite/23_containers/multiset/modifiers/dr130.cc
1446
===================================================================
1447
--- a/src/libstdc++-v3/testsuite/23_containers/multiset/modifiers/dr130.cc (.../tags/gcc_4_8_1_release)
1448
+++ b/src/libstdc++-v3/testsuite/23_containers/multiset/modifiers/dr130.cc (.../branches/gcc-4_8-branch)
1450
+// { dg-options "-std=gnu++0x" }
1452
+// Copyright (C) 2009-2013 Free Software Foundation, Inc.
1454
+// This file is part of the GNU ISO C++ Library. This library is free
1455
+// software; you can redistribute it and/or modify it under the
1456
+// terms of the GNU General Public License as published by the
1457
+// Free Software Foundation; either version 3, or (at your option)
1458
+// any later version.
1460
+// This library is distributed in the hope that it will be useful,
1461
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
1462
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1463
+// GNU General Public License for more details.
1465
+// You should have received a copy of the GNU General Public License along
1466
+// with this library; see the file COPYING3. If not see
1467
+// <http://www.gnu.org/licenses/>.
1470
+// NOTE: This makes use of the fact that we know how moveable
1471
+// is implemented on multiset (via swap). If the implementation changed
1472
+// this test may begin to fail.
1476
+#include <testsuite_hooks.h>
1478
+using namespace std;
1483
+ bool test __attribute__((unused)) = true;
1484
+ using namespace std;
1486
+ multiset<int> ms0;
1487
+ typedef multiset<int>::iterator iterator;
1488
+ typedef multiset<int>::const_iterator const_iterator;
1489
+ typedef iterator insert_return_type;
1491
+ vector<insert_return_type> irt;
1492
+ for ( int i = 1; i <= 4; ++i )
1493
+ for (int j = 1; j <= i; ++j)
1494
+ irt.push_back( ms0.insert( i ) );
1496
+ iterator pos1 = ms0.erase(irt[1]);
1497
+ VERIFY( pos1 == irt[2] );
1499
+ iterator pos2 = ms0.erase(irt[2]);
1500
+ VERIFY( pos2 == irt[3] );
1502
+ iterator pos3 = ms0.erase(irt[9]);
1503
+ VERIFY( pos3 == ms0.end() );
1509
+ bool test __attribute__((unused)) = true;
1510
+ using namespace std;
1512
+ multiset<int> ms0;
1513
+ typedef multiset<int>::iterator iterator;
1514
+ typedef multiset<int>::const_iterator const_iterator;
1515
+ typedef iterator insert_return_type;
1517
+ vector<insert_return_type> irt;
1518
+ for ( int i = 1; i <= 4; ++i )
1519
+ for (int j = 1; j <= i; ++j)
1520
+ irt.push_back( ms0.insert( i ) );
1522
+ iterator pos1 = ms0.erase(irt[3], irt[6]);
1523
+ VERIFY( pos1 == irt[6] );
1525
+ iterator pos2 = ms0.erase(irt[6], ++irt[9]);
1526
+ VERIFY( pos2 == ms0.end() );
1535
Index: libstdc++-v3/testsuite/23_containers/map/dr130.cc
1536
===================================================================
1537
--- a/src/libstdc++-v3/testsuite/23_containers/map/dr130.cc (.../tags/gcc_4_8_1_release)
1538
+++ b/src/libstdc++-v3/testsuite/23_containers/map/dr130.cc (.../branches/gcc-4_8-branch)
1540
-// { dg-options "-std=gnu++0x" }
1541
-// 2008-07-22 Edward Smith-Rowland <3dw4rd@verizon.net>
1543
-// Copyright (C) 2009-2013 Free Software Foundation, Inc.
1545
-// This file is part of the GNU ISO C++ Library. This library is free
1546
-// software; you can redistribute it and/or modify it under the
1547
-// terms of the GNU General Public License as published by the
1548
-// Free Software Foundation; either version 3, or (at your option)
1549
-// any later version.
1551
-// This library is distributed in the hope that it will be useful,
1552
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
1553
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1554
-// GNU General Public License for more details.
1556
-// You should have received a copy of the GNU General Public License along
1557
-// with this library; see the file COPYING3. If not see
1558
-// <http://www.gnu.org/licenses/>.
1561
-#include <testsuite_hooks.h>
1563
-// DR 130. Associative erase should return an iterator.
1567
- bool test __attribute__((unused)) = true;
1568
- using namespace std;
1571
- typedef map<int, int>::iterator iterator;
1572
- typedef map<int, int>::const_iterator const_iterator;
1573
- typedef map<int, int>::value_type value_type;
1574
- typedef pair<iterator, bool> insert_return_type;
1576
- m0.insert(value_type(1, 1));
1577
- insert_return_type irt1 = m0.insert(value_type(2, 2));
1578
- insert_return_type irt2 = m0.insert(value_type(3, 3));
1580
- iterator pos1 = m0.erase(irt1.first);
1581
- VERIFY( pos1 == irt2.first );
1583
- iterator pos2 = m0.erase(irt2.first);
1584
- VERIFY( pos2 == m0.end() );
1590
- bool test __attribute__((unused)) = true;
1591
- using namespace std;
1594
- typedef map<int, int>::iterator iterator;
1595
- typedef map<int, int>::const_iterator const_iterator;
1596
- typedef map<int, int>::value_type value_type;
1597
- typedef pair<iterator, bool> insert_return_type;
1599
- insert_return_type irt0 = m0.insert(value_type(1, 1));
1600
- m0.insert(value_type(2, 2));
1601
- insert_return_type irt2 = m0.insert(value_type(3, 3));
1602
- insert_return_type irt3 = m0.insert(value_type(4, 4));
1604
- iterator pos1 = m0.erase(irt0.first, irt2.first);
1605
- VERIFY( pos1 == irt2.first );
1607
- iterator pos2 = m0.erase(irt2.first, ++irt3.first);
1608
- VERIFY( pos2 == m0.end() );
1617
Index: libstdc++-v3/testsuite/23_containers/map/modifiers/erase/dr130-linkage-check.cc
1618
===================================================================
1619
--- a/src/libstdc++-v3/testsuite/23_containers/map/modifiers/erase/dr130-linkage-check.cc (.../tags/gcc_4_8_1_release)
1620
+++ b/src/libstdc++-v3/testsuite/23_containers/map/modifiers/erase/dr130-linkage-check.cc (.../branches/gcc-4_8-branch)
1622
+// { dg-require-effective-target ia32 }
1623
+// { dg-require-sharedlib "" }
1624
+// { dg-options "-fno-inline -std=gnu++11 ./testsuite_shared.so" }
1625
+// 2013-06-03 Benjamin Kosnik <bkoz@redhat..com>
1627
+// Copyright (C) 2013 Free Software Foundation, Inc.
1629
+// This file is part of the GNU ISO C++ Library. This library is free
1630
+// software; you can redistribute it and/or modify it under the
1631
+// terms of the GNU General Public License as published by the
1632
+// Free Software Foundation; either version 3, or (at your option)
1633
+// any later version.
1635
+// This library is distributed in the hope that it will be useful,
1636
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
1637
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1638
+// GNU General Public License for more details.
1640
+// You should have received a copy of the GNU General Public License along
1641
+// with this library; see the file COPYING3. If not see
1642
+// <http://www.gnu.org/licenses/>.
1644
+#include <testsuite_containers.h>
1648
+ typedef std::map<int, int> container_type;
1651
+ container_type s { {0,0} , {1,1} , {2,2} };
1652
+ __gnu_test::linkage_check_cxx98_cxx11_erase(s);
1656
+ container_type s { {0,0} , {1,1} , {2,2} };
1657
+ __gnu_test::linkage_check_cxx98_cxx11_erase_iterators(s);
1662
Index: libstdc++-v3/testsuite/23_containers/map/modifiers/erase/abi_tag.cc
1663
===================================================================
1664
--- a/src/libstdc++-v3/testsuite/23_containers/map/modifiers/erase/abi_tag.cc (.../tags/gcc_4_8_1_release)
1665
+++ b/src/libstdc++-v3/testsuite/23_containers/map/modifiers/erase/abi_tag.cc (.../branches/gcc-4_8-branch)
1667
+// { dg-do compile }
1668
+// { dg-options -std=c++11 }
1670
+// Copyright (C) 2013 Free Software Foundation, Inc.
1672
+// This file is part of the GNU ISO C++ Library. This library is free
1673
+// software; you can redistribute it and/or modify it under the
1674
+// terms of the GNU General Public License as published by the
1675
+// Free Software Foundation; either version 3, or (at your option)
1676
+// any later version.
1678
+// This library is distributed in the hope that it will be useful,
1679
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
1680
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1681
+// GNU General Public License for more details.
1683
+// Under Section 7 of GPL version 3, you are granted additional
1684
+// permissions described in the GCC Runtime Library Exception, version
1685
+// 3.1, as published by the Free Software Foundation.
1687
+// You should have received a copy of the GNU General Public License and
1688
+// a copy of the GCC Runtime Library Exception along with this program;
1689
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
1690
+// <http://www.gnu.org/licenses/>.
1692
+// Test that the C++11 variants have an ABI tag
1696
+using container = std::map<int, int>;
1697
+using iterator = typename container::iterator;
1698
+using const_iterator = typename container::const_iterator;
1700
+// { dg-final { scan-assembler "_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE5eraseB5cxx11ESt17_Rb_tree_iteratorIS4_E" } }
1701
+iterator (container::*p1)(iterator) = &container::erase;
1702
Index: libstdc++-v3/testsuite/23_containers/map/modifiers/dr130.cc
1703
===================================================================
1704
--- a/src/libstdc++-v3/testsuite/23_containers/map/modifiers/dr130.cc (.../tags/gcc_4_8_1_release)
1705
+++ b/src/libstdc++-v3/testsuite/23_containers/map/modifiers/dr130.cc (.../branches/gcc-4_8-branch)
1707
+// { dg-options "-std=gnu++0x" }
1708
+// 2008-07-22 Edward Smith-Rowland <3dw4rd@verizon.net>
1710
+// Copyright (C) 2009-2013 Free Software Foundation, Inc.
1712
+// This file is part of the GNU ISO C++ Library. This library is free
1713
+// software; you can redistribute it and/or modify it under the
1714
+// terms of the GNU General Public License as published by the
1715
+// Free Software Foundation; either version 3, or (at your option)
1716
+// any later version.
1718
+// This library is distributed in the hope that it will be useful,
1719
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
1720
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1721
+// GNU General Public License for more details.
1723
+// You should have received a copy of the GNU General Public License along
1724
+// with this library; see the file COPYING3. If not see
1725
+// <http://www.gnu.org/licenses/>.
1728
+#include <testsuite_hooks.h>
1730
+// DR 130. Associative erase should return an iterator.
1734
+ bool test __attribute__((unused)) = true;
1735
+ using namespace std;
1738
+ typedef map<int, int>::iterator iterator;
1739
+ typedef map<int, int>::const_iterator const_iterator;
1740
+ typedef map<int, int>::value_type value_type;
1741
+ typedef pair<iterator, bool> insert_return_type;
1743
+ m0.insert(value_type(1, 1));
1744
+ insert_return_type irt1 = m0.insert(value_type(2, 2));
1745
+ insert_return_type irt2 = m0.insert(value_type(3, 3));
1747
+ iterator pos1 = m0.erase(irt1.first);
1748
+ VERIFY( pos1 == irt2.first );
1750
+ iterator pos2 = m0.erase(irt2.first);
1751
+ VERIFY( pos2 == m0.end() );
1757
+ bool test __attribute__((unused)) = true;
1758
+ using namespace std;
1761
+ typedef map<int, int>::iterator iterator;
1762
+ typedef map<int, int>::const_iterator const_iterator;
1763
+ typedef map<int, int>::value_type value_type;
1764
+ typedef pair<iterator, bool> insert_return_type;
1766
+ insert_return_type irt0 = m0.insert(value_type(1, 1));
1767
+ m0.insert(value_type(2, 2));
1768
+ insert_return_type irt2 = m0.insert(value_type(3, 3));
1769
+ insert_return_type irt3 = m0.insert(value_type(4, 4));
1771
+ iterator pos1 = m0.erase(irt0.first, irt2.first);
1772
+ VERIFY( pos1 == irt2.first );
1774
+ iterator pos2 = m0.erase(irt2.first, ++irt3.first);
1775
+ VERIFY( pos2 == m0.end() );
1784
Index: libstdc++-v3/testsuite/util/testsuite_containers.h
1785
===================================================================
1786
--- a/src/libstdc++-v3/testsuite/util/testsuite_containers.h (.../tags/gcc_4_8_1_release)
1787
+++ b/src/libstdc++-v3/testsuite/util/testsuite_containers.h (.../branches/gcc-4_8-branch)
1788
@@ -223,7 +223,59 @@
1789
template<typename _Tp>
1790
_Tp citerator<_Tp>::_S_container;
1792
+ // DR 130 vs. C++98 vs. C++11.
1793
+ // Defined in testsuite_shared.cc.
1795
+ erase_external(std::set<int>& s);
1798
+ erase_external(std::multiset<int>& s);
1801
+ erase_external(std::map<int, int>& s);
1804
+ erase_external(std::multimap<int, int>& s);
1807
+ erase_external_iterators(std::set<int>& s);
1810
+ erase_external_iterators(std::multiset<int>& s);
1813
+ erase_external_iterators(std::map<int, int>& s);
1816
+ erase_external_iterators(std::multimap<int, int>& s);
1818
+// NB: "must be compiled with C++11"
1819
+#if __cplusplus >= 201103L
1820
+template<typename _Tp>
1822
+ linkage_check_cxx98_cxx11_erase(_Tp& container)
1824
+ // Crashing when exteral reference and internal reference symbols are
1825
+ // equivalently mangled but have different size return types in C++98
1826
+ // and C++11 signatures.
1827
+ erase_external(container); // C++98
1828
+ container.erase(container.begin()); // C++11
1831
+template<typename _Tp>
1833
+ linkage_check_cxx98_cxx11_erase_iterators(_Tp& container)
1835
+ // Crashing when exteral reference and internal reference symbols are
1836
+ // equivalently mangled but have different size return types in C++98
1837
+ // and C++11 signatures.
1838
+ erase_external_iterators(container);// C++98
1840
+ auto iter = container.begin();
1841
+ container.erase(iter, ++iter); // C++11
1845
} // namespace __gnu_test
1848
Index: libstdc++-v3/testsuite/util/testsuite_shared.cc
1849
===================================================================
1850
--- a/src/libstdc++-v3/testsuite/util/testsuite_shared.cc (.../tags/gcc_4_8_1_release)
1851
+++ b/src/libstdc++-v3/testsuite/util/testsuite_shared.cc (.../branches/gcc-4_8-branch)
1853
#include <stdexcept>
1858
#include <ext/mt_allocator.h>
1859
#include <bits/functexcept.h>
1861
+namespace __gnu_test
1867
// Randomly throw. See if other threads cleanup.
1868
std::__throw_bad_exception();
1871
+#if __cplusplus < 201103L
1872
+// "must be compiled with C++98"
1874
+ erase_external(std::set<int>& s)
1875
+ { s.erase(s.begin()); }
1878
+ erase_external(std::multiset<int>& s)
1879
+ { s.erase(s.begin()); }
1882
+ erase_external(std::map<int, int>& s)
1883
+ { s.erase(s.begin()); }
1886
+ erase_external(std::multimap<int, int>& s)
1887
+ { s.erase(s.begin()); }
1890
+ erase_external_iterators(std::set<int>& s)
1892
+ typedef typename std::set<int>::iterator iterator_type;
1893
+ iterator_type iter = s.begin();
1894
+ s.erase(iter, ++iter);
1898
+ erase_external_iterators(std::multiset<int>& s)
1900
+ typedef typename std::multiset<int>::iterator iterator_type;
1901
+ iterator_type iter = s.begin();
1902
+ s.erase(iter, ++iter);
1906
+ erase_external_iterators(std::map<int, int>& s)
1908
+ typedef typename std::map<int, int>::iterator iterator_type;
1909
+ iterator_type iter = s.begin();
1910
+ s.erase(iter, ++iter);
1915
+ erase_external_iterators(std::multimap<int, int>& s)
1917
+ typedef typename std::multimap<int, int>::iterator iterator_type;
1918
+ iterator_type iter = s.begin();
1919
+ s.erase(iter, ++iter);
1923
+} // end namepace __gnu_test
1924
Index: libstdc++-v3/config/abi/post/alpha-linux-gnu/baseline_symbols.txt
1925
===================================================================
1926
--- a/src/libstdc++-v3/config/abi/post/alpha-linux-gnu/baseline_symbols.txt (.../tags/gcc_4_8_1_release)
1927
+++ b/src/libstdc++-v3/config/abi/post/alpha-linux-gnu/baseline_symbols.txt (.../branches/gcc-4_8-branch)
1929
FUNC:_ZNKSt17__gnu_cxx_ldbl1289money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE8__do_putES4_bRSt8ios_basewd@@GLIBCXX_LDBL_3.4
1930
FUNC:_ZNKSt17__gnu_cxx_ldbl1289money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE9_M_insertILb0EEES4_S4_RSt8ios_basewRKSbIwS3_SaIwEE@@GLIBCXX_LDBL_3.4
1931
FUNC:_ZNKSt17__gnu_cxx_ldbl1289money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE9_M_insertILb1EEES4_S4_RSt8ios_basewRKSbIwS3_SaIwEE@@GLIBCXX_LDBL_3.4
1932
+FUNC:_ZNKSt17bad_function_call4whatEv@@GLIBCXX_3.4.18
1933
FUNC:_ZNKSt18basic_stringstreamIcSt11char_traitsIcESaIcEE3strEv@@GLIBCXX_3.4
1934
FUNC:_ZNKSt18basic_stringstreamIcSt11char_traitsIcESaIcEE5rdbufEv@@GLIBCXX_3.4
1935
FUNC:_ZNKSt18basic_stringstreamIwSt11char_traitsIwESaIwEE3strEv@@GLIBCXX_3.4
1937
FUNC:_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE6do_putES3_RSt8ios_basewm@@GLIBCXX_3.4
1938
FUNC:_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE6do_putES3_RSt8ios_basewx@@GLIBCXX_3.4
1939
FUNC:_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE6do_putES3_RSt8ios_basewy@@GLIBCXX_3.4
1940
+FUNC:_ZNKSt8__detail20_Prime_rehash_policy11_M_next_bktEm@@GLIBCXX_3.4.18
1941
+FUNC:_ZNKSt8__detail20_Prime_rehash_policy14_M_need_rehashEmmm@@GLIBCXX_3.4.18
1942
FUNC:_ZNKSt8bad_cast4whatEv@@GLIBCXX_3.4.9
1943
FUNC:_ZNKSt8ios_base7failure4whatEv@@GLIBCXX_3.4
1944
FUNC:_ZNKSt8messagesIcE18_M_convert_to_charERKSs@@GLIBCXX_3.4
1945
@@ -1353,6 +1356,7 @@
1946
FUNC:_ZNSt11regex_errorD0Ev@@GLIBCXX_3.4.15
1947
FUNC:_ZNSt11regex_errorD1Ev@@GLIBCXX_3.4.15
1948
FUNC:_ZNSt11regex_errorD2Ev@@GLIBCXX_3.4.15
1949
+FUNC:_ZNSt11this_thread11__sleep_forENSt6chrono8durationIlSt5ratioILl1ELl1EEEENS1_IlS2_ILl1ELl1000000000EEEE@@GLIBCXX_3.4.18
1950
FUNC:_ZNSt12__basic_fileIcE2fdEv@@GLIBCXX_3.4
1951
FUNC:_ZNSt12__basic_fileIcE4fileEv@@GLIBCXX_3.4.1
1952
FUNC:_ZNSt12__basic_fileIcE4openEPKcSt13_Ios_Openmodei@@GLIBCXX_3.4
1953
@@ -1635,6 +1639,11 @@
1954
FUNC:_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEt@@GLIBCXX_3.4
1955
FUNC:_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEx@@GLIBCXX_3.4
1956
FUNC:_ZNSt13basic_ostreamIwSt11char_traitsIwEElsEy@@GLIBCXX_3.4
1957
+FUNC:_ZNSt13random_device14_M_init_pretr1ERKSs@@GLIBCXX_3.4.18
1958
+FUNC:_ZNSt13random_device16_M_getval_pretr1Ev@@GLIBCXX_3.4.18
1959
+FUNC:_ZNSt13random_device7_M_finiEv@@GLIBCXX_3.4.18
1960
+FUNC:_ZNSt13random_device7_M_initERKSs@@GLIBCXX_3.4.18
1961
+FUNC:_ZNSt13random_device9_M_getvalEv@@GLIBCXX_3.4.18
1962
FUNC:_ZNSt13runtime_errorC1ERKSs@@GLIBCXX_3.4
1963
FUNC:_ZNSt13runtime_errorC2ERKSs@@GLIBCXX_3.4
1964
FUNC:_ZNSt13runtime_errorD0Ev@@GLIBCXX_3.4
1965
@@ -2119,6 +2128,8 @@
1966
FUNC:_ZNSt6__norm15_List_node_base8transferEPS0_S1_@@GLIBCXX_3.4.9
1967
FUNC:_ZNSt6__norm15_List_node_base9_M_unhookEv@@GLIBCXX_3.4.14
1968
FUNC:_ZNSt6chrono12system_clock3nowEv@@GLIBCXX_3.4.11
1969
+FUNC:_ZNSt6chrono3_V212steady_clock3nowEv@@GLIBCXX_3.4.19
1970
+FUNC:_ZNSt6chrono3_V212system_clock3nowEv@@GLIBCXX_3.4.19
1971
FUNC:_ZNSt6gslice8_IndexerC1EmRKSt8valarrayImES4_@@GLIBCXX_3.4
1972
FUNC:_ZNSt6gslice8_IndexerC2EmRKSt8valarrayImES4_@@GLIBCXX_3.4
1973
FUNC:_ZNSt6locale11_M_coalesceERKS_S1_i@@GLIBCXX_3.4
1974
@@ -2678,6 +2689,7 @@
1975
FUNC:__cxa_guard_release@@CXXABI_1.3
1976
FUNC:__cxa_pure_virtual@@CXXABI_1.3
1977
FUNC:__cxa_rethrow@@CXXABI_1.3
1978
+FUNC:__cxa_thread_atexit@@CXXABI_1.3.7
1979
FUNC:__cxa_throw@@CXXABI_1.3
1980
FUNC:__cxa_tm_cleanup@@CXXABI_TM_1
1981
FUNC:__cxa_vec_cctor@@CXXABI_1.3
1982
@@ -2724,6 +2736,7 @@
1983
OBJECT:0:CXXABI_1.3.4
1984
OBJECT:0:CXXABI_1.3.5
1985
OBJECT:0:CXXABI_1.3.6
1986
+OBJECT:0:CXXABI_1.3.7
1987
OBJECT:0:CXXABI_LDBL_1.3
1988
OBJECT:0:CXXABI_TM_1
1989
OBJECT:0:GLIBCXX_3.4
1990
@@ -2736,6 +2749,8 @@
1991
OBJECT:0:GLIBCXX_3.4.15
1992
OBJECT:0:GLIBCXX_3.4.16
1993
OBJECT:0:GLIBCXX_3.4.17
1994
+OBJECT:0:GLIBCXX_3.4.18
1995
+OBJECT:0:GLIBCXX_3.4.19
1996
OBJECT:0:GLIBCXX_3.4.2
1997
OBJECT:0:GLIBCXX_3.4.3
1998
OBJECT:0:GLIBCXX_3.4.4
1999
@@ -3193,6 +3208,8 @@
2000
OBJECT:1:_ZNSt21__numeric_limits_base9is_moduloE@@GLIBCXX_3.4
2001
OBJECT:1:_ZNSt21__numeric_limits_base9is_signedE@@GLIBCXX_3.4
2002
OBJECT:1:_ZNSt6chrono12system_clock12is_monotonicE@@GLIBCXX_3.4.11
2003
+OBJECT:1:_ZNSt6chrono3_V212steady_clock9is_steadyE@@GLIBCXX_3.4.19
2004
+OBJECT:1:_ZNSt6chrono3_V212system_clock9is_steadyE@@GLIBCXX_3.4.19
2005
OBJECT:1:_ZSt10adopt_lock@@GLIBCXX_3.4.11
2006
OBJECT:1:_ZSt10defer_lock@@GLIBCXX_3.4.11
2007
OBJECT:1:_ZSt11try_to_lock@@GLIBCXX_3.4.11
2008
Index: libjava/classpath/m4/pkg.m4
2009
===================================================================
2010
--- a/src/libjava/classpath/m4/pkg.m4 (.../tags/gcc_4_8_1_release)
2011
+++ b/src/libjava/classpath/m4/pkg.m4 (.../branches/gcc-4_8-branch)
2015
if test -z "$PKG_CONFIG"; then
2016
- AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
2017
+ AC_PATH_TOOL(PKG_CONFIG, pkg-config, no)
2020
if test "$PKG_CONFIG" = "no" ; then
2021
Index: libjava/classpath/configure
2022
===================================================================
2023
--- a/src/libjava/classpath/configure (.../tags/gcc_4_8_1_release)
2024
+++ b/src/libjava/classpath/configure (.../branches/gcc-4_8-branch)
2025
@@ -18779,8 +18779,9 @@
2028
if test -z "$PKG_CONFIG"; then
2029
- # Extract the first word of "pkg-config", so it can be a program name with args.
2030
-set dummy pkg-config; ac_word=$2
2031
+ if test -n "$ac_tool_prefix"; then
2032
+ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
2033
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
2034
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2035
$as_echo_n "checking for $ac_word... " >&6; }
2036
if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
2037
@@ -18806,7 +18807,6 @@
2041
- test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
2045
@@ -18820,8 +18820,65 @@
2050
+if test -z "$ac_cv_path_PKG_CONFIG"; then
2051
+ ac_pt_PKG_CONFIG=$PKG_CONFIG
2052
+ # Extract the first word of "pkg-config", so it can be a program name with args.
2053
+set dummy pkg-config; ac_word=$2
2054
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2055
+$as_echo_n "checking for $ac_word... " >&6; }
2056
+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
2057
+ $as_echo_n "(cached) " >&6
2059
+ case $ac_pt_PKG_CONFIG in
2060
+ [\\/]* | ?:[\\/]*)
2061
+ ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
2064
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2065
+for as_dir in $PATH
2068
+ test -z "$as_dir" && as_dir=.
2069
+ for ac_exec_ext in '' $ac_executable_extensions; do
2070
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
2071
+ ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
2072
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
2082
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
2083
+if test -n "$ac_pt_PKG_CONFIG"; then
2084
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
2085
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
2087
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
2088
+$as_echo "no" >&6; }
2091
+ if test "x$ac_pt_PKG_CONFIG" = x; then
2094
+ case $cross_compiling:$ac_tool_warned in
2096
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
2097
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
2098
+ac_tool_warned=yes ;;
2100
+ PKG_CONFIG=$ac_pt_PKG_CONFIG
2103
+ PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
2108
if test "$PKG_CONFIG" = "no" ; then
2109
echo "*** The pkg-config script could not be found. Make sure it is"
2110
echo "*** in your path, or set the PKG_CONFIG environment variable"
2111
@@ -18876,8 +18933,9 @@
2114
if test -z "$PKG_CONFIG"; then
2115
- # Extract the first word of "pkg-config", so it can be a program name with args.
2116
-set dummy pkg-config; ac_word=$2
2117
+ if test -n "$ac_tool_prefix"; then
2118
+ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
2119
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
2120
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2121
$as_echo_n "checking for $ac_word... " >&6; }
2122
if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
2123
@@ -18903,7 +18961,6 @@
2127
- test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
2131
@@ -18917,8 +18974,65 @@
2136
+if test -z "$ac_cv_path_PKG_CONFIG"; then
2137
+ ac_pt_PKG_CONFIG=$PKG_CONFIG
2138
+ # Extract the first word of "pkg-config", so it can be a program name with args.
2139
+set dummy pkg-config; ac_word=$2
2140
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2141
+$as_echo_n "checking for $ac_word... " >&6; }
2142
+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
2143
+ $as_echo_n "(cached) " >&6
2145
+ case $ac_pt_PKG_CONFIG in
2146
+ [\\/]* | ?:[\\/]*)
2147
+ ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
2150
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2151
+for as_dir in $PATH
2154
+ test -z "$as_dir" && as_dir=.
2155
+ for ac_exec_ext in '' $ac_executable_extensions; do
2156
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
2157
+ ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
2158
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
2168
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
2169
+if test -n "$ac_pt_PKG_CONFIG"; then
2170
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
2171
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
2173
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
2174
+$as_echo "no" >&6; }
2177
+ if test "x$ac_pt_PKG_CONFIG" = x; then
2180
+ case $cross_compiling:$ac_tool_warned in
2182
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
2183
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
2184
+ac_tool_warned=yes ;;
2186
+ PKG_CONFIG=$ac_pt_PKG_CONFIG
2189
+ PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
2194
if test "$PKG_CONFIG" = "no" ; then
2195
echo "*** The pkg-config script could not be found. Make sure it is"
2196
echo "*** in your path, or set the PKG_CONFIG environment variable"
2197
@@ -19751,8 +19865,9 @@
2200
if test -z "$PKG_CONFIG"; then
2201
- # Extract the first word of "pkg-config", so it can be a program name with args.
2202
-set dummy pkg-config; ac_word=$2
2203
+ if test -n "$ac_tool_prefix"; then
2204
+ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
2205
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
2206
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2207
$as_echo_n "checking for $ac_word... " >&6; }
2208
if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
2209
@@ -19778,7 +19893,6 @@
2213
- test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
2217
@@ -19792,8 +19906,65 @@
2222
+if test -z "$ac_cv_path_PKG_CONFIG"; then
2223
+ ac_pt_PKG_CONFIG=$PKG_CONFIG
2224
+ # Extract the first word of "pkg-config", so it can be a program name with args.
2225
+set dummy pkg-config; ac_word=$2
2226
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2227
+$as_echo_n "checking for $ac_word... " >&6; }
2228
+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
2229
+ $as_echo_n "(cached) " >&6
2231
+ case $ac_pt_PKG_CONFIG in
2232
+ [\\/]* | ?:[\\/]*)
2233
+ ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
2236
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2237
+for as_dir in $PATH
2240
+ test -z "$as_dir" && as_dir=.
2241
+ for ac_exec_ext in '' $ac_executable_extensions; do
2242
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
2243
+ ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
2244
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
2254
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
2255
+if test -n "$ac_pt_PKG_CONFIG"; then
2256
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
2257
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
2259
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
2260
+$as_echo "no" >&6; }
2263
+ if test "x$ac_pt_PKG_CONFIG" = x; then
2266
+ case $cross_compiling:$ac_tool_warned in
2268
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
2269
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
2270
+ac_tool_warned=yes ;;
2272
+ PKG_CONFIG=$ac_pt_PKG_CONFIG
2275
+ PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
2280
if test "$PKG_CONFIG" = "no" ; then
2281
echo "*** The pkg-config script could not be found. Make sure it is"
2282
echo "*** in your path, or set the PKG_CONFIG environment variable"
2283
@@ -19848,8 +20019,9 @@
2286
if test -z "$PKG_CONFIG"; then
2287
- # Extract the first word of "pkg-config", so it can be a program name with args.
2288
-set dummy pkg-config; ac_word=$2
2289
+ if test -n "$ac_tool_prefix"; then
2290
+ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
2291
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
2292
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2293
$as_echo_n "checking for $ac_word... " >&6; }
2294
if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
2295
@@ -19875,7 +20047,6 @@
2299
- test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
2303
@@ -19889,8 +20060,65 @@
2308
+if test -z "$ac_cv_path_PKG_CONFIG"; then
2309
+ ac_pt_PKG_CONFIG=$PKG_CONFIG
2310
+ # Extract the first word of "pkg-config", so it can be a program name with args.
2311
+set dummy pkg-config; ac_word=$2
2312
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2313
+$as_echo_n "checking for $ac_word... " >&6; }
2314
+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
2315
+ $as_echo_n "(cached) " >&6
2317
+ case $ac_pt_PKG_CONFIG in
2318
+ [\\/]* | ?:[\\/]*)
2319
+ ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
2322
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2323
+for as_dir in $PATH
2326
+ test -z "$as_dir" && as_dir=.
2327
+ for ac_exec_ext in '' $ac_executable_extensions; do
2328
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
2329
+ ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
2330
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
2340
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
2341
+if test -n "$ac_pt_PKG_CONFIG"; then
2342
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
2343
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
2345
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
2346
+$as_echo "no" >&6; }
2349
+ if test "x$ac_pt_PKG_CONFIG" = x; then
2352
+ case $cross_compiling:$ac_tool_warned in
2354
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
2355
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
2356
+ac_tool_warned=yes ;;
2358
+ PKG_CONFIG=$ac_pt_PKG_CONFIG
2361
+ PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
2366
if test "$PKG_CONFIG" = "no" ; then
2367
echo "*** The pkg-config script could not be found. Make sure it is"
2368
echo "*** in your path, or set the PKG_CONFIG environment variable"
2369
@@ -19945,8 +20173,9 @@
2372
if test -z "$PKG_CONFIG"; then
2373
- # Extract the first word of "pkg-config", so it can be a program name with args.
2374
-set dummy pkg-config; ac_word=$2
2375
+ if test -n "$ac_tool_prefix"; then
2376
+ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
2377
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
2378
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2379
$as_echo_n "checking for $ac_word... " >&6; }
2380
if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
2381
@@ -19972,7 +20201,6 @@
2385
- test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
2389
@@ -19986,8 +20214,65 @@
2394
+if test -z "$ac_cv_path_PKG_CONFIG"; then
2395
+ ac_pt_PKG_CONFIG=$PKG_CONFIG
2396
+ # Extract the first word of "pkg-config", so it can be a program name with args.
2397
+set dummy pkg-config; ac_word=$2
2398
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2399
+$as_echo_n "checking for $ac_word... " >&6; }
2400
+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
2401
+ $as_echo_n "(cached) " >&6
2403
+ case $ac_pt_PKG_CONFIG in
2404
+ [\\/]* | ?:[\\/]*)
2405
+ ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
2408
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2409
+for as_dir in $PATH
2412
+ test -z "$as_dir" && as_dir=.
2413
+ for ac_exec_ext in '' $ac_executable_extensions; do
2414
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
2415
+ ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
2416
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
2426
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
2427
+if test -n "$ac_pt_PKG_CONFIG"; then
2428
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
2429
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
2431
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
2432
+$as_echo "no" >&6; }
2435
+ if test "x$ac_pt_PKG_CONFIG" = x; then
2438
+ case $cross_compiling:$ac_tool_warned in
2440
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
2441
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
2442
+ac_tool_warned=yes ;;
2444
+ PKG_CONFIG=$ac_pt_PKG_CONFIG
2447
+ PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
2452
if test "$PKG_CONFIG" = "no" ; then
2453
echo "*** The pkg-config script could not be found. Make sure it is"
2454
echo "*** in your path, or set the PKG_CONFIG environment variable"
2455
@@ -20042,8 +20327,9 @@
2458
if test -z "$PKG_CONFIG"; then
2459
- # Extract the first word of "pkg-config", so it can be a program name with args.
2460
-set dummy pkg-config; ac_word=$2
2461
+ if test -n "$ac_tool_prefix"; then
2462
+ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
2463
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
2464
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2465
$as_echo_n "checking for $ac_word... " >&6; }
2466
if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
2467
@@ -20069,7 +20355,6 @@
2471
- test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
2475
@@ -20083,8 +20368,65 @@
2480
+if test -z "$ac_cv_path_PKG_CONFIG"; then
2481
+ ac_pt_PKG_CONFIG=$PKG_CONFIG
2482
+ # Extract the first word of "pkg-config", so it can be a program name with args.
2483
+set dummy pkg-config; ac_word=$2
2484
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2485
+$as_echo_n "checking for $ac_word... " >&6; }
2486
+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
2487
+ $as_echo_n "(cached) " >&6
2489
+ case $ac_pt_PKG_CONFIG in
2490
+ [\\/]* | ?:[\\/]*)
2491
+ ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
2494
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2495
+for as_dir in $PATH
2498
+ test -z "$as_dir" && as_dir=.
2499
+ for ac_exec_ext in '' $ac_executable_extensions; do
2500
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
2501
+ ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
2502
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
2512
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
2513
+if test -n "$ac_pt_PKG_CONFIG"; then
2514
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
2515
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
2517
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
2518
+$as_echo "no" >&6; }
2521
+ if test "x$ac_pt_PKG_CONFIG" = x; then
2524
+ case $cross_compiling:$ac_tool_warned in
2526
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
2527
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
2528
+ac_tool_warned=yes ;;
2530
+ PKG_CONFIG=$ac_pt_PKG_CONFIG
2533
+ PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
2538
if test "$PKG_CONFIG" = "no" ; then
2539
echo "*** The pkg-config script could not be found. Make sure it is"
2540
echo "*** in your path, or set the PKG_CONFIG environment variable"
2541
@@ -20245,8 +20587,9 @@
2544
if test -z "$PKG_CONFIG"; then
2545
- # Extract the first word of "pkg-config", so it can be a program name with args.
2546
-set dummy pkg-config; ac_word=$2
2547
+ if test -n "$ac_tool_prefix"; then
2548
+ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
2549
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
2550
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2551
$as_echo_n "checking for $ac_word... " >&6; }
2552
if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
2553
@@ -20272,7 +20615,6 @@
2557
- test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
2561
@@ -20286,8 +20628,65 @@
2566
+if test -z "$ac_cv_path_PKG_CONFIG"; then
2567
+ ac_pt_PKG_CONFIG=$PKG_CONFIG
2568
+ # Extract the first word of "pkg-config", so it can be a program name with args.
2569
+set dummy pkg-config; ac_word=$2
2570
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2571
+$as_echo_n "checking for $ac_word... " >&6; }
2572
+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
2573
+ $as_echo_n "(cached) " >&6
2575
+ case $ac_pt_PKG_CONFIG in
2576
+ [\\/]* | ?:[\\/]*)
2577
+ ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
2580
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2581
+for as_dir in $PATH
2584
+ test -z "$as_dir" && as_dir=.
2585
+ for ac_exec_ext in '' $ac_executable_extensions; do
2586
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
2587
+ ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
2588
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
2598
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
2599
+if test -n "$ac_pt_PKG_CONFIG"; then
2600
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
2601
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
2603
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
2604
+$as_echo "no" >&6; }
2607
+ if test "x$ac_pt_PKG_CONFIG" = x; then
2610
+ case $cross_compiling:$ac_tool_warned in
2612
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
2613
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
2614
+ac_tool_warned=yes ;;
2616
+ PKG_CONFIG=$ac_pt_PKG_CONFIG
2619
+ PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
2624
if test "$PKG_CONFIG" = "no" ; then
2625
echo "*** The pkg-config script could not be found. Make sure it is"
2626
echo "*** in your path, or set the PKG_CONFIG environment variable"
2627
@@ -20344,8 +20743,9 @@
2630
if test -z "$PKG_CONFIG"; then
2631
- # Extract the first word of "pkg-config", so it can be a program name with args.
2632
-set dummy pkg-config; ac_word=$2
2633
+ if test -n "$ac_tool_prefix"; then
2634
+ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
2635
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
2636
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2637
$as_echo_n "checking for $ac_word... " >&6; }
2638
if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
2639
@@ -20371,7 +20771,6 @@
2643
- test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
2647
@@ -20385,8 +20784,65 @@
2652
+if test -z "$ac_cv_path_PKG_CONFIG"; then
2653
+ ac_pt_PKG_CONFIG=$PKG_CONFIG
2654
+ # Extract the first word of "pkg-config", so it can be a program name with args.
2655
+set dummy pkg-config; ac_word=$2
2656
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2657
+$as_echo_n "checking for $ac_word... " >&6; }
2658
+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
2659
+ $as_echo_n "(cached) " >&6
2661
+ case $ac_pt_PKG_CONFIG in
2662
+ [\\/]* | ?:[\\/]*)
2663
+ ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
2666
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2667
+for as_dir in $PATH
2670
+ test -z "$as_dir" && as_dir=.
2671
+ for ac_exec_ext in '' $ac_executable_extensions; do
2672
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
2673
+ ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
2674
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
2684
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
2685
+if test -n "$ac_pt_PKG_CONFIG"; then
2686
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
2687
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
2689
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
2690
+$as_echo "no" >&6; }
2693
+ if test "x$ac_pt_PKG_CONFIG" = x; then
2696
+ case $cross_compiling:$ac_tool_warned in
2698
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
2699
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
2700
+ac_tool_warned=yes ;;
2702
+ PKG_CONFIG=$ac_pt_PKG_CONFIG
2705
+ PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
2710
if test "$PKG_CONFIG" = "no" ; then
2711
echo "*** The pkg-config script could not be found. Make sure it is"
2712
echo "*** in your path, or set the PKG_CONFIG environment variable"
2713
@@ -20453,8 +20909,9 @@
2716
if test -z "$PKG_CONFIG"; then
2717
- # Extract the first word of "pkg-config", so it can be a program name with args.
2718
-set dummy pkg-config; ac_word=$2
2719
+ if test -n "$ac_tool_prefix"; then
2720
+ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
2721
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
2722
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2723
$as_echo_n "checking for $ac_word... " >&6; }
2724
if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
2725
@@ -20480,7 +20937,6 @@
2729
- test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
2733
@@ -20494,8 +20950,65 @@
2738
+if test -z "$ac_cv_path_PKG_CONFIG"; then
2739
+ ac_pt_PKG_CONFIG=$PKG_CONFIG
2740
+ # Extract the first word of "pkg-config", so it can be a program name with args.
2741
+set dummy pkg-config; ac_word=$2
2742
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2743
+$as_echo_n "checking for $ac_word... " >&6; }
2744
+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
2745
+ $as_echo_n "(cached) " >&6
2747
+ case $ac_pt_PKG_CONFIG in
2748
+ [\\/]* | ?:[\\/]*)
2749
+ ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
2752
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2753
+for as_dir in $PATH
2756
+ test -z "$as_dir" && as_dir=.
2757
+ for ac_exec_ext in '' $ac_executable_extensions; do
2758
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
2759
+ ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
2760
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
2770
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
2771
+if test -n "$ac_pt_PKG_CONFIG"; then
2772
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
2773
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
2775
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
2776
+$as_echo "no" >&6; }
2779
+ if test "x$ac_pt_PKG_CONFIG" = x; then
2782
+ case $cross_compiling:$ac_tool_warned in
2784
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
2785
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
2786
+ac_tool_warned=yes ;;
2788
+ PKG_CONFIG=$ac_pt_PKG_CONFIG
2791
+ PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
2796
if test "$PKG_CONFIG" = "no" ; then
2797
echo "*** The pkg-config script could not be found. Make sure it is"
2798
echo "*** in your path, or set the PKG_CONFIG environment variable"
2799
@@ -20553,8 +21066,9 @@
2802
if test -z "$PKG_CONFIG"; then
2803
- # Extract the first word of "pkg-config", so it can be a program name with args.
2804
-set dummy pkg-config; ac_word=$2
2805
+ if test -n "$ac_tool_prefix"; then
2806
+ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
2807
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
2808
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2809
$as_echo_n "checking for $ac_word... " >&6; }
2810
if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
2811
@@ -20580,7 +21094,6 @@
2815
- test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
2819
@@ -20594,8 +21107,65 @@
2824
+if test -z "$ac_cv_path_PKG_CONFIG"; then
2825
+ ac_pt_PKG_CONFIG=$PKG_CONFIG
2826
+ # Extract the first word of "pkg-config", so it can be a program name with args.
2827
+set dummy pkg-config; ac_word=$2
2828
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2829
+$as_echo_n "checking for $ac_word... " >&6; }
2830
+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
2831
+ $as_echo_n "(cached) " >&6
2833
+ case $ac_pt_PKG_CONFIG in
2834
+ [\\/]* | ?:[\\/]*)
2835
+ ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
2838
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2839
+for as_dir in $PATH
2842
+ test -z "$as_dir" && as_dir=.
2843
+ for ac_exec_ext in '' $ac_executable_extensions; do
2844
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
2845
+ ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
2846
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
2856
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
2857
+if test -n "$ac_pt_PKG_CONFIG"; then
2858
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
2859
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
2861
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
2862
+$as_echo "no" >&6; }
2865
+ if test "x$ac_pt_PKG_CONFIG" = x; then
2868
+ case $cross_compiling:$ac_tool_warned in
2870
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
2871
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
2872
+ac_tool_warned=yes ;;
2874
+ PKG_CONFIG=$ac_pt_PKG_CONFIG
2877
+ PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
2882
if test "$PKG_CONFIG" = "no" ; then
2883
echo "*** The pkg-config script could not be found. Make sure it is"
2884
echo "*** in your path, or set the PKG_CONFIG environment variable"
2885
@@ -20653,8 +21223,9 @@
2888
if test -z "$PKG_CONFIG"; then
2889
- # Extract the first word of "pkg-config", so it can be a program name with args.
2890
-set dummy pkg-config; ac_word=$2
2891
+ if test -n "$ac_tool_prefix"; then
2892
+ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
2893
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
2894
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2895
$as_echo_n "checking for $ac_word... " >&6; }
2896
if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
2897
@@ -20680,7 +21251,6 @@
2901
- test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
2905
@@ -20694,8 +21264,65 @@
2910
+if test -z "$ac_cv_path_PKG_CONFIG"; then
2911
+ ac_pt_PKG_CONFIG=$PKG_CONFIG
2912
+ # Extract the first word of "pkg-config", so it can be a program name with args.
2913
+set dummy pkg-config; ac_word=$2
2914
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2915
+$as_echo_n "checking for $ac_word... " >&6; }
2916
+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
2917
+ $as_echo_n "(cached) " >&6
2919
+ case $ac_pt_PKG_CONFIG in
2920
+ [\\/]* | ?:[\\/]*)
2921
+ ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
2924
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2925
+for as_dir in $PATH
2928
+ test -z "$as_dir" && as_dir=.
2929
+ for ac_exec_ext in '' $ac_executable_extensions; do
2930
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
2931
+ ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
2932
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
2942
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
2943
+if test -n "$ac_pt_PKG_CONFIG"; then
2944
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
2945
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
2947
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
2948
+$as_echo "no" >&6; }
2951
+ if test "x$ac_pt_PKG_CONFIG" = x; then
2954
+ case $cross_compiling:$ac_tool_warned in
2956
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
2957
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
2958
+ac_tool_warned=yes ;;
2960
+ PKG_CONFIG=$ac_pt_PKG_CONFIG
2963
+ PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
2968
if test "$PKG_CONFIG" = "no" ; then
2969
echo "*** The pkg-config script could not be found. Make sure it is"
2970
echo "*** in your path, or set the PKG_CONFIG environment variable"
2971
@@ -20756,8 +21383,9 @@
2974
if test -z "$PKG_CONFIG"; then
2975
- # Extract the first word of "pkg-config", so it can be a program name with args.
2976
-set dummy pkg-config; ac_word=$2
2977
+ if test -n "$ac_tool_prefix"; then
2978
+ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
2979
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
2980
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2981
$as_echo_n "checking for $ac_word... " >&6; }
2982
if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
2983
@@ -20783,7 +21411,6 @@
2987
- test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
2991
@@ -20797,8 +21424,65 @@
2996
+if test -z "$ac_cv_path_PKG_CONFIG"; then
2997
+ ac_pt_PKG_CONFIG=$PKG_CONFIG
2998
+ # Extract the first word of "pkg-config", so it can be a program name with args.
2999
+set dummy pkg-config; ac_word=$2
3000
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3001
+$as_echo_n "checking for $ac_word... " >&6; }
3002
+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
3003
+ $as_echo_n "(cached) " >&6
3005
+ case $ac_pt_PKG_CONFIG in
3006
+ [\\/]* | ?:[\\/]*)
3007
+ ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
3010
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3011
+for as_dir in $PATH
3014
+ test -z "$as_dir" && as_dir=.
3015
+ for ac_exec_ext in '' $ac_executable_extensions; do
3016
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
3017
+ ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
3018
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3028
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
3029
+if test -n "$ac_pt_PKG_CONFIG"; then
3030
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
3031
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
3033
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3034
+$as_echo "no" >&6; }
3037
+ if test "x$ac_pt_PKG_CONFIG" = x; then
3040
+ case $cross_compiling:$ac_tool_warned in
3042
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
3043
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
3044
+ac_tool_warned=yes ;;
3046
+ PKG_CONFIG=$ac_pt_PKG_CONFIG
3049
+ PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
3054
if test "$PKG_CONFIG" = "no" ; then
3055
echo "*** The pkg-config script could not be found. Make sure it is"
3056
echo "*** in your path, or set the PKG_CONFIG environment variable"
3057
@@ -20863,8 +21547,9 @@
3060
if test -z "$PKG_CONFIG"; then
3061
- # Extract the first word of "pkg-config", so it can be a program name with args.
3062
-set dummy pkg-config; ac_word=$2
3063
+ if test -n "$ac_tool_prefix"; then
3064
+ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
3065
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
3066
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3067
$as_echo_n "checking for $ac_word... " >&6; }
3068
if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
3069
@@ -20890,7 +21575,6 @@
3073
- test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
3077
@@ -20904,8 +21588,65 @@
3082
+if test -z "$ac_cv_path_PKG_CONFIG"; then
3083
+ ac_pt_PKG_CONFIG=$PKG_CONFIG
3084
+ # Extract the first word of "pkg-config", so it can be a program name with args.
3085
+set dummy pkg-config; ac_word=$2
3086
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3087
+$as_echo_n "checking for $ac_word... " >&6; }
3088
+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
3089
+ $as_echo_n "(cached) " >&6
3091
+ case $ac_pt_PKG_CONFIG in
3092
+ [\\/]* | ?:[\\/]*)
3093
+ ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
3096
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3097
+for as_dir in $PATH
3100
+ test -z "$as_dir" && as_dir=.
3101
+ for ac_exec_ext in '' $ac_executable_extensions; do
3102
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
3103
+ ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
3104
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3114
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
3115
+if test -n "$ac_pt_PKG_CONFIG"; then
3116
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
3117
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
3119
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3120
+$as_echo "no" >&6; }
3123
+ if test "x$ac_pt_PKG_CONFIG" = x; then
3126
+ case $cross_compiling:$ac_tool_warned in
3128
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
3129
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
3130
+ac_tool_warned=yes ;;
3132
+ PKG_CONFIG=$ac_pt_PKG_CONFIG
3135
+ PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
3140
if test "$PKG_CONFIG" = "no" ; then
3141
echo "*** The pkg-config script could not be found. Make sure it is"
3142
echo "*** in your path, or set the PKG_CONFIG environment variable"
3143
@@ -21242,8 +21983,9 @@
3146
if test -z "$PKG_CONFIG"; then
3147
- # Extract the first word of "pkg-config", so it can be a program name with args.
3148
-set dummy pkg-config; ac_word=$2
3149
+ if test -n "$ac_tool_prefix"; then
3150
+ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
3151
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
3152
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3153
$as_echo_n "checking for $ac_word... " >&6; }
3154
if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
3155
@@ -21269,7 +22011,6 @@
3159
- test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
3163
@@ -21283,8 +22024,65 @@
3168
+if test -z "$ac_cv_path_PKG_CONFIG"; then
3169
+ ac_pt_PKG_CONFIG=$PKG_CONFIG
3170
+ # Extract the first word of "pkg-config", so it can be a program name with args.
3171
+set dummy pkg-config; ac_word=$2
3172
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3173
+$as_echo_n "checking for $ac_word... " >&6; }
3174
+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
3175
+ $as_echo_n "(cached) " >&6
3177
+ case $ac_pt_PKG_CONFIG in
3178
+ [\\/]* | ?:[\\/]*)
3179
+ ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
3182
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3183
+for as_dir in $PATH
3186
+ test -z "$as_dir" && as_dir=.
3187
+ for ac_exec_ext in '' $ac_executable_extensions; do
3188
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
3189
+ ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
3190
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3200
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
3201
+if test -n "$ac_pt_PKG_CONFIG"; then
3202
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
3203
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
3205
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3206
+$as_echo "no" >&6; }
3209
+ if test "x$ac_pt_PKG_CONFIG" = x; then
3212
+ case $cross_compiling:$ac_tool_warned in
3214
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
3215
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
3216
+ac_tool_warned=yes ;;
3218
+ PKG_CONFIG=$ac_pt_PKG_CONFIG
3221
+ PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
3226
if test "$PKG_CONFIG" = "no" ; then
3227
echo "*** The pkg-config script could not be found. Make sure it is"
3228
echo "*** in your path, or set the PKG_CONFIG environment variable"
3229
@@ -21340,8 +22138,9 @@
3232
if test -z "$PKG_CONFIG"; then
3233
- # Extract the first word of "pkg-config", so it can be a program name with args.
3234
-set dummy pkg-config; ac_word=$2
3235
+ if test -n "$ac_tool_prefix"; then
3236
+ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
3237
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
3238
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3239
$as_echo_n "checking for $ac_word... " >&6; }
3240
if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
3241
@@ -21367,7 +22166,6 @@
3245
- test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
3249
@@ -21381,8 +22179,65 @@
3254
+if test -z "$ac_cv_path_PKG_CONFIG"; then
3255
+ ac_pt_PKG_CONFIG=$PKG_CONFIG
3256
+ # Extract the first word of "pkg-config", so it can be a program name with args.
3257
+set dummy pkg-config; ac_word=$2
3258
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3259
+$as_echo_n "checking for $ac_word... " >&6; }
3260
+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
3261
+ $as_echo_n "(cached) " >&6
3263
+ case $ac_pt_PKG_CONFIG in
3264
+ [\\/]* | ?:[\\/]*)
3265
+ ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
3268
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3269
+for as_dir in $PATH
3272
+ test -z "$as_dir" && as_dir=.
3273
+ for ac_exec_ext in '' $ac_executable_extensions; do
3274
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
3275
+ ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
3276
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3286
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
3287
+if test -n "$ac_pt_PKG_CONFIG"; then
3288
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
3289
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
3291
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3292
+$as_echo "no" >&6; }
3295
+ if test "x$ac_pt_PKG_CONFIG" = x; then
3298
+ case $cross_compiling:$ac_tool_warned in
3300
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
3301
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
3302
+ac_tool_warned=yes ;;
3304
+ PKG_CONFIG=$ac_pt_PKG_CONFIG
3307
+ PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
3312
if test "$PKG_CONFIG" = "no" ; then
3313
echo "*** The pkg-config script could not be found. Make sure it is"
3314
echo "*** in your path, or set the PKG_CONFIG environment variable"
3315
@@ -21439,8 +22294,9 @@
3318
if test -z "$PKG_CONFIG"; then
3319
- # Extract the first word of "pkg-config", so it can be a program name with args.
3320
-set dummy pkg-config; ac_word=$2
3321
+ if test -n "$ac_tool_prefix"; then
3322
+ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
3323
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
3324
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3325
$as_echo_n "checking for $ac_word... " >&6; }
3326
if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
3327
@@ -21466,7 +22322,6 @@
3331
- test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
3335
@@ -21480,8 +22335,65 @@
3340
+if test -z "$ac_cv_path_PKG_CONFIG"; then
3341
+ ac_pt_PKG_CONFIG=$PKG_CONFIG
3342
+ # Extract the first word of "pkg-config", so it can be a program name with args.
3343
+set dummy pkg-config; ac_word=$2
3344
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3345
+$as_echo_n "checking for $ac_word... " >&6; }
3346
+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
3347
+ $as_echo_n "(cached) " >&6
3349
+ case $ac_pt_PKG_CONFIG in
3350
+ [\\/]* | ?:[\\/]*)
3351
+ ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
3354
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3355
+for as_dir in $PATH
3358
+ test -z "$as_dir" && as_dir=.
3359
+ for ac_exec_ext in '' $ac_executable_extensions; do
3360
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
3361
+ ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
3362
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3372
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
3373
+if test -n "$ac_pt_PKG_CONFIG"; then
3374
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
3375
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
3377
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3378
+$as_echo "no" >&6; }
3381
+ if test "x$ac_pt_PKG_CONFIG" = x; then
3384
+ case $cross_compiling:$ac_tool_warned in
3386
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
3387
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
3388
+ac_tool_warned=yes ;;
3390
+ PKG_CONFIG=$ac_pt_PKG_CONFIG
3393
+ PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
3398
if test "$PKG_CONFIG" = "no" ; then
3399
echo "*** The pkg-config script could not be found. Make sure it is"
3400
echo "*** in your path, or set the PKG_CONFIG environment variable"
3401
@@ -21538,8 +22450,9 @@
3404
if test -z "$PKG_CONFIG"; then
3405
- # Extract the first word of "pkg-config", so it can be a program name with args.
3406
-set dummy pkg-config; ac_word=$2
3407
+ if test -n "$ac_tool_prefix"; then
3408
+ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
3409
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
3410
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3411
$as_echo_n "checking for $ac_word... " >&6; }
3412
if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
3413
@@ -21565,7 +22478,6 @@
3417
- test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
3421
@@ -21579,8 +22491,65 @@
3426
+if test -z "$ac_cv_path_PKG_CONFIG"; then
3427
+ ac_pt_PKG_CONFIG=$PKG_CONFIG
3428
+ # Extract the first word of "pkg-config", so it can be a program name with args.
3429
+set dummy pkg-config; ac_word=$2
3430
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3431
+$as_echo_n "checking for $ac_word... " >&6; }
3432
+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
3433
+ $as_echo_n "(cached) " >&6
3435
+ case $ac_pt_PKG_CONFIG in
3436
+ [\\/]* | ?:[\\/]*)
3437
+ ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
3440
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3441
+for as_dir in $PATH
3444
+ test -z "$as_dir" && as_dir=.
3445
+ for ac_exec_ext in '' $ac_executable_extensions; do
3446
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
3447
+ ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
3448
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3458
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
3459
+if test -n "$ac_pt_PKG_CONFIG"; then
3460
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
3461
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
3463
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3464
+$as_echo "no" >&6; }
3467
+ if test "x$ac_pt_PKG_CONFIG" = x; then
3470
+ case $cross_compiling:$ac_tool_warned in
3472
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
3473
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
3474
+ac_tool_warned=yes ;;
3476
+ PKG_CONFIG=$ac_pt_PKG_CONFIG
3479
+ PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
3484
if test "$PKG_CONFIG" = "no" ; then
3485
echo "*** The pkg-config script could not be found. Make sure it is"
3486
echo "*** in your path, or set the PKG_CONFIG environment variable"
3487
@@ -21637,8 +22606,9 @@
3490
if test -z "$PKG_CONFIG"; then
3491
- # Extract the first word of "pkg-config", so it can be a program name with args.
3492
-set dummy pkg-config; ac_word=$2
3493
+ if test -n "$ac_tool_prefix"; then
3494
+ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
3495
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
3496
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3497
$as_echo_n "checking for $ac_word... " >&6; }
3498
if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
3499
@@ -21664,7 +22634,6 @@
3503
- test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
3507
@@ -21678,8 +22647,65 @@
3512
+if test -z "$ac_cv_path_PKG_CONFIG"; then
3513
+ ac_pt_PKG_CONFIG=$PKG_CONFIG
3514
+ # Extract the first word of "pkg-config", so it can be a program name with args.
3515
+set dummy pkg-config; ac_word=$2
3516
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3517
+$as_echo_n "checking for $ac_word... " >&6; }
3518
+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
3519
+ $as_echo_n "(cached) " >&6
3521
+ case $ac_pt_PKG_CONFIG in
3522
+ [\\/]* | ?:[\\/]*)
3523
+ ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
3526
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3527
+for as_dir in $PATH
3530
+ test -z "$as_dir" && as_dir=.
3531
+ for ac_exec_ext in '' $ac_executable_extensions; do
3532
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
3533
+ ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
3534
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3544
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
3545
+if test -n "$ac_pt_PKG_CONFIG"; then
3546
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
3547
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
3549
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3550
+$as_echo "no" >&6; }
3553
+ if test "x$ac_pt_PKG_CONFIG" = x; then
3556
+ case $cross_compiling:$ac_tool_warned in
3558
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
3559
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
3560
+ac_tool_warned=yes ;;
3562
+ PKG_CONFIG=$ac_pt_PKG_CONFIG
3565
+ PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
3570
if test "$PKG_CONFIG" = "no" ; then
3571
echo "*** The pkg-config script could not be found. Make sure it is"
3572
echo "*** in your path, or set the PKG_CONFIG environment variable"
3573
@@ -21736,8 +22762,9 @@
3576
if test -z "$PKG_CONFIG"; then
3577
- # Extract the first word of "pkg-config", so it can be a program name with args.
3578
-set dummy pkg-config; ac_word=$2
3579
+ if test -n "$ac_tool_prefix"; then
3580
+ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
3581
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
3582
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3583
$as_echo_n "checking for $ac_word... " >&6; }
3584
if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
3585
@@ -21763,7 +22790,6 @@
3589
- test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
3593
@@ -21777,8 +22803,65 @@
3598
+if test -z "$ac_cv_path_PKG_CONFIG"; then
3599
+ ac_pt_PKG_CONFIG=$PKG_CONFIG
3600
+ # Extract the first word of "pkg-config", so it can be a program name with args.
3601
+set dummy pkg-config; ac_word=$2
3602
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3603
+$as_echo_n "checking for $ac_word... " >&6; }
3604
+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
3605
+ $as_echo_n "(cached) " >&6
3607
+ case $ac_pt_PKG_CONFIG in
3608
+ [\\/]* | ?:[\\/]*)
3609
+ ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
3612
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3613
+for as_dir in $PATH
3616
+ test -z "$as_dir" && as_dir=.
3617
+ for ac_exec_ext in '' $ac_executable_extensions; do
3618
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
3619
+ ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
3620
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3630
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
3631
+if test -n "$ac_pt_PKG_CONFIG"; then
3632
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
3633
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
3635
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3636
+$as_echo "no" >&6; }
3639
+ if test "x$ac_pt_PKG_CONFIG" = x; then
3642
+ case $cross_compiling:$ac_tool_warned in
3644
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
3645
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
3646
+ac_tool_warned=yes ;;
3648
+ PKG_CONFIG=$ac_pt_PKG_CONFIG
3651
+ PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
3656
if test "$PKG_CONFIG" = "no" ; then
3657
echo "*** The pkg-config script could not be found. Make sure it is"
3658
echo "*** in your path, or set the PKG_CONFIG environment variable"
3659
@@ -21835,8 +22918,9 @@
3662
if test -z "$PKG_CONFIG"; then
3663
- # Extract the first word of "pkg-config", so it can be a program name with args.
3664
-set dummy pkg-config; ac_word=$2
3665
+ if test -n "$ac_tool_prefix"; then
3666
+ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
3667
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
3668
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3669
$as_echo_n "checking for $ac_word... " >&6; }
3670
if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
3671
@@ -21862,7 +22946,6 @@
3675
- test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
3679
@@ -21876,8 +22959,65 @@
3684
+if test -z "$ac_cv_path_PKG_CONFIG"; then
3685
+ ac_pt_PKG_CONFIG=$PKG_CONFIG
3686
+ # Extract the first word of "pkg-config", so it can be a program name with args.
3687
+set dummy pkg-config; ac_word=$2
3688
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3689
+$as_echo_n "checking for $ac_word... " >&6; }
3690
+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
3691
+ $as_echo_n "(cached) " >&6
3693
+ case $ac_pt_PKG_CONFIG in
3694
+ [\\/]* | ?:[\\/]*)
3695
+ ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
3698
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3699
+for as_dir in $PATH
3702
+ test -z "$as_dir" && as_dir=.
3703
+ for ac_exec_ext in '' $ac_executable_extensions; do
3704
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
3705
+ ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
3706
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3716
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
3717
+if test -n "$ac_pt_PKG_CONFIG"; then
3718
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
3719
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
3721
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3722
+$as_echo "no" >&6; }
3725
+ if test "x$ac_pt_PKG_CONFIG" = x; then
3728
+ case $cross_compiling:$ac_tool_warned in
3730
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
3731
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
3732
+ac_tool_warned=yes ;;
3734
+ PKG_CONFIG=$ac_pt_PKG_CONFIG
3737
+ PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
3742
if test "$PKG_CONFIG" = "no" ; then
3743
echo "*** The pkg-config script could not be found. Make sure it is"
3744
echo "*** in your path, or set the PKG_CONFIG environment variable"
3745
@@ -21937,8 +23077,9 @@
3748
if test -z "$PKG_CONFIG"; then
3749
- # Extract the first word of "pkg-config", so it can be a program name with args.
3750
-set dummy pkg-config; ac_word=$2
3751
+ if test -n "$ac_tool_prefix"; then
3752
+ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
3753
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
3754
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3755
$as_echo_n "checking for $ac_word... " >&6; }
3756
if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
3757
@@ -21964,7 +23105,6 @@
3761
- test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
3765
@@ -21978,8 +23118,65 @@
3770
+if test -z "$ac_cv_path_PKG_CONFIG"; then
3771
+ ac_pt_PKG_CONFIG=$PKG_CONFIG
3772
+ # Extract the first word of "pkg-config", so it can be a program name with args.
3773
+set dummy pkg-config; ac_word=$2
3774
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3775
+$as_echo_n "checking for $ac_word... " >&6; }
3776
+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
3777
+ $as_echo_n "(cached) " >&6
3779
+ case $ac_pt_PKG_CONFIG in
3780
+ [\\/]* | ?:[\\/]*)
3781
+ ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
3784
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3785
+for as_dir in $PATH
3788
+ test -z "$as_dir" && as_dir=.
3789
+ for ac_exec_ext in '' $ac_executable_extensions; do
3790
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
3791
+ ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
3792
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3802
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
3803
+if test -n "$ac_pt_PKG_CONFIG"; then
3804
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
3805
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
3807
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3808
+$as_echo "no" >&6; }
3811
+ if test "x$ac_pt_PKG_CONFIG" = x; then
3814
+ case $cross_compiling:$ac_tool_warned in
3816
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
3817
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
3818
+ac_tool_warned=yes ;;
3820
+ PKG_CONFIG=$ac_pt_PKG_CONFIG
3823
+ PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
3828
if test "$PKG_CONFIG" = "no" ; then
3829
echo "*** The pkg-config script could not be found. Make sure it is"
3830
echo "*** in your path, or set the PKG_CONFIG environment variable"
3831
@@ -22034,8 +23231,9 @@
3834
if test -z "$PKG_CONFIG"; then
3835
- # Extract the first word of "pkg-config", so it can be a program name with args.
3836
-set dummy pkg-config; ac_word=$2
3837
+ if test -n "$ac_tool_prefix"; then
3838
+ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
3839
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
3840
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3841
$as_echo_n "checking for $ac_word... " >&6; }
3842
if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
3843
@@ -22061,7 +23259,6 @@
3847
- test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
3851
@@ -22075,8 +23272,65 @@
3856
+if test -z "$ac_cv_path_PKG_CONFIG"; then
3857
+ ac_pt_PKG_CONFIG=$PKG_CONFIG
3858
+ # Extract the first word of "pkg-config", so it can be a program name with args.
3859
+set dummy pkg-config; ac_word=$2
3860
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3861
+$as_echo_n "checking for $ac_word... " >&6; }
3862
+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
3863
+ $as_echo_n "(cached) " >&6
3865
+ case $ac_pt_PKG_CONFIG in
3866
+ [\\/]* | ?:[\\/]*)
3867
+ ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
3870
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3871
+for as_dir in $PATH
3874
+ test -z "$as_dir" && as_dir=.
3875
+ for ac_exec_ext in '' $ac_executable_extensions; do
3876
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
3877
+ ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
3878
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3888
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
3889
+if test -n "$ac_pt_PKG_CONFIG"; then
3890
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
3891
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
3893
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3894
+$as_echo "no" >&6; }
3897
+ if test "x$ac_pt_PKG_CONFIG" = x; then
3900
+ case $cross_compiling:$ac_tool_warned in
3902
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
3903
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
3904
+ac_tool_warned=yes ;;
3906
+ PKG_CONFIG=$ac_pt_PKG_CONFIG
3909
+ PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
3914
if test "$PKG_CONFIG" = "no" ; then
3915
echo "*** The pkg-config script could not be found. Make sure it is"
3916
echo "*** in your path, or set the PKG_CONFIG environment variable"
3917
@@ -24046,7 +25300,7 @@
3918
JAVA_TEST=Object.java
3919
CLASS_TEST=Object.class
3920
cat << \EOF > $JAVA_TEST
3921
-/* #line 24049 "configure" */
3922
+/* #line 25303 "configure" */
3926
@@ -24139,7 +25393,7 @@
3927
if uudecode$EXEEXT Test.uue; then
3928
ac_cv_prog_uudecode_base64=yes
3930
- echo "configure: 24142: uudecode had trouble decoding base 64 file 'Test.uue'" >&5
3931
+ echo "configure: 25396: uudecode had trouble decoding base 64 file 'Test.uue'" >&5
3932
echo "configure: failed file was:" >&5
3934
ac_cv_prog_uudecode_base64=no
3935
@@ -24167,7 +25421,7 @@
3936
CLASS_TEST=Test.class
3938
cat << \EOF > $JAVA_TEST
3939
-/* [#]line 24170 "configure" */
3940
+/* [#]line 25424 "configure" */
3942
public static void main (String args[]) {
3944
@@ -24375,7 +25629,7 @@
3946
CLASS_TEST=Test.class
3947
cat << \EOF > $JAVA_TEST
3948
- /* #line 24378 "configure" */
3949
+ /* #line 25632 "configure" */
3952
public static void main(String args)
3953
Index: libjava/ChangeLog
3954
===================================================================
3955
--- a/src/libjava/ChangeLog (.../tags/gcc_4_8_1_release)
3956
+++ b/src/libjava/ChangeLog (.../branches/gcc-4_8-branch)
3958
+2013-06-19 Matthias Klose <doko@ubuntu.com>
3960
+ * pkg.m4 (PKG_CHECK_MODULES): Use AC_PATH_TOOL to check for pkg-config.
3961
+ * classpath/m4/pkg.m4 (PKG_CHECK_MODULES): Likewise.
3962
+ * configure: Regenerate.
3963
+ * classpath/configure: Regenerate.
3965
2013-05-31 Release Manager
3967
* GCC 4.8.1 released.
3968
Index: libjava/configure
3969
===================================================================
3970
--- a/src/libjava/configure (.../tags/gcc_4_8_1_release)
3971
+++ b/src/libjava/configure (.../branches/gcc-4_8-branch)
3972
@@ -3206,7 +3206,7 @@
3973
-I\$(top_builddir)/../libstdc++-v3/include/\$(target_noncanonical) \
3974
-I\$(top_srcdir)/../libstdc++-v3/libsupc++"
3975
LIBSTDCXX_RAW_CXX_LDFLAGS="\
3976
- -I\$(top_builddir)/../libstdc++-v3/src/libstdc++.la"
3977
+ \$(top_builddir)/../libstdc++-v3/src/libstdc++.la"
3981
@@ -22806,8 +22806,9 @@
3984
if test -z "$PKG_CONFIG"; then
3985
- # Extract the first word of "pkg-config", so it can be a program name with args.
3986
-set dummy pkg-config; ac_word=$2
3987
+ if test -n "$ac_tool_prefix"; then
3988
+ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
3989
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
3990
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3991
$as_echo_n "checking for $ac_word... " >&6; }
3992
if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
3993
@@ -22833,7 +22834,6 @@
3997
- test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
4001
@@ -22847,8 +22847,65 @@
4006
+if test -z "$ac_cv_path_PKG_CONFIG"; then
4007
+ ac_pt_PKG_CONFIG=$PKG_CONFIG
4008
+ # Extract the first word of "pkg-config", so it can be a program name with args.
4009
+set dummy pkg-config; ac_word=$2
4010
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4011
+$as_echo_n "checking for $ac_word... " >&6; }
4012
+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
4013
+ $as_echo_n "(cached) " >&6
4015
+ case $ac_pt_PKG_CONFIG in
4016
+ [\\/]* | ?:[\\/]*)
4017
+ ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
4020
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4021
+for as_dir in $PATH
4024
+ test -z "$as_dir" && as_dir=.
4025
+ for ac_exec_ext in '' $ac_executable_extensions; do
4026
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
4027
+ ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
4028
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4038
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
4039
+if test -n "$ac_pt_PKG_CONFIG"; then
4040
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
4041
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
4043
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4044
+$as_echo "no" >&6; }
4047
+ if test "x$ac_pt_PKG_CONFIG" = x; then
4050
+ case $cross_compiling:$ac_tool_warned in
4052
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
4053
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
4054
+ac_tool_warned=yes ;;
4056
+ PKG_CONFIG=$ac_pt_PKG_CONFIG
4059
+ PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
4064
if test "$PKG_CONFIG" = "no" ; then
4065
echo "*** The pkg-config script could not be found. Make sure it is"
4066
echo "*** in your path, or set the PKG_CONFIG environment variable"
4067
@@ -22906,8 +22963,9 @@
4070
if test -z "$PKG_CONFIG"; then
4071
- # Extract the first word of "pkg-config", so it can be a program name with args.
4072
-set dummy pkg-config; ac_word=$2
4073
+ if test -n "$ac_tool_prefix"; then
4074
+ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
4075
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
4076
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4077
$as_echo_n "checking for $ac_word... " >&6; }
4078
if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
4079
@@ -22933,7 +22991,6 @@
4083
- test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
4087
@@ -22947,8 +23004,65 @@
4092
+if test -z "$ac_cv_path_PKG_CONFIG"; then
4093
+ ac_pt_PKG_CONFIG=$PKG_CONFIG
4094
+ # Extract the first word of "pkg-config", so it can be a program name with args.
4095
+set dummy pkg-config; ac_word=$2
4096
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4097
+$as_echo_n "checking for $ac_word... " >&6; }
4098
+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
4099
+ $as_echo_n "(cached) " >&6
4101
+ case $ac_pt_PKG_CONFIG in
4102
+ [\\/]* | ?:[\\/]*)
4103
+ ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
4106
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4107
+for as_dir in $PATH
4110
+ test -z "$as_dir" && as_dir=.
4111
+ for ac_exec_ext in '' $ac_executable_extensions; do
4112
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
4113
+ ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
4114
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4124
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
4125
+if test -n "$ac_pt_PKG_CONFIG"; then
4126
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
4127
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
4129
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4130
+$as_echo "no" >&6; }
4133
+ if test "x$ac_pt_PKG_CONFIG" = x; then
4136
+ case $cross_compiling:$ac_tool_warned in
4138
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
4139
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
4140
+ac_tool_warned=yes ;;
4142
+ PKG_CONFIG=$ac_pt_PKG_CONFIG
4145
+ PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
4150
if test "$PKG_CONFIG" = "no" ; then
4151
echo "*** The pkg-config script could not be found. Make sure it is"
4152
echo "*** in your path, or set the PKG_CONFIG environment variable"
4153
@@ -23006,8 +23120,9 @@
4156
if test -z "$PKG_CONFIG"; then
4157
- # Extract the first word of "pkg-config", so it can be a program name with args.
4158
-set dummy pkg-config; ac_word=$2
4159
+ if test -n "$ac_tool_prefix"; then
4160
+ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
4161
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
4162
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4163
$as_echo_n "checking for $ac_word... " >&6; }
4164
if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
4165
@@ -23033,7 +23148,6 @@
4169
- test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
4173
@@ -23047,8 +23161,65 @@
4178
+if test -z "$ac_cv_path_PKG_CONFIG"; then
4179
+ ac_pt_PKG_CONFIG=$PKG_CONFIG
4180
+ # Extract the first word of "pkg-config", so it can be a program name with args.
4181
+set dummy pkg-config; ac_word=$2
4182
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4183
+$as_echo_n "checking for $ac_word... " >&6; }
4184
+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
4185
+ $as_echo_n "(cached) " >&6
4187
+ case $ac_pt_PKG_CONFIG in
4188
+ [\\/]* | ?:[\\/]*)
4189
+ ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
4192
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4193
+for as_dir in $PATH
4196
+ test -z "$as_dir" && as_dir=.
4197
+ for ac_exec_ext in '' $ac_executable_extensions; do
4198
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
4199
+ ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
4200
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4210
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
4211
+if test -n "$ac_pt_PKG_CONFIG"; then
4212
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
4213
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
4215
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4216
+$as_echo "no" >&6; }
4219
+ if test "x$ac_pt_PKG_CONFIG" = x; then
4222
+ case $cross_compiling:$ac_tool_warned in
4224
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
4225
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
4226
+ac_tool_warned=yes ;;
4228
+ PKG_CONFIG=$ac_pt_PKG_CONFIG
4231
+ PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
4236
if test "$PKG_CONFIG" = "no" ; then
4237
echo "*** The pkg-config script could not be found. Make sure it is"
4238
echo "*** in your path, or set the PKG_CONFIG environment variable"
4239
Index: libjava/pkg.m4
4240
===================================================================
4241
--- a/src/libjava/pkg.m4 (.../tags/gcc_4_8_1_release)
4242
+++ b/src/libjava/pkg.m4 (.../branches/gcc-4_8-branch)
4246
if test -z "$PKG_CONFIG"; then
4247
- AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
4248
+ AC_PATH_TOOL(PKG_CONFIG, pkg-config, no)
4251
if test "$PKG_CONFIG" = "no" ; then
4252
Index: libgcc/config.host
4253
===================================================================
4254
--- a/src/libgcc/config.host (.../tags/gcc_4_8_1_release)
4255
+++ b/src/libgcc/config.host (.../branches/gcc-4_8-branch)
4257
md_unwind_header=alpha/vms-unwind.h
4260
- tmake_file="$tmake_file arm/t-arm arm/t-vxworks t-fdpbit"
4261
+ tmake_file="$tmake_file arm/t-arm arm/t-vxworks t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp"
4262
extra_parts="$extra_parts crti.o crtn.o"
4266
tmake_file="${tmake_file} rs6000/t-ppccomm rs6000/t-savresfgpr rs6000/t-crtstuff t-crtstuff-pic t-fdpbit"
4267
extra_parts="$extra_parts crtbeginS.o crtendS.o crtbeginT.o ecrti.o ecrtn.o ncrti.o ncrtn.o"
4269
-powerpc-*-linux* | powerpc64-*-linux*)
4271
tmake_file="${tmake_file} rs6000/t-ppccomm rs6000/t-savresfgpr rs6000/t-crtstuff rs6000/t-linux t-softfp-sfdf t-softfp-excl t-dfprules rs6000/t-ppc64-fp t-softfp t-slibgcc-libgcc"
4272
extra_parts="$extra_parts ecrti.o ecrtn.o ncrti.o ncrtn.o"
4273
md_unwind_header=rs6000/linux-unwind.h
4274
Index: libgcc/ChangeLog
4275
===================================================================
4276
--- a/src/libgcc/ChangeLog (.../tags/gcc_4_8_1_release)
4277
+++ b/src/libgcc/ChangeLog (.../branches/gcc-4_8-branch)
4279
+2013-06-19 Alan Modra <amodra@gmail.com>
4281
+ Apply mainline patches
4282
+ 2013-06-04 Alan Modra <amodra@gmail.com>
4283
+ * config/rs6000/ibm-ldouble.c: Enable for little-endian.
4285
+ 2013-04-25 Alan Modra <amodra@gmail.com>
4286
+ * config.host: Match little-endian powerpc-linux.
4288
+2013-06-08 Walter Lee <walt@tilera.com>
4290
+ Backport from mainline:
4291
+ 2013-06-08 Walter Lee <walt@tilera.com>
4293
+ * config/tilepro/atomic.h: Don't include stdint.h or features.h.
4294
+ Replace int64_t with long long. Add __extension__ where
4297
+2013-06-06 Douglas B Rupp <rupp@adacore.com>
4299
+ * config.host (arm-wrs-vxworks): Configure with other soft float.
4301
+2013-05-31 Richard Henderson <rth@redhat.com>
4304
+ * unwind-dw2.c (UNWIND_COLUMN_IN_RANGE): New macro.
4305
+ (execute_cfa_program): Use it when storing to fs->regs.
4307
2013-05-31 Release Manager
4309
* GCC 4.8.1 released.
4312
Backport from mainline:
4313
2013-03-26 Walter Lee <walt@tilera.com>
4316
* config/tilegx/t-crtstuff: Add -fno-asynchronous-unwind-tables
4317
-mcmodel=large to CRTSTUFF_T_CFLAGS_S variable.
4319
Index: libgcc/config/rs6000/ibm-ldouble.c
4320
===================================================================
4321
--- a/src/libgcc/config/rs6000/ibm-ldouble.c (.../tags/gcc_4_8_1_release)
4322
+++ b/src/libgcc/config/rs6000/ibm-ldouble.c (.../branches/gcc-4_8-branch)
4324
represented as (1.0, +0.0) or (1.0, -0.0), and the low part of a
4327
- This code currently assumes big-endian. */
4328
+ This code currently assumes the most significant double is in
4329
+ the lower numbered register or lower addressed memory. */
4331
-#if (!defined (__LITTLE_ENDIAN__) \
4332
- && (defined (__MACH__) || defined (__powerpc__) || defined (_AIX)))
4333
+#if defined (__MACH__) || defined (__powerpc__) || defined (_AIX)
4335
#define fabs(x) __builtin_fabs(x)
4336
#define isless(x, y) __builtin_isless (x, y)
4337
Index: libgcc/config/tilepro/atomic.h
4338
===================================================================
4339
--- a/src/libgcc/config/tilepro/atomic.h (.../tags/gcc_4_8_1_release)
4340
+++ b/src/libgcc/config/tilepro/atomic.h (.../branches/gcc-4_8-branch)
4342
compare-and-exchange routine, so may be potentially less efficient. */
4345
-#include <stdint.h>
4346
-#include <features.h>
4348
#include <arch/spr_def.h>
4352
/* 64-bit integer compare-and-exchange. */
4353
static __inline __attribute__ ((always_inline))
4354
- int64_t arch_atomic_val_compare_and_exchange_8 (volatile int64_t * mem,
4357
+ long long arch_atomic_val_compare_and_exchange_8 (volatile long long
4358
+ *mem, long long oldval,
4362
__insn_mtspr (SPR_CMPEXCH_VALUE, oldval);
4364
"R04" (newval_lo), "R05" (newval_hi),
4365
"m" (*mem):"r20", "r21", "r22", "r23", "r24", "r25",
4366
"r26", "r27", "r28", "r29", "memory");
4367
- return ((uint64_t) result_hi) << 32 | result_lo;
4368
+ return ((long long) result_hi) << 32 | result_lo;
4372
@@ -150,11 +148,11 @@
4375
#define arch_atomic_val_compare_and_exchange(mem, o, n) \
4377
+ __extension__ ({ \
4378
(__typeof(*(mem)))(__typeof(*(mem)-*(mem))) \
4379
((sizeof(*(mem)) == 8) ? \
4380
arch_atomic_val_compare_and_exchange_8( \
4381
- (volatile int64_t*)(mem), (__typeof((o)-(o)))(o), \
4382
+ (volatile long long*)(mem), (__typeof((o)-(o)))(o), \
4383
(__typeof((n)-(n)))(n)) : \
4384
(sizeof(*(mem)) == 4) ? \
4385
arch_atomic_val_compare_and_exchange_4( \
4389
#define arch_atomic_bool_compare_and_exchange(mem, o, n) \
4391
+ __extension__ ({ \
4392
__typeof(o) __o = (o); \
4394
__o == arch_atomic_val_compare_and_exchange((mem), __o, (n)), 1); \
4396
/* Loop with compare_and_exchange until we guess the correct value.
4397
Normally "expr" will be an expression using __old and __value. */
4398
#define __arch_atomic_update_cmpxchg(mem, value, expr) \
4400
+ __extension__ ({ \
4401
__typeof(value) __value = (value); \
4402
__typeof(*(mem)) *__mem = (mem), __old = *__mem, __guess; \
4404
@@ -189,12 +187,14 @@
4405
/* Generic atomic op with 8- or 4-byte variant.
4406
The _mask, _addend, and _expr arguments are ignored on tilegx. */
4407
#define __arch_atomic_update(mem, value, op, _mask, _addend, _expr) \
4409
+ __extension__ ({ \
4410
((__typeof(*(mem))) \
4411
((sizeof(*(mem)) == 8) ? (__typeof(*(mem)-*(mem)))__insn_##op( \
4412
- (void *)(mem), (int64_t)(__typeof((value)-(value)))(value)) : \
4413
+ (volatile void *)(mem), \
4414
+ (long long)(__typeof((value)-(value)))(value)) : \
4415
(sizeof(*(mem)) == 4) ? (int)__insn_##op##4( \
4416
- (void *)(mem), (int32_t)(__typeof((value)-(value)))(value)) : \
4417
+ (volatile void *)(mem), \
4418
+ (int)(__typeof((value)-(value)))(value)) : \
4419
__arch_atomic_error_bad_argument_size())); \
4423
/* Generic atomic op with 8- or 4-byte variant.
4424
The _op argument is ignored on tilepro. */
4425
#define __arch_atomic_update(mem, value, _op, mask, addend, expr) \
4427
+ __extension__ ({ \
4428
(__typeof(*(mem)))(__typeof(*(mem)-*(mem))) \
4429
((sizeof(*(mem)) == 8) ? \
4430
__arch_atomic_update_cmpxchg((mem), (value), (expr)) : \
4431
@@ -263,13 +263,13 @@
4432
__arch_atomic_update_cmpxchg(mem, mask, ~(__old & __value))
4434
#define arch_atomic_bit_set(mem, bit) \
4436
+ __extension__ ({ \
4437
__typeof(*(mem)) __mask = (__typeof(*(mem)))1 << (bit); \
4438
__mask & arch_atomic_or((mem), __mask); \
4441
#define arch_atomic_bit_clear(mem, bit) \
4443
+ __extension__ ({ \
4444
__typeof(*(mem)) __mask = (__typeof(*(mem)))1 << (bit); \
4445
__mask & arch_atomic_and((mem), ~__mask); \
4447
Index: libgcc/unwind-dw2.c
4448
===================================================================
4449
--- a/src/libgcc/unwind-dw2.c (.../tags/gcc_4_8_1_release)
4450
+++ b/src/libgcc/unwind-dw2.c (.../branches/gcc-4_8-branch)
4452
#define DWARF_REG_TO_UNWIND_COLUMN(REGNO) (REGNO)
4455
+/* ??? For the public function interfaces, we tend to gcc_assert that the
4456
+ column numbers are in range. For the dwarf2 unwind info this does happen,
4457
+ although so far in a case that doesn't actually matter.
4459
+ See PR49146, in which a call from x86_64 ms abi to x86_64 unix abi stores
4460
+ the call-saved xmm registers and annotates them. We havn't bothered
4461
+ providing support for the xmm registers for the x86_64 port primarily
4462
+ because the 64-bit windows targets don't use dwarf2 unwind, using sjlj or
4463
+ SEH instead. Adding the support for unix targets would generally be a
4464
+ waste. However, some runtime libraries supplied with ICC do contain such
4465
+ an unorthodox transition, as well as the unwind info to match. This loss
4466
+ of register restoration doesn't matter in practice, because the exception
4467
+ is caught in the native unix abi, where all of the xmm registers are
4470
+ Ideally, we'd record some bit to notice when we're failing to restore some
4471
+ register recorded in the unwind info, but to do that we need annotation on
4472
+ the unix->ms abi edge, so that we know when the register data may be
4473
+ discarded. And since this edge is also within the ICC library, we're
4474
+ unlikely to be able to get the new annotation.
4476
+ Barring a magic solution to restore the ms abi defined 128-bit xmm registers
4477
+ (as distictly opposed to the full runtime width) without causing extra
4478
+ overhead for normal unix abis, the best solution seems to be to simply
4479
+ ignore unwind data for unknown columns. */
4481
+#define UNWIND_COLUMN_IN_RANGE(x) \
4482
+ __builtin_expect((x) <= DWARF_FRAME_REGISTERS, 1)
4484
#ifdef REG_VALUE_IN_UNWIND_CONTEXT
4485
typedef _Unwind_Word _Unwind_Context_Reg_Val;
4487
@@ -939,14 +968,19 @@
4489
insn_ptr = read_uleb128 (insn_ptr, &utmp);
4490
offset = (_Unwind_Sword) utmp * fs->data_align;
4491
- fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN (reg)].how
4492
- = REG_SAVED_OFFSET;
4493
- fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN (reg)].loc.offset = offset;
4494
+ reg = DWARF_REG_TO_UNWIND_COLUMN (reg);
4495
+ if (UNWIND_COLUMN_IN_RANGE (reg))
4497
+ fs->regs.reg[reg].how = REG_SAVED_OFFSET;
4498
+ fs->regs.reg[reg].loc.offset = offset;
4501
else if ((insn & 0xc0) == DW_CFA_restore)
4504
- fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN (reg)].how = REG_UNSAVED;
4505
+ reg = DWARF_REG_TO_UNWIND_COLUMN (reg);
4506
+ if (UNWIND_COLUMN_IN_RANGE (reg))
4507
+ fs->regs.reg[reg].how = REG_UNSAVED;
4511
@@ -977,26 +1011,35 @@
4512
insn_ptr = read_uleb128 (insn_ptr, ®);
4513
insn_ptr = read_uleb128 (insn_ptr, &utmp);
4514
offset = (_Unwind_Sword) utmp * fs->data_align;
4515
- fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN (reg)].how
4516
- = REG_SAVED_OFFSET;
4517
- fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN (reg)].loc.offset = offset;
4518
+ reg = DWARF_REG_TO_UNWIND_COLUMN (reg);
4519
+ if (UNWIND_COLUMN_IN_RANGE (reg))
4521
+ fs->regs.reg[reg].how = REG_SAVED_OFFSET;
4522
+ fs->regs.reg[reg].loc.offset = offset;
4526
case DW_CFA_restore_extended:
4527
insn_ptr = read_uleb128 (insn_ptr, ®);
4528
/* FIXME, this is wrong; the CIE might have said that the
4529
register was saved somewhere. */
4530
- fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN(reg)].how = REG_UNSAVED;
4531
+ reg = DWARF_REG_TO_UNWIND_COLUMN (reg);
4532
+ if (UNWIND_COLUMN_IN_RANGE (reg))
4533
+ fs->regs.reg[reg].how = REG_UNSAVED;
4536
case DW_CFA_same_value:
4537
insn_ptr = read_uleb128 (insn_ptr, ®);
4538
- fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN(reg)].how = REG_UNSAVED;
4539
+ reg = DWARF_REG_TO_UNWIND_COLUMN (reg);
4540
+ if (UNWIND_COLUMN_IN_RANGE (reg))
4541
+ fs->regs.reg[reg].how = REG_UNSAVED;
4544
case DW_CFA_undefined:
4545
insn_ptr = read_uleb128 (insn_ptr, ®);
4546
- fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN(reg)].how = REG_UNDEFINED;
4547
+ reg = DWARF_REG_TO_UNWIND_COLUMN (reg);
4548
+ if (UNWIND_COLUMN_IN_RANGE (reg))
4549
+ fs->regs.reg[reg].how = REG_UNDEFINED;
4553
@@ -1007,9 +1050,12 @@
4555
insn_ptr = read_uleb128 (insn_ptr, ®);
4556
insn_ptr = read_uleb128 (insn_ptr, ®2);
4557
- fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN (reg)].how = REG_SAVED_REG;
4558
- fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN (reg)].loc.reg =
4559
- (_Unwind_Word)reg2;
4560
+ reg = DWARF_REG_TO_UNWIND_COLUMN (reg);
4561
+ if (UNWIND_COLUMN_IN_RANGE (reg))
4563
+ fs->regs.reg[reg].how = REG_SAVED_REG;
4564
+ fs->regs.reg[reg].loc.reg = (_Unwind_Word)reg2;
4569
@@ -1067,8 +1113,12 @@
4571
case DW_CFA_expression:
4572
insn_ptr = read_uleb128 (insn_ptr, ®);
4573
- fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN (reg)].how = REG_SAVED_EXP;
4574
- fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN (reg)].loc.exp = insn_ptr;
4575
+ reg = DWARF_REG_TO_UNWIND_COLUMN (reg);
4576
+ if (UNWIND_COLUMN_IN_RANGE (reg))
4578
+ fs->regs.reg[reg].how = REG_SAVED_EXP;
4579
+ fs->regs.reg[reg].loc.exp = insn_ptr;
4581
insn_ptr = read_uleb128 (insn_ptr, &utmp);
4584
@@ -1078,9 +1128,12 @@
4585
insn_ptr = read_uleb128 (insn_ptr, ®);
4586
insn_ptr = read_sleb128 (insn_ptr, &stmp);
4587
offset = stmp * fs->data_align;
4588
- fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN (reg)].how
4589
- = REG_SAVED_OFFSET;
4590
- fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN (reg)].loc.offset = offset;
4591
+ reg = DWARF_REG_TO_UNWIND_COLUMN (reg);
4592
+ if (UNWIND_COLUMN_IN_RANGE (reg))
4594
+ fs->regs.reg[reg].how = REG_SAVED_OFFSET;
4595
+ fs->regs.reg[reg].loc.offset = offset;
4599
case DW_CFA_def_cfa_sf:
4600
@@ -1103,25 +1156,34 @@
4601
insn_ptr = read_uleb128 (insn_ptr, ®);
4602
insn_ptr = read_uleb128 (insn_ptr, &utmp);
4603
offset = (_Unwind_Sword) utmp * fs->data_align;
4604
- fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN (reg)].how
4605
- = REG_SAVED_VAL_OFFSET;
4606
- fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN (reg)].loc.offset = offset;
4607
+ reg = DWARF_REG_TO_UNWIND_COLUMN (reg);
4608
+ if (UNWIND_COLUMN_IN_RANGE (reg))
4610
+ fs->regs.reg[reg].how = REG_SAVED_VAL_OFFSET;
4611
+ fs->regs.reg[reg].loc.offset = offset;
4615
case DW_CFA_val_offset_sf:
4616
insn_ptr = read_uleb128 (insn_ptr, ®);
4617
insn_ptr = read_sleb128 (insn_ptr, &stmp);
4618
offset = stmp * fs->data_align;
4619
- fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN (reg)].how
4620
- = REG_SAVED_VAL_OFFSET;
4621
- fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN (reg)].loc.offset = offset;
4622
+ reg = DWARF_REG_TO_UNWIND_COLUMN (reg);
4623
+ if (UNWIND_COLUMN_IN_RANGE (reg))
4625
+ fs->regs.reg[reg].how = REG_SAVED_VAL_OFFSET;
4626
+ fs->regs.reg[reg].loc.offset = offset;
4630
case DW_CFA_val_expression:
4631
insn_ptr = read_uleb128 (insn_ptr, ®);
4632
- fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN (reg)].how
4633
- = REG_SAVED_VAL_EXP;
4634
- fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN (reg)].loc.exp = insn_ptr;
4635
+ reg = DWARF_REG_TO_UNWIND_COLUMN (reg);
4636
+ if (UNWIND_COLUMN_IN_RANGE (reg))
4638
+ fs->regs.reg[reg].how = REG_SAVED_VAL_EXP;
4639
+ fs->regs.reg[reg].loc.exp = insn_ptr;
4641
insn_ptr = read_uleb128 (insn_ptr, &utmp);
4644
@@ -1147,9 +1209,12 @@
4645
insn_ptr = read_uleb128 (insn_ptr, ®);
4646
insn_ptr = read_uleb128 (insn_ptr, &utmp);
4647
offset = (_Unwind_Word) utmp * fs->data_align;
4648
- fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN (reg)].how
4649
- = REG_SAVED_OFFSET;
4650
- fs->regs.reg[DWARF_REG_TO_UNWIND_COLUMN (reg)].loc.offset = -offset;
4651
+ reg = DWARF_REG_TO_UNWIND_COLUMN (reg);
4652
+ if (UNWIND_COLUMN_IN_RANGE (reg))
4654
+ fs->regs.reg[reg].how = REG_SAVED_OFFSET;
4655
+ fs->regs.reg[reg].loc.offset = -offset;
4660
Index: gcc/file-find.h
4661
===================================================================
4662
--- a/src/gcc/file-find.h (.../tags/gcc_4_8_1_release)
4663
+++ b/src/gcc/file-find.h (.../branches/gcc-4_8-branch)
4667
extern void find_file_set_debug (bool);
4668
-extern char *find_a_file (struct path_prefix *, const char *);
4669
+extern char *find_a_file (struct path_prefix *, const char *, int);
4670
extern void add_prefix (struct path_prefix *, const char *);
4671
extern void prefix_from_env (const char *, struct path_prefix *);
4672
extern void prefix_from_string (const char *, struct path_prefix *);
4673
Index: gcc/DATESTAMP
4674
===================================================================
4675
--- a/src/gcc/DATESTAMP (.../tags/gcc_4_8_1_release)
4676
+++ b/src/gcc/DATESTAMP (.../branches/gcc-4_8-branch)
4681
===================================================================
4682
--- a/src/gcc/ipa-cp.c (.../tags/gcc_4_8_1_release)
4683
+++ b/src/gcc/ipa-cp.c (.../branches/gcc-4_8-branch)
4684
@@ -1507,7 +1507,8 @@
4688
- if (param_index == -1)
4689
+ if (param_index == -1
4690
+ || known_vals.length () <= (unsigned int) param_index)
4693
if (!ie->indirect_info->polymorphic)
4694
@@ -1528,8 +1529,7 @@
4698
- t = (known_vals.length () > (unsigned int) param_index
4699
- ? known_vals[param_index] : NULL);
4700
+ t = known_vals[param_index];
4703
TREE_CODE (t) == ADDR_EXPR
4704
Index: gcc/configure
4705
===================================================================
4706
--- a/src/gcc/configure (.../tags/gcc_4_8_1_release)
4707
+++ b/src/gcc/configure (.../branches/gcc-4_8-branch)
4708
@@ -23281,35 +23281,9 @@
4715
.section ".tdata","awT",@progbits
4723
- addi 3,31,ld0@got@tlsgd
4725
- addi 3,31,x1@got@tlsld
4727
- addi 9,3,x1@dtprel
4728
- addis 9,3,x2@dtprel@ha
4729
- addi 9,9,x2@dtprel@l
4730
- lwz 9,x3@got@tprel(31)
4733
- addis 9,2,x2@tprel@ha
4734
- addi 9,9,x2@tprel@l'
4736
- tls_first_minor=14
4737
- tls_as_opt="-a32 --fatal-warnings"
4741
- .section ".tdata","awT",@progbits
4745
@@ -23341,6 +23315,32 @@
4747
tls_as_opt="-a64 --fatal-warnings"
4751
+ .section ".tdata","awT",@progbits
4759
+ addi 3,31,ld0@got@tlsgd
4761
+ addi 3,31,x1@got@tlsld
4763
+ addi 9,3,x1@dtprel
4764
+ addis 9,3,x2@dtprel@ha
4765
+ addi 9,9,x2@dtprel@l
4766
+ lwz 9,x3@got@tprel(31)
4769
+ addis 9,2,x2@tprel@ha
4770
+ addi 9,9,x2@tprel@l'
4772
+ tls_first_minor=14
4773
+ tls_as_opt="-a32 --fatal-warnings"
4777
.section ".tdata","awT",@progbits
4778
@@ -26472,6 +26472,9 @@
4779
case "$target:$tm_file" in
4780
powerpc64-*-freebsd* | powerpc64*-*-linux* | powerpc*-*-linux*rs6000/biarch64.h*)
4783
+ emul_name="-melf64lppc"
4786
emul_name="-melf64ppc"
4788
Index: gcc/ChangeLog
4789
===================================================================
4790
--- a/src/gcc/ChangeLog (.../tags/gcc_4_8_1_release)
4791
+++ b/src/gcc/ChangeLog (.../branches/gcc-4_8-branch)
4793
+2013-06-21 Uros Bizjak <ubizjak@gmail.com>
4795
+ Backport from mainline
4796
+ 2013-06-20 Uros Bizjak <ubizjak@gmail.com>
4799
+ * config/i386/i386.c (construct_container): Report error if
4800
+ long double is used with disabled x87 float returns.
4802
+2013-06-20 Wei Mi <wmi@google.com>
4804
+ Backport from mainline
4805
+ 2013-06-19 Wei Mi <wmi@google.com>
4807
+ PR rtl-optimization/57518
4808
+ * ira.c (set_paradoxical_subreg): Set pdx_subregs[regno]
4809
+ if regno is used in paradoxical subreg.
4810
+ (update_equiv_regs): Check pdx_subregs[regno] before
4811
+ set a reg to be equivalent with a mem.
4814
+2013-06-20 David Edelsohn <dje.gcc@gmail.com>
4816
+ Backport from mainline
4817
+ 2013-06-19 David Edelsohn <dje.gcc@gmail.com>
4820
+ * collect2.c (collect_atexit): New.
4821
+ (collect_exit): Delete.
4822
+ (main): Register collect_atexit with atexit.
4823
+ (collect_wait): Change collect_exit to exit.
4825
+ * collect2.h (collect_exit): Delete.
4826
+ * tlink.c (do_tlink): Rename exit to ret. Change collect_exit to exit.
4828
+2013-06-19 Matthias Klose <doko@ubuntu.com>
4831
+ * file-find.h (find_a_file): Add a mode parameter.
4832
+ * file-find.c (find_a_file): Likewise.
4833
+ * gcc-ar.c (main): Call find_a_file with R_OK for the plugin,
4834
+ with X_OK for the executables.
4835
+ * collect2.c (main): Call find_a_file with X_OK.
4837
+2013-06-19 Igor Zamyatin <igor.zamyatin@intel.com>
4839
+ * doc/invoke.texi (core-avx2): Document.
4840
+ (atom): Updated with MOVBE.
4842
+2013-06-19 Jakub Jelinek <jakub@redhat.com>
4845
+ * gcc-ar.c (main): If not CROSS_DIRECTORY_STRUCTURE, look for
4846
+ PERSONALITY in $PATH derived prefixes.
4848
+2013-06-19 Paolo Carlini <paolo.carlini@oracle.com>
4851
+ * doc/cpp.texi [Standard Predefined Macros, __cplusplus]: Document
4852
+ that now in C++ the value is correct per the C++ standards.
4854
+2013-06-19 Alan Modra <amodra@gmail.com>
4856
+ Apply mainline patches
4857
+ 2013-06-13 Alan Modra <amodra@gmail.com>
4858
+ * config/rs6000/rs6000.h (LONG_DOUBLE_LARGE_FIRST): Define.
4859
+ * config/rs6000/rs6000.md (signbittf2): New insn.
4860
+ (extenddftf2_internal): Use LONG_DOUBLE_LARGE_FIRST.
4861
+ (abstf2_internal, cmptf_internal2): Likewise.
4862
+ * config/rs6000/spe.md (spe_abstf2_cmp, spe_abstf2_tst): Likewise.
4864
+ 2013-06-11 Anton Blanchard <anton@samba.org>
4865
+ * config/rs6000/rs6000.c (rs6000_adjust_atomic_subword): Calculate
4866
+ correct shift value in little-endian mode.
4868
+ 2013-06-07 Alan Modra <amodra@gmail.com>
4869
+ * config/rs6000/rs6000.c (setup_incoming_varargs): Round up
4872
+ 2013-06-04 Alan Modra <amodra@gmail.com>
4873
+ * config/rs6000/rs6000.c (output_toc): Correct little-endian float
4876
+ 2013-05-10 Alan Modra <amodra@gmail.com>
4877
+ * configure.ac (HAVE_AS_TLS): Swap powerpc64 and powerpc cases.
4878
+ (HAVE_LD_LARGE_TOC): Don't mention AIX in help text.
4879
+ * configure: Regenerate.
4881
+ 2013-05-09 Alan Modra <amodra@gmail.com>
4882
+ * configure.ac (HAVE_AS_TLS): Enable tests for powerpcle and
4884
+ * configure: Regenerate.
4886
+ 2013-05-07 Anton Blanchard <anton@samba.org>
4887
+ * configure.ac (HAVE_LD_LARGE_TOC): Use right linker emulation
4888
+ for powerpc64 little endian.
4889
+ * configure: Regenerate.
4891
+ 2013-05-06 Alan Modra <amodra@gmail.com>
4892
+ * config/rs6000/linux.h (DEFAULT_ASM_ENDIAN): Define.
4893
+ (LINK_OS_LINUX_EMUL): Use ENDIAN_SELECT.
4894
+ * config/rs6000/linux64.h (DEFAULT_ASM_ENDIAN): Define.
4895
+ * config/rs6000/sysv4le.h (DEFAULT_ASM_ENDIAN): Define.
4896
+ (LINK_TARGET_SPEC): Use ENDIAN_SELECT.
4897
+ * config/rs6000/sysv4.h (DEFAULT_ASM_ENDIAN): Define as -mbig.
4899
+ 2013-05-06 Alan Modra <amodra@gmail.com>
4900
+ * config/rs6000/sysv4.h (ENDIAN_SELECT): Define, extracted from
4901
+ (ASM_SPEC): ..here. Emit DEFAULT_ASM_ENDIAN too.
4902
+ (DEFAULT_ASM_ENDIAN): Define.
4903
+ (CC1_SPEC, LINK_TARGET_SPEC): Use ENDIAN_SELECT.
4904
+ * config/rs6000/linux64.h (ASM_SPEC32): Remove endian options.
4905
+ Update -K PIC clause from sysv4.h.
4906
+ (ASM_SPEC_COMMON): Use ENDIAN_SELECT.
4907
+ (LINK_OS_LINUX_EMUL32, LINK_OS_LINUX_EMUL64): Likewise.
4909
+ 2013-05-06 Alan Modra <amodra@gmail.com>
4910
+ * config/rs6000/rs6000.md (bswapdi 2nd splitter): Don't swap words
4911
+ twice for little-endian.
4912
+ (ashrdi3_no_power, ashrdi3): Support little-endian.
4914
+ 2013-04-25 Alan Modra <amodra@gmail.com>
4915
+ * config.gcc: Support little-endian powerpc-linux targets.
4916
+ * config/rs6000/linux.h (LINK_OS_LINUX_EMUL): Define.
4917
+ (LINK_OS_LINUX_SPEC): Define.
4918
+ * config/rs6000/linuxspe.h (TARGET_DEFAULT):
4919
+ Preserve MASK_LITTLE_ENDIAN.
4920
+ * config/rs6000/default64.h (TARGET_DEFAULT): Likewise.
4921
+ * config/rs6000/linuxaltivec.h (TARGET_DEFAULT): Likewise.
4922
+ * config/rs6000/linux64.h (OPTION_LITTLE_ENDIAN): Don't zero.
4923
+ (LINK_OS_LINUX_EMUL32, LINK_OS_LINUX_EMUL64): Define.
4924
+ (LINK_OS_LINUX_SPEC32, LINK_OS_LINUX_SPEC64): Use above.
4925
+ * config/rs6000/rs6000.c (output_toc): Don't use .tc for TARGET_ELF.
4926
+ Correct fp word order for little-endian. Don't shift toc entries
4927
+ smaller than a word for little-endian.
4928
+ * config/rs6000/rs6000.md (bswaphi2, bswapsi2 split): Comment.
4929
+ (bswapdi2 splits): Correct low-part subreg for little-endian.
4930
+ Remove wrong BYTES_BIG_ENDIAN tests, and rename vars to remove
4931
+ low/high where such is correct only for be.
4932
+ * config/rs6000/sysv4.h (SUBTARGET_OVERRIDE_OPTIONS): Allow
4933
+ little-endian for -mcall-aixdesc.
4935
+2013-06-12 Martin Jambor <mjambor@suse.cz>
4937
+ * ipa-cp.c (ipa_get_indirect_edge_target_1): Check that param_index is
4938
+ within bounds at the beginning of the function.
4940
+2013-06-12 Jakub Jelinek <jakub@redhat.com>
4942
+ PR tree-optimization/57537
4943
+ * tree-vect-patterns.c (vect_recog_widen_mult_pattern): If
4944
+ vect_handle_widen_op_by_const, convert oprnd1 to half_type1.
4946
+2013-06-10 Uros Bizjak <ubizjak@gmail.com>
4948
+ Backport from mainline
4949
+ 2013-06-10 Uros Bizjak <ubizjak@gmail.com>
4951
+ * config/alpha/alpha.c (alpha_emit_xfloating_compare): Also use
4952
+ cmp_code to construct REG_EQUAL note.
4954
+2013-06-10 Oleg Endo <olegendo@gcc.gnu.org>
4956
+ Backport from mainline
4957
+ 2013-05-20 Oleg Endo <olegendo@gcc.gnu.org>
4960
+ * config/sh/sh.md (fmasf4): Remove empty constraints strings.
4961
+ (*fmasf4, *fmasf4_media): New insns.
4963
+2013-06-09 Jakub Jelinek <jakub@redhat.com>
4966
+ * config/i386/i386.md (TARGET_READ_MODIFY_WRITE peepholes): Ensure
4967
+ that operands[2] doesn't overlap with operands[0].
4969
+2013-06-07 Richard Sandiford <rsandifo@linux.vnet.ibm.com>
4971
+ * recog.c (offsettable_address_addr_space_p): Fix calculation of
4972
+ address mode. Move pointer mode initialization to the same place.
4974
+2013-06-07 Uros Bizjak <ubizjak@gmail.com>
4976
+ Backport from mainline
4977
+ 2013-06-05 Uros Bizjak <ubizjak@gmail.com>
4979
+ * config/alpha/alpha.c (alpha_emit_conditional_move): Swap all
4980
+ GE, GT, GEU and GTU compares, modulo DImode compares with zero.
4982
+ Backport from mainline
4983
+ 2013-05-23 Uros Bizjak <ubizjak@gmail.com>
4986
+ * config/alpha/alpha.md (unspec): Add UNSPEC_XFLT_COMPARE.
4987
+ * config/alpha/alpha.c (alpha_emit_xfloating_compare): Construct
4988
+ REG_EQUAL note as UNSPEC_XFLT_COMPARE unspec.
4990
+2013-06-04 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
4992
+ Backport from mainline.
4993
+ 2013-05-22 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
4995
+ * config/rs6000/rs6000.h (MALLOC_ABI_ALIGNMENT): New #define.
4997
+2013-06-03 James Greenhalgh <james.greenhalgh@arm.com>
4999
+ Backport from mainline.
5000
+ 2013-04-25 James Greenhalgh <james.greenhalgh@arm.com>
5002
+ * config/aarch64/aarch64.c (aarch64_print_operand): Fix asm_fprintf
5003
+ format specifier in 'X' case.
5005
+2013-05-31 Richard Henderson <rth@redhat.com>
5008
+ * config/i386/i386.c (ix86_seh_fixup_eh_fallthru): New.
5009
+ (ix86_reorg): Call it.
5011
2013-05-31 Release Manager
5013
* GCC 4.8.1 released.
5015
Backport from mainline
5016
2013-05-02 Greta Yorsh <Greta.Yorsh@arm.com>
5020
* config/arm/arm.c (arm_expand_epilogue): Check really_return before
5021
generating simple_return for naked functions.
5023
@@ -203,14 +431,14 @@
5025
2013-05-09 Martin Jambor <mjambor@suse.cz>
5027
- PR middle-end/56988
5028
- * ipa-prop.h (ipa_agg_replacement_value): New flag by_ref.
5029
- * ipa-cp.c (find_aggregate_values_for_callers_subset): Fill in the
5030
+ PR middle-end/56988
5031
+ * ipa-prop.h (ipa_agg_replacement_value): New flag by_ref.
5032
+ * ipa-cp.c (find_aggregate_values_for_callers_subset): Fill in the
5033
by_ref flag of ipa_agg_replacement_value structures.
5034
- (known_aggs_to_agg_replacement_list): Likewise.
5035
- * ipa-prop.c (write_agg_replacement_chain): Stream by_ref flag.
5036
- (read_agg_replacement_chain): Likewise.
5037
- (ipcp_transform_function): Also check that by_ref flags match.
5038
+ (known_aggs_to_agg_replacement_list): Likewise.
5039
+ * ipa-prop.c (write_agg_replacement_chain): Stream by_ref flag.
5040
+ (read_agg_replacement_chain): Likewise.
5041
+ (ipcp_transform_function): Also check that by_ref flags match.
5043
2013-05-08 Diego Novillo <dnovillo@google.com>
5046
2013-04-25 Marek Polacek <polacek@redhat.com>
5048
PR tree-optimization/57066
5049
- * builtins.c (fold_builtin_logb): Return +Inf for -Inf.
5050
+ * builtins.c (fold_builtin_logb): Return +Inf for -Inf.
5052
2013-05-02 Vladimir Makarov <vmakarov@redhat.com>
5054
@@ -351,40 +579,40 @@
5055
Backport from mainline
5056
2013-04-24 Vladimir Makarov <vmakarov@redhat.com>
5058
- PR rtl-optimizations/57046
5059
- * lra-constraints (split_reg): Set up lra_risky_transformations_p
5060
- for multi-reg splits.
5061
+ PR rtl-optimizations/57046
5062
+ * lra-constraints (split_reg): Set up lra_risky_transformations_p
5063
+ for multi-reg splits.
5065
2013-05-02 Vladimir Makarov <vmakarov@redhat.com>
5067
Backport from mainline
5068
2013-04-22 Vladimir Makarov <vmakarov@redhat.com>
5071
- * lra-eliminations.c (mark_not_eliminable): Prevent elimination of
5072
- a set sp if no stack realignment.
5074
+ * lra-eliminations.c (mark_not_eliminable): Prevent elimination of
5075
+ a set sp if no stack realignment.
5077
2013-05-02 Vladimir Makarov <vmakarov@redhat.com>
5079
Backport from mainline
5080
2013-04-18 Vladimir Makarov <vmakarov@redhat.com>
5082
- PR rtl-optimization/56999
5083
- * lra-coalesce.c (coalescable_pseudo_p): Remove 2nd parameter and
5085
- (lra_coalesce): Remove split_origin_bitmap and related code.
5086
- * lra.c (lra): Coalesce after undoing inheritance. Recreate live
5087
- ranges if necessary.
5088
+ PR rtl-optimization/56999
5089
+ * lra-coalesce.c (coalescable_pseudo_p): Remove 2nd parameter and
5091
+ (lra_coalesce): Remove split_origin_bitmap and related code.
5092
+ * lra.c (lra): Coalesce after undoing inheritance. Recreate live
5093
+ ranges if necessary.
5095
2013-05-02 Vladimir Makarov <vmakarov@redhat.com>
5097
Backport from mainline
5098
2013-04-19 Vladimir Makarov <vmakarov@redhat.com>
5100
- PR rtl-optimization/56847
5101
- * lra-constraints.c (process_alt_operands): Discourage alternative
5102
- with non-matche doffsettable memory constraint fro memory with
5104
+ PR rtl-optimization/56847
5105
+ * lra-constraints.c (process_alt_operands): Discourage alternative
5106
+ with non-matche doffsettable memory constraint fro memory with
5109
2013-05-02 Ian Bolton <ian.bolton@arm.com>
5111
Index: gcc/testsuite/gcc.target/i386/pr57655.c
5112
===================================================================
5113
--- a/src/gcc/testsuite/gcc.target/i386/pr57655.c (.../tags/gcc_4_8_1_release)
5114
+++ b/src/gcc/testsuite/gcc.target/i386/pr57655.c (.../branches/gcc-4_8-branch)
5116
+/* { dg-do compile } */
5117
+/* { dg-options "-mavx -mvzeroupper -mno-fp-ret-in-387" }
5119
+/* { dg-error "x87 register return with x87 disabled" "" { target { ! ia32 } } 8 } */
5122
+foo (long double x)
5124
+ return __builtin_ilogbl (x);
5126
Index: gcc/testsuite/gcc.target/sh/pr56547-2.c
5127
===================================================================
5128
--- a/src/gcc/testsuite/gcc.target/sh/pr56547-2.c (.../tags/gcc_4_8_1_release)
5129
+++ b/src/gcc/testsuite/gcc.target/sh/pr56547-2.c (.../branches/gcc-4_8-branch)
5131
+/* Verify that the fmac insn is used for the expression 'a * b + a' and
5132
+ 'a * a + a' when -ffast-math is specified. */
5133
+/* { dg-do compile { target "sh*-*-*" } } */
5134
+/* { dg-options "-O1 -ffast-math" } */
5135
+/* { dg-skip-if "" { "sh*-*-*" } { "-m1" "-m2" "-m3" "-m4al" "*nofpu" "-m4-340*" "-m4-400*" "-m4-500*" "-m5*" } { "" } } */
5136
+/* { dg-final { scan-assembler-times "fmac" 2 } } */
5139
+test_00 (float a, float b)
5149
Index: gcc/testsuite/gcc.target/sh/pr56547-1.c
5150
===================================================================
5151
--- a/src/gcc/testsuite/gcc.target/sh/pr56547-1.c (.../tags/gcc_4_8_1_release)
5152
+++ b/src/gcc/testsuite/gcc.target/sh/pr56547-1.c (.../branches/gcc-4_8-branch)
5154
+/* Verify that the fmac insn is used for the expression 'a * b + a' and
5156
+ This assumes that the default compiler setting is -ffp-contract=fast. */
5157
+/* { dg-do compile { target "sh*-*-*" } } */
5158
+/* { dg-options "-O1" } */
5159
+/* { dg-skip-if "" { "sh*-*-*" } { "-m1" "-m2" "-m3" "-m4al" "*nofpu" "-m4-340*" "-m4-400*" "-m4-500*" "-m5*" } { "" } } */
5160
+/* { dg-final { scan-assembler-times "fmac" 2 } } */
5163
+test_00 (float a, float b)
5173
Index: gcc/testsuite/gfortran.dg/defined_assignment_7.f90
5174
===================================================================
5175
--- a/src/gcc/testsuite/gfortran.dg/defined_assignment_7.f90 (.../tags/gcc_4_8_1_release)
5176
+++ b/src/gcc/testsuite/gfortran.dg/defined_assignment_7.f90 (.../branches/gcc-4_8-branch)
5182
+module ForTrilinos_ref_counter
5185
+ procedure :: assign
5186
+ generic :: assignment(=) => assign
5189
+ subroutine assign (lhs, rhs)
5190
+ class (ref_counter), intent(inout) :: lhs
5191
+ class (ref_counter), intent(in) :: rhs
5194
+module FEpetra_BlockMap
5195
+ use ForTrilinos_ref_counter, only : ref_counter
5196
+ type :: Epetra_BlockMap
5197
+ type(ref_counter) :: counter
5200
+ function from_struct() result(new_Epetra_BlockMap)
5201
+ type(Epetra_BlockMap) :: new_Epetra_BlockMap
5203
+ type(Epetra_BlockMap) function create_arbitrary()
5204
+ create_arbitrary = from_struct()
5207
Index: gcc/testsuite/gfortran.dg/defined_assignment_6.f90
5208
===================================================================
5209
--- a/src/gcc/testsuite/gfortran.dg/defined_assignment_6.f90 (.../tags/gcc_4_8_1_release)
5210
+++ b/src/gcc/testsuite/gfortran.dg/defined_assignment_6.f90 (.../branches/gcc-4_8-branch)
5212
+! { dg-do compile }
5216
+! Contributed by Damian Rouson
5218
+module ref_counter_implementation
5221
+ procedure :: assign
5222
+ generic :: assignment(=) => assign
5225
+ subroutine assign (lhs, rhs)
5226
+ class (ref_counter), intent(inout) :: lhs
5227
+ class (ref_counter), intent(in) :: rhs
5230
+module foo_parent_implementation
5231
+ use ref_counter_implementation ,only: ref_counter
5232
+ type :: foo_parent
5233
+ type(ref_counter) :: counter
5236
+ type(foo_parent) function new_foo_parent()
5239
+module foo_implementation
5240
+ use foo_parent_implementation ,only: foo_parent,new_foo_parent
5241
+ type, extends(foo_parent) :: foo
5244
+ type(foo) function new_foo()
5245
+ new_foo%foo_parent = new_foo_parent()
5248
Index: gcc/testsuite/gfortran.dg/typebound_override_4.f90
5249
===================================================================
5250
--- a/src/gcc/testsuite/gfortran.dg/typebound_override_4.f90 (.../tags/gcc_4_8_1_release)
5251
+++ b/src/gcc/testsuite/gfortran.dg/typebound_override_4.f90 (.../branches/gcc-4_8-branch)
5253
+! { dg-do compile }
5255
+! PR 57217: [4.7/4.8/4.9 Regression][OOP] Accepts invalid TBP overriding - lacking arguments check
5257
+! Contributed by Salvatore Filippone <filippone.salvatore@gmail.com>
5263
+ procedure, pass(map) :: clone => base_clone
5266
+ subroutine base_clone(map,mapout)
5267
+ class(base_type) :: map
5268
+ class(base_type) :: mapout
5275
+ type, extends(base_type) :: r_type
5277
+ procedure, pass(map) :: clone => r_clone ! { dg-error "Type/rank mismatch in argument" }
5280
+ subroutine r_clone(map,mapout)
5281
+ class(r_type) :: map
5282
+ class(r_type) :: mapout
5286
+! { dg-final { cleanup-modules "base_mod r_mod" } }
5287
Index: gcc/testsuite/gcc.c-torture/execute/pr57568.c
5288
===================================================================
5289
--- a/src/gcc/testsuite/gcc.c-torture/execute/pr57568.c (.../tags/gcc_4_8_1_release)
5290
+++ b/src/gcc/testsuite/gcc.c-torture/execute/pr57568.c (.../branches/gcc-4_8-branch)
5292
+/* PR target/57568 */
5294
+extern void abort (void);
5295
+int a[6][9] = { }, b = 1, *c = &a[3][5];
5300
+ if (b && (*c = *c + *c))
5304
Index: gcc/testsuite/gcc.dg/pr57518.c
5305
===================================================================
5306
--- a/src/gcc/testsuite/gcc.dg/pr57518.c (.../tags/gcc_4_8_1_release)
5307
+++ b/src/gcc/testsuite/gcc.dg/pr57518.c (.../branches/gcc-4_8-branch)
5309
+/* PR rtl-optimization/57130 */
5311
+/* { dg-do compile } */
5312
+/* { dg-options "-O2 -fdump-rtl-ira" } */
5313
+/* { dg-final { scan-rtl-dump-not "REG_EQUIV.*mem.*\"ip\"" "ira" } } */
5324
Index: gcc/testsuite/ChangeLog
5325
===================================================================
5326
--- a/src/gcc/testsuite/ChangeLog (.../tags/gcc_4_8_1_release)
5327
+++ b/src/gcc/testsuite/ChangeLog (.../branches/gcc-4_8-branch)
5329
+2013-06-21 Uros Bizjak <ubizjak@gmail.com>
5331
+ Backport from mainline
5332
+ 2013-06-20 Uros Bizjak <ubizjak@gmail.com>
5335
+ * gcc.target/i386/pr57655.c: New test.
5337
+2013-06-21 Paolo Carlini <paolo.carlini@oracle.com>
5340
+ * g++.dg/cpp0x/decltype55.C: New.
5342
+2013-06-20 Wei Mi <wmi@google.com>
5344
+ Backport from mainline
5345
+ 2013-06-19 Wei Mi <wmi@google.com>
5347
+ PR rtl-optimization/57518
5348
+ * testsuite/gcc.dg/pr57518.c: New test.
5350
+2013-06-11 Tobias Burnus <burnus@net-b.de>
5353
+ * gfortran.dg/defined_assignment_7.f90: New.
5355
+2013-06-10 Oleg Endo <olegendo@gcc.gnu.org>
5357
+ Backport from mainline
5358
+ 2013-05-20 Oleg Endo <olegendo@gcc.gnu.org>
5361
+ * gcc.target/sh/pr56547-1.c: New.
5362
+ * gcc.target/sh/pr56547-2.c: New.
5364
+2013-06-09 Jakub Jelinek <jakub@redhat.com>
5367
+ * gcc.c-torture/execute/pr57568.c: New test.
5369
+2013-06-04 Tobias Burnus <burnus@net-b.de>
5371
+ Backport from mainline
5372
+ 2013-05-22 Tobias Burnus <burnus@net-b.de>
5375
+ * gfortran.dg/defined_assignment_6.f90: New.
5377
+2013-05-31 Janus Weil <janus@gcc.gnu.org>
5378
+ Tobias Burnus <burnus@net-b.de>
5381
+ * gfortran.dg/typebound_override_4.f90: New.
5383
2013-05-31 Release Manager
5385
* GCC 4.8.1 released.
5386
Index: gcc/testsuite/g++.dg/cpp0x/initlist71.C
5387
===================================================================
5388
--- a/src/gcc/testsuite/g++.dg/cpp0x/initlist71.C (.../tags/gcc_4_8_1_release)
5389
+++ b/src/gcc/testsuite/g++.dg/cpp0x/initlist71.C (.../branches/gcc-4_8-branch)
5392
+// { dg-require-effective-target c++11 }
5393
+// { dg-options -Wconversion }
5397
+ int x = sizeof(int);
5398
+ int y { sizeof(int) };
5400
Index: gcc/testsuite/g++.dg/cpp0x/decltype55.C
5401
===================================================================
5402
--- a/src/gcc/testsuite/g++.dg/cpp0x/decltype55.C (.../tags/gcc_4_8_1_release)
5403
+++ b/src/gcc/testsuite/g++.dg/cpp0x/decltype55.C (.../branches/gcc-4_8-branch)
5406
+// { dg-do compile { target c++11 } }
5408
+template<typename A, typename B>
5409
+ struct is_same { static const bool value = false; };
5411
+template<typename A>
5412
+ struct is_same<A, A> { static const bool value = true; };
5414
+template<typename... Args>
5415
+void func(Args... args)
5417
+ int arr[] = { args... };
5418
+ static_assert (is_same<decltype(arr), int[sizeof...(Args)]>::value, "");
5425
Index: gcc/testsuite/g++.dg/cpp0x/defaulted44.C
5426
===================================================================
5427
--- a/src/gcc/testsuite/g++.dg/cpp0x/defaulted44.C (.../tags/gcc_4_8_1_release)
5428
+++ b/src/gcc/testsuite/g++.dg/cpp0x/defaulted44.C (.../branches/gcc-4_8-branch)
5431
+// { dg-require-effective-target c++11 }
5435
+ struct B: virtual A { };
5436
+ struct C: virtual B { };
5440
+ void operator= (D &);
5445
+ struct A { A& operator=(A&&); };
5446
+ struct B: virtual A { }; // { dg-warning "move assignment" }
5447
+ struct C: virtual B { }; // { dg-warning "move assignment" }
5451
+ void operator= (D &);
5454
Index: gcc/cp/class.c
5455
===================================================================
5456
--- a/src/gcc/cp/class.c (.../tags/gcc_4_8_1_release)
5457
+++ b/src/gcc/cp/class.c (.../branches/gcc-4_8-branch)
5458
@@ -4833,6 +4833,44 @@
5462
+/* TYPE is being used as a virtual base, and has a non-trivial move
5463
+ assignment. Return true if this is due to there being a user-provided
5464
+ move assignment in TYPE or one of its subobjects; if there isn't, then
5465
+ multiple move assignment can't cause any harm. */
5468
+vbase_has_user_provided_move_assign (tree type)
5470
+ /* Does the type itself have a user-provided move assignment operator? */
5472
+ = lookup_fnfields_slot_nolazy (type, ansi_assopname (NOP_EXPR));
5473
+ fns; fns = OVL_NEXT (fns))
5475
+ tree fn = OVL_CURRENT (fns);
5476
+ if (move_fn_p (fn) && user_provided_p (fn))
5480
+ /* Do any of its bases? */
5481
+ tree binfo = TYPE_BINFO (type);
5483
+ for (int i = 0; BINFO_BASE_ITERATE (binfo, i, base_binfo); ++i)
5484
+ if (vbase_has_user_provided_move_assign (BINFO_TYPE (base_binfo)))
5487
+ /* Or non-static data members? */
5488
+ for (tree field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field))
5490
+ if (TREE_CODE (field) == FIELD_DECL
5491
+ && CLASS_TYPE_P (TREE_TYPE (field))
5492
+ && vbase_has_user_provided_move_assign (TREE_TYPE (field)))
5500
/* If default-initialization leaves part of TYPE uninitialized, returns
5501
a DECL for the field or TYPE itself (DR 253). */
5503
Index: gcc/cp/method.c
5504
===================================================================
5505
--- a/src/gcc/cp/method.c (.../tags/gcc_4_8_1_release)
5506
+++ b/src/gcc/cp/method.c (.../branches/gcc-4_8-branch)
5507
@@ -1340,7 +1340,8 @@
5508
if (diag && assign_p && move_p
5509
&& BINFO_VIRTUAL_P (base_binfo)
5510
&& rval && TREE_CODE (rval) == FUNCTION_DECL
5511
- && move_fn_p (rval) && !trivial_fn_p (rval))
5512
+ && move_fn_p (rval) && !trivial_fn_p (rval)
5513
+ && vbase_has_user_provided_move_assign (basetype))
5514
warning (OPT_Wvirtual_move_assign,
5515
"defaulted move assignment for %qT calls a non-trivial "
5516
"move assignment operator for virtual base %qT",
5517
Index: gcc/cp/ChangeLog
5518
===================================================================
5519
--- a/src/gcc/cp/ChangeLog (.../tags/gcc_4_8_1_release)
5520
+++ b/src/gcc/cp/ChangeLog (.../branches/gcc-4_8-branch)
5522
+2013-06-21 Paolo Carlini <paolo.carlini@oracle.com>
5525
+ * pt.c (type_dependent_expression_p): Handle an array of unknown
5526
+ bound depending on a variadic parameter.
5527
+ * parser.c (cp_parser_range_for): Revert PR56794 changes.
5529
+2013-05-31 Jason Merrill <jason@redhat.com>
5532
+ * class.c (vbase_has_user_provided_move_assign): New.
5533
+ * method.c (synthesized_method_walk): Check it.
5534
+ * cp-tree.h: Declare it.
5537
+ * call.c (convert_like_real): Use cp_convert_and_check.
5538
+ * cvt.c (cp_convert_and_check): Use maybe_constant_value.
5539
+ * semantics.c (cxx_eval_constant_expression): Handle LTGT_EXPR.
5540
+ (potential_constant_expression_1): Handle OMP_ATOMIC*.
5542
2013-05-31 Release Manager
5544
* GCC 4.8.1 released.
5546
===================================================================
5547
--- a/src/gcc/cp/pt.c (.../tags/gcc_4_8_1_release)
5548
+++ b/src/gcc/cp/pt.c (.../branches/gcc-4_8-branch)
5549
@@ -19888,6 +19888,29 @@
5550
&& VAR_HAD_UNKNOWN_BOUND (expression))
5553
+ /* An array of unknown bound depending on a variadic parameter, eg:
5555
+ template<typename... Args>
5556
+ void foo (Args... args)
5558
+ int arr[] = { args... };
5561
+ template<int... vals>
5564
+ int arr[] = { vals... };
5567
+ If the array has no length and has an initializer, it must be that
5568
+ we couldn't determine its length in cp_complete_array_type because
5569
+ it is dependent. */
5570
+ if (TREE_CODE (expression) == VAR_DECL
5571
+ && TREE_CODE (TREE_TYPE (expression)) == ARRAY_TYPE
5572
+ && !TYPE_DOMAIN (TREE_TYPE (expression))
5573
+ && DECL_INITIAL (expression))
5576
if (TREE_TYPE (expression) == unknown_type_node)
5578
if (TREE_CODE (expression) == ADDR_EXPR)
5579
Index: gcc/cp/semantics.c
5580
===================================================================
5581
--- a/src/gcc/cp/semantics.c (.../tags/gcc_4_8_1_release)
5582
+++ b/src/gcc/cp/semantics.c (.../branches/gcc-4_8-branch)
5583
@@ -7990,6 +7990,7 @@
5590
r = cxx_eval_binary_expression (call, t, allow_non_constant, addr,
5591
@@ -8846,6 +8847,12 @@
5596
+ case OMP_ATOMIC_READ:
5597
+ case OMP_ATOMIC_CAPTURE_OLD:
5598
+ case OMP_ATOMIC_CAPTURE_NEW:
5602
if (objc_is_property_ref (t))
5604
Index: gcc/cp/parser.c
5605
===================================================================
5606
--- a/src/gcc/cp/parser.c (.../tags/gcc_4_8_1_release)
5607
+++ b/src/gcc/cp/parser.c (.../branches/gcc-4_8-branch)
5608
@@ -9595,10 +9595,7 @@
5609
range_expr = error_mark_node;
5610
stmt = begin_range_for_stmt (scope, init);
5611
finish_range_for_decl (stmt, range_decl, range_expr);
5612
- if (range_expr != error_mark_node
5613
- && !type_dependent_expression_p (range_expr)
5614
- /* The length of an array might be dependent. */
5615
- && COMPLETE_TYPE_P (complete_type (TREE_TYPE (range_expr)))
5616
+ if (!type_dependent_expression_p (range_expr)
5617
/* do_auto_deduction doesn't mess with template init-lists. */
5618
&& !BRACE_ENCLOSED_INITIALIZER_P (range_expr))
5619
do_range_for_auto_deduction (range_decl, range_expr);
5620
Index: gcc/cp/call.c
5621
===================================================================
5622
--- a/src/gcc/cp/call.c (.../tags/gcc_4_8_1_release)
5623
+++ b/src/gcc/cp/call.c (.../branches/gcc-4_8-branch)
5624
@@ -6195,8 +6195,8 @@
5625
if (convs->check_narrowing)
5626
check_narrowing (totype, expr);
5628
- if (issue_conversion_warnings && (complain & tf_warning))
5629
- expr = convert_and_check (totype, expr);
5630
+ if (issue_conversion_warnings)
5631
+ expr = cp_convert_and_check (totype, expr, complain);
5633
expr = convert (totype, expr);
5636
===================================================================
5637
--- a/src/gcc/cp/cvt.c (.../tags/gcc_4_8_1_release)
5638
+++ b/src/gcc/cp/cvt.c (.../branches/gcc-4_8-branch)
5641
if (TREE_TYPE (expr) == type)
5644
+ if (TREE_CODE (expr) == SIZEOF_EXPR)
5645
+ expr = maybe_constant_value (expr);
5647
result = cp_convert (type, expr, complain);
5649
Index: gcc/cp/cp-tree.h
5650
===================================================================
5651
--- a/src/gcc/cp/cp-tree.h (.../tags/gcc_4_8_1_release)
5652
+++ b/src/gcc/cp/cp-tree.h (.../branches/gcc-4_8-branch)
5653
@@ -5057,6 +5057,7 @@
5654
extern bool user_provided_p (tree);
5655
extern bool type_has_user_provided_constructor (tree);
5656
extern bool type_has_user_provided_default_constructor (tree);
5657
+extern bool vbase_has_user_provided_move_assign (tree);
5658
extern tree default_init_uninitialized_part (tree);
5659
extern bool trivial_default_constructor_is_constexpr (tree);
5660
extern bool type_has_constexpr_default_constructor (tree);
5661
Index: gcc/config.in
5662
===================================================================
5663
--- a/src/gcc/config.in (.../tags/gcc_4_8_1_release)
5664
+++ b/src/gcc/config.in (.../branches/gcc-4_8-branch)
5665
@@ -1228,7 +1228,7 @@
5669
-/* Define if your AIX linker supports a large TOC. */
5670
+/* Define if your PowerPC64 linker supports a large TOC. */
5671
#ifndef USED_FOR_TARGET
5672
#undef HAVE_LD_LARGE_TOC
5674
Index: gcc/go/go-gcc.cc
5675
===================================================================
5676
--- a/src/gcc/go/go-gcc.cc (.../tags/gcc_4_8_1_release)
5677
+++ b/src/gcc/go/go-gcc.cc (.../branches/gcc-4_8-branch)
5678
@@ -287,10 +287,10 @@
5679
Location, Bstatement**);
5682
- immutable_struct(const std::string&, bool, Btype*, Location);
5683
+ immutable_struct(const std::string&, bool, bool, Btype*, Location);
5686
- immutable_struct_set_init(Bvariable*, const std::string&, bool, Btype*,
5687
+ immutable_struct_set_init(Bvariable*, const std::string&, bool, bool, Btype*,
5688
Location, Bexpression*);
5691
@@ -1454,8 +1454,8 @@
5692
// Create a named immutable initialized data structure.
5695
-Gcc_backend::immutable_struct(const std::string& name, bool, Btype* btype,
5696
- Location location)
5697
+Gcc_backend::immutable_struct(const std::string& name, bool, bool,
5698
+ Btype* btype, Location location)
5700
tree type_tree = btype->get_tree();
5701
if (type_tree == error_mark_node)
5702
@@ -1482,7 +1482,7 @@
5705
Gcc_backend::immutable_struct_set_init(Bvariable* var, const std::string&,
5706
- bool is_common, Btype*,
5707
+ bool is_hidden, bool is_common, Btype*,
5709
Bexpression* initializer)
5711
@@ -1495,7 +1495,10 @@
5713
// We can't call make_decl_one_only until we set DECL_INITIAL.
5715
- TREE_PUBLIC(decl) = 1;
5718
+ TREE_PUBLIC(decl) = 1;
5722
make_decl_one_only(decl, DECL_ASSEMBLER_NAME(decl));
5723
Index: gcc/go/ChangeLog
5724
===================================================================
5725
--- a/src/gcc/go/ChangeLog (.../tags/gcc_4_8_1_release)
5726
+++ b/src/gcc/go/ChangeLog (.../branches/gcc-4_8-branch)
5728
+2013-06-18 Ian Lance Taylor <iant@google.com>
5730
+ * go-gcc.cc (Gcc_backend::immutable_struct): Add is_hidden
5732
+ (Gcc_backend::immutable_struct_set_init): Likewise.
5734
2013-05-31 Release Manager
5736
* GCC 4.8.1 released.
5737
Index: gcc/go/gofrontend/gogo.cc
5738
===================================================================
5739
--- a/src/gcc/go/gofrontend/gogo.cc (.../tags/gcc_4_8_1_release)
5740
+++ b/src/gcc/go/gofrontend/gogo.cc (.../branches/gcc-4_8-branch)
5742
// Declare "main" as a function which takes no parameters and
5743
// returns no value.
5744
Location uloc = Linemap::unknown_location();
5745
- this->declare_function("main",
5746
+ this->declare_function(Gogo::pack_hidden_name("main", false),
5747
Type::make_function_type (NULL, NULL, NULL, uloc),
5752
snprintf(buf, sizeof buf, ".$sink%d", sink_count);
5754
- ret = Named_object::make_function(buf, NULL, function);
5755
+ ret = this->package_->bindings()->add_function(buf, NULL, function);
5756
+ ret->func_value()->set_is_sink();
5758
else if (!type->is_method())
5760
@@ -1599,8 +1600,9 @@
5761
return TRAVERSE_CONTINUE;
5764
-// Lower function closure types. Record the function while lowering
5765
-// it, so that we can pass it down when lowering an expression.
5766
+// Lower the body of a function, and set the closure type. Record the
5767
+// function while lowering it, so that we can pass it down when
5768
+// lowering an expression.
5771
Lower_parse_tree::function(Named_object* no)
5772
@@ -1732,6 +1734,121 @@
5773
lower.constant(no, false);
5776
+// Traverse the tree to create function descriptors as needed.
5778
+class Create_function_descriptors : public Traverse
5781
+ Create_function_descriptors(Gogo* gogo)
5782
+ : Traverse(traverse_functions | traverse_expressions),
5787
+ function(Named_object*);
5790
+ expression(Expression**);
5796
+// Create a descriptor for every top-level exported function.
5799
+Create_function_descriptors::function(Named_object* no)
5801
+ if (no->is_function()
5802
+ && no->func_value()->enclosing() == NULL
5803
+ && !no->func_value()->is_method()
5804
+ && !no->func_value()->is_descriptor_wrapper()
5805
+ && !Gogo::is_hidden_name(no->name()))
5806
+ no->func_value()->descriptor(this->gogo_, no);
5808
+ return TRAVERSE_CONTINUE;
5811
+// If we see a function referenced in any way other than calling it,
5812
+// create a descriptor for it.
5815
+Create_function_descriptors::expression(Expression** pexpr)
5817
+ Expression* expr = *pexpr;
5819
+ Func_expression* fe = expr->func_expression();
5822
+ // We would not get here for a call to this function, so this is
5823
+ // a reference to a function other than calling it. We need a
5825
+ if (fe->closure() != NULL)
5826
+ return TRAVERSE_CONTINUE;
5827
+ Named_object* no = fe->named_object();
5828
+ if (no->is_function() && !no->func_value()->is_method())
5829
+ no->func_value()->descriptor(this->gogo_, no);
5830
+ else if (no->is_function_declaration()
5831
+ && !no->func_declaration_value()->type()->is_method()
5832
+ && !Linemap::is_predeclared_location(no->location()))
5833
+ no->func_declaration_value()->descriptor(this->gogo_, no);
5834
+ return TRAVERSE_CONTINUE;
5837
+ Call_expression* ce = expr->call_expression();
5840
+ Expression* fn = ce->fn();
5841
+ if (fn->func_expression() != NULL)
5843
+ // Traverse the arguments but not the function.
5844
+ Expression_list* args = ce->args();
5847
+ if (args->traverse(this) == TRAVERSE_EXIT)
5848
+ return TRAVERSE_EXIT;
5850
+ return TRAVERSE_SKIP_COMPONENTS;
5854
+ return TRAVERSE_CONTINUE;
5857
+// Create function descriptors as needed. We need a function
5858
+// descriptor for all exported functions and for all functions that
5859
+// are referenced without being called.
5862
+Gogo::create_function_descriptors()
5864
+ // Create a function descriptor for any exported function that is
5865
+ // declared in this package. This is so that we have a descriptor
5866
+ // for functions written in assembly. Gather the descriptors first
5867
+ // so that we don't add declarations while looping over them.
5868
+ std::vector<Named_object*> fndecls;
5869
+ Bindings* b = this->package_->bindings();
5870
+ for (Bindings::const_declarations_iterator p = b->begin_declarations();
5871
+ p != b->end_declarations();
5874
+ Named_object* no = p->second;
5875
+ if (no->is_function_declaration()
5876
+ && !no->func_declaration_value()->type()->is_method()
5877
+ && !Linemap::is_predeclared_location(no->location())
5878
+ && !Gogo::is_hidden_name(no->name()))
5879
+ fndecls.push_back(no);
5881
+ for (std::vector<Named_object*>::const_iterator p = fndecls.begin();
5882
+ p != fndecls.end();
5884
+ (*p)->func_declaration_value()->descriptor(this, *p);
5887
+ Create_function_descriptors cfd(this);
5888
+ this->traverse(&cfd);
5891
// Look for interface types to finalize methods of inherited
5894
@@ -2643,6 +2760,13 @@
5895
Expression* closure = NULL;
5896
if (orig_func->needs_closure())
5898
+ // For the new function we are creating, declare a new parameter
5899
+ // variable NEW_CLOSURE_NO and set it to be the closure variable
5900
+ // of the function. This will be set to the closure value
5901
+ // passed in by the caller. Then pass a reference to this
5902
+ // variable as the closure value when calling the original
5903
+ // function. In other words, simply pass the closure value
5904
+ // through the thunk we are creating.
5905
Named_object* orig_closure_no = orig_func->closure_var();
5906
Variable* orig_closure_var = orig_closure_no->var_value();
5907
Variable* new_var = new Variable(orig_closure_var->type(), NULL, false,
5908
@@ -3101,6 +3225,7 @@
5909
Map_type::make_map_descriptor_type();
5910
Channel_type::make_chan_type_descriptor_type();
5911
Interface_type::make_interface_type_descriptor_type();
5912
+ Expression::make_func_descriptor_type();
5913
Type::convert_builtin_named_types(this);
5915
Runtime::convert_types(this);
5916
@@ -3128,10 +3253,10 @@
5918
: type_(type), enclosing_(enclosing), results_(NULL),
5919
closure_var_(NULL), block_(block), location_(location), labels_(),
5920
- local_type_count_(0), fndecl_(NULL), defer_stack_(NULL),
5921
- results_are_named_(false), nointerface_(false), calls_recover_(false),
5922
- is_recover_thunk_(false), has_recover_thunk_(false),
5923
- in_unique_section_(false)
5924
+ local_type_count_(0), descriptor_(NULL), fndecl_(NULL), defer_stack_(NULL),
5925
+ is_sink_(false), results_are_named_(false), nointerface_(false),
5926
+ calls_recover_(false), is_recover_thunk_(false), has_recover_thunk_(false),
5927
+ in_unique_section_(false), is_descriptor_wrapper_(false)
5931
@@ -3206,6 +3331,7 @@
5933
if (this->closure_var_ == NULL)
5935
+ go_assert(this->descriptor_ == NULL);
5936
// We don't know the type of the variable yet. We add fields as
5938
Location loc = this->type_->location();
5939
@@ -3229,6 +3355,13 @@
5941
Named_object* closure = this->closure_var_;
5942
Struct_type* st = closure->var_value()->type()->deref()->struct_type();
5944
+ // The first field of a closure is always a pointer to the function
5946
+ Type* voidptr_type = Type::make_pointer_type(Type::make_void_type());
5947
+ st->push_field(Struct_field(Typed_identifier(".$f", voidptr_type,
5948
+ this->location_)));
5950
unsigned int index = 0;
5951
for (Closure_fields::const_iterator p = this->closure_fields_.begin();
5952
p != this->closure_fields_.end();
5953
@@ -3410,6 +3543,143 @@
5954
this->block_->determine_types();
5957
+// Build a wrapper function for a function descriptor. A function
5958
+// descriptor refers to a function that takes a closure as its last
5959
+// argument. In this case there will be no closure, but an indirect
5960
+// call will pass nil as the last argument. We need to build a
5961
+// wrapper function that accepts and discards that last argument, so
5962
+// that cases like -mrtd will work correctly. In most cases the
5963
+// wrapper function will simply be a jump.
5966
+Function::make_descriptor_wrapper(Gogo* gogo, Named_object* no,
5967
+ Function_type* orig_fntype)
5969
+ Location loc = no->location();
5971
+ Typed_identifier_list* new_params = new Typed_identifier_list();
5972
+ const Typed_identifier_list* orig_params = orig_fntype->parameters();
5973
+ if (orig_params != NULL && !orig_params->empty())
5977
+ for (Typed_identifier_list::const_iterator p = orig_params->begin();
5978
+ p != orig_params->end();
5981
+ snprintf(buf, sizeof buf, "pt.%u", count);
5983
+ new_params->push_back(Typed_identifier(buf, p->type(),
5987
+ Type* vt = Type::make_pointer_type(Type::make_void_type());
5988
+ new_params->push_back(Typed_identifier("closure.0", vt, loc));
5990
+ const Typed_identifier_list* orig_results = orig_fntype->results();
5991
+ Typed_identifier_list* new_results;
5992
+ if (orig_results == NULL || orig_results->empty())
5993
+ new_results = NULL;
5996
+ new_results = new Typed_identifier_list();
5997
+ for (Typed_identifier_list::const_iterator p = orig_results->begin();
5998
+ p != orig_results->end();
6000
+ new_results->push_back(Typed_identifier("", p->type(),
6004
+ Function_type* new_fntype = Type::make_function_type(NULL, new_params,
6008
+ std::string name = no->name() + "$descriptorfn";
6009
+ Named_object* dno = gogo->start_function(name, new_fntype, false, loc);
6010
+ dno->func_value()->is_descriptor_wrapper_ = true;
6012
+ gogo->start_block(loc);
6014
+ Expression* fn = Expression::make_func_reference(no, NULL, loc);
6016
+ // Call the wrapper function, passing all of the arguments except
6017
+ // for the last one (the last argument is the ignored closure).
6018
+ Expression_list* args;
6019
+ if (orig_params == NULL || orig_params->empty())
6023
+ args = new Expression_list();
6024
+ for (Typed_identifier_list::const_iterator p = new_params->begin();
6025
+ p + 1 != new_params->end();
6028
+ Named_object* p_no = gogo->lookup(p->name(), NULL);
6029
+ go_assert(p_no != NULL
6030
+ && p_no->is_variable()
6031
+ && p_no->var_value()->is_parameter());
6032
+ args->push_back(Expression::make_var_reference(p_no, loc));
6036
+ Call_expression* call = Expression::make_call(fn, args,
6037
+ orig_fntype->is_varargs(),
6039
+ call->set_varargs_are_lowered();
6042
+ if (orig_results == NULL || orig_results->empty())
6043
+ s = Statement::make_statement(call, true);
6046
+ Expression_list* vals = new Expression_list();
6047
+ size_t rc = orig_results->size();
6049
+ vals->push_back(call);
6052
+ for (size_t i = 0; i < rc; ++i)
6053
+ vals->push_back(Expression::make_call_result(call, i));
6055
+ s = Statement::make_return_statement(vals, loc);
6058
+ gogo->add_statement(s);
6059
+ Block* b = gogo->finish_block(loc);
6060
+ gogo->add_block(b, loc);
6061
+ gogo->lower_block(dno, b);
6062
+ gogo->finish_function(loc);
6067
+// Return the function descriptor, the value you get when you refer to
6068
+// the function in Go code without calling it.
6071
+Function::descriptor(Gogo* gogo, Named_object* no)
6073
+ go_assert(!this->is_method());
6074
+ go_assert(this->closure_var_ == NULL);
6075
+ go_assert(!this->is_descriptor_wrapper_);
6076
+ if (this->descriptor_ == NULL)
6078
+ // Make and record the descriptor first, so that when we lower
6079
+ // the descriptor wrapper we don't try to make it again.
6080
+ Func_descriptor_expression* descriptor =
6081
+ Expression::make_func_descriptor(no);
6082
+ this->descriptor_ = descriptor;
6083
+ if (no->package() == NULL
6084
+ && !Linemap::is_predeclared_location(no->location()))
6086
+ Named_object* dno = Function::make_descriptor_wrapper(gogo, no,
6088
+ descriptor->set_descriptor_wrapper(dno);
6091
+ return this->descriptor_;
6094
// Get a pointer to the variable representing the defer stack for this
6095
// function, making it if necessary. The value of the variable is set
6096
// by the runtime routines to true if the function is returning,
6097
@@ -3940,6 +4210,32 @@
6101
+// Class Function_declaration.
6103
+// Return the function descriptor.
6106
+Function_declaration::descriptor(Gogo* gogo, Named_object* no)
6108
+ go_assert(!this->fntype_->is_method());
6109
+ if (this->descriptor_ == NULL)
6111
+ // Make and record the descriptor first, so that when we lower
6112
+ // the descriptor wrapper we don't try to make it again.
6113
+ Func_descriptor_expression* descriptor =
6114
+ Expression::make_func_descriptor(no);
6115
+ this->descriptor_ = descriptor;
6116
+ if (no->package() == NULL
6117
+ && !Linemap::is_predeclared_location(no->location()))
6119
+ Named_object* dno = Function::make_descriptor_wrapper(gogo, no,
6121
+ descriptor->set_descriptor_wrapper(dno);
6124
+ return this->descriptor_;
6129
Variable::Variable(Type* type, Expression* init, bool is_global,
6130
@@ -4755,6 +5051,12 @@
6131
Named_object::set_function_value(Function* function)
6133
go_assert(this->classification_ == NAMED_OBJECT_FUNC_DECLARATION);
6134
+ if (this->func_declaration_value()->has_descriptor())
6136
+ Expression* descriptor =
6137
+ this->func_declaration_value()->descriptor(NULL, NULL);
6138
+ function->set_descriptor(descriptor);
6140
this->classification_ = NAMED_OBJECT_FUNC;
6141
// FIXME: We should free the old value.
6142
this->u_.func_value = function;
6143
Index: gcc/go/gofrontend/runtime.def
6144
===================================================================
6145
--- a/src/gcc/go/gofrontend/runtime.def (.../tags/gcc_4_8_1_release)
6146
+++ b/src/gcc/go/gofrontend/runtime.def (.../branches/gcc-4_8-branch)
6147
@@ -224,11 +224,6 @@
6148
DEF_GO_RUNTIME(NEW_NOPOINTERS, "__go_new_nopointers", P1(UINTPTR), R1(POINTER))
6151
-// Allocate a trampoline for a function literal.
6152
-DEF_GO_RUNTIME(ALLOCATE_GO_TRAMPOLINE, "__go_allocate_trampoline",
6153
- P2(UINTPTR, POINTER), R1(POINTER))
6156
// Start a new goroutine.
6157
DEF_GO_RUNTIME(GO, "__go_go", P2(FUNC_PTR, POINTER), R0())
6159
Index: gcc/go/gofrontend/gogo.h
6160
===================================================================
6161
--- a/src/gcc/go/gofrontend/gogo.h (.../tags/gcc_4_8_1_release)
6162
+++ b/src/gcc/go/gofrontend/gogo.h (.../branches/gcc-4_8-branch)
6163
@@ -476,6 +476,10 @@
6165
lower_constant(Named_object*);
6167
+ // Create all necessary function descriptors.
6169
+ create_function_descriptors();
6171
// Finalize the method lists and build stub methods for named types.
6174
@@ -614,10 +618,6 @@
6175
receive_from_channel(tree type_tree, tree type_descriptor_tree, tree channel,
6178
- // Make a trampoline which calls FNADDR passing CLOSURE.
6180
- make_trampoline(tree fnaddr, tree closure, Location);
6183
// During parsing, we keep a stack of functions. Each function on
6184
// the stack is one that we are currently parsing. For each
6185
@@ -669,10 +669,6 @@
6187
ptr_go_string_constant_tree(const std::string&);
6189
- // Return the type of a trampoline.
6191
- trampoline_type_tree();
6193
// Type used to map import names to packages.
6194
typedef std::map<std::string, Package*> Imports;
6196
@@ -915,6 +911,14 @@
6198
{ return this->results_; }
6202
+ { return this->is_sink_; }
6206
+ { this->is_sink_ = true; }
6208
// Whether the result variables have names.
6210
results_are_named() const
6211
@@ -1046,6 +1050,12 @@
6212
set_in_unique_section()
6213
{ this->in_unique_section_ = true; }
6215
+ // Whether this function was created as a descriptor wrapper for
6216
+ // another function.
6218
+ is_descriptor_wrapper() const
6219
+ { return this->is_descriptor_wrapper_; }
6221
// Swap with another function. Used only for the thunk which calls
6224
@@ -1059,6 +1069,26 @@
6228
+ // Return an expression for the function descriptor, given the named
6229
+ // object for this function. This may only be called for functions
6230
+ // without a closure. This will be an immutable struct with one
6231
+ // field that points to the function's code.
6233
+ descriptor(Gogo*, Named_object*);
6235
+ // Set the descriptor for this function. This is used when a
6236
+ // function declaration is followed by a function definition.
6238
+ set_descriptor(Expression* descriptor)
6240
+ go_assert(this->descriptor_ == NULL);
6241
+ this->descriptor_ = descriptor;
6244
+ // Build a descriptor wrapper function.
6245
+ static Named_object*
6246
+ make_descriptor_wrapper(Gogo*, Named_object*, Function_type*);
6248
// Return the function's decl given an identifier.
6250
get_or_make_decl(Gogo*, Named_object*, tree id);
6251
@@ -1137,25 +1167,32 @@
6253
// The number of local types defined in this function.
6254
unsigned int local_type_count_;
6255
+ // The function descriptor, if any.
6256
+ Expression* descriptor_;
6257
// The function decl.
6259
// The defer stack variable. A pointer to this variable is used to
6260
// distinguish the defer stack for one function from another. This
6261
// is NULL unless we actually need a defer stack.
6262
Temporary_statement* defer_stack_;
6263
+ // True if this function is sink-named. No code is generated.
6264
+ bool is_sink_ : 1;
6265
// True if the result variables are named.
6266
- bool results_are_named_;
6267
+ bool results_are_named_ : 1;
6268
// True if this method should not be included in the type descriptor.
6269
- bool nointerface_;
6270
+ bool nointerface_ : 1;
6271
// True if this function calls the predeclared recover function.
6272
- bool calls_recover_;
6273
+ bool calls_recover_ : 1;
6274
// True if this a thunk built for a function which calls recover.
6275
- bool is_recover_thunk_;
6276
+ bool is_recover_thunk_ : 1;
6277
// True if this function already has a recover thunk.
6278
- bool has_recover_thunk_;
6279
+ bool has_recover_thunk_ : 1;
6280
// True if this function should be put in a unique section. This is
6281
// turned on for field tracking.
6282
bool in_unique_section_ : 1;
6283
+ // True if this is a function wrapper created to put in a function
6285
+ bool is_descriptor_wrapper_ : 1;
6288
// A snapshot of the current binding state.
6289
@@ -1198,7 +1235,8 @@
6292
Function_declaration(Function_type* fntype, Location location)
6293
- : fntype_(fntype), location_(location), asm_name_(), fndecl_(NULL)
6294
+ : fntype_(fntype), location_(location), asm_name_(), descriptor_(NULL),
6299
@@ -1218,10 +1256,27 @@
6300
set_asm_name(const std::string& asm_name)
6301
{ this->asm_name_ = asm_name; }
6303
+ // Return an expression for the function descriptor, given the named
6304
+ // object for this function. This may only be called for functions
6305
+ // without a closure. This will be an immutable struct with one
6306
+ // field that points to the function's code.
6308
+ descriptor(Gogo*, Named_object*);
6310
+ // Return true if we have created a descriptor for this declaration.
6312
+ has_descriptor() const
6313
+ { return this->descriptor_ != NULL; }
6315
// Return a decl for the function given an identifier.
6317
get_or_make_decl(Gogo*, Named_object*, tree id);
6319
+ // If there is a descriptor, build it into the backend
6320
+ // representation.
6322
+ build_backend_descriptor(Gogo*);
6324
// Export a function declaration.
6326
export_func(Export* exp, const std::string& name) const
6327
@@ -1235,6 +1290,8 @@
6328
// The assembler name: this is the name to use in references to the
6329
// function. This is normally empty.
6330
std::string asm_name_;
6331
+ // The function descriptor, if any.
6332
+ Expression* descriptor_;
6333
// The function decl if needed.
6336
Index: gcc/go/gofrontend/go.cc
6337
===================================================================
6338
--- a/src/gcc/go/gofrontend/go.cc (.../tags/gcc_4_8_1_release)
6339
+++ b/src/gcc/go/gofrontend/go.cc (.../branches/gcc-4_8-branch)
6343
go_parse_input_files(const char** filenames, unsigned int filename_count,
6344
- bool only_check_syntax, bool require_return_statement)
6345
+ bool only_check_syntax, bool)
6347
go_assert(filename_count > 0);
6350
// Finalize method lists and build stub methods for named types.
6351
::gogo->finalize_methods();
6353
+ // Check that functions have a terminating statement.
6354
+ ::gogo->check_return_statements();
6356
// Now that we have seen all the names, lower the parse tree into a
6357
// form which is easier to use.
6358
::gogo->lower_parse_tree();
6360
+ // Create function descriptors as needed.
6361
+ ::gogo->create_function_descriptors();
6363
// Write out queued up functions for hash and comparison of types.
6364
::gogo->write_specific_type_functions();
6366
@@ -104,10 +110,6 @@
6367
if (only_check_syntax)
6370
- // Check that functions have return statements.
6371
- if (require_return_statement)
6372
- ::gogo->check_return_statements();
6374
// Export global identifiers as appropriate.
6375
::gogo->do_exports();
6377
Index: gcc/go/gofrontend/types.h
6378
===================================================================
6379
--- a/src/gcc/go/gofrontend/types.h (.../tags/gcc_4_8_1_release)
6380
+++ b/src/gcc/go/gofrontend/types.h (.../branches/gcc-4_8-branch)
6381
@@ -523,6 +523,14 @@
6383
make_forward_declaration(Named_object*);
6385
+ // Make a builtin struct type from a list of fields.
6386
+ static Struct_type*
6387
+ make_builtin_struct_type(int nfields, ...);
6389
+ // Make a builtin named type.
6390
+ static Named_type*
6391
+ make_builtin_named_type(const char* name, Type* type);
6395
traverse(Type*, Traverse*);
6396
@@ -1035,14 +1043,6 @@
6397
type_descriptor_constructor(Gogo*, int runtime_type_kind, Named_type*,
6398
const Methods*, bool only_value_methods);
6400
- // Make a builtin struct type from a list of fields.
6401
- static Struct_type*
6402
- make_builtin_struct_type(int nfields, ...);
6404
- // Make a builtin named type.
6405
- static Named_type*
6406
- make_builtin_named_type(const char* name, Type* type);
6408
// For the benefit of child class reflection string generation.
6410
append_reflection(const Type* type, Gogo* gogo, std::string* ret) const
6411
@@ -1796,7 +1796,7 @@
6413
do_traverse(Traverse*);
6415
- // A trampoline function has a pointer which matters for GC.
6416
+ // A function descriptor may be allocated on the heap.
6418
do_has_pointer() const
6420
Index: gcc/go/gofrontend/parse.cc
6421
===================================================================
6422
--- a/src/gcc/go/gofrontend/parse.cc (.../tags/gcc_4_8_1_release)
6423
+++ b/src/gcc/go/gofrontend/parse.cc (.../branches/gcc-4_8-branch)
6424
@@ -2627,7 +2627,11 @@
6425
Named_object* this_function = this->gogo_->current_function();
6426
Named_object* closure = this_function->func_value()->closure_var();
6428
- Enclosing_var ev(var, in_function, this->enclosing_vars_.size());
6429
+ // The last argument to the Enclosing_var constructor is the index
6430
+ // of this variable in the closure. We add 1 to the current number
6431
+ // of enclosed variables, because the first field in the closure
6432
+ // points to the function code.
6433
+ Enclosing_var ev(var, in_function, this->enclosing_vars_.size() + 1);
6434
std::pair<Enclosing_vars::iterator, bool> ins =
6435
this->enclosing_vars_.insert(ev);
6437
@@ -2882,8 +2886,9 @@
6438
// Create a closure for the nested function FUNCTION. This is based
6439
// on ENCLOSING_VARS, which is a list of all variables defined in
6440
// enclosing functions and referenced from FUNCTION. A closure is the
6441
-// address of a struct which contains the addresses of all the
6442
-// referenced variables. This returns NULL if no closure is required.
6443
+// address of a struct which point to the real function code and
6444
+// contains the addresses of all the referenced variables. This
6445
+// returns NULL if no closure is required.
6448
Parse::create_closure(Named_object* function, Enclosing_vars* enclosing_vars,
6449
@@ -2899,16 +2904,25 @@
6450
for (Enclosing_vars::const_iterator p = enclosing_vars->begin();
6451
p != enclosing_vars->end();
6453
- ev[p->index()] = *p;
6455
+ // Subtract 1 because index 0 is the function code.
6456
+ ev[p->index() - 1] = *p;
6459
// Build an initializer for a composite literal of the closure's
6462
Named_object* enclosing_function = this->gogo_->current_function();
6463
Expression_list* initializer = new Expression_list;
6465
+ initializer->push_back(Expression::make_func_code_reference(function,
6468
for (size_t i = 0; i < enclosing_var_count; ++i)
6470
- go_assert(ev[i].index() == i);
6471
+ // Add 1 to i because the first field in the closure is a
6472
+ // pointer to the function code.
6473
+ go_assert(ev[i].index() == i + 1);
6474
Named_object* var = ev[i].var();
6476
if (ev[i].in_function() == enclosing_function)
6477
Index: gcc/go/gofrontend/expressions.h
6478
===================================================================
6479
--- a/src/gcc/go/gofrontend/expressions.h (.../tags/gcc_4_8_1_release)
6480
+++ b/src/gcc/go/gofrontend/expressions.h (.../branches/gcc-4_8-branch)
6482
class Binary_expression;
6483
class Call_expression;
6484
class Func_expression;
6485
+class Func_descriptor_expression;
6486
class Unknown_expression;
6487
class Index_expression;
6488
class Map_index_expression;
6490
EXPRESSION_SET_AND_USE_TEMPORARY,
6492
EXPRESSION_FUNC_REFERENCE,
6493
+ EXPRESSION_FUNC_DESCRIPTOR,
6494
+ EXPRESSION_FUNC_CODE_REFERENCE,
6495
EXPRESSION_UNKNOWN_REFERENCE,
6498
@@ -150,10 +153,24 @@
6500
make_sink(Location);
6502
- // Make a reference to a function in an expression.
6503
+ // Make a reference to a function in an expression. This returns a
6504
+ // pointer to the struct holding the address of the function
6505
+ // followed by any closed-over variables.
6507
make_func_reference(Named_object*, Expression* closure, Location);
6509
+ // Make a function descriptor, an immutable struct with a single
6510
+ // field that points to the function code. This may only be used
6511
+ // with functions that do not have closures. FN is the function for
6512
+ // which we are making the descriptor.
6513
+ static Func_descriptor_expression*
6514
+ make_func_descriptor(Named_object* fn);
6516
+ // Make a reference to the code of a function. This is used to set
6517
+ // descriptor and closure fields.
6518
+ static Expression*
6519
+ make_func_code_reference(Named_object*, Location);
6521
// Make a reference to an unknown name. In a correct program this
6522
// will always be lowered to a real const/var/func reference.
6523
static Unknown_expression*
6524
@@ -523,6 +540,11 @@
6526
is_local_variable() const;
6528
+ // Make the builtin function descriptor type, so that it can be
6531
+ make_func_descriptor_type();
6533
// Traverse an expression.
6535
traverse(Expression**, Traverse*);
6536
@@ -1484,7 +1506,7 @@
6539
// Return the object associated with the function.
6540
- const Named_object*
6542
named_object() const
6543
{ return this->function_; }
6545
@@ -1494,9 +1516,9 @@
6547
{ return this->closure_; }
6549
- // Return a tree for this function without evaluating the closure.
6551
- get_tree_without_closure(Gogo*);
6552
+ // Return a tree for the code for a function.
6554
+ get_code_pointer(Gogo*, Named_object* function, Location loc);
6558
@@ -1532,11 +1554,68 @@
6559
// The function itself.
6560
Named_object* function_;
6561
// A closure. This is normally NULL. For a nested function, it may
6562
- // be a heap-allocated struct holding pointers to all the variables
6563
- // referenced by this function and defined in enclosing functions.
6564
+ // be a struct holding pointers to all the variables referenced by
6565
+ // this function and defined in enclosing functions.
6566
Expression* closure_;
6569
+// A function descriptor. A function descriptor is a struct with a
6570
+// single field pointing to the function code. This is used for
6571
+// functions without closures.
6573
+class Func_descriptor_expression : public Expression
6576
+ Func_descriptor_expression(Named_object* fn);
6578
+ // Set the descriptor wrapper.
6580
+ set_descriptor_wrapper(Named_object* dfn)
6582
+ go_assert(this->dfn_ == NULL);
6586
+ // Make the function descriptor type, so that it can be converted.
6588
+ make_func_descriptor_type();
6592
+ do_traverse(Traverse*);
6598
+ do_determine_type(const Type_context*)
6605
+ do_is_addressable() const
6609
+ do_get_tree(Translate_context*);
6612
+ do_dump_expression(Ast_dump_context* context) const;
6615
+ // The type of all function descriptors.
6616
+ static Type* descriptor_type;
6618
+ // The function for which this is the descriptor.
6619
+ Named_object* fn_;
6620
+ // The descriptor function.
6621
+ Named_object* dfn_;
6622
+ // The descriptor variable.
6626
// A reference to an unknown name.
6628
class Unknown_expression : public Parser_expression
6629
@@ -1847,7 +1926,7 @@
6630
Field_reference_expression(Expression* expr, unsigned int field_index,
6632
: Expression(EXPRESSION_FIELD_REFERENCE, location),
6633
- expr_(expr), field_index_(field_index), called_fieldtrack_(false)
6634
+ expr_(expr), field_index_(field_index), implicit_(false), called_fieldtrack_(false)
6637
// Return the struct expression.
6638
@@ -1860,6 +1939,15 @@
6640
{ return this->field_index_; }
6642
+ // Return whether this node was implied by an anonymous field.
6645
+ { return this->implicit_; }
6648
+ set_implicit(bool implicit)
6649
+ { this->implicit_ = implicit; }
6651
// Set the struct expression. This is used when parsing.
6653
set_struct_expression(Expression* expr)
6654
@@ -1914,6 +2002,9 @@
6656
// The zero-based index of the field we are retrieving.
6657
unsigned int field_index_;
6658
+ // Whether this node was emitted implicitly for an embedded field,
6659
+ // that is, expr_ is not the expr_ of the original user node.
6661
// Whether we have already emitted a fieldtrack call.
6662
bool called_fieldtrack_;
6664
Index: gcc/go/gofrontend/statements.cc
6665
===================================================================
6666
--- a/src/gcc/go/gofrontend/statements.cc (.../tags/gcc_4_8_1_release)
6667
+++ b/src/gcc/go/gofrontend/statements.cc (.../branches/gcc-4_8-branch)
6668
@@ -1707,8 +1707,8 @@
6669
this->expr_->discarding_value();
6672
-// An expression statement may fall through unless it is a call to a
6673
-// function which does not return.
6674
+// An expression statement is only a terminating statement if it is
6675
+// a call to panic.
6678
Expression_statement::do_may_fall_through() const
6679
@@ -1717,22 +1717,28 @@
6682
const Expression* fn = call->fn();
6683
- const Func_expression* fe = fn->func_expression();
6685
+ // panic is still an unknown named object.
6686
+ const Unknown_expression* ue = fn->unknown_expression();
6689
- const Named_object* no = fe->named_object();
6690
+ Named_object* no = ue->named_object();
6692
- Function_type* fntype;
6693
- if (no->is_function())
6694
- fntype = no->func_value()->type();
6695
- else if (no->is_function_declaration())
6696
- fntype = no->func_declaration_value()->type();
6699
+ if (no->is_unknown())
6700
+ no = no->unknown_value()->real_named_object();
6703
+ Function_type* fntype;
6704
+ if (no->is_function())
6705
+ fntype = no->func_value()->type();
6706
+ else if (no->is_function_declaration())
6707
+ fntype = no->func_declaration_value()->type();
6711
- // The builtin function panic does not return.
6712
- if (fntype != NULL && fntype->is_builtin() && no->name() == "panic")
6714
+ // The builtin function panic does not return.
6715
+ if (fntype != NULL && fntype->is_builtin() && no->name() == "panic")
6721
@@ -1953,12 +1959,17 @@
6722
&& results->begin()->type()->points_to() == NULL)))
6725
- // If this calls something which is not a simple function, then we
6726
+ // If this calls something that is not a simple function, then we
6728
Expression* fn = this->call_->call_expression()->fn();
6729
- if (fn->interface_field_reference_expression() != NULL)
6730
+ if (fn->func_expression() == NULL)
6733
+ // If the function uses a closure, then we need a thunk. FIXME: We
6734
+ // could accept a zero argument function with a closure.
6735
+ if (fn->func_expression()->closure() != NULL)
6741
@@ -2496,7 +2507,11 @@
6743
Call_expression* ce = this->call_->call_expression();
6746
+ Expression* fn = ce->fn();
6747
+ Func_expression* fe = fn->func_expression();
6748
+ go_assert(fe != NULL);
6749
+ *pfn = Expression::make_func_code_reference(fe->named_object(),
6752
const Expression_list* args = ce->args();
6753
if (args == NULL || args->empty())
6754
@@ -3700,9 +3715,6 @@
6756
do_check_types(Gogo*);
6759
- do_may_fall_through() const;
6762
do_get_backend(Translate_context*);
6764
@@ -3746,22 +3758,6 @@
6765
this->set_is_error();
6768
-// Return whether this switch may fall through.
6771
-Constant_switch_statement::do_may_fall_through() const
6773
- if (this->clauses_ == NULL)
6776
- // If we have a break label, then some case needed it. That implies
6777
- // that the switch statement as a whole can fall through.
6778
- if (this->break_label_ != NULL)
6781
- return this->clauses_->may_fall_through();
6784
// Convert to GENERIC.
6787
@@ -3911,6 +3907,22 @@
6788
ast_dump_context->ostream() << std::endl;
6791
+// Return whether this switch may fall through.
6794
+Switch_statement::do_may_fall_through() const
6796
+ if (this->clauses_ == NULL)
6799
+ // If we have a break label, then some case needed it. That implies
6800
+ // that the switch statement as a whole can fall through.
6801
+ if (this->break_label_ != NULL)
6804
+ return this->clauses_->may_fall_through();
6807
// Make a switch statement.
6810
@@ -4050,6 +4062,17 @@
6814
+// Return true if this type clause may fall through to the statements
6815
+// following the switch.
6818
+Type_case_clauses::Type_case_clause::may_fall_through() const
6820
+ if (this->statements_ == NULL)
6822
+ return this->statements_->may_fall_through();
6825
// Dump the AST representation for a type case clause
6828
@@ -4148,6 +4171,25 @@
6832
+// Return true if these clauses may fall through to the statements
6833
+// following the switch statement.
6836
+Type_case_clauses::may_fall_through() const
6838
+ bool found_default = false;
6839
+ for (Type_clauses::const_iterator p = this->clauses_.begin();
6840
+ p != this->clauses_.end();
6843
+ if (p->may_fall_through())
6845
+ if (p->is_default())
6846
+ found_default = true;
6848
+ return !found_default;
6851
// Dump the AST representation for case clauses (from a switch statement)
6854
@@ -4237,6 +4279,22 @@
6855
return Statement::make_block_statement(b, loc);
6858
+// Return whether this switch may fall through.
6861
+Type_switch_statement::do_may_fall_through() const
6863
+ if (this->clauses_ == NULL)
6866
+ // If we have a break label, then some case needed it. That implies
6867
+ // that the switch statement as a whole can fall through.
6868
+ if (this->break_label_ != NULL)
6871
+ return this->clauses_->may_fall_through();
6874
// Return the break label for this type switch statement, creating it
6877
@@ -4954,6 +5012,19 @@
6878
return Statement::make_block_statement(b, loc);
6881
+// Whether the select statement itself may fall through to the following
6885
+Select_statement::do_may_fall_through() const
6887
+ // A select statement is terminating if no break statement
6888
+ // refers to it and all of its clauses are terminating.
6889
+ if (this->break_label_ != NULL)
6891
+ return this->clauses_->may_fall_through();
6894
// Return the backend representation for a select statement.
6897
@@ -5114,6 +5185,20 @@
6898
this->continue_label_ = continue_label;
6901
+// Whether the overall statement may fall through.
6904
+For_statement::do_may_fall_through() const
6906
+ // A for loop is terminating if it has no condition and
6907
+ // no break statement.
6908
+ if(this->cond_ != NULL)
6910
+ if(this->break_label_ != NULL)
6915
// Dump the AST representation for a for statement.
6918
Index: gcc/go/gofrontend/gogo-tree.cc
6919
===================================================================
6920
--- a/src/gcc/go/gofrontend/gogo-tree.cc (.../tags/gcc_4_8_1_release)
6921
+++ b/src/gcc/go/gofrontend/gogo-tree.cc (.../branches/gcc-4_8-branch)
6922
@@ -755,6 +755,18 @@
6923
this->build_interface_method_tables();
6925
Bindings* bindings = this->current_bindings();
6927
+ for (Bindings::const_declarations_iterator p = bindings->begin_declarations();
6928
+ p != bindings->end_declarations();
6931
+ // If any function declarations needed a descriptor, make sure
6933
+ Named_object* no = p->second;
6934
+ if (no->is_function_declaration())
6935
+ no->func_declaration_value()->build_backend_descriptor(this);
6938
size_t count_definitions = bindings->size_definitions();
6939
size_t count = count_definitions;
6943
Named_object* no = *p;
6945
+ go_assert(i < count);
6947
go_assert(!no->is_type_declaration() && !no->is_function_declaration());
6948
// There is nothing to do for a package.
6949
if (no->is_package())
6950
@@ -815,6 +829,14 @@
6954
+ // Skip blank named functions.
6955
+ if (no->is_function() && no->func_value()->is_sink())
6962
if (!no->is_variable())
6964
vec[i] = no->get_tree(this, NULL);
6965
@@ -1255,14 +1277,47 @@
6966
if (this->fndecl_ == NULL_TREE)
6968
tree functype = type_to_tree(this->type_->get_backend(gogo));
6970
+ if (functype != error_mark_node)
6972
+ // The type of a function comes back as a pointer to a
6973
+ // struct whose first field is the function, but we want the
6974
+ // real function type for a function declaration.
6975
+ go_assert(POINTER_TYPE_P(functype)
6976
+ && TREE_CODE(TREE_TYPE(functype)) == RECORD_TYPE);
6977
+ functype = TREE_TYPE(TYPE_FIELDS(TREE_TYPE(functype)));
6978
+ go_assert(FUNCTION_POINTER_TYPE_P(functype));
6979
+ functype = TREE_TYPE(functype);
6981
+ // In the struct, the function type always has a trailing
6982
+ // closure argument. For the function body, we only use
6983
+ // that trailing arg if this is a function literal or if it
6984
+ // is a wrapper created to store in a descriptor. Remove it
6986
+ if (this->enclosing_ == NULL && !this->is_descriptor_wrapper_)
6988
+ tree old_params = TYPE_ARG_TYPES(functype);
6989
+ go_assert(old_params != NULL_TREE
6990
+ && old_params != void_list_node);
6991
+ tree new_params = NULL_TREE;
6992
+ tree *pp = &new_params;
6993
+ while (TREE_CHAIN (old_params) != void_list_node)
6995
+ tree p = TREE_VALUE(old_params);
6996
+ go_assert(TYPE_P(p));
6997
+ *pp = tree_cons(NULL_TREE, p, NULL_TREE);
6998
+ pp = &TREE_CHAIN(*pp);
6999
+ old_params = TREE_CHAIN (old_params);
7001
+ *pp = void_list_node;
7002
+ functype = build_function_type(TREE_TYPE(functype), new_params);
7006
if (functype == error_mark_node)
7007
this->fndecl_ = error_mark_node;
7010
- // The type of a function comes back as a pointer, but we
7011
- // want the real function type for a function declaration.
7012
- go_assert(POINTER_TYPE_P(functype));
7013
- functype = TREE_TYPE(functype);
7014
tree decl = build_decl(this->location().gcc_location(), FUNCTION_DECL,
7017
@@ -1308,9 +1363,6 @@
7018
DECL_CONTEXT(resdecl) = decl;
7019
DECL_RESULT(decl) = resdecl;
7021
- if (this->enclosing_ != NULL)
7022
- DECL_STATIC_CHAIN(decl) = 1;
7024
// If a function calls the predeclared recover function, we
7025
// can't inline it, because recover behaves differently in a
7026
// function passed directly to defer. If this is a recover
7027
@@ -1333,29 +1385,6 @@
7028
resolve_unique_section (decl, 0, 1);
7030
go_preserve_from_gc(decl);
7032
- if (this->closure_var_ != NULL)
7034
- push_struct_function(decl);
7036
- Bvariable* bvar = this->closure_var_->get_backend_variable(gogo,
7038
- tree closure_decl = var_to_tree(bvar);
7039
- if (closure_decl == error_mark_node)
7040
- this->fndecl_ = error_mark_node;
7043
- DECL_ARTIFICIAL(closure_decl) = 1;
7044
- DECL_IGNORED_P(closure_decl) = 1;
7045
- TREE_USED(closure_decl) = 1;
7046
- DECL_ARG_TYPE(closure_decl) = TREE_TYPE(closure_decl);
7047
- TREE_READONLY(closure_decl) = 1;
7049
- DECL_STRUCT_FUNCTION(decl)->static_chain_decl = closure_decl;
7056
return this->fndecl_;
7057
@@ -1382,15 +1411,44 @@
7060
tree functype = type_to_tree(this->fntype_->get_backend(gogo));
7062
+ if (functype != error_mark_node)
7064
+ // The type of a function comes back as a pointer to a
7065
+ // struct whose first field is the function, but we want the
7066
+ // real function type for a function declaration.
7067
+ go_assert(POINTER_TYPE_P(functype)
7068
+ && TREE_CODE(TREE_TYPE(functype)) == RECORD_TYPE);
7069
+ functype = TREE_TYPE(TYPE_FIELDS(TREE_TYPE(functype)));
7070
+ go_assert(FUNCTION_POINTER_TYPE_P(functype));
7071
+ functype = TREE_TYPE(functype);
7073
+ // In the struct, the function type always has a trailing
7074
+ // closure argument. Here we are referring to the function
7075
+ // code directly, and we know it is not a function literal,
7076
+ // and we know it is not a wrapper created to store in a
7077
+ // descriptor. Remove that trailing argument.
7078
+ tree old_params = TYPE_ARG_TYPES(functype);
7079
+ go_assert(old_params != NULL_TREE && old_params != void_list_node);
7080
+ tree new_params = NULL_TREE;
7081
+ tree *pp = &new_params;
7082
+ while (TREE_CHAIN (old_params) != void_list_node)
7084
+ tree p = TREE_VALUE(old_params);
7085
+ go_assert(TYPE_P(p));
7086
+ *pp = tree_cons(NULL_TREE, p, NULL_TREE);
7087
+ pp = &TREE_CHAIN(*pp);
7088
+ old_params = TREE_CHAIN (old_params);
7090
+ *pp = void_list_node;
7091
+ functype = build_function_type(TREE_TYPE(functype), new_params);
7095
if (functype == error_mark_node)
7096
decl = error_mark_node;
7099
- // The type of a function comes back as a pointer, but we
7100
- // want the real function type for a function declaration.
7101
- go_assert(POINTER_TYPE_P(functype));
7102
- functype = TREE_TYPE(functype);
7103
decl = build_decl(this->location().gcc_location(), FUNCTION_DECL, id,
7105
TREE_PUBLIC(decl) = 1;
7106
@@ -1599,6 +1657,32 @@
7111
+ // The closure variable is passed last, if this is a function
7112
+ // literal or a descriptor wrapper.
7113
+ if (this->closure_var_ != NULL)
7116
+ this->closure_var_->get_backend_variable(gogo, named_function);
7117
+ tree var_decl = var_to_tree(bvar);
7118
+ if (var_decl != error_mark_node)
7120
+ go_assert(TREE_CODE(var_decl) == PARM_DECL);
7122
+ pp = &DECL_CHAIN(*pp);
7125
+ else if (this->enclosing_ != NULL || this->is_descriptor_wrapper_)
7127
+ tree parm_decl = build_decl(this->location_.gcc_location(), PARM_DECL,
7128
+ get_identifier("$closure"),
7129
+ const_ptr_type_node);
7130
+ DECL_CONTEXT(parm_decl) = current_function_decl;
7131
+ DECL_ARG_TYPE(parm_decl) = const_ptr_type_node;
7133
+ pp = &DECL_CHAIN(*pp);
7138
DECL_ARGUMENTS(fndecl) = params;
7139
@@ -1681,6 +1765,13 @@
7141
DECL_SAVED_TREE(fndecl) = code;
7144
+ // If we created a descriptor for the function, make sure we emit it.
7145
+ if (this->descriptor_ != NULL)
7147
+ Translate_context context(gogo, NULL, NULL, NULL);
7148
+ this->descriptor_->get_tree(&context);
7152
// Build the wrappers around function code needed if the function has
7153
@@ -1844,6 +1935,20 @@
7157
+// Build the descriptor for a function declaration. This won't
7158
+// necessarily happen if the package has just a declaration for the
7159
+// function and no other reference to it, but we may still need the
7160
+// descriptor for references from other packages.
7162
+Function_declaration::build_backend_descriptor(Gogo* gogo)
7164
+ if (this->descriptor_ != NULL)
7166
+ Translate_context context(gogo, NULL, NULL, NULL);
7167
+ this->descriptor_->get_tree(&context);
7171
// Return the integer type to use for a size.
7174
@@ -2437,70 +2542,3 @@
7175
build2(COMPOUND_EXPR, type_tree, call, tmp));
7179
-// Return the type of a function trampoline. This is like
7180
-// get_trampoline_type in tree-nested.c.
7183
-Gogo::trampoline_type_tree()
7185
- static tree type_tree;
7186
- if (type_tree == NULL_TREE)
7188
- unsigned int size;
7189
- unsigned int align;
7190
- go_trampoline_info(&size, &align);
7191
- tree t = build_index_type(build_int_cst(integer_type_node, size - 1));
7192
- t = build_array_type(char_type_node, t);
7194
- type_tree = Gogo::builtin_struct(NULL, "__go_trampoline", NULL_TREE, 1,
7196
- t = TYPE_FIELDS(type_tree);
7197
- DECL_ALIGN(t) = align;
7198
- DECL_USER_ALIGN(t) = 1;
7200
- go_preserve_from_gc(type_tree);
7205
-// Make a trampoline which calls FNADDR passing CLOSURE.
7208
-Gogo::make_trampoline(tree fnaddr, tree closure, Location location)
7210
- tree trampoline_type = Gogo::trampoline_type_tree();
7211
- tree trampoline_size = TYPE_SIZE_UNIT(trampoline_type);
7213
- closure = save_expr(closure);
7215
- // We allocate the trampoline using a special function which will
7216
- // mark it as executable.
7217
- static tree trampoline_fndecl;
7218
- tree x = Gogo::call_builtin(&trampoline_fndecl,
7220
- "__go_allocate_trampoline",
7226
- fold_convert_loc(location.gcc_location(),
7227
- ptr_type_node, closure));
7228
- if (x == error_mark_node)
7229
- return error_mark_node;
7233
- // Initialize the trampoline.
7234
- tree calldecl = builtin_decl_implicit(BUILT_IN_INIT_HEAP_TRAMPOLINE);
7235
- tree ini = build_call_expr(calldecl, 3, x, fnaddr, closure);
7237
- // On some targets the trampoline address needs to be adjusted. For
7238
- // example, when compiling in Thumb mode on the ARM, the address
7239
- // needs to have the low bit set.
7240
- x = build_call_expr(builtin_decl_explicit(BUILT_IN_ADJUST_TRAMPOLINE), 1, x);
7241
- x = fold_convert(TREE_TYPE(fnaddr), x);
7243
- return build2(COMPOUND_EXPR, TREE_TYPE(x), ini, x);
7245
Index: gcc/go/gofrontend/statements.h
7246
===================================================================
7247
--- a/src/gcc/go/gofrontend/statements.h (.../tags/gcc_4_8_1_release)
7248
+++ b/src/gcc/go/gofrontend/statements.h (.../branches/gcc-4_8-branch)
7250
{ this->clauses_->check_types(); }
7253
- do_may_fall_through() const
7254
- { return this->clauses_->may_fall_through(); }
7255
+ do_may_fall_through() const;
7258
do_get_backend(Translate_context*);
7259
@@ -1086,6 +1085,9 @@
7261
do_lower(Gogo*, Named_object*, Block*, Statement_inserter*);
7264
+ do_may_fall_through() const;
7267
do_get_backend(Translate_context*)
7268
{ go_unreachable(); }
7269
@@ -1399,6 +1401,9 @@
7271
do_dump_statement(Ast_dump_context*) const;
7274
+ do_may_fall_through() const;
7277
// The value to switch on. This may be NULL.
7279
@@ -1449,6 +1454,11 @@
7280
lower(Type*, Block*, Temporary_statement* descriptor_temp,
7281
Unnamed_label* break_label) const;
7283
+ // Return true if these clauses may fall through to the statements
7284
+ // following the switch statement.
7286
+ may_fall_through() const;
7288
// Dump the AST representation to a dump context.
7290
dump_clauses(Ast_dump_context*) const;
7291
@@ -1493,6 +1503,12 @@
7292
lower(Type*, Block*, Temporary_statement* descriptor_temp,
7293
Unnamed_label* break_label, Unnamed_label** stmts_label) const;
7295
+ // Return true if this clause may fall through to execute the
7296
+ // statements following the switch statement. This is not the
7297
+ // same as whether this clause falls through to the next clause.
7299
+ may_fall_through() const;
7301
// Dump the AST representation to a dump context.
7303
dump_clause(Ast_dump_context*) const;
7304
@@ -1556,6 +1572,9 @@
7306
do_dump_statement(Ast_dump_context*) const;
7309
+ do_may_fall_through() const;
7312
// The variable holding the value we are switching on.
7314
Index: gcc/go/gofrontend/backend.h
7315
===================================================================
7316
--- a/src/gcc/go/gofrontend/backend.h (.../tags/gcc_4_8_1_release)
7317
+++ b/src/gcc/go/gofrontend/backend.h (.../branches/gcc-4_8-branch)
7320
// Get a function type. The receiver, parameter, and results are
7321
// generated from the types in the Function_type. The Function_type
7322
- // is provided so that the names are available.
7323
+ // is provided so that the names are available. This should return
7324
+ // not the type of a Go function (which is a pointer to a struct)
7325
+ // but the type of a C function pointer (which will be used as the
7326
+ // type of the first field of the struct).
7328
function_type(const Btyped_identifier& receiver,
7329
const std::vector<Btyped_identifier>& parameters,
7330
@@ -388,18 +391,22 @@
7331
Bstatement** pstatement) = 0;
7333
// Create a named immutable initialized data structure. This is
7334
- // used for type descriptors and map descriptors. This returns a
7335
- // Bvariable because it corresponds to an initialized const global
7337
+ // used for type descriptors, map descriptors, and function
7338
+ // descriptors. This returns a Bvariable because it corresponds to
7339
+ // an initialized const variable in C.
7341
// NAME is the name to use for the initialized global variable which
7342
// this call will create.
7344
+ // IS_HIDDEN will be true if the descriptor should only be visible
7345
+ // within the current object.
7347
// IS_COMMON is true if NAME may be defined by several packages, and
7348
// the linker should merge all such definitions. If IS_COMMON is
7349
// false, NAME should be defined in only one file. In general
7350
// IS_COMMON will be true for the type descriptor of an unnamed type
7351
- // or a builtin type.
7352
+ // or a builtin type. IS_HIDDEN and IS_COMMON will never both be
7355
// TYPE will be a struct type; the type of the returned expression
7356
// must be a pointer to this struct type.
7357
@@ -409,20 +416,20 @@
7358
// address. After calling this the frontend will call
7359
// immutable_struct_set_init.
7361
- immutable_struct(const std::string& name, bool is_common, Btype* type,
7363
+ immutable_struct(const std::string& name, bool is_hidden, bool is_common,
7364
+ Btype* type, Location) = 0;
7366
// Set the initial value of a variable created by immutable_struct.
7367
- // The NAME, IS_COMMON, TYPE, and location parameters are the same
7368
- // ones passed to immutable_struct. INITIALIZER will be a composite
7369
- // literal of type TYPE. It will not contain any function calls or
7370
- // anything else which can not be put into a read-only data section.
7371
- // It may contain the address of variables created by
7372
+ // The NAME, IS_HIDDEN, IS_COMMON, TYPE, and location parameters are
7373
+ // the same ones passed to immutable_struct. INITIALIZER will be a
7374
+ // composite literal of type TYPE. It will not contain any function
7375
+ // calls or anything else that can not be put into a read-only data
7376
+ // section. It may contain the address of variables created by
7377
// immutable_struct.
7379
immutable_struct_set_init(Bvariable*, const std::string& name,
7380
- bool is_common, Btype* type, Location,
7381
- Bexpression* initializer) = 0;
7382
+ bool is_hidden, bool is_common, Btype* type,
7383
+ Location, Bexpression* initializer) = 0;
7385
// Create a reference to a named immutable initialized data
7386
// structure defined in some other package. This will be a
7387
Index: gcc/go/gofrontend/types.cc
7388
===================================================================
7389
--- a/src/gcc/go/gofrontend/types.cc (.../tags/gcc_4_8_1_release)
7390
+++ b/src/gcc/go/gofrontend/types.cc (.../branches/gcc-4_8-branch)
7391
@@ -1298,8 +1298,8 @@
7392
// converting INITIALIZER.
7394
this->type_descriptor_var_ =
7395
- gogo->backend()->immutable_struct(var_name, is_common, initializer_btype,
7397
+ gogo->backend()->immutable_struct(var_name, false, is_common,
7398
+ initializer_btype, loc);
7400
*phash = this->type_descriptor_var_;
7402
@@ -1308,7 +1308,7 @@
7403
Bexpression* binitializer = tree_to_expr(initializer->get_tree(&context));
7405
gogo->backend()->immutable_struct_set_init(this->type_descriptor_var_,
7406
- var_name, is_common,
7407
+ var_name, false, is_common,
7408
initializer_btype, loc,
7411
@@ -1528,26 +1528,6 @@
7413
// The type descriptor type.
7415
- Typed_identifier_list* params = new Typed_identifier_list();
7416
- params->push_back(Typed_identifier("key", unsafe_pointer_type, bloc));
7417
- params->push_back(Typed_identifier("key_size", uintptr_type, bloc));
7419
- Typed_identifier_list* results = new Typed_identifier_list();
7420
- results->push_back(Typed_identifier("", uintptr_type, bloc));
7422
- Type* hashfn_type = Type::make_function_type(NULL, params, results, bloc);
7424
- params = new Typed_identifier_list();
7425
- params->push_back(Typed_identifier("key1", unsafe_pointer_type, bloc));
7426
- params->push_back(Typed_identifier("key2", unsafe_pointer_type, bloc));
7427
- params->push_back(Typed_identifier("key_size", uintptr_type, bloc));
7429
- results = new Typed_identifier_list();
7430
- results->push_back(Typed_identifier("", Type::lookup_bool_type(), bloc));
7432
- Type* equalfn_type = Type::make_function_type(NULL, params, results,
7435
Struct_type* type_descriptor_type =
7436
Type::make_builtin_struct_type(10,
7438
@@ -1555,8 +1535,8 @@
7439
"fieldAlign", uint8_type,
7440
"size", uintptr_type,
7441
"hash", uint32_type,
7442
- "hashfn", hashfn_type,
7443
- "equalfn", equalfn_type,
7444
+ "hashfn", uintptr_type,
7445
+ "equalfn", uintptr_type,
7446
"string", pointer_string_type,
7447
"", pointer_uncommon_type,
7449
@@ -1946,8 +1926,8 @@
7450
Named_object* equal_fn;
7451
this->type_functions(gogo, name, hash_fntype, equal_fntype, &hash_fn,
7453
- vals->push_back(Expression::make_func_reference(hash_fn, NULL, bloc));
7454
- vals->push_back(Expression::make_func_reference(equal_fn, NULL, bloc));
7455
+ vals->push_back(Expression::make_func_code_reference(hash_fn, bloc));
7456
+ vals->push_back(Expression::make_func_code_reference(equal_fn, bloc));
7459
go_assert(p->is_field_name("string"));
7460
@@ -2207,7 +2187,7 @@
7463
go_assert(p->is_field_name("tfn"));
7464
- vals->push_back(Expression::make_func_reference(no, NULL, bloc));
7465
+ vals->push_back(Expression::make_func_code_reference(no, bloc));
7468
go_assert(p == fields->end());
7469
@@ -3407,6 +3387,18 @@
7471
Function_type::do_get_backend(Gogo* gogo)
7473
+ // When we do anything with a function value other than call it, it
7474
+ // is represented as a pointer to a struct whose first field is the
7475
+ // actual function. So that is what we return as the type of a Go
7476
+ // function. The function stored in the first field always that
7477
+ // takes one additional trailing argument: the closure pointer. For
7478
+ // a top-level function, this additional argument will only be
7479
+ // passed when invoking the function indirectly, via the struct.
7481
+ Location loc = this->location();
7482
+ Btype* struct_type = gogo->backend()->placeholder_struct_type("", loc);
7483
+ Btype* ptr_struct_type = gogo->backend()->pointer_type(struct_type);
7485
Backend::Btyped_identifier breceiver;
7486
if (this->receiver_ != NULL)
7488
@@ -3422,9 +3414,15 @@
7491
std::vector<Backend::Btyped_identifier> bparameters;
7492
- if (this->parameters_ != NULL)
7494
+ if (this->parameters_ == NULL)
7496
- bparameters.resize(this->parameters_->size());
7497
+ bparameters.resize(1);
7502
+ bparameters.resize(this->parameters_->size() + 1);
7504
for (Typed_identifier_list::const_iterator p = this->parameters_->begin();
7505
p != this->parameters_->end();
7506
@@ -3434,8 +3432,12 @@
7507
bparameters[i].btype = p->type()->get_backend(gogo);
7508
bparameters[i].location = p->location();
7510
- go_assert(i == bparameters.size());
7513
+ go_assert(last + 1 == bparameters.size());
7514
+ bparameters[last].name = "$closure";
7515
+ bparameters[last].btype = ptr_struct_type;
7516
+ bparameters[last].location = loc;
7518
std::vector<Backend::Btyped_identifier> bresults;
7519
if (this->results_ != NULL)
7520
@@ -3453,8 +3455,15 @@
7521
go_assert(i == bresults.size());
7524
- return gogo->backend()->function_type(breceiver, bparameters, bresults,
7525
- this->location());
7526
+ Btype* fntype = gogo->backend()->function_type(breceiver, bparameters,
7528
+ std::vector<Backend::Btyped_identifier> fields(1);
7529
+ fields[0].name = "code";
7530
+ fields[0].btype = fntype;
7531
+ fields[0].location = loc;
7532
+ if (!gogo->backend()->set_placeholder_struct_type(struct_type, fields))
7533
+ return gogo->backend()->error_type();
7534
+ return ptr_struct_type;
7537
// The type of a function type descriptor.
7538
@@ -4532,6 +4541,7 @@
7539
go_assert(sub != NULL);
7541
sub->set_struct_expression(here);
7542
+ sub->set_implicit(true);
7544
else if (subdepth > found_depth)
7546
@@ -6227,7 +6237,8 @@
7548
std::string mangled_name = "__go_map_" + this->mangled_name(gogo);
7549
Btype* map_descriptor_btype = map_descriptor_type->get_backend(gogo);
7550
- Bvariable* bvar = gogo->backend()->immutable_struct(mangled_name, true,
7551
+ Bvariable* bvar = gogo->backend()->immutable_struct(mangled_name, false,
7553
map_descriptor_btype,
7556
@@ -6235,7 +6246,7 @@
7557
context.set_is_const();
7558
Bexpression* binitializer = tree_to_expr(initializer->get_tree(&context));
7560
- gogo->backend()->immutable_struct_set_init(bvar, mangled_name, true,
7561
+ gogo->backend()->immutable_struct_set_init(bvar, mangled_name, false, true,
7562
map_descriptor_btype, bloc,
7565
Index: gcc/go/gofrontend/expressions.cc
7566
===================================================================
7567
--- a/src/gcc/go/gofrontend/expressions.cc (.../tags/gcc_4_8_1_release)
7568
+++ b/src/gcc/go/gofrontend/expressions.cc (.../branches/gcc-4_8-branch)
7569
@@ -1255,17 +1255,16 @@
7573
-// Get the tree for a function expression without evaluating the
7575
+// Get the tree for the code of a function expression.
7578
-Func_expression::get_tree_without_closure(Gogo* gogo)
7579
+Func_expression::get_code_pointer(Gogo* gogo, Named_object* no, Location loc)
7581
Function_type* fntype;
7582
- if (this->function_->is_function())
7583
- fntype = this->function_->func_value()->type();
7584
- else if (this->function_->is_function_declaration())
7585
- fntype = this->function_->func_declaration_value()->type();
7586
+ if (no->is_function())
7587
+ fntype = no->func_value()->type();
7588
+ else if (no->is_function_declaration())
7589
+ fntype = no->func_declaration_value()->type();
7593
@@ -1273,14 +1272,12 @@
7594
// can't take their address.
7595
if (fntype->is_builtin())
7597
- error_at(this->location(),
7599
"invalid use of special builtin function %qs; must be called",
7600
- this->function_->name().c_str());
7601
+ no->message_name().c_str());
7602
return error_mark_node;
7605
- Named_object* no = this->function_;
7607
tree id = no->get_id(gogo);
7608
if (id == error_mark_node)
7609
return error_mark_node;
7610
@@ -1296,46 +1293,55 @@
7611
if (fndecl == error_mark_node)
7612
return error_mark_node;
7614
- return build_fold_addr_expr_loc(this->location().gcc_location(), fndecl);
7615
+ return build_fold_addr_expr_loc(loc.gcc_location(), fndecl);
7618
// Get the tree for a function expression. This is used when we take
7619
-// the address of a function rather than simply calling it. If the
7620
-// function has a closure, we must use a trampoline.
7621
+// the address of a function rather than simply calling it. A func
7622
+// value is represented as a pointer to a block of memory. The first
7623
+// word of that memory is a pointer to the function code. The
7624
+// remaining parts of that memory are the addresses of variables that
7625
+// the function closes over.
7628
Func_expression::do_get_tree(Translate_context* context)
7630
- Gogo* gogo = context->gogo();
7631
+ // If there is no closure, just use the function descriptor.
7632
+ if (this->closure_ == NULL)
7634
+ Gogo* gogo = context->gogo();
7635
+ Named_object* no = this->function_;
7636
+ Expression* descriptor;
7637
+ if (no->is_function())
7638
+ descriptor = no->func_value()->descriptor(gogo, no);
7639
+ else if (no->is_function_declaration())
7641
+ if (no->func_declaration_value()->type()->is_builtin())
7643
+ error_at(this->location(),
7644
+ ("invalid use of special builtin function %qs; "
7645
+ "must be called"),
7646
+ no->message_name().c_str());
7647
+ return error_mark_node;
7649
+ descriptor = no->func_declaration_value()->descriptor(gogo, no);
7654
- tree fnaddr = this->get_tree_without_closure(gogo);
7655
- if (fnaddr == error_mark_node)
7656
- return error_mark_node;
7657
+ tree dtree = descriptor->get_tree(context);
7658
+ if (dtree == error_mark_node)
7659
+ return error_mark_node;
7660
+ return build_fold_addr_expr_loc(this->location().gcc_location(), dtree);
7663
- go_assert(TREE_CODE(fnaddr) == ADDR_EXPR
7664
- && TREE_CODE(TREE_OPERAND(fnaddr, 0)) == FUNCTION_DECL);
7665
- TREE_ADDRESSABLE(TREE_OPERAND(fnaddr, 0)) = 1;
7667
- // If there is no closure, that is all have to do.
7668
- if (this->closure_ == NULL)
7671
go_assert(this->function_->func_value()->enclosing() != NULL);
7673
- // Get the value of the closure. This will be a pointer to space
7674
- // allocated on the heap.
7675
- tree closure_tree = this->closure_->get_tree(context);
7676
- if (closure_tree == error_mark_node)
7677
- return error_mark_node;
7678
- go_assert(POINTER_TYPE_P(TREE_TYPE(closure_tree)));
7680
- // Now we need to build some code on the heap. This code will load
7681
- // the static chain pointer with the closure and then jump to the
7682
- // body of the function. The normal gcc approach is to build the
7683
- // code on the stack. Unfortunately we can not do that, as Go
7684
- // permits us to return the function pointer.
7686
- return gogo->make_trampoline(fnaddr, closure_tree, this->location());
7687
+ // If there is a closure, then the closure is itself the function
7688
+ // expression. It is a pointer to a struct whose first field points
7689
+ // to the function code and whose remaining fields are the addresses
7690
+ // of the closed-over variables.
7691
+ return this->closure_->get_tree(context);
7694
// Ast dump for function.
7695
@@ -1361,6 +1367,197 @@
7696
return new Func_expression(function, closure, location);
7699
+// Class Func_descriptor_expression.
7703
+Func_descriptor_expression::Func_descriptor_expression(Named_object* fn)
7704
+ : Expression(EXPRESSION_FUNC_DESCRIPTOR, fn->location()),
7705
+ fn_(fn), dfn_(NULL), dvar_(NULL)
7707
+ go_assert(!fn->is_function() || !fn->func_value()->needs_closure());
7713
+Func_descriptor_expression::do_traverse(Traverse*)
7715
+ return TRAVERSE_CONTINUE;
7718
+// All function descriptors have the same type.
7720
+Type* Func_descriptor_expression::descriptor_type;
7723
+Func_descriptor_expression::make_func_descriptor_type()
7725
+ if (Func_descriptor_expression::descriptor_type != NULL)
7727
+ Type* uintptr_type = Type::lookup_integer_type("uintptr");
7728
+ Type* struct_type = Type::make_builtin_struct_type(1, "code", uintptr_type);
7729
+ Func_descriptor_expression::descriptor_type =
7730
+ Type::make_builtin_named_type("functionDescriptor", struct_type);
7734
+Func_descriptor_expression::do_type()
7736
+ Func_descriptor_expression::make_func_descriptor_type();
7737
+ return Func_descriptor_expression::descriptor_type;
7740
+// Copy a Func_descriptor_expression;
7743
+Func_descriptor_expression::do_copy()
7745
+ Func_descriptor_expression* fde =
7746
+ Expression::make_func_descriptor(this->fn_);
7747
+ if (this->dfn_ != NULL)
7748
+ fde->set_descriptor_wrapper(this->dfn_);
7752
+// The tree for a function descriptor.
7755
+Func_descriptor_expression::do_get_tree(Translate_context* context)
7757
+ if (this->dvar_ != NULL)
7758
+ return var_to_tree(this->dvar_);
7760
+ Gogo* gogo = context->gogo();
7761
+ Named_object* no = this->fn_;
7762
+ Location loc = no->location();
7764
+ std::string var_name;
7765
+ if (no->package() == NULL)
7766
+ var_name = gogo->pkgpath_symbol();
7768
+ var_name = no->package()->pkgpath_symbol();
7769
+ var_name.push_back('.');
7770
+ var_name.append(Gogo::unpack_hidden_name(no->name()));
7771
+ var_name.append("$descriptor");
7773
+ Btype* btype = this->type()->get_backend(gogo);
7776
+ if (no->package() != NULL
7777
+ || Linemap::is_predeclared_location(no->location()))
7779
+ bvar = context->backend()->immutable_struct_reference(var_name, btype,
7781
+ go_assert(this->dfn_ == NULL);
7785
+ Location bloc = Linemap::predeclared_location();
7786
+ bool is_hidden = ((no->is_function()
7787
+ && no->func_value()->enclosing() != NULL)
7788
+ || Gogo::is_thunk(no));
7789
+ bvar = context->backend()->immutable_struct(var_name, is_hidden, false,
7791
+ Expression_list* vals = new Expression_list();
7792
+ go_assert(this->dfn_ != NULL);
7793
+ vals->push_back(Expression::make_func_code_reference(this->dfn_, bloc));
7794
+ Expression* init =
7795
+ Expression::make_struct_composite_literal(this->type(), vals, bloc);
7796
+ Translate_context bcontext(gogo, NULL, NULL, NULL);
7797
+ bcontext.set_is_const();
7798
+ Bexpression* binit = tree_to_expr(init->get_tree(&bcontext));
7799
+ context->backend()->immutable_struct_set_init(bvar, var_name, is_hidden,
7800
+ false, btype, bloc, binit);
7803
+ this->dvar_ = bvar;
7804
+ return var_to_tree(bvar);
7807
+// Print a function descriptor expression.
7810
+Func_descriptor_expression::do_dump_expression(Ast_dump_context* context) const
7812
+ context->ostream() << "[descriptor " << this->fn_->name() << "]";
7815
+// Make a function descriptor expression.
7817
+Func_descriptor_expression*
7818
+Expression::make_func_descriptor(Named_object* fn)
7820
+ return new Func_descriptor_expression(fn);
7823
+// Make the function descriptor type, so that it can be converted.
7826
+Expression::make_func_descriptor_type()
7828
+ Func_descriptor_expression::make_func_descriptor_type();
7831
+// A reference to just the code of a function.
7833
+class Func_code_reference_expression : public Expression
7836
+ Func_code_reference_expression(Named_object* function, Location location)
7837
+ : Expression(EXPRESSION_FUNC_CODE_REFERENCE, location),
7838
+ function_(function)
7843
+ do_traverse(Traverse*)
7844
+ { return TRAVERSE_CONTINUE; }
7848
+ { return Type::make_pointer_type(Type::make_void_type()); }
7851
+ do_determine_type(const Type_context*)
7857
+ return Expression::make_func_code_reference(this->function_,
7858
+ this->location());
7862
+ do_get_tree(Translate_context*);
7865
+ do_dump_expression(Ast_dump_context* context) const
7866
+ { context->ostream() << "[raw " << this->function_->name() << "]" ; }
7870
+ Named_object* function_;
7873
+// Get the tree for a reference to function code.
7876
+Func_code_reference_expression::do_get_tree(Translate_context* context)
7878
+ return Func_expression::get_code_pointer(context->gogo(), this->function_,
7879
+ this->location());
7882
+// Make a reference to the code of a function.
7885
+Expression::make_func_code_reference(Named_object* function, Location location)
7887
+ return new Func_code_reference_expression(function, location);
7890
// Class Unknown_expression.
7892
// Return the name of an unknown expression.
7893
@@ -6722,6 +6919,26 @@
7894
return Expression::make_error(loc);
7897
+ if (this->code_ == BUILTIN_OFFSETOF)
7899
+ Expression* arg = this->one_arg();
7900
+ Field_reference_expression* farg = arg->field_reference_expression();
7901
+ while (farg != NULL)
7903
+ if (!farg->implicit())
7905
+ // When the selector refers to an embedded field,
7906
+ // it must not be reached through pointer indirections.
7907
+ if (farg->expr()->deref() != farg->expr())
7909
+ this->report_error(_("argument of Offsetof implies indirection of an embedded field"));
7912
+ // Go up until we reach the original base.
7913
+ farg = farg->expr()->field_reference_expression();
7917
if (this->is_constant())
7919
Numeric_constant nc;
7920
@@ -7279,19 +7496,31 @@
7921
Field_reference_expression* farg = arg->field_reference_expression();
7924
- Expression* struct_expr = farg->expr();
7925
- Type* st = struct_expr->type();
7926
- if (st->struct_type() == NULL)
7928
- if (st->named_type() != NULL)
7929
- st->named_type()->convert(this->gogo_);
7930
- unsigned int offset;
7931
- if (!st->struct_type()->backend_field_offset(this->gogo_,
7932
- farg->field_index(),
7935
+ unsigned int total_offset = 0;
7938
+ Expression* struct_expr = farg->expr();
7939
+ Type* st = struct_expr->type();
7940
+ if (st->struct_type() == NULL)
7942
+ if (st->named_type() != NULL)
7943
+ st->named_type()->convert(this->gogo_);
7944
+ unsigned int offset;
7945
+ if (!st->struct_type()->backend_field_offset(this->gogo_,
7946
+ farg->field_index(),
7949
+ total_offset += offset;
7950
+ if (farg->implicit() && struct_expr->field_reference_expression() != NULL)
7952
+ // Go up until we reach the original base.
7953
+ farg = struct_expr->field_reference_expression();
7958
nc->set_unsigned_long(Type::lookup_integer_type("uintptr"),
7959
- static_cast<unsigned long>(offset));
7960
+ static_cast<unsigned long>(total_offset));
7963
else if (this->code_ == BUILTIN_REAL || this->code_ == BUILTIN_IMAG)
7964
@@ -8509,6 +8738,74 @@
7966
// Class Call_expression.
7968
+// A Go function can be viewed in a couple of different ways. The
7969
+// code of a Go function becomes a backend function with parameters
7970
+// whose types are simply the backend representation of the Go types.
7971
+// If there are multiple results, they are returned as a backend
7974
+// However, when Go code refers to a function other than simply
7975
+// calling it, the backend type of that function is actually a struct.
7976
+// The first field of the struct points to the Go function code
7977
+// (sometimes a wrapper as described below). The remaining fields
7978
+// hold addresses of closed-over variables. This struct is called a
7981
+// There are a few cases to consider.
7983
+// A direct function call of a known function in package scope. In
7984
+// this case there are no closed-over variables, and we know the name
7985
+// of the function code. We can simply produce a backend call to the
7986
+// function directly, and not worry about the closure.
7988
+// A direct function call of a known function literal. In this case
7989
+// we know the function code and we know the closure. We generate the
7990
+// function code such that it expects an additional final argument of
7991
+// the closure type. We pass the closure as the last argument, after
7992
+// the other arguments.
7994
+// An indirect function call. In this case we have a closure. We
7995
+// load the pointer to the function code from the first field of the
7996
+// closure. We pass the address of the closure as the last argument.
7998
+// A call to a method of an interface. Type methods are always at
7999
+// package scope, so we call the function directly, and don't worry
8000
+// about the closure.
8002
+// This means that for a function at package scope we have two cases.
8003
+// One is the direct call, which has no closure. The other is the
8004
+// indirect call, which does have a closure. We can't simply ignore
8005
+// the closure, even though it is the last argument, because that will
8006
+// fail on targets where the function pops its arguments. So when
8007
+// generating a closure for a package-scope function we set the
8008
+// function code pointer in the closure to point to a wrapper
8009
+// function. This wrapper function accepts a final argument that
8010
+// points to the closure, ignores it, and calls the real function as a
8011
+// direct function call. This wrapper will normally be efficient, and
8012
+// can often simply be a tail call to the real function.
8014
+// We don't use GCC's static chain pointer because 1) we don't need
8015
+// it; 2) GCC only permits using a static chain to call a known
8016
+// function, so we can't use it for an indirect call anyhow. Since we
8017
+// can't use it for an indirect call, we may as well not worry about
8018
+// using it for a direct call either.
8020
+// We pass the closure last rather than first because it means that
8021
+// the function wrapper we put into a closure for a package-scope
8022
+// function can normally just be a tail call to the real function.
8024
+// For method expressions we generate a wrapper that loads the
8025
+// receiver from the closure and then calls the method. This
8026
+// unfortunately forces reshuffling the arguments, since there is a
8027
+// new first argument, but we can't avoid reshuffling either for
8028
+// method expressions or for indirect calls of package-scope
8029
+// functions, and since the latter are more common we reshuffle for
8030
+// method expressions.
8032
+// Note that the Go code retains the Go types. The extra final
8033
+// argument only appears when we convert to the backend
8039
@@ -9117,11 +9414,21 @@
8040
const bool has_closure = func != NULL && func->closure() != NULL;
8041
const bool is_interface_method = interface_method != NULL;
8046
+ else if (func != NULL)
8048
+ else if (is_interface_method)
8055
if (this->args_ == NULL || this->args_->empty())
8057
- nargs = is_interface_method ? 1 : 0;
8058
+ nargs = (is_interface_method ? 1 : 0) + closure_arg;
8059
args = nargs == 0 ? NULL : new tree[nargs];
8061
else if (fntype->parameters() == NULL || fntype->parameters()->empty())
8062
@@ -9130,7 +9437,7 @@
8063
go_assert(!is_interface_method
8064
&& fntype->is_method()
8065
&& this->args_->size() == 1);
8067
+ nargs = 1 + closure_arg;
8068
args = new tree[nargs];
8069
args[0] = this->args_->front()->get_tree(context);
8071
@@ -9141,6 +9448,7 @@
8072
nargs = this->args_->size();
8073
int i = is_interface_method ? 1 : 0;
8075
+ nargs += closure_arg;
8076
args = new tree[nargs];
8078
Typed_identifier_list::const_iterator pp = params->begin();
8079
@@ -9161,36 +9469,71 @@
8082
if (args[i] == error_mark_node)
8085
- return error_mark_node;
8087
+ return error_mark_node;
8089
go_assert(pp == params->end());
8090
- go_assert(i == nargs);
8091
+ go_assert(i + closure_arg == nargs);
8094
- tree rettype = TREE_TYPE(TREE_TYPE(type_to_tree(fntype->get_backend(gogo))));
8095
+ tree fntype_tree = type_to_tree(fntype->get_backend(gogo));
8096
+ if (fntype_tree == error_mark_node)
8097
+ return error_mark_node;
8098
+ go_assert(POINTER_TYPE_P(fntype_tree));
8099
+ if (TREE_TYPE(fntype_tree) == error_mark_node)
8100
+ return error_mark_node;
8101
+ go_assert(TREE_CODE(TREE_TYPE(fntype_tree)) == RECORD_TYPE);
8102
+ tree fnfield_type = TREE_TYPE(TYPE_FIELDS(TREE_TYPE(fntype_tree)));
8103
+ if (fnfield_type == error_mark_node)
8104
+ return error_mark_node;
8105
+ go_assert(FUNCTION_POINTER_TYPE_P(fnfield_type));
8106
+ tree rettype = TREE_TYPE(TREE_TYPE(fnfield_type));
8107
if (rettype == error_mark_node)
8108
+ return error_mark_node;
8114
- return error_mark_node;
8115
+ Named_object* no = func->named_object();
8116
+ go_assert(!no->is_function()
8117
+ || !no->func_value()->is_descriptor_wrapper());
8118
+ fn = Func_expression::get_code_pointer(gogo, no, location);
8121
+ go_assert(closure_arg == 1 && nargs > 0);
8122
+ args[nargs - 1] = func->closure()->get_tree(context);
8128
- fn = func->get_tree_without_closure(gogo);
8129
else if (!is_interface_method)
8130
- fn = this->fn_->get_tree(context);
8132
+ tree closure_tree = this->fn_->get_tree(context);
8133
+ if (closure_tree == error_mark_node)
8134
+ return error_mark_node;
8135
+ tree fnc = fold_convert_loc(location.gcc_location(), fntype_tree,
8137
+ go_assert(POINTER_TYPE_P(TREE_TYPE(fnc))
8138
+ && (TREE_CODE(TREE_TYPE(TREE_TYPE(fnc)))
8140
+ tree field = TYPE_FIELDS(TREE_TYPE(TREE_TYPE(fnc)));
8141
+ fn = fold_build3_loc(location.gcc_location(), COMPONENT_REF,
8143
+ build_fold_indirect_ref_loc(location.gcc_location(),
8145
+ field, NULL_TREE);
8146
+ go_assert(closure_arg == 1 && nargs > 0);
8147
+ args[nargs - 1] = closure_tree;
8150
- fn = this->interface_method_function(context, interface_method, &args[0]);
8152
- if (fn == error_mark_node || TREE_TYPE(fn) == error_mark_node)
8155
- return error_mark_node;
8156
+ fn = this->interface_method_function(context, interface_method,
8158
+ if (fn == error_mark_node)
8159
+ return error_mark_node;
8160
+ go_assert(closure_arg == 0);
8163
+ if (fn == error_mark_node || TREE_TYPE(fn) == error_mark_node)
8164
+ return error_mark_node;
8167
if (TREE_CODE(fndecl) == ADDR_EXPR)
8168
fndecl = TREE_OPERAND(fndecl, 0);
8169
@@ -9198,12 +9541,7 @@
8170
// Add a type cast in case the type of the function is a recursive
8171
// type which refers to itself.
8172
if (!DECL_P(fndecl) || !DECL_IS_BUILTIN(fndecl))
8174
- tree fnt = type_to_tree(fntype->get_backend(gogo));
8175
- if (fnt == error_mark_node)
8176
- return error_mark_node;
8177
- fn = fold_convert_loc(location.gcc_location(), fnt, fn);
8179
+ fn = fold_convert_loc(location.gcc_location(), fnfield_type, fn);
8181
// This is to support builtin math functions when using 80387 math.
8182
tree excess_type = NULL_TREE;
8183
@@ -9247,13 +9585,6 @@
8185
SET_EXPR_LOCATION(ret, location.gcc_location());
8189
- tree closure_tree = func->closure()->get_tree(context);
8190
- if (closure_tree != error_mark_node)
8191
- CALL_EXPR_STATIC_CHAIN(ret) = closure_tree;
8194
// If this is a recursive function type which returns itself, as in
8196
// we have used ptr_type_node for the return type. Add a cast here
8197
@@ -9274,24 +9605,6 @@
8198
if (this->results_ != NULL)
8199
ret = this->set_results(context, ret);
8201
- // We can't unwind the stack past a call to nil, so we need to
8202
- // insert an explicit check so that the panic can be recovered.
8205
- tree compare = fold_build2_loc(location.gcc_location(), EQ_EXPR,
8206
- boolean_type_node, fn,
8207
- fold_convert_loc(location.gcc_location(),
8209
- null_pointer_node));
8210
- tree crash = build3_loc(location.gcc_location(), COND_EXPR,
8211
- void_type_node, compare,
8212
- gogo->runtime_error(RUNTIME_ERROR_NIL_DEREFERENCE,
8215
- ret = fold_build2_loc(location.gcc_location(), COMPOUND_EXPR,
8216
- TREE_TYPE(ret), crash, ret);
8222
@@ -11114,8 +11427,10 @@
8223
// as their first argument. If this is for a pointer type, we can
8224
// simply reuse the existing function. We use an internal hack to
8225
// get the right type.
8227
- if (method != NULL && is_pointer)
8228
+ // FIXME: This optimization is disabled because it doesn't yet work
8229
+ // with function descriptors when the method expression is not
8230
+ // directly called.
8231
+ if (method != NULL && is_pointer && false)
8233
Named_object* mno = (method->needs_stub_method()
8234
? method->stub_object()
8236
===================================================================
8237
--- a/src/gcc/recog.c (.../tags/gcc_4_8_1_release)
8238
+++ b/src/gcc/recog.c (.../branches/gcc-4_8-branch)
8239
@@ -1949,9 +1949,6 @@
8240
(strictp ? strict_memory_address_addr_space_p
8241
: memory_address_addr_space_p);
8242
unsigned int mode_sz = GET_MODE_SIZE (mode);
8243
-#ifdef POINTERS_EXTEND_UNSIGNED
8244
- enum machine_mode pointer_mode = targetm.addr_space.pointer_mode (as);
8247
if (CONSTANT_ADDRESS_P (y))
8249
@@ -1962,6 +1959,13 @@
8250
if (mode_dependent_address_p (y, as))
8253
+ enum machine_mode address_mode = GET_MODE (y);
8254
+ if (address_mode == VOIDmode)
8255
+ address_mode = targetm.addr_space.address_mode (as);
8256
+#ifdef POINTERS_EXTEND_UNSIGNED
8257
+ enum machine_mode pointer_mode = targetm.addr_space.pointer_mode (as);
8260
/* ??? How much offset does an offsettable BLKmode reference need?
8261
Clearly that depends on the situation in which it's being used.
8262
However, the current situation in which we test 0xffffffff is
8263
@@ -1977,7 +1981,7 @@
8267
- *y2 = plus_constant (GET_MODE (y), *y2, mode_sz - 1);
8268
+ *y2 = plus_constant (address_mode, *y2, mode_sz - 1);
8269
/* Use QImode because an odd displacement may be automatically invalid
8270
for any wider mode. But it should be valid for a single byte. */
8271
good = (*addressp) (QImode, y, as);
8272
@@ -1998,20 +2002,20 @@
8273
if (GET_CODE (y) == LO_SUM
8275
&& mode_sz <= GET_MODE_ALIGNMENT (mode) / BITS_PER_UNIT)
8276
- z = gen_rtx_LO_SUM (GET_MODE (y), XEXP (y, 0),
8277
- plus_constant (GET_MODE (y), XEXP (y, 1),
8278
+ z = gen_rtx_LO_SUM (address_mode, XEXP (y, 0),
8279
+ plus_constant (address_mode, XEXP (y, 1),
8281
#ifdef POINTERS_EXTEND_UNSIGNED
8282
/* Likewise for a ZERO_EXTEND from pointer_mode. */
8283
else if (POINTERS_EXTEND_UNSIGNED > 0
8284
&& GET_CODE (y) == ZERO_EXTEND
8285
&& GET_MODE (XEXP (y, 0)) == pointer_mode)
8286
- z = gen_rtx_ZERO_EXTEND (GET_MODE (y),
8287
+ z = gen_rtx_ZERO_EXTEND (address_mode,
8288
plus_constant (pointer_mode, XEXP (y, 0),
8292
- z = plus_constant (GET_MODE (y), y, mode_sz - 1);
8293
+ z = plus_constant (address_mode, y, mode_sz - 1);
8295
/* Use QImode because an odd displacement may be automatically invalid
8296
for any wider mode. But it should be valid for a single byte. */
8297
Index: gcc/ada/targparm.ads
8298
===================================================================
8299
--- a/src/gcc/ada/targparm.ads (.../tags/gcc_4_8_1_release)
8300
+++ b/src/gcc/ada/targparm.ads (.../branches/gcc-4_8-branch)
8302
-- the source program may not contain explicit 64-bit shifts. In addition,
8303
-- the code generated for packed arrays will avoid the use of long shifts.
8305
- Support_Nondefault_SSO_On_Target : Boolean := False;
8306
+ Support_Nondefault_SSO_On_Target : Boolean := True;
8307
-- If True, the back end supports the non-default Scalar_Storage_Order
8308
-- (i.e. allows non-confirming Scalar_Storage_Order attribute definition
8310
Index: gcc/ada/ChangeLog
8311
===================================================================
8312
--- a/src/gcc/ada/ChangeLog (.../tags/gcc_4_8_1_release)
8313
+++ b/src/gcc/ada/ChangeLog (.../branches/gcc-4_8-branch)
8315
+2013-06-13 Eric Botcazou <ebotcazou@adacore.com>
8317
+ * gcc-interface/ada-tree.h (DECL_BY_DOUBLE_REF_P): Delete.
8318
+ * gcc-interface/gigi.h (annotate_object): Adjust prototype.
8319
+ (convert_vms_descriptor): Likewise.
8320
+ * gcc-interface/decl.c (gnat_to_gnu_param): Do not pass fat pointer
8321
+ types by double dereference.
8322
+ (annotate_object): Remove BY_DOUBLE_REF parameter and adjust.
8323
+ (gnat_to_gnu_entity): Adjust calls to annotate_object.
8324
+ * gcc-interface/trans.c (Identifier_to_gnu): Do not deal with double
8326
+ (Call_to_gnu): Likewise.
8327
+ (build_function_stub): Adjust call to convert_vms_descriptor.
8328
+ (Subprogram_Body_to_gnu): Adjust call to annotate_object.
8329
+ * gcc-interface/utils.c (convert_vms_descriptor): Remove BY_REF
8330
+ parameter and adjust.
8332
2013-05-31 Release Manager
8334
* GCC 4.8.1 released.
8335
Index: gcc/ada/gcc-interface/utils.c
8336
===================================================================
8337
--- a/src/gcc/ada/gcc-interface/utils.c (.../tags/gcc_4_8_1_release)
8338
+++ b/src/gcc/ada/gcc-interface/utils.c (.../branches/gcc-4_8-branch)
8339
@@ -4073,33 +4073,25 @@
8341
/* Convert GNU_EXPR, a pointer to a VMS descriptor, to GNU_TYPE, a regular
8342
pointer or fat pointer type. GNU_EXPR_ALT_TYPE is the alternate (32-bit)
8343
- pointer type of GNU_EXPR. BY_REF is true if the result is to be used by
8344
- reference. GNAT_SUBPROG is the subprogram to which the VMS descriptor is
8346
+ pointer type of GNU_EXPR. GNAT_SUBPROG is the subprogram to which the
8347
+ descriptor is passed. */
8350
convert_vms_descriptor (tree gnu_type, tree gnu_expr, tree gnu_expr_alt_type,
8351
- bool by_ref, Entity_Id gnat_subprog)
8352
+ Entity_Id gnat_subprog)
8354
tree desc_type = TREE_TYPE (TREE_TYPE (gnu_expr));
8355
tree desc = build1 (INDIRECT_REF, desc_type, gnu_expr);
8356
tree mbo = TYPE_FIELDS (desc_type);
8357
const char *mbostr = IDENTIFIER_POINTER (DECL_NAME (mbo));
8358
tree mbmo = DECL_CHAIN (DECL_CHAIN (DECL_CHAIN (mbo)));
8359
- tree real_type, is64bit, gnu_expr32, gnu_expr64;
8360
+ tree is64bit, gnu_expr32, gnu_expr64;
8363
- real_type = TREE_TYPE (gnu_type);
8365
- real_type = gnu_type;
8367
/* If the field name is not MBO, it must be 32-bit and no alternate.
8368
Otherwise primary must be 64-bit and alternate 32-bit. */
8369
if (strcmp (mbostr, "MBO") != 0)
8371
- tree ret = convert_vms_descriptor32 (real_type, gnu_expr, gnat_subprog);
8373
- ret = build_unary_op (ADDR_EXPR, gnu_type, ret);
8374
+ tree ret = convert_vms_descriptor32 (gnu_type, gnu_expr, gnat_subprog);
8378
@@ -4116,14 +4108,9 @@
8379
integer_minus_one_node));
8381
/* Build the 2 possible end results. */
8382
- gnu_expr64 = convert_vms_descriptor64 (real_type, gnu_expr, gnat_subprog);
8384
- gnu_expr64 = build_unary_op (ADDR_EXPR, gnu_type, gnu_expr64);
8385
+ gnu_expr64 = convert_vms_descriptor64 (gnu_type, gnu_expr, gnat_subprog);
8386
gnu_expr = fold_convert (gnu_expr_alt_type, gnu_expr);
8387
- gnu_expr32 = convert_vms_descriptor32 (real_type, gnu_expr, gnat_subprog);
8389
- gnu_expr32 = build_unary_op (ADDR_EXPR, gnu_type, gnu_expr32);
8391
+ gnu_expr32 = convert_vms_descriptor32 (gnu_type, gnu_expr, gnat_subprog);
8392
return build3 (COND_EXPR, gnu_type, is64bit, gnu_expr64, gnu_expr32);
8395
Index: gcc/ada/gcc-interface/decl.c
8396
===================================================================
8397
--- a/src/gcc/ada/gcc-interface/decl.c (.../tags/gcc_4_8_1_release)
8398
+++ b/src/gcc/ada/gcc-interface/decl.c (.../branches/gcc-4_8-branch)
8399
@@ -1019,7 +1019,7 @@
8400
save_gnu_tree (gnat_entity, gnu_decl, true);
8402
annotate_object (gnat_entity, gnu_type, NULL_TREE,
8405
/* This assertion will fail if the renamed object
8406
isn't aligned enough as to make it possible to
8407
honor the alignment set on the renaming. */
8408
@@ -1605,7 +1605,7 @@
8409
type of the object and not on the object directly, and makes it
8410
possible to support all confirming representation clauses. */
8411
annotate_object (gnat_entity, TREE_TYPE (gnu_decl), gnu_object_size,
8412
- used_by_ref, false);
8417
@@ -5595,7 +5595,7 @@
8418
/* The parameter can be indirectly modified if its address is taken. */
8419
bool ro_param = in_param && !Address_Taken (gnat_param);
8420
bool by_return = false, by_component_ptr = false;
8421
- bool by_ref = false, by_double_ref = false;
8422
+ bool by_ref = false;
8425
/* Copy-return is used only for the first parameter of a valued procedure.
8426
@@ -5720,19 +5720,6 @@
8428
= build_qualified_type (gnu_param_type, TYPE_QUAL_RESTRICT);
8431
- /* In some ABIs, e.g. SPARC 32-bit, fat pointer types are themselves
8432
- passed by reference. Pass them by explicit reference, this will
8433
- generate more debuggable code at -O0. */
8434
- if (TYPE_IS_FAT_POINTER_P (gnu_param_type)
8435
- && targetm.calls.pass_by_reference (pack_cumulative_args (NULL),
8436
- TYPE_MODE (gnu_param_type),
8440
- gnu_param_type = build_reference_type (gnu_param_type);
8441
- by_double_ref = true;
8445
/* Pass In Out or Out parameters using copy-in copy-out mechanism. */
8446
@@ -5775,7 +5762,6 @@
8447
gnu_param = create_param_decl (gnu_param_name, gnu_param_type,
8448
ro_param || by_ref || by_component_ptr);
8449
DECL_BY_REF_P (gnu_param) = by_ref;
8450
- DECL_BY_DOUBLE_REF_P (gnu_param) = by_double_ref;
8451
DECL_BY_COMPONENT_PTR_P (gnu_param) = by_component_ptr;
8452
DECL_BY_DESCRIPTOR_P (gnu_param) = (mech == By_Descriptor ||
8453
mech == By_Short_Descriptor);
8454
@@ -7427,18 +7413,13 @@
8455
/* Given GNAT_ENTITY, an object (constant, variable, parameter, exception)
8456
and GNU_TYPE, its corresponding GCC type, set Esize and Alignment to the
8457
size and alignment used by Gigi. Prefer SIZE over TYPE_SIZE if non-null.
8458
- BY_REF is true if the object is used by reference and BY_DOUBLE_REF is
8459
- true if the object is used by double reference. */
8460
+ BY_REF is true if the object is used by reference. */
8463
-annotate_object (Entity_Id gnat_entity, tree gnu_type, tree size, bool by_ref,
8464
- bool by_double_ref)
8465
+annotate_object (Entity_Id gnat_entity, tree gnu_type, tree size, bool by_ref)
8469
- if (by_double_ref)
8470
- gnu_type = TREE_TYPE (gnu_type);
8472
if (TYPE_IS_FAT_POINTER_P (gnu_type))
8473
gnu_type = TYPE_UNCONSTRAINED_ARRAY (gnu_type);
8475
Index: gcc/ada/gcc-interface/gigi.h
8476
===================================================================
8477
--- a/src/gcc/ada/gcc-interface/gigi.h (.../tags/gcc_4_8_1_release)
8478
+++ b/src/gcc/ada/gcc-interface/gigi.h (.../branches/gcc-4_8-branch)
8479
@@ -177,10 +177,9 @@
8480
/* Given GNAT_ENTITY, an object (constant, variable, parameter, exception)
8481
and GNU_TYPE, its corresponding GCC type, set Esize and Alignment to the
8482
size and alignment used by Gigi. Prefer SIZE over TYPE_SIZE if non-null.
8483
- BY_REF is true if the object is used by reference and BY_DOUBLE_REF is
8484
- true if the object is used by double reference. */
8485
+ BY_REF is true if the object is used by reference. */
8486
extern void annotate_object (Entity_Id gnat_entity, tree gnu_type, tree size,
8487
- bool by_ref, bool by_double_ref);
8490
/* Return the variant part of RECORD_TYPE, if any. Otherwise return NULL. */
8491
extern tree get_variant_part (tree record_type);
8492
@@ -930,11 +929,10 @@
8494
/* Convert GNU_EXPR, a pointer to a VMS descriptor, to GNU_TYPE, a regular
8495
pointer or fat pointer type. GNU_EXPR_ALT_TYPE is the alternate (32-bit)
8496
- pointer type of GNU_EXPR. BY_REF is true if the result is to be used by
8497
- reference. GNAT_SUBPROG is the subprogram to which the VMS descriptor is
8499
+ pointer type of GNU_EXPR. GNAT_SUBPROG is the subprogram to which the
8500
+ descriptor is passed. */
8501
extern tree convert_vms_descriptor (tree gnu_type, tree gnu_expr,
8502
- tree gnu_expr_alt_type, bool by_ref,
8503
+ tree gnu_expr_alt_type,
8504
Entity_Id gnat_subprog);
8506
/* Indicate that we need to take the address of T and that it therefore
8507
Index: gcc/ada/gcc-interface/ada-tree.h
8508
===================================================================
8509
--- a/src/gcc/ada/gcc-interface/ada-tree.h (.../tags/gcc_4_8_1_release)
8510
+++ b/src/gcc/ada/gcc-interface/ada-tree.h (.../branches/gcc-4_8-branch)
8511
@@ -360,10 +360,6 @@
8512
constant CONSTRUCTOR. */
8513
#define DECL_CONST_ADDRESS_P(NODE) DECL_LANG_FLAG_0 (CONST_DECL_CHECK (NODE))
8515
-/* Nonzero in a PARM_DECL if it is always used by double reference, i.e. a
8516
- pair of INDIRECT_REFs is needed to access the object. */
8517
-#define DECL_BY_DOUBLE_REF_P(NODE) DECL_LANG_FLAG_0 (PARM_DECL_CHECK (NODE))
8519
/* Nonzero in a FIELD_DECL if it is declared as aliased. */
8520
#define DECL_ALIASED_P(NODE) DECL_LANG_FLAG_0 (FIELD_DECL_CHECK (NODE))
8522
Index: gcc/ada/gcc-interface/trans.c
8523
===================================================================
8524
--- a/src/gcc/ada/gcc-interface/trans.c (.../tags/gcc_4_8_1_release)
8525
+++ b/src/gcc/ada/gcc-interface/trans.c (.../branches/gcc-4_8-branch)
8526
@@ -1075,19 +1075,6 @@
8528
const bool read_only = DECL_POINTS_TO_READONLY_P (gnu_result);
8530
- /* First do the first dereference if needed. */
8531
- if (TREE_CODE (gnu_result) == PARM_DECL
8532
- && DECL_BY_DOUBLE_REF_P (gnu_result))
8534
- gnu_result = build_unary_op (INDIRECT_REF, NULL_TREE, gnu_result);
8535
- if (TREE_CODE (gnu_result) == INDIRECT_REF)
8536
- TREE_THIS_NOTRAP (gnu_result) = 1;
8538
- /* The first reference, in case of a double reference, always points
8539
- to read-only, see gnat_to_gnu_param for the rationale. */
8540
- TREE_READONLY (gnu_result) = 1;
8543
/* If it's a PARM_DECL to foreign convention subprogram, convert it. */
8544
if (TREE_CODE (gnu_result) == PARM_DECL
8545
&& DECL_BY_COMPONENT_PTR_P (gnu_result))
8546
@@ -3251,7 +3238,6 @@
8547
= convert_vms_descriptor (TREE_TYPE (gnu_subprog_param),
8549
DECL_PARM_ALT_TYPE (gnu_stub_param),
8550
- DECL_BY_DOUBLE_REF_P (gnu_subprog_param),
8554
@@ -3546,8 +3532,7 @@
8555
bool is_var_decl = (TREE_CODE (gnu_param) == VAR_DECL);
8557
annotate_object (gnat_param, TREE_TYPE (gnu_param), NULL_TREE,
8558
- DECL_BY_REF_P (gnu_param),
8559
- !is_var_decl && DECL_BY_DOUBLE_REF_P (gnu_param));
8560
+ DECL_BY_REF_P (gnu_param));
8563
save_gnu_tree (gnat_param, NULL_TREE, false);
8564
@@ -4009,12 +3994,6 @@
8565
/* The symmetry of the paths to the type of an entity is broken here
8566
since arguments don't know that they will be passed by ref. */
8567
gnu_formal_type = TREE_TYPE (gnu_formal);
8569
- if (DECL_BY_DOUBLE_REF_P (gnu_formal))
8571
- = build_unary_op (ADDR_EXPR, TREE_TYPE (gnu_formal_type),
8574
gnu_actual = build_unary_op (ADDR_EXPR, gnu_formal_type, gnu_actual);
8576
else if (is_true_formal_parm && DECL_BY_COMPONENT_PTR_P (gnu_formal))
8577
Index: gcc/fortran/interface.c
8578
===================================================================
8579
--- a/src/gcc/fortran/interface.c (.../tags/gcc_4_8_1_release)
8580
+++ b/src/gcc/fortran/interface.c (.../branches/gcc-4_8-branch)
8581
@@ -1024,7 +1024,8 @@
8582
bool type_must_agree, char *errmsg, int err_len)
8584
/* Check type and rank. */
8585
- if (type_must_agree && !compare_type_rank (s2, s1))
8586
+ if (type_must_agree &&
8587
+ (!compare_type_rank (s1, s2) || !compare_type_rank (s2, s1)))
8589
snprintf (errmsg, err_len, "Type/rank mismatch in argument '%s'",
8591
Index: gcc/fortran/ChangeLog
8592
===================================================================
8593
--- a/src/gcc/fortran/ChangeLog (.../tags/gcc_4_8_1_release)
8594
+++ b/src/gcc/fortran/ChangeLog (.../branches/gcc-4_8-branch)
8596
+2013-06-11 Tobias Burnus <burnus@net-b.de>
8599
+ * resolve.c (get_temp_from_expr): Don't copy function
8600
+ result attributes to temporary.
8602
+2013-06-04 Tobias Burnus <burnus@net-b.de>
8604
+ Backport from mainline
8605
+ 2013-05-22 Tobias Burnus <burnus@net-b.de>
8608
+ * resolve.c (get_temp_from_expr): Commit created sym.
8610
+2013-05-31 Janus Weil <janus@gcc.gnu.org>
8611
+ Tobias Burnus <burnus@net-b.de>
8614
+ * interface.c (check_dummy_characteristics): Symmetrize type check.
8616
2013-05-31 Release Manager
8618
* GCC 4.8.1 released.
8619
Index: gcc/fortran/resolve.c
8620
===================================================================
8621
--- a/src/gcc/fortran/resolve.c (.../tags/gcc_4_8_1_release)
8622
+++ b/src/gcc/fortran/resolve.c (.../branches/gcc-4_8-branch)
8623
@@ -9746,6 +9746,10 @@
8625
/* Add the attributes and the arrayspec to the temporary. */
8626
tmp->n.sym->attr = gfc_expr_attr (e);
8627
+ tmp->n.sym->attr.function = 0;
8628
+ tmp->n.sym->attr.result = 0;
8629
+ tmp->n.sym->attr.flavor = FL_VARIABLE;
8633
tmp->n.sym->as = gfc_copy_array_spec (as);
8634
@@ -9759,6 +9763,7 @@
8636
gfc_set_sym_referenced (tmp->n.sym);
8637
gfc_add_flavor (&tmp->n.sym->attr, FL_VARIABLE, name, NULL);
8638
+ gfc_commit_symbol (tmp->n.sym);
8639
e = gfc_lval_expr_from_sym (tmp->n.sym);
8641
/* Should the lhs be a section, use its array ref for the
8642
Index: gcc/configure.ac
8643
===================================================================
8644
--- a/src/gcc/configure.ac (.../tags/gcc_4_8_1_release)
8645
+++ b/src/gcc/configure.ac (.../branches/gcc-4_8-branch)
8646
@@ -3044,35 +3044,9 @@
8653
.section ".tdata","awT",@progbits
8661
- addi 3,31,ld0@got@tlsgd
8663
- addi 3,31,x1@got@tlsld
8665
- addi 9,3,x1@dtprel
8666
- addis 9,3,x2@dtprel@ha
8667
- addi 9,9,x2@dtprel@l
8668
- lwz 9,x3@got@tprel(31)
8671
- addis 9,2,x2@tprel@ha
8672
- addi 9,9,x2@tprel@l'
8674
- tls_first_minor=14
8675
- tls_as_opt="-a32 --fatal-warnings"
8679
- .section ".tdata","awT",@progbits
8683
@@ -3104,6 +3078,32 @@
8685
tls_as_opt="-a64 --fatal-warnings"
8689
+ .section ".tdata","awT",@progbits
8697
+ addi 3,31,ld0@got@tlsgd
8699
+ addi 3,31,x1@got@tlsld
8701
+ addi 9,3,x1@dtprel
8702
+ addis 9,3,x2@dtprel@ha
8703
+ addi 9,9,x2@dtprel@l
8704
+ lwz 9,x3@got@tprel(31)
8707
+ addis 9,2,x2@tprel@ha
8708
+ addi 9,9,x2@tprel@l'
8710
+ tls_first_minor=14
8711
+ tls_as_opt="-a32 --fatal-warnings"
8715
.section ".tdata","awT",@progbits
8716
@@ -4507,6 +4507,9 @@
8717
case "$target:$tm_file" in
8718
powerpc64-*-freebsd* | powerpc64*-*-linux* | powerpc*-*-linux*rs6000/biarch64.h*)
8721
+ emul_name="-melf64lppc"
8724
emul_name="-melf64ppc"
8726
@@ -4611,7 +4614,7 @@
8728
if test x"$gcc_cv_ld_large_toc" = xyes; then
8729
AC_DEFINE(HAVE_LD_LARGE_TOC, 1,
8730
- [Define if your AIX linker supports a large TOC.])
8731
+ [Define if your PowerPC64 linker supports a large TOC.])
8736
===================================================================
8737
--- a/src/gcc/gcc-ar.c (.../tags/gcc_4_8_1_release)
8738
+++ b/src/gcc/gcc-ar.c (.../branches/gcc-4_8-branch)
8740
setup_prefixes (av[0]);
8742
/* Find the GCC LTO plugin */
8743
- plugin = find_a_file (&target_path, LTOPLUGINSONAME);
8744
+ plugin = find_a_file (&target_path, LTOPLUGINSONAME, R_OK);
8747
fprintf (stderr, "%s: Cannot find plugin '%s'\n", av[0], LTOPLUGINSONAME);
8748
@@ -144,24 +144,20 @@
8751
/* Find the wrapped binutils program. */
8752
- exe_name = find_a_file (&target_path, PERSONALITY);
8753
+ exe_name = find_a_file (&target_path, PERSONALITY, X_OK);
8756
+ const char *real_exe_name = PERSONALITY;
8757
#ifdef CROSS_DIRECTORY_STRUCTURE
8758
- const char *cross_exe_name;
8760
- cross_exe_name = concat (target_machine, "-", PERSONALITY, NULL);
8761
- exe_name = find_a_file (&path, cross_exe_name);
8762
+ real_exe_name = concat (target_machine, "-", PERSONALITY, NULL);
8764
+ exe_name = find_a_file (&path, real_exe_name, X_OK);
8767
fprintf (stderr, "%s: Cannot find binary '%s'\n", av[0],
8773
- fprintf (stderr, "%s: Cannot find binary '%s'\n", av[0], PERSONALITY);
8778
/* Create new command line with plugin */
8779
Index: gcc/tree-vect-patterns.c
8780
===================================================================
8781
--- a/src/gcc/tree-vect-patterns.c (.../tags/gcc_4_8_1_release)
8782
+++ b/src/gcc/tree-vect-patterns.c (.../branches/gcc-4_8-branch)
8783
@@ -638,7 +638,10 @@
8784
&& vect_handle_widen_op_by_const (last_stmt, MULT_EXPR, oprnd1,
8785
&oprnd0, stmts, type,
8786
&half_type0, def_stmt0))
8787
- half_type1 = half_type0;
8789
+ half_type1 = half_type0;
8790
+ oprnd1 = fold_convert (half_type1, oprnd1);
8796
===================================================================
8797
--- a/src/gcc/ira.c (.../tags/gcc_4_8_1_release)
8798
+++ b/src/gcc/ira.c (.../branches/gcc-4_8-branch)
8799
@@ -2863,6 +2863,28 @@
8803
+/* Check whether the SUBREG is a paradoxical subreg and set the result
8804
+ in PDX_SUBREGS. */
8807
+set_paradoxical_subreg (rtx *subreg, void *pdx_subregs)
8811
+ if ((*subreg) == NULL_RTX)
8813
+ if (GET_CODE (*subreg) != SUBREG)
8815
+ reg = SUBREG_REG (*subreg);
8819
+ if (paradoxical_subreg_p (*subreg))
8820
+ ((bool *)pdx_subregs)[REGNO (reg)] = true;
8825
/* In DEBUG_INSN location adjust REGs from CLEARED_REGS bitmap to the
8826
equivalent replacement. */
8828
@@ -2901,16 +2923,33 @@
8831
bitmap cleared_regs;
8832
+ bool *pdx_subregs;
8834
/* We need to keep track of whether or not we recorded a LABEL_REF so
8835
that we know if the jump optimizer needs to be rerun. */
8836
recorded_label_ref = 0;
8838
+ /* Use pdx_subregs to show whether a reg is used in a paradoxical
8840
+ pdx_subregs = XCNEWVEC (bool, max_regno);
8842
reg_equiv = XCNEWVEC (struct equivalence, max_regno);
8845
init_alias_analysis ();
8847
+ /* Scan insns and set pdx_subregs[regno] if the reg is used in a
8848
+ paradoxical subreg. Don't set such reg sequivalent to a mem,
8849
+ because lra will not substitute such equiv memory in order to
8850
+ prevent access beyond allocated memory for paradoxical memory subreg. */
8852
+ FOR_BB_INSNS (bb, insn)
8854
+ if (! INSN_P (insn))
8856
+ for_each_rtx (&insn, set_paradoxical_subreg, (void *)pdx_subregs);
8859
/* Scan the insns and find which registers have equivalences. Do this
8860
in a separate scan of the insns because (due to -fcse-follow-jumps)
8861
a register can be set below its use. */
8862
@@ -3008,6 +3047,13 @@
8866
+ /* Don't set reg (if pdx_subregs[regno] == true) equivalent to a mem. */
8867
+ if (MEM_P (src) && pdx_subregs[regno])
8869
+ note_stores (set, no_equiv, NULL);
8873
note = find_reg_note (insn, REG_EQUAL, NULL_RTX);
8875
/* cse sometimes generates function invariants, but doesn't put a
8876
@@ -3166,7 +3212,8 @@
8877
&& reg_equiv[regno].init_insns != const0_rtx
8878
&& ! find_reg_note (XEXP (reg_equiv[regno].init_insns, 0),
8879
REG_EQUIV, NULL_RTX)
8880
- && ! contains_replace_regs (XEXP (dest, 0)))
8881
+ && ! contains_replace_regs (XEXP (dest, 0))
8882
+ && ! pdx_subregs[regno])
8884
rtx init_insn = XEXP (reg_equiv[regno].init_insns, 0);
8885
if (validate_equiv_mem (init_insn, src, dest)
8886
@@ -3357,6 +3404,7 @@
8888
end_alias_analysis ();
8890
+ free (pdx_subregs);
8891
return recorded_label_ref;
8894
Index: gcc/config.gcc
8895
===================================================================
8896
--- a/src/gcc/config.gcc (.../tags/gcc_4_8_1_release)
8897
+++ b/src/gcc/config.gcc (.../branches/gcc-4_8-branch)
8898
@@ -2066,20 +2066,24 @@
8899
extra_options="${extra_options} rs6000/sysv4.opt"
8900
tmake_file="rs6000/t-fprules rs6000/t-rtems t-rtems rs6000/t-ppccomm"
8902
-powerpc-*-linux* | powerpc64-*-linux*)
8904
tm_file="${tm_file} dbxelf.h elfos.h freebsd-spec.h rs6000/sysv4.h"
8905
extra_options="${extra_options} rs6000/sysv4.opt"
8906
tmake_file="rs6000/t-fprules rs6000/t-ppcos ${tmake_file} rs6000/t-ppccomm"
8909
+ tm_file="${tm_file} rs6000/sysv4le.h" ;;
8913
- powerpc64-*-linux*spe* | powerpc64-*-linux*paired*)
8914
+ powerpc64*-*-linux*spe* | powerpc64*-*-linux*paired*)
8915
echo "*** Configuration ${target} not supported" 1>&2
8918
- powerpc-*-linux*spe* | powerpc-*-linux*paired*)
8919
+ powerpc*-*-linux*spe* | powerpc*-*-linux*paired*)
8922
- powerpc64-*-linux*)
8923
+ powerpc64*-*-linux*)
8924
test x$with_cpu != x || cpu_is_64bit=yes
8928
===================================================================
8929
--- a/src/gcc/tlink.c (.../tags/gcc_4_8_1_release)
8930
+++ b/src/gcc/tlink.c (.../branches/gcc-4_8-branch)
8931
@@ -817,18 +817,18 @@
8933
do_tlink (char **ld_argv, char **object_lst ATTRIBUTE_UNUSED)
8935
- int exit = tlink_execute ("ld", ld_argv, ldout, lderrout);
8936
+ int ret = tlink_execute ("ld", ld_argv, ldout, lderrout);
8945
/* Until collect does a better job of figuring out which are object
8946
files, assume that everything on the command line could be. */
8947
if (read_repo_files (ld_argv))
8948
- while (exit && i++ < MAX_ITERATIONS)
8949
+ while (ret && i++ < MAX_ITERATIONS)
8951
if (tlink_verbose >= 3)
8956
fprintf (stderr, _("collect: relinking\n"));
8957
- exit = tlink_execute ("ld", ld_argv, ldout, lderrout);
8958
+ ret = tlink_execute ("ld", ld_argv, ldout, lderrout);
8962
@@ -851,10 +851,10 @@
8964
dump_ld_file (lderrout, stderr);
8969
- error ("ld returned %d exit status", exit);
8970
- collect_exit (exit);
8971
+ error ("ld returned %d exit status", ret);
8976
Index: gcc/config/alpha/alpha.md
8977
===================================================================
8978
--- a/src/gcc/config/alpha/alpha.md (.../tags/gcc_4_8_1_release)
8979
+++ b/src/gcc/config/alpha/alpha.md (.../branches/gcc-4_8-branch)
8981
;; Uses of UNSPEC in this file:
8983
(define_c_enum "unspec" [
8984
+ UNSPEC_XFLT_COMPARE
8988
Index: gcc/config/alpha/alpha.c
8989
===================================================================
8990
--- a/src/gcc/config/alpha/alpha.c (.../tags/gcc_4_8_1_release)
8991
+++ b/src/gcc/config/alpha/alpha.c (.../branches/gcc-4_8-branch)
8992
@@ -2700,12 +2700,12 @@
8995
case GE: case GT: case GEU: case GTU:
8996
- /* These must be swapped. */
8997
- if (op1 != CONST0_RTX (cmp_mode))
8999
- code = swap_condition (code);
9000
- tem = op0, op0 = op1, op1 = tem;
9002
+ /* These normally need swapping, but for integer zero we have
9003
+ special patterns that recognize swapped operands. */
9004
+ if (cmp_mode == DImode && op1 == const0_rtx)
9006
+ code = swap_condition (code);
9007
+ tem = op0, op0 = op1, op1 = tem;
9011
@@ -3067,12 +3067,9 @@
9013
out = gen_reg_rtx (DImode);
9015
- /* What's actually returned is -1,0,1, not a proper boolean value,
9016
- so use an EXPR_LIST as with a generic libcall instead of a
9017
- comparison type expression. */
9018
- note = gen_rtx_EXPR_LIST (VOIDmode, op1, NULL_RTX);
9019
- note = gen_rtx_EXPR_LIST (VOIDmode, op0, note);
9020
- note = gen_rtx_EXPR_LIST (VOIDmode, func, note);
9021
+ /* What's actually returned is -1,0,1, not a proper boolean value. */
9022
+ note = gen_rtx_fmt_ee (cmp_code, VOIDmode, op0, op1);
9023
+ note = gen_rtx_UNSPEC (DImode, gen_rtvec (1, note), UNSPEC_XFLT_COMPARE);
9024
alpha_emit_xfloating_libcall (func, out, operands, 2, note);
9027
Index: gcc/config/i386/i386.md
9028
===================================================================
9029
--- a/src/gcc/config/i386/i386.md (.../tags/gcc_4_8_1_release)
9030
+++ b/src/gcc/config/i386/i386.md (.../branches/gcc-4_8-branch)
9031
@@ -17043,6 +17043,7 @@
9032
"(TARGET_READ_MODIFY_WRITE || optimize_insn_for_size_p ())
9033
&& peep2_reg_dead_p (4, operands[0])
9034
&& !reg_overlap_mentioned_p (operands[0], operands[1])
9035
+ && !reg_overlap_mentioned_p (operands[0], operands[2])
9036
&& (<MODE>mode != QImode
9037
|| immediate_operand (operands[2], QImode)
9038
|| q_regs_operand (operands[2], QImode))
9039
@@ -17107,6 +17108,7 @@
9040
|| immediate_operand (operands[2], SImode)
9041
|| q_regs_operand (operands[2], SImode))
9042
&& !reg_overlap_mentioned_p (operands[0], operands[1])
9043
+ && !reg_overlap_mentioned_p (operands[0], operands[2])
9044
&& ix86_match_ccmode (peep2_next_insn (3),
9045
(GET_CODE (operands[3]) == PLUS
9046
|| GET_CODE (operands[3]) == MINUS)
9047
Index: gcc/config/i386/i386.c
9048
===================================================================
9049
--- a/src/gcc/config/i386/i386.c (.../tags/gcc_4_8_1_release)
9050
+++ b/src/gcc/config/i386/i386.c (.../branches/gcc-4_8-branch)
9051
@@ -6396,7 +6396,7 @@
9053
/* Likewise, error if the ABI requires us to return values in the
9054
x87 registers and the user specified -mno-80387. */
9055
- if (!TARGET_80387 && in_return)
9056
+ if (in_return && !TARGET_FLOAT_RETURNS_IN_80387)
9057
for (i = 0; i < n; i++)
9058
if (regclass[i] == X86_64_X87_CLASS
9059
|| regclass[i] == X86_64_X87UP_CLASS
9060
@@ -35444,6 +35444,46 @@
9064
+/* Fix up a Windows system unwinder issue. If an EH region falls thru into
9065
+ the epilogue, the Windows system unwinder will apply epilogue logic and
9066
+ produce incorrect offsets. This can be avoided by adding a nop between
9067
+ the last insn that can throw and the first insn of the epilogue. */
9070
+ix86_seh_fixup_eh_fallthru (void)
9075
+ FOR_EACH_EDGE (e, ei, EXIT_BLOCK_PTR->preds)
9079
+ /* Find the beginning of the epilogue. */
9080
+ for (insn = BB_END (e->src); insn != NULL; insn = PREV_INSN (insn))
9081
+ if (NOTE_P (insn) && NOTE_KIND (insn) == NOTE_INSN_EPILOGUE_BEG)
9086
+ /* We only care about preceeding insns that can throw. */
9087
+ insn = prev_active_insn (insn);
9088
+ if (insn == NULL || !can_throw_internal (insn))
9091
+ /* Do not separate calls from their debug information. */
9092
+ for (next = NEXT_INSN (insn); next != NULL; next = NEXT_INSN (next))
9094
+ && (NOTE_KIND (next) == NOTE_INSN_VAR_LOCATION
9095
+ || NOTE_KIND (next) == NOTE_INSN_CALL_ARG_LOCATION))
9100
+ emit_insn_after (gen_nops (const1_rtx), insn);
9104
/* Implement machine specific optimizations. We implement padding of returns
9105
for K8 CPUs and pass to avoid 4 jumps in the single 16 byte window. */
9107
@@ -35453,6 +35493,9 @@
9108
with old MDEP_REORGS that are not CFG based. Recompute it now. */
9109
compute_bb_for_insn ();
9111
+ if (TARGET_SEH && current_function_has_exception_handlers ())
9112
+ ix86_seh_fixup_eh_fallthru ();
9114
if (optimize && optimize_function_for_speed_p (cfun))
9116
if (TARGET_PAD_SHORT_FUNCTION)
9117
Index: gcc/config/sh/sh.md
9118
===================================================================
9119
--- a/src/gcc/config/sh/sh.md (.../tags/gcc_4_8_1_release)
9120
+++ b/src/gcc/config/sh/sh.md (.../branches/gcc-4_8-branch)
9121
@@ -12073,10 +12073,10 @@
9123
;; FMA (fused multiply-add) patterns
9124
(define_expand "fmasf4"
9125
- [(set (match_operand:SF 0 "fp_arith_reg_operand" "")
9126
- (fma:SF (match_operand:SF 1 "fp_arith_reg_operand" "")
9127
- (match_operand:SF 2 "fp_arith_reg_operand" "")
9128
- (match_operand:SF 3 "fp_arith_reg_operand" "")))]
9129
+ [(set (match_operand:SF 0 "fp_arith_reg_operand")
9130
+ (fma:SF (match_operand:SF 1 "fp_arith_reg_operand")
9131
+ (match_operand:SF 2 "fp_arith_reg_operand")
9132
+ (match_operand:SF 3 "fp_arith_reg_operand")))]
9133
"TARGET_SH2E || TARGET_SHMEDIA_FPU"
9136
@@ -12107,6 +12107,43 @@
9138
[(set_attr "type" "fparith_media")])
9140
+;; For some cases such as 'a * b + a' the FMA pattern is not generated by
9141
+;; previous transformations. If FMA is generally allowed, let the combine
9142
+;; pass utilize it.
9143
+(define_insn_and_split "*fmasf4"
9144
+ [(set (match_operand:SF 0 "fp_arith_reg_operand" "=f")
9145
+ (plus:SF (mult:SF (match_operand:SF 1 "fp_arith_reg_operand" "%w")
9146
+ (match_operand:SF 2 "fp_arith_reg_operand" "f"))
9147
+ (match_operand:SF 3 "arith_reg_operand" "0")))
9148
+ (use (match_operand:PSI 4 "fpscr_operand"))]
9149
+ "TARGET_SH2E && flag_fp_contract_mode != FP_CONTRACT_OFF"
9151
+ "&& can_create_pseudo_p ()"
9152
+ [(parallel [(set (match_dup 0)
9153
+ (fma:SF (match_dup 1) (match_dup 2) (match_dup 3)))
9154
+ (use (match_dup 4))])]
9156
+ /* Change 'b * a + a' into 'a * b + a'.
9157
+ This is better for register allocation. */
9158
+ if (REGNO (operands[2]) == REGNO (operands[3]))
9160
+ rtx tmp = operands[1];
9161
+ operands[1] = operands[2];
9162
+ operands[2] = tmp;
9165
+ [(set_attr "type" "fp")
9166
+ (set_attr "fp_mode" "single")])
9168
+(define_insn "*fmasf4_media"
9169
+ [(set (match_operand:SF 0 "fp_arith_reg_operand" "=f")
9170
+ (plus:SF (mult:SF (match_operand:SF 1 "fp_arith_reg_operand" "%f")
9171
+ (match_operand:SF 2 "fp_arith_reg_operand" "f"))
9172
+ (match_operand:SF 3 "fp_arith_reg_operand" "0")))]
9173
+ "TARGET_SHMEDIA_FPU && flag_fp_contract_mode != FP_CONTRACT_OFF"
9174
+ "fmac.s %1, %2, %0"
9175
+ [(set_attr "type" "fparith_media")])
9177
(define_expand "divsf3"
9178
[(set (match_operand:SF 0 "arith_reg_operand" "")
9179
(div:SF (match_operand:SF 1 "arith_reg_operand" "")
9180
Index: gcc/config/aarch64/aarch64.c
9181
===================================================================
9182
--- a/src/gcc/config/aarch64/aarch64.c (.../tags/gcc_4_8_1_release)
9183
+++ b/src/gcc/config/aarch64/aarch64.c (.../branches/gcc-4_8-branch)
9184
@@ -3373,7 +3373,7 @@
9185
output_operand_lossage ("invalid operand for '%%%c'", code);
9188
- asm_fprintf (f, "0x%x", UINTVAL (x));
9189
+ asm_fprintf (f, "0x%wx", UINTVAL (x));
9193
Index: gcc/config/rs6000/linux.h
9194
===================================================================
9195
--- a/src/gcc/config/rs6000/linux.h (.../tags/gcc_4_8_1_release)
9196
+++ b/src/gcc/config/rs6000/linux.h (.../branches/gcc-4_8-branch)
9198
#undef LINK_OS_DEFAULT_SPEC
9199
#define LINK_OS_DEFAULT_SPEC "%(link_os_linux)"
9201
+#undef DEFAULT_ASM_ENDIAN
9202
+#if (TARGET_DEFAULT & MASK_LITTLE_ENDIAN)
9203
+#define DEFAULT_ASM_ENDIAN " -mlittle"
9204
+#define LINK_OS_LINUX_EMUL ENDIAN_SELECT(" -m elf32ppclinux", \
9205
+ " -m elf32lppclinux", \
9206
+ " -m elf32lppclinux")
9208
+#define DEFAULT_ASM_ENDIAN " -mbig"
9209
+#define LINK_OS_LINUX_EMUL ENDIAN_SELECT(" -m elf32ppclinux", \
9210
+ " -m elf32lppclinux", \
9211
+ " -m elf32ppclinux")
9214
+#undef LINK_OS_LINUX_SPEC
9215
+#define LINK_OS_LINUX_SPEC LINK_OS_LINUX_EMUL " %{!shared: %{!static: \
9216
+ %{rdynamic:-export-dynamic} \
9217
+ -dynamic-linker " GNU_USER_DYNAMIC_LINKER "}}"
9219
#define LINK_GCC_C_SEQUENCE_SPEC \
9220
"%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
9222
Index: gcc/config/rs6000/linuxspe.h
9223
===================================================================
9224
--- a/src/gcc/config/rs6000/linuxspe.h (.../tags/gcc_4_8_1_release)
9225
+++ b/src/gcc/config/rs6000/linuxspe.h (.../branches/gcc-4_8-branch)
9227
<http://www.gnu.org/licenses/>. */
9229
/* Override rs6000.h and sysv4.h definition. */
9230
+#if (TARGET_DEFAULT & MASK_LITTLE_ENDIAN)
9231
#undef TARGET_DEFAULT
9232
+#define TARGET_DEFAULT (MASK_STRICT_ALIGN | MASK_LITTLE_ENDIAN)
9234
+#undef TARGET_DEFAULT
9235
#define TARGET_DEFAULT MASK_STRICT_ALIGN
9238
#undef ASM_DEFAULT_SPEC
9239
#define ASM_DEFAULT_SPEC "-mppc -mspe -me500"
9240
Index: gcc/config/rs6000/default64.h
9241
===================================================================
9242
--- a/src/gcc/config/rs6000/default64.h (.../tags/gcc_4_8_1_release)
9243
+++ b/src/gcc/config/rs6000/default64.h (.../branches/gcc-4_8-branch)
9245
along with GCC; see the file COPYING3. If not see
9246
<http://www.gnu.org/licenses/>. */
9248
+#if (TARGET_DEFAULT & MASK_LITTLE_ENDIAN)
9249
#undef TARGET_DEFAULT
9250
+#define TARGET_DEFAULT (MASK_PPC_GFXOPT | MASK_POWERPC64 | MASK_64BIT | MASK_LITTLE_ENDIAN)
9252
+#undef TARGET_DEFAULT
9253
#define TARGET_DEFAULT (MASK_PPC_GFXOPT | MASK_POWERPC64 | MASK_64BIT)
9255
Index: gcc/config/rs6000/spe.md
9256
===================================================================
9257
--- a/src/gcc/config/rs6000/spe.md (.../tags/gcc_4_8_1_release)
9258
+++ b/src/gcc/config/rs6000/spe.md (.../branches/gcc-4_8-branch)
9259
@@ -2604,8 +2604,8 @@
9260
&& TARGET_HARD_FLOAT && TARGET_E500_DOUBLE && TARGET_LONG_DOUBLE_128"
9263
- const int hi_word = FLOAT_WORDS_BIG_ENDIAN ? 0 : GET_MODE_SIZE (DFmode);
9264
- const int lo_word = FLOAT_WORDS_BIG_ENDIAN ? GET_MODE_SIZE (DFmode) : 0;
9265
+ const int hi_word = LONG_DOUBLE_LARGE_FIRST ? 0 : GET_MODE_SIZE (DFmode);
9266
+ const int lo_word = LONG_DOUBLE_LARGE_FIRST ? GET_MODE_SIZE (DFmode) : 0;
9267
operands[3] = gen_reg_rtx (DFmode);
9268
operands[4] = gen_reg_rtx (CCFPmode);
9269
operands[5] = simplify_gen_subreg (DFmode, operands[0], TFmode, hi_word);
9270
@@ -2627,8 +2627,8 @@
9271
&& TARGET_HARD_FLOAT && TARGET_E500_DOUBLE && TARGET_LONG_DOUBLE_128"
9274
- const int hi_word = FLOAT_WORDS_BIG_ENDIAN ? 0 : GET_MODE_SIZE (DFmode);
9275
- const int lo_word = FLOAT_WORDS_BIG_ENDIAN ? GET_MODE_SIZE (DFmode) : 0;
9276
+ const int hi_word = LONG_DOUBLE_LARGE_FIRST ? 0 : GET_MODE_SIZE (DFmode);
9277
+ const int lo_word = LONG_DOUBLE_LARGE_FIRST ? GET_MODE_SIZE (DFmode) : 0;
9278
operands[3] = gen_reg_rtx (DFmode);
9279
operands[4] = gen_reg_rtx (CCFPmode);
9280
operands[5] = simplify_gen_subreg (DFmode, operands[0], TFmode, hi_word);
9281
Index: gcc/config/rs6000/linuxaltivec.h
9282
===================================================================
9283
--- a/src/gcc/config/rs6000/linuxaltivec.h (.../tags/gcc_4_8_1_release)
9284
+++ b/src/gcc/config/rs6000/linuxaltivec.h (.../branches/gcc-4_8-branch)
9286
<http://www.gnu.org/licenses/>. */
9288
/* Override rs6000.h and sysv4.h definition. */
9289
+#if (TARGET_DEFAULT & MASK_LITTLE_ENDIAN)
9290
#undef TARGET_DEFAULT
9291
+#define TARGET_DEFAULT (MASK_ALTIVEC | MASK_LITTLE_ENDIAN)
9293
+#undef TARGET_DEFAULT
9294
#define TARGET_DEFAULT MASK_ALTIVEC
9297
#undef SUBSUBTARGET_OVERRIDE_OPTIONS
9298
#define SUBSUBTARGET_OVERRIDE_OPTIONS rs6000_altivec_abi = 1
9299
Index: gcc/config/rs6000/linux64.h
9300
===================================================================
9301
--- a/src/gcc/config/rs6000/linux64.h (.../tags/gcc_4_8_1_release)
9302
+++ b/src/gcc/config/rs6000/linux64.h (.../branches/gcc-4_8-branch)
9303
@@ -180,20 +180,14 @@
9306
#define ASM_SPEC32 "-a32 \
9307
-%{mrelocatable} %{mrelocatable-lib} %{fpic:-K PIC} %{fPIC:-K PIC} \
9308
-%{memb} %{!memb: %{msdata=eabi: -memb}} \
9309
-%{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
9310
- %{mcall-freebsd: -mbig} \
9311
- %{mcall-i960-old: -mlittle} \
9312
- %{mcall-linux: -mbig} \
9313
- %{mcall-netbsd: -mbig} \
9315
+%{mrelocatable} %{mrelocatable-lib} %{fpic|fpie|fPIC|fPIE:-K PIC} \
9316
+%{memb|msdata=eabi: -memb}"
9318
#define ASM_SPEC64 "-a64"
9320
#define ASM_SPEC_COMMON "%(asm_cpu) \
9321
-%{,assembler|,assembler-with-cpp: %{mregnames} %{mno-regnames}} \
9322
-%{mlittle} %{mlittle-endian} %{mbig} %{mbig-endian}"
9323
+%{,assembler|,assembler-with-cpp: %{mregnames} %{mno-regnames}}" \
9324
+ ENDIAN_SELECT(" -mbig", " -mlittle", DEFAULT_ASM_ENDIAN)
9326
#undef SUBSUBTARGET_EXTRA_SPECS
9327
#define SUBSUBTARGET_EXTRA_SPECS \
9328
@@ -212,10 +206,6 @@
9330
#ifndef RS6000_BI_ARCH
9332
-/* 64-bit PowerPC Linux is always big-endian. */
9333
-#undef OPTION_LITTLE_ENDIAN
9334
-#define OPTION_LITTLE_ENDIAN 0
9336
/* 64-bit PowerPC Linux always has a TOC. */
9338
#define TARGET_TOC 1
9339
@@ -376,12 +366,30 @@
9340
#define GNU_USER_DYNAMIC_LINKER64 \
9341
CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64)
9343
+#undef DEFAULT_ASM_ENDIAN
9344
+#if (TARGET_DEFAULT & MASK_LITTLE_ENDIAN)
9345
+#define DEFAULT_ASM_ENDIAN " -mlittle"
9346
+#define LINK_OS_LINUX_EMUL32 ENDIAN_SELECT(" -m elf32ppclinux", \
9347
+ " -m elf32lppclinux", \
9348
+ " -m elf32lppclinux")
9349
+#define LINK_OS_LINUX_EMUL64 ENDIAN_SELECT(" -m elf64ppc", \
9350
+ " -m elf64lppc", \
9353
+#define DEFAULT_ASM_ENDIAN " -mbig"
9354
+#define LINK_OS_LINUX_EMUL32 ENDIAN_SELECT(" -m elf32ppclinux", \
9355
+ " -m elf32lppclinux", \
9356
+ " -m elf32ppclinux")
9357
+#define LINK_OS_LINUX_EMUL64 ENDIAN_SELECT(" -m elf64ppc", \
9358
+ " -m elf64lppc", \
9362
-#define LINK_OS_LINUX_SPEC32 "-m elf32ppclinux %{!shared: %{!static: \
9363
+#define LINK_OS_LINUX_SPEC32 LINK_OS_LINUX_EMUL32 " %{!shared: %{!static: \
9364
%{rdynamic:-export-dynamic} \
9365
-dynamic-linker " GNU_USER_DYNAMIC_LINKER32 "}}"
9367
-#define LINK_OS_LINUX_SPEC64 "-m elf64ppc %{!shared: %{!static: \
9368
+#define LINK_OS_LINUX_SPEC64 LINK_OS_LINUX_EMUL64 " %{!shared: %{!static: \
9369
%{rdynamic:-export-dynamic} \
9370
-dynamic-linker " GNU_USER_DYNAMIC_LINKER64 "}}"
9372
Index: gcc/config/rs6000/rs6000.c
9373
===================================================================
9374
--- a/src/gcc/config/rs6000/rs6000.c (.../tags/gcc_4_8_1_release)
9375
+++ b/src/gcc/config/rs6000/rs6000.c (.../branches/gcc-4_8-branch)
9376
@@ -9066,19 +9066,20 @@
9377
&& cfun->va_list_gpr_size)
9379
int nregs = GP_ARG_NUM_REG - first_reg_offset;
9382
if (va_list_gpr_counter_field)
9384
/* V4 va_list_gpr_size counts number of registers needed. */
9385
- if (nregs > cfun->va_list_gpr_size)
9386
- nregs = cfun->va_list_gpr_size;
9387
+ n_gpr = cfun->va_list_gpr_size;
9391
/* char * va_list instead counts number of bytes needed. */
9392
- if (nregs > cfun->va_list_gpr_size / reg_size)
9393
- nregs = cfun->va_list_gpr_size / reg_size;
9394
+ n_gpr = (cfun->va_list_gpr_size + reg_size - 1) / reg_size;
9396
+ if (nregs > n_gpr)
9399
mem = gen_rtx_MEM (BLKmode,
9400
plus_constant (Pmode, save_area,
9401
@@ -16900,8 +16901,9 @@
9402
shift = gen_reg_rtx (SImode);
9403
addr = gen_lowpart (SImode, addr);
9404
emit_insn (gen_rlwinm (shift, addr, GEN_INT (3), GEN_INT (shift_mask)));
9405
- shift = expand_simple_binop (SImode, XOR, shift, GEN_INT (shift_mask),
9406
- shift, 1, OPTAB_LIB_WIDEN);
9407
+ if (WORDS_BIG_ENDIAN)
9408
+ shift = expand_simple_binop (SImode, XOR, shift, GEN_INT (shift_mask),
9409
+ shift, 1, OPTAB_LIB_WIDEN);
9412
/* Mask for insertion. */
9413
@@ -22151,20 +22153,22 @@
9417
- if (TARGET_MINIMAL_TOC)
9418
+ if (TARGET_ELF || TARGET_MINIMAL_TOC)
9419
fputs (DOUBLE_INT_ASM_OP, file);
9421
fprintf (file, "\t.tc FT_%lx_%lx_%lx_%lx[TC],",
9422
k[0] & 0xffffffff, k[1] & 0xffffffff,
9423
k[2] & 0xffffffff, k[3] & 0xffffffff);
9424
fprintf (file, "0x%lx%08lx,0x%lx%08lx\n",
9425
- k[0] & 0xffffffff, k[1] & 0xffffffff,
9426
- k[2] & 0xffffffff, k[3] & 0xffffffff);
9427
+ k[WORDS_BIG_ENDIAN ? 0 : 1] & 0xffffffff,
9428
+ k[WORDS_BIG_ENDIAN ? 1 : 0] & 0xffffffff,
9429
+ k[WORDS_BIG_ENDIAN ? 2 : 3] & 0xffffffff,
9430
+ k[WORDS_BIG_ENDIAN ? 3 : 2] & 0xffffffff);
9435
- if (TARGET_MINIMAL_TOC)
9436
+ if (TARGET_ELF || TARGET_MINIMAL_TOC)
9437
fputs ("\t.long ", file);
9439
fprintf (file, "\t.tc FT_%lx_%lx_%lx_%lx[TC],",
9440
@@ -22191,18 +22195,19 @@
9444
- if (TARGET_MINIMAL_TOC)
9445
+ if (TARGET_ELF || TARGET_MINIMAL_TOC)
9446
fputs (DOUBLE_INT_ASM_OP, file);
9448
fprintf (file, "\t.tc FD_%lx_%lx[TC],",
9449
k[0] & 0xffffffff, k[1] & 0xffffffff);
9450
fprintf (file, "0x%lx%08lx\n",
9451
- k[0] & 0xffffffff, k[1] & 0xffffffff);
9452
+ k[WORDS_BIG_ENDIAN ? 0 : 1] & 0xffffffff,
9453
+ k[WORDS_BIG_ENDIAN ? 1 : 0] & 0xffffffff);
9458
- if (TARGET_MINIMAL_TOC)
9459
+ if (TARGET_ELF || TARGET_MINIMAL_TOC)
9460
fputs ("\t.long ", file);
9462
fprintf (file, "\t.tc FD_%lx_%lx[TC],",
9463
@@ -22226,16 +22231,19 @@
9467
- if (TARGET_MINIMAL_TOC)
9468
+ if (TARGET_ELF || TARGET_MINIMAL_TOC)
9469
fputs (DOUBLE_INT_ASM_OP, file);
9471
fprintf (file, "\t.tc FS_%lx[TC],", l & 0xffffffff);
9472
- fprintf (file, "0x%lx00000000\n", l & 0xffffffff);
9473
+ if (WORDS_BIG_ENDIAN)
9474
+ fprintf (file, "0x%lx00000000\n", l & 0xffffffff);
9476
+ fprintf (file, "0x%lx\n", l & 0xffffffff);
9481
- if (TARGET_MINIMAL_TOC)
9482
+ if (TARGET_ELF || TARGET_MINIMAL_TOC)
9483
fputs ("\t.long ", file);
9485
fprintf (file, "\t.tc FS_%lx[TC],", l & 0xffffffff);
9486
@@ -22267,9 +22275,8 @@
9490
- /* TOC entries are always Pmode-sized, but since this
9491
- is a bigendian machine then if we're putting smaller
9492
- integer constants in the TOC we have to pad them.
9493
+ /* TOC entries are always Pmode-sized, so when big-endian
9494
+ smaller integer constants in the TOC need to be padded.
9495
(This is still a win over putting the constants in
9496
a separate constant pool, because then we'd have
9497
to have both a TOC entry _and_ the actual constant.)
9498
@@ -22280,7 +22287,7 @@
9499
/* It would be easy to make this work, but it doesn't now. */
9500
gcc_assert (!TARGET_64BIT || POINTER_SIZE >= GET_MODE_BITSIZE (mode));
9502
- if (POINTER_SIZE > GET_MODE_BITSIZE (mode))
9503
+ if (WORDS_BIG_ENDIAN && POINTER_SIZE > GET_MODE_BITSIZE (mode))
9505
#if HOST_BITS_PER_WIDE_INT == 32
9506
lshift_double (low, high, POINTER_SIZE - GET_MODE_BITSIZE (mode),
9507
@@ -22295,7 +22302,7 @@
9511
- if (TARGET_MINIMAL_TOC)
9512
+ if (TARGET_ELF || TARGET_MINIMAL_TOC)
9513
fputs (DOUBLE_INT_ASM_OP, file);
9515
fprintf (file, "\t.tc ID_%lx_%lx[TC],",
9516
@@ -22308,7 +22315,7 @@
9518
if (POINTER_SIZE < GET_MODE_BITSIZE (mode))
9520
- if (TARGET_MINIMAL_TOC)
9521
+ if (TARGET_ELF || TARGET_MINIMAL_TOC)
9522
fputs ("\t.long ", file);
9524
fprintf (file, "\t.tc ID_%lx_%lx[TC],",
9525
@@ -22318,7 +22325,7 @@
9529
- if (TARGET_MINIMAL_TOC)
9530
+ if (TARGET_ELF || TARGET_MINIMAL_TOC)
9531
fputs ("\t.long ", file);
9533
fprintf (file, "\t.tc IS_%lx[TC],", (long) low & 0xffffffff);
9534
@@ -22356,7 +22363,7 @@
9538
- if (TARGET_MINIMAL_TOC)
9539
+ if (TARGET_ELF || TARGET_MINIMAL_TOC)
9540
fputs (TARGET_32BIT ? "\t.long " : DOUBLE_INT_ASM_OP, file);
9543
Index: gcc/config/rs6000/rs6000.h
9544
===================================================================
9545
--- a/src/gcc/config/rs6000/rs6000.h (.../tags/gcc_4_8_1_release)
9546
+++ b/src/gcc/config/rs6000/rs6000.h (.../branches/gcc-4_8-branch)
9547
@@ -662,6 +662,11 @@
9548
instructions for them. Might as well be consistent with bits and bytes. */
9549
#define WORDS_BIG_ENDIAN 1
9551
+/* This says that for the IBM long double the larger magnitude double
9552
+ comes first. It's really a two element double array, and arrays
9553
+ don't index differently between little- and big-endian. */
9554
+#define LONG_DOUBLE_LARGE_FIRST 1
9556
#define MAX_BITS_PER_WORD 64
9558
/* Width of a word, in units (bytes). */
9559
@@ -2289,6 +2294,13 @@
9560
/* How to align the given loop. */
9561
#define LOOP_ALIGN(LABEL) rs6000_loop_align(LABEL)
9563
+/* Alignment guaranteed by __builtin_malloc. */
9564
+/* FIXME: 128-bit alignment is guaranteed by glibc for TARGET_64BIT.
9565
+ However, specifying the stronger guarantee currently leads to
9566
+ a regression in SPEC CPU2006 437.leslie3d. The stronger
9567
+ guarantee should be implemented here once that's fixed. */
9568
+#define MALLOC_ABI_ALIGNMENT (64)
9570
/* Pick up the return address upon entry to a procedure. Used for
9571
dwarf2 unwind information. This also enables the table driven
9573
Index: gcc/config/rs6000/sysv4le.h
9574
===================================================================
9575
--- a/src/gcc/config/rs6000/sysv4le.h (.../tags/gcc_4_8_1_release)
9576
+++ b/src/gcc/config/rs6000/sysv4le.h (.../branches/gcc-4_8-branch)
9578
#undef CC1_ENDIAN_DEFAULT_SPEC
9579
#define CC1_ENDIAN_DEFAULT_SPEC "%(cc1_endian_little)"
9581
+#undef DEFAULT_ASM_ENDIAN
9582
+#define DEFAULT_ASM_ENDIAN " -mlittle"
9584
#undef LINK_TARGET_SPEC
9585
-#define LINK_TARGET_SPEC "\
9586
-%{mbig: --oformat elf32-powerpc } %{mbig-endian: --oformat elf32-powerpc } \
9587
-%{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
9588
- %{mcall-linux: --oformat elf32-powerpc} \
9590
+#define LINK_TARGET_SPEC \
9591
+ ENDIAN_SELECT(" --oformat elf32-powerpc", "", "")
9593
#undef MULTILIB_DEFAULTS
9594
#define MULTILIB_DEFAULTS { "mlittle", "mcall-sysv" }
9595
Index: gcc/config/rs6000/rs6000.md
9596
===================================================================
9597
--- a/src/gcc/config/rs6000/rs6000.md (.../tags/gcc_4_8_1_release)
9598
+++ b/src/gcc/config/rs6000/rs6000.md (.../branches/gcc-4_8-branch)
9599
@@ -1990,6 +1990,8 @@
9600
[(set_attr "length" "4,4,12")
9601
(set_attr "type" "load,store,*")])
9603
+;; We are always BITS_BIG_ENDIAN, so the (const_int 16) below is
9604
+;; correct for -mlittle as well as -mbig.
9606
[(set (match_operand:HI 0 "gpc_reg_operand" "")
9607
(bswap:HI (match_operand:HI 1 "gpc_reg_operand" "")))
9608
@@ -2043,6 +2045,8 @@
9609
[(set_attr "length" "4,4,12")
9610
(set_attr "type" "load,store,*")])
9612
+;; We are always BITS_BIG_ENDIAN, so the bit positions below in
9613
+;; zero_extract insns do not change for -mlittle.
9615
[(set (match_operand:SI 0 "gpc_reg_operand" "")
9616
(bswap:SI (match_operand:SI 1 "gpc_reg_operand" "")))]
9617
@@ -2125,8 +2129,10 @@
9618
rtx op2 = operands[2];
9619
rtx op3 = operands[3];
9620
rtx op4 = operands[4];
9621
- rtx op3_32 = simplify_gen_subreg (SImode, op3, DImode, 4);
9622
- rtx op4_32 = simplify_gen_subreg (SImode, op4, DImode, 4);
9623
+ rtx op3_32 = simplify_gen_subreg (SImode, op3, DImode,
9624
+ BYTES_BIG_ENDIAN ? 4 : 0);
9625
+ rtx op4_32 = simplify_gen_subreg (SImode, op4, DImode,
9626
+ BYTES_BIG_ENDIAN ? 4 : 0);
9630
@@ -2186,8 +2192,10 @@
9631
rtx src = operands[1];
9632
rtx op2 = operands[2];
9633
rtx op3 = operands[3];
9634
- rtx src_si = simplify_gen_subreg (SImode, src, DImode, 4);
9635
- rtx op3_si = simplify_gen_subreg (SImode, op3, DImode, 4);
9636
+ rtx src_si = simplify_gen_subreg (SImode, src, DImode,
9637
+ BYTES_BIG_ENDIAN ? 4 : 0);
9638
+ rtx op3_si = simplify_gen_subreg (SImode, op3, DImode,
9639
+ BYTES_BIG_ENDIAN ? 4 : 0);
9643
@@ -2221,16 +2229,14 @@
9645
word_high = change_address (dest, SImode, addr1);
9646
word_low = change_address (dest, SImode, addr2);
9647
- emit_insn (gen_bswapsi2 (word_high, src_si));
9648
- emit_insn (gen_bswapsi2 (word_low, op3_si));
9652
word_high = change_address (dest, SImode, addr2);
9653
word_low = change_address (dest, SImode, addr1);
9654
- emit_insn (gen_bswapsi2 (word_low, src_si));
9655
- emit_insn (gen_bswapsi2 (word_high, op3_si));
9657
+ emit_insn (gen_bswapsi2 (word_high, src_si));
9658
+ emit_insn (gen_bswapsi2 (word_low, op3_si));
9662
@@ -2247,10 +2253,11 @@
9663
rtx src = operands[1];
9664
rtx op2 = operands[2];
9665
rtx op3 = operands[3];
9666
- rtx dest_si = simplify_gen_subreg (SImode, dest, DImode, 4);
9667
- rtx src_si = simplify_gen_subreg (SImode, src, DImode, 4);
9668
- rtx op2_si = simplify_gen_subreg (SImode, op2, DImode, 4);
9669
- rtx op3_si = simplify_gen_subreg (SImode, op3, DImode, 4);
9670
+ int lo_off = BYTES_BIG_ENDIAN ? 4 : 0;
9671
+ rtx dest_si = simplify_gen_subreg (SImode, dest, DImode, lo_off);
9672
+ rtx src_si = simplify_gen_subreg (SImode, src, DImode, lo_off);
9673
+ rtx op2_si = simplify_gen_subreg (SImode, op2, DImode, lo_off);
9674
+ rtx op3_si = simplify_gen_subreg (SImode, op3, DImode, lo_off);
9676
emit_insn (gen_lshrdi3 (op2, src, GEN_INT (32)));
9677
emit_insn (gen_bswapsi2 (dest_si, src_si));
9678
@@ -2275,15 +2282,15 @@
9682
- rtx dest = operands[0];
9683
- rtx src = operands[1];
9684
- rtx op2 = operands[2];
9685
- rtx dest_hi = simplify_gen_subreg (SImode, dest, DImode, 0);
9686
- rtx dest_lo = simplify_gen_subreg (SImode, dest, DImode, 4);
9687
+ rtx dest = operands[0];
9688
+ rtx src = operands[1];
9689
+ rtx op2 = operands[2];
9690
+ rtx dest1 = simplify_gen_subreg (SImode, dest, DImode, 0);
9691
+ rtx dest2 = simplify_gen_subreg (SImode, dest, DImode, 4);
9699
addr1 = XEXP (src, 0);
9700
if (GET_CODE (addr1) == PLUS)
9701
@@ -2308,19 +2315,11 @@
9702
addr2 = gen_rtx_PLUS (SImode, op2, addr1);
9705
- if (BYTES_BIG_ENDIAN)
9707
- word_high = change_address (src, SImode, addr1);
9708
- word_low = change_address (src, SImode, addr2);
9712
- word_high = change_address (src, SImode, addr2);
9713
- word_low = change_address (src, SImode, addr1);
9715
+ word1 = change_address (src, SImode, addr1);
9716
+ word2 = change_address (src, SImode, addr2);
9718
- emit_insn (gen_bswapsi2 (dest_hi, word_low));
9719
- emit_insn (gen_bswapsi2 (dest_lo, word_high));
9720
+ emit_insn (gen_bswapsi2 (dest2, word1));
9721
+ emit_insn (gen_bswapsi2 (dest1, word2));
9725
@@ -2331,15 +2330,15 @@
9729
- rtx dest = operands[0];
9730
- rtx src = operands[1];
9731
- rtx op2 = operands[2];
9732
- rtx src_high = simplify_gen_subreg (SImode, src, DImode, 0);
9733
- rtx src_low = simplify_gen_subreg (SImode, src, DImode, 4);
9734
+ rtx dest = operands[0];
9735
+ rtx src = operands[1];
9736
+ rtx op2 = operands[2];
9737
+ rtx src1 = simplify_gen_subreg (SImode, src, DImode, 0);
9738
+ rtx src2 = simplify_gen_subreg (SImode, src, DImode, 4);
9746
addr1 = XEXP (dest, 0);
9747
if (GET_CODE (addr1) == PLUS)
9748
@@ -2364,19 +2363,11 @@
9749
addr2 = gen_rtx_PLUS (SImode, op2, addr1);
9752
- if (BYTES_BIG_ENDIAN)
9754
- word_high = change_address (dest, SImode, addr1);
9755
- word_low = change_address (dest, SImode, addr2);
9759
- word_high = change_address (dest, SImode, addr2);
9760
- word_low = change_address (dest, SImode, addr1);
9762
+ word1 = change_address (dest, SImode, addr1);
9763
+ word2 = change_address (dest, SImode, addr2);
9765
- emit_insn (gen_bswapsi2 (word_high, src_low));
9766
- emit_insn (gen_bswapsi2 (word_low, src_high));
9767
+ emit_insn (gen_bswapsi2 (word2, src1));
9768
+ emit_insn (gen_bswapsi2 (word1, src2));
9772
@@ -2387,15 +2378,15 @@
9776
- rtx dest = operands[0];
9777
- rtx src = operands[1];
9778
- rtx src_high = simplify_gen_subreg (SImode, src, DImode, 0);
9779
- rtx src_low = simplify_gen_subreg (SImode, src, DImode, 4);
9780
- rtx dest_high = simplify_gen_subreg (SImode, dest, DImode, 0);
9781
- rtx dest_low = simplify_gen_subreg (SImode, dest, DImode, 4);
9782
+ rtx dest = operands[0];
9783
+ rtx src = operands[1];
9784
+ rtx src1 = simplify_gen_subreg (SImode, src, DImode, 0);
9785
+ rtx src2 = simplify_gen_subreg (SImode, src, DImode, 4);
9786
+ rtx dest1 = simplify_gen_subreg (SImode, dest, DImode, 0);
9787
+ rtx dest2 = simplify_gen_subreg (SImode, dest, DImode, 4);
9789
- emit_insn (gen_bswapsi2 (dest_high, src_low));
9790
- emit_insn (gen_bswapsi2 (dest_low, src_high));
9791
+ emit_insn (gen_bswapsi2 (dest1, src2));
9792
+ emit_insn (gen_bswapsi2 (dest2, src1));
9795
(define_insn "mulsi3"
9796
@@ -4682,6 +4673,41 @@
9798
[(set_attr "type" "fp")])
9800
+;; This expander is here to avoid FLOAT_WORDS_BIGENDIAN tests in
9801
+;; builtins.c and optabs.c that are not correct for IBM long double
9802
+;; when little-endian.
9803
+(define_expand "signbittf2"
9804
+ [(set (match_dup 2)
9805
+ (float_truncate:DF (match_operand:TF 1 "gpc_reg_operand" "")))
9806
+ (set (match_dup 3)
9807
+ (subreg:DI (match_dup 2) 0))
9808
+ (set (match_dup 4)
9810
+ (set (match_operand:SI 0 "gpc_reg_operand" "")
9813
+ && TARGET_HARD_FLOAT
9814
+ && (TARGET_FPRS || TARGET_E500_DOUBLE)
9815
+ && TARGET_LONG_DOUBLE_128"
9817
+ operands[2] = gen_reg_rtx (DFmode);
9818
+ operands[3] = gen_reg_rtx (DImode);
9819
+ if (TARGET_POWERPC64)
9821
+ operands[4] = gen_reg_rtx (DImode);
9822
+ operands[5] = gen_rtx_LSHIFTRT (DImode, operands[3], GEN_INT (63));
9823
+ operands[6] = gen_rtx_SUBREG (SImode, operands[4],
9824
+ WORDS_BIG_ENDIAN ? 4 : 0);
9828
+ operands[4] = gen_reg_rtx (SImode);
9829
+ operands[5] = gen_rtx_SUBREG (SImode, operands[3],
9830
+ WORDS_BIG_ENDIAN ? 0 : 4);
9831
+ operands[6] = gen_rtx_LSHIFTRT (SImode, operands[4], GEN_INT (31));
9835
(define_expand "copysign<mode>3"
9837
(abs:SFDF (match_operand:SFDF 1 "gpc_reg_operand" "")))
9838
@@ -6210,10 +6236,25 @@
9839
[(set (match_operand:DI 0 "gpc_reg_operand" "=&r,&r")
9840
(ashiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
9841
(match_operand:SI 2 "const_int_operand" "M,i")))]
9842
- "TARGET_32BIT && !TARGET_POWERPC64 && WORDS_BIG_ENDIAN"
9844
- srawi %0,%1,31\;srawi %L0,%1,%h2
9845
- srwi %L0,%L1,%h2\;insrwi %L0,%1,%h2,0\;srawi %0,%1,%h2"
9846
+ "!TARGET_POWERPC64"
9849
+ switch (which_alternative)
9852
+ gcc_unreachable ();
9854
+ if (WORDS_BIG_ENDIAN)
9855
+ return \"srawi %0,%1,31\;srawi %L0,%1,%h2\";
9857
+ return \"srawi %L0,%L1,31\;srawi %0,%L1,%h2\";
9859
+ if (WORDS_BIG_ENDIAN)
9860
+ return \"srwi %L0,%L1,%h2\;insrwi %L0,%1,%h2,0\;srawi %0,%1,%h2\";
9862
+ return \"srwi %0,%1,%h2\;insrwi %0,%L1,%h2,0\;srawi %L0,%L1,%h2\";
9865
[(set_attr "type" "two,three")
9866
(set_attr "length" "8,12")])
9868
@@ -7064,13 +7105,12 @@
9869
[(set (match_operand:DI 0 "gpc_reg_operand" "")
9870
(ashiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "")
9871
(match_operand:SI 2 "reg_or_cint_operand" "")))]
9872
- "WORDS_BIG_ENDIAN"
9876
if (TARGET_POWERPC64)
9878
- else if (TARGET_32BIT && GET_CODE (operands[2]) == CONST_INT
9879
- && WORDS_BIG_ENDIAN)
9880
+ else if (GET_CODE (operands[2]) == CONST_INT)
9882
emit_insn (gen_ashrdi3_no_power (operands[0], operands[1], operands[2]));
9884
@@ -8277,8 +8317,8 @@
9885
"&& reload_completed"
9888
- const int lo_word = FLOAT_WORDS_BIG_ENDIAN ? GET_MODE_SIZE (DFmode) : 0;
9889
- const int hi_word = FLOAT_WORDS_BIG_ENDIAN ? 0 : GET_MODE_SIZE (DFmode);
9890
+ const int lo_word = LONG_DOUBLE_LARGE_FIRST ? GET_MODE_SIZE (DFmode) : 0;
9891
+ const int hi_word = LONG_DOUBLE_LARGE_FIRST ? 0 : GET_MODE_SIZE (DFmode);
9892
emit_move_insn (simplify_gen_subreg (DFmode, operands[0], TFmode, hi_word),
9894
emit_move_insn (simplify_gen_subreg (DFmode, operands[0], TFmode, lo_word),
9895
@@ -8507,8 +8547,8 @@
9896
&& TARGET_LONG_DOUBLE_128"
9899
- const int hi_word = FLOAT_WORDS_BIG_ENDIAN ? 0 : GET_MODE_SIZE (DFmode);
9900
- const int lo_word = FLOAT_WORDS_BIG_ENDIAN ? GET_MODE_SIZE (DFmode) : 0;
9901
+ const int hi_word = LONG_DOUBLE_LARGE_FIRST ? 0 : GET_MODE_SIZE (DFmode);
9902
+ const int lo_word = LONG_DOUBLE_LARGE_FIRST ? GET_MODE_SIZE (DFmode) : 0;
9903
operands[3] = gen_reg_rtx (DFmode);
9904
operands[4] = gen_reg_rtx (CCFPmode);
9905
operands[5] = simplify_gen_subreg (DFmode, operands[0], TFmode, hi_word);
9906
@@ -11609,8 +11649,8 @@
9910
- const int lo_word = FLOAT_WORDS_BIG_ENDIAN ? GET_MODE_SIZE (DFmode) : 0;
9911
- const int hi_word = FLOAT_WORDS_BIG_ENDIAN ? 0 : GET_MODE_SIZE (DFmode);
9912
+ const int lo_word = LONG_DOUBLE_LARGE_FIRST ? GET_MODE_SIZE (DFmode) : 0;
9913
+ const int hi_word = LONG_DOUBLE_LARGE_FIRST ? 0 : GET_MODE_SIZE (DFmode);
9915
operands[5] = simplify_gen_subreg (DFmode, operands[1], TFmode, hi_word);
9916
operands[6] = simplify_gen_subreg (DFmode, operands[1], TFmode, lo_word);
9917
Index: gcc/config/rs6000/sysv4.h
9918
===================================================================
9919
--- a/src/gcc/config/rs6000/sysv4.h (.../tags/gcc_4_8_1_release)
9920
+++ b/src/gcc/config/rs6000/sysv4.h (.../branches/gcc-4_8-branch)
9921
@@ -187,12 +187,6 @@
9925
- if (rs6000_current_abi == ABI_AIX && TARGET_LITTLE_ENDIAN) \
9927
- rs6000_isa_flags &= ~OPTION_MASK_LITTLE_ENDIAN; \
9928
- error ("-mcall-aixdesc must be big endian"); \
9931
if (TARGET_SECURE_PLT != secure_plt) \
9933
error ("-msecure-plt not supported by your assembler"); \
9934
@@ -523,19 +517,24 @@
9938
+/* Select one of BIG_OPT, LITTLE_OPT or DEFAULT_OPT depending
9939
+ on various -mbig, -mlittle and -mcall- options. */
9940
+#define ENDIAN_SELECT(BIG_OPT, LITTLE_OPT, DEFAULT_OPT) \
9941
+"%{mlittle|mlittle-endian:" LITTLE_OPT ";" \
9942
+ "mbig|mbig-endian:" BIG_OPT ";" \
9943
+ "mcall-aixdesc|mcall-freebsd|mcall-netbsd|" \
9944
+ "mcall-openbsd|mcall-linux:" BIG_OPT ";" \
9945
+ "mcall-i960-old:" LITTLE_OPT ";" \
9946
+ ":" DEFAULT_OPT "}"
9948
+#define DEFAULT_ASM_ENDIAN " -mbig"
9951
#define ASM_SPEC "%(asm_cpu) \
9952
%{,assembler|,assembler-with-cpp: %{mregnames} %{mno-regnames}} \
9953
%{mrelocatable} %{mrelocatable-lib} %{fpic|fpie|fPIC|fPIE:-K PIC} \
9954
-%{memb|msdata=eabi: -memb} \
9955
-%{mlittle|mlittle-endian:-mlittle; \
9956
- mbig|mbig-endian :-mbig; \
9961
- mcall-linux :-mbig; \
9962
- mcall-i960-old :-mlittle}"
9963
+%{memb|msdata=eabi: -memb}" \
9964
+ENDIAN_SELECT(" -mbig", " -mlittle", DEFAULT_ASM_ENDIAN)
9966
#define CC1_ENDIAN_BIG_SPEC ""
9968
@@ -553,17 +552,10 @@
9971
/* Pass -G xxx to the compiler and set correct endian mode. */
9972
-#define CC1_SPEC "%{G*} %(cc1_cpu) \
9973
-%{mlittle|mlittle-endian: %(cc1_endian_little); \
9974
- mbig |mbig-endian : %(cc1_endian_big); \
9979
- mcall-linux : -mbig %(cc1_endian_big); \
9980
- mcall-i960-old : -mlittle %(cc1_endian_little); \
9981
- : %(cc1_endian_default)} \
9982
-%{meabi: %{!mcall-*: -mcall-sysv }} \
9983
+#define CC1_SPEC "%{G*} %(cc1_cpu)" \
9984
+ ENDIAN_SELECT(" %(cc1_endian_big)", " %(cc1_endian_little)", \
9985
+ " %(cc1_endian_default)") \
9986
+"%{meabi: %{!mcall-*: -mcall-sysv }} \
9987
%{!meabi: %{!mno-eabi: \
9988
%{mrelocatable: -meabi } \
9989
%{mcall-freebsd: -mno-eabi } \
9990
@@ -607,11 +599,8 @@
9991
%{symbolic:-Bsymbolic -G -dy -z text }"
9993
/* Override the default target of the linker. */
9994
-#define LINK_TARGET_SPEC "\
9995
-%{mlittle: --oformat elf32-powerpcle } %{mlittle-endian: --oformat elf32-powerpcle } \
9996
-%{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
9997
- %{mcall-i960-old: --oformat elf32-powerpcle} \
9999
+#define LINK_TARGET_SPEC \
10000
+ ENDIAN_SELECT("", " --oformat elf32-powerpcle", "")
10002
/* Any specific OS flags. */
10003
#define LINK_OS_SPEC "\
10004
Index: gcc/collect2.c
10005
===================================================================
10006
--- a/src/gcc/collect2.c (.../tags/gcc_4_8_1_release)
10007
+++ b/src/gcc/collect2.c (.../branches/gcc-4_8-branch)
10008
@@ -366,8 +366,8 @@
10010
/* Delete tempfiles and exit function. */
10013
-collect_exit (int status)
10015
+collect_atexit (void)
10017
if (c_file != 0 && c_file[0])
10018
maybe_unlink (c_file);
10019
@@ -395,13 +395,8 @@
10020
maybe_unlink (lderrout);
10023
- if (status != 0 && output_file != 0 && output_file[0])
10024
- maybe_unlink (output_file);
10027
maybe_unlink (response_file);
10033
@@ -970,6 +965,9 @@
10034
signal (SIGCHLD, SIG_DFL);
10037
+ if (atexit (collect_atexit) != 0)
10038
+ fatal_error ("atexit failed");
10040
/* Unlock the stdio streams. */
10041
unlock_std_streams ();
10043
@@ -1110,55 +1108,55 @@
10044
if (ld_file_name == 0)
10046
#ifdef REAL_LD_FILE_NAME
10047
- ld_file_name = find_a_file (&path, REAL_LD_FILE_NAME);
10048
+ ld_file_name = find_a_file (&path, REAL_LD_FILE_NAME, X_OK);
10049
if (ld_file_name == 0)
10051
/* Search the (target-specific) compiler dirs for ld'. */
10052
- ld_file_name = find_a_file (&cpath, real_ld_suffix);
10053
+ ld_file_name = find_a_file (&cpath, real_ld_suffix, X_OK);
10054
/* Likewise for `collect-ld'. */
10055
if (ld_file_name == 0)
10057
- ld_file_name = find_a_file (&cpath, collect_ld_suffix);
10058
+ ld_file_name = find_a_file (&cpath, collect_ld_suffix, X_OK);
10059
use_collect_ld = ld_file_name != 0;
10061
/* Search the compiler directories for `ld'. We have protection against
10062
recursive calls in find_a_file. */
10063
if (ld_file_name == 0)
10064
- ld_file_name = find_a_file (&cpath, ld_suffixes[selected_linker]);
10065
+ ld_file_name = find_a_file (&cpath, ld_suffixes[selected_linker], X_OK);
10066
/* Search the ordinary system bin directories
10067
for `ld' (if native linking) or `TARGET-ld' (if cross). */
10068
if (ld_file_name == 0)
10069
- ld_file_name = find_a_file (&path, full_ld_suffixes[selected_linker]);
10070
+ ld_file_name = find_a_file (&path, full_ld_suffixes[selected_linker], X_OK);
10072
#ifdef REAL_NM_FILE_NAME
10073
- nm_file_name = find_a_file (&path, REAL_NM_FILE_NAME);
10074
+ nm_file_name = find_a_file (&path, REAL_NM_FILE_NAME, X_OK);
10075
if (nm_file_name == 0)
10077
- nm_file_name = find_a_file (&cpath, gnm_suffix);
10078
+ nm_file_name = find_a_file (&cpath, gnm_suffix, X_OK);
10079
if (nm_file_name == 0)
10080
- nm_file_name = find_a_file (&path, full_gnm_suffix);
10081
+ nm_file_name = find_a_file (&path, full_gnm_suffix, X_OK);
10082
if (nm_file_name == 0)
10083
- nm_file_name = find_a_file (&cpath, nm_suffix);
10084
+ nm_file_name = find_a_file (&cpath, nm_suffix, X_OK);
10085
if (nm_file_name == 0)
10086
- nm_file_name = find_a_file (&path, full_nm_suffix);
10087
+ nm_file_name = find_a_file (&path, full_nm_suffix, X_OK);
10090
- ldd_file_name = find_a_file (&cpath, ldd_suffix);
10091
+ ldd_file_name = find_a_file (&cpath, ldd_suffix, X_OK);
10092
if (ldd_file_name == 0)
10093
- ldd_file_name = find_a_file (&path, full_ldd_suffix);
10094
+ ldd_file_name = find_a_file (&path, full_ldd_suffix, X_OK);
10097
#ifdef REAL_STRIP_FILE_NAME
10098
- strip_file_name = find_a_file (&path, REAL_STRIP_FILE_NAME);
10099
+ strip_file_name = find_a_file (&path, REAL_STRIP_FILE_NAME, X_OK);
10100
if (strip_file_name == 0)
10102
- strip_file_name = find_a_file (&cpath, gstrip_suffix);
10103
+ strip_file_name = find_a_file (&cpath, gstrip_suffix, X_OK);
10104
if (strip_file_name == 0)
10105
- strip_file_name = find_a_file (&path, full_gstrip_suffix);
10106
+ strip_file_name = find_a_file (&path, full_gstrip_suffix, X_OK);
10107
if (strip_file_name == 0)
10108
- strip_file_name = find_a_file (&cpath, strip_suffix);
10109
+ strip_file_name = find_a_file (&cpath, strip_suffix, X_OK);
10110
if (strip_file_name == 0)
10111
- strip_file_name = find_a_file (&path, full_strip_suffix);
10112
+ strip_file_name = find_a_file (&path, full_strip_suffix, X_OK);
10114
/* Determine the full path name of the C compiler to use. */
10115
c_file_name = getenv ("COLLECT_GCC");
10116
@@ -1171,12 +1169,12 @@
10120
- p = find_a_file (&cpath, c_file_name);
10121
+ p = find_a_file (&cpath, c_file_name, X_OK);
10123
/* Here it should be safe to use the system search path since we should have
10124
already qualified the name of the compiler when it is needed. */
10126
- p = find_a_file (&path, c_file_name);
10127
+ p = find_a_file (&path, c_file_name, X_OK);
10131
@@ -1813,7 +1811,7 @@
10132
error ("%s terminated with signal %d [%s]%s",
10133
prog, sig, strsignal(sig),
10134
WCOREDUMP(status) ? ", core dumped" : "");
10135
- collect_exit (FATAL_EXIT_CODE);
10136
+ exit (FATAL_EXIT_CODE);
10139
if (WIFEXITED (status))
10140
@@ -1829,7 +1827,7 @@
10143
error ("%s returned %d exit status", prog, ret);
10144
- collect_exit (ret);
10149
Index: gcc/collect2.h
10150
===================================================================
10151
--- a/src/gcc/collect2.h (.../tags/gcc_4_8_1_release)
10152
+++ b/src/gcc/collect2.h (.../branches/gcc-4_8-branch)
10154
extern struct pex_obj *collect_execute (const char *, char **, const char *,
10155
const char *, int flags);
10157
-extern void collect_exit (int) ATTRIBUTE_NORETURN;
10159
extern int collect_wait (const char *, struct pex_obj *);
10161
extern void dump_ld_file (const char *, FILE *);
10162
Index: gcc/file-find.c
10163
===================================================================
10164
--- a/src/gcc/file-find.c (.../tags/gcc_4_8_1_release)
10165
+++ b/src/gcc/file-find.c (.../branches/gcc-4_8-branch)
10170
-find_a_file (struct path_prefix *pprefix, const char *name)
10171
+find_a_file (struct path_prefix *pprefix, const char *name, int mode)
10174
struct prefix_list *pl;
10177
if (IS_ABSOLUTE_PATH (name))
10179
- if (access (name, X_OK) == 0)
10180
+ if (access (name, mode) == 0)
10182
strcpy (temp, name);
10185
strcpy (temp, name);
10186
strcat (temp, HOST_EXECUTABLE_SUFFIX);
10188
- if (access (temp, X_OK) == 0)
10189
+ if (access (temp, mode) == 0)
10195
if (stat (temp, &st) >= 0
10196
&& ! S_ISDIR (st.st_mode)
10197
- && access (temp, X_OK) == 0)
10198
+ && access (temp, mode) == 0)
10201
#ifdef HOST_EXECUTABLE_SUFFIX
10204
if (stat (temp, &st) >= 0
10205
&& ! S_ISDIR (st.st_mode)
10206
- && access (temp, X_OK) == 0)
10207
+ && access (temp, mode) == 0)
10211
Index: libgo/configure
10212
===================================================================
10213
--- a/src/libgo/configure (.../tags/gcc_4_8_1_release)
10214
+++ b/src/libgo/configure (.../branches/gcc-4_8-branch)
10215
@@ -2496,7 +2496,7 @@
10216
ac_config_headers="$ac_config_headers config.h"
10219
-libtool_VERSION=3:1:0
10220
+libtool_VERSION=4:0:0
10223
# Default to --enable-multilib
10224
Index: libgo/Makefile.in
10225
===================================================================
10226
--- a/src/libgo/Makefile.in (.../tags/gcc_4_8_1_release)
10227
+++ b/src/libgo/Makefile.in (.../branches/gcc-4_8-branch)
10228
@@ -208,7 +208,7 @@
10229
go-reflect-call.lo go-reflect-map.lo go-rune.lo \
10230
go-runtime-error.lo go-setenv.lo go-signal.lo go-strcmp.lo \
10231
go-string-to-byte-array.lo go-string-to-int-array.lo \
10232
- go-strplus.lo go-strslice.lo go-traceback.lo go-trampoline.lo \
10233
+ go-strplus.lo go-strslice.lo go-traceback.lo \
10234
go-type-complex.lo go-type-eface.lo go-type-error.lo \
10235
go-type-float.lo go-type-identity.lo go-type-interface.lo \
10236
go-type-string.lo go-typedesc-equal.lo go-typestring.lo \
10237
@@ -822,7 +822,6 @@
10238
runtime/go-strplus.c \
10239
runtime/go-strslice.c \
10240
runtime/go-traceback.c \
10241
- runtime/go-trampoline.c \
10242
runtime/go-type-complex.c \
10243
runtime/go-type-eface.c \
10244
runtime/go-type-error.c \
10245
@@ -2519,7 +2518,6 @@
10246
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/go-strplus.Plo@am__quote@
10247
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/go-strslice.Plo@am__quote@
10248
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/go-traceback.Plo@am__quote@
10249
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/go-trampoline.Plo@am__quote@
10250
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/go-type-complex.Plo@am__quote@
10251
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/go-type-eface.Plo@am__quote@
10252
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/go-type-error.Plo@am__quote@
10253
@@ -2959,13 +2957,6 @@
10254
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
10255
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o go-traceback.lo `test -f 'runtime/go-traceback.c' || echo '$(srcdir)/'`runtime/go-traceback.c
10257
-go-trampoline.lo: runtime/go-trampoline.c
10258
-@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT go-trampoline.lo -MD -MP -MF $(DEPDIR)/go-trampoline.Tpo -c -o go-trampoline.lo `test -f 'runtime/go-trampoline.c' || echo '$(srcdir)/'`runtime/go-trampoline.c
10259
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/go-trampoline.Tpo $(DEPDIR)/go-trampoline.Plo
10260
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='runtime/go-trampoline.c' object='go-trampoline.lo' libtool=yes @AMDEPBACKSLASH@
10261
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
10262
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o go-trampoline.lo `test -f 'runtime/go-trampoline.c' || echo '$(srcdir)/'`runtime/go-trampoline.c
10264
go-type-complex.lo: runtime/go-type-complex.c
10265
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT go-type-complex.lo -MD -MP -MF $(DEPDIR)/go-type-complex.Tpo -c -o go-type-complex.lo `test -f 'runtime/go-type-complex.c' || echo '$(srcdir)/'`runtime/go-type-complex.c
10266
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/go-type-complex.Tpo $(DEPDIR)/go-type-complex.Plo
10267
Index: libgo/runtime/go-reflect-call.c
10268
===================================================================
10269
--- a/src/libgo/runtime/go-reflect-call.c (.../tags/gcc_4_8_1_release)
10270
+++ b/src/libgo/runtime/go-reflect-call.c (.../branches/gcc-4_8-branch)
10271
@@ -302,7 +302,9 @@
10272
in_types = ((const struct __go_type_descriptor **)
10273
func->__in.__values);
10275
- num_args = num_params + (is_interface ? 1 : 0);
10276
+ num_args = (num_params
10277
+ + (is_interface ? 1 : 0)
10278
+ + (!is_interface && !is_method ? 1 : 0));
10279
args = (ffi_type **) __go_alloc (num_args * sizeof (ffi_type *));
10282
@@ -319,6 +321,12 @@
10283
for (; i < num_params; ++i)
10284
args[i + off] = go_type_to_ffi (in_types[i]);
10286
+ if (!is_interface && !is_method)
10288
+ // There is a closure argument, a pointer.
10289
+ args[i + off] = &ffi_type_pointer;
10292
rettype = go_func_return_ffi (func);
10294
status = ffi_prep_cif (cif, FFI_DEFAULT_ABI, num_args, rettype, args);
10295
@@ -491,11 +499,24 @@
10298
/* Call a function. The type of the function is FUNC_TYPE, and the
10299
- address is FUNC_ADDR. PARAMS is an array of parameter addresses.
10300
- RESULTS is an array of result addresses. */
10301
+ closure is FUNC_VAL. PARAMS is an array of parameter addresses.
10302
+ RESULTS is an array of result addresses.
10304
+ If IS_INTERFACE is true this is a call to an interface method and
10305
+ the first argument is the receiver, which is always a pointer.
10306
+ This argument, the receiver, is not described in FUNC_TYPE.
10308
+ If IS_METHOD is true this is a call to a method expression. The
10309
+ first argument is the receiver. It is described in FUNC_TYPE, but
10310
+ regardless of FUNC_TYPE, it is passed as a pointer.
10312
+ If neither IS_INTERFACE nor IS_METHOD is true then we are calling a
10313
+ function indirectly, and the caller is responsible for passing a
10314
+ trailing closure argument, a pointer, which is not described in
10318
-reflect_call (const struct __go_func_type *func_type, const void *func_addr,
10319
+reflect_call (const struct __go_func_type *func_type, FuncVal *func_val,
10320
_Bool is_interface, _Bool is_method, void **params,
10323
@@ -507,7 +528,7 @@
10325
call_result = (unsigned char *) malloc (go_results_size (func_type));
10327
- ffi_call (&cif, func_addr, call_result, params);
10328
+ ffi_call (&cif, func_val->fn, call_result, params);
10330
/* Some day we may need to free result values if RESULTS is
10332
@@ -521,7 +542,7 @@
10335
reflect_call (const struct __go_func_type *func_type __attribute__ ((unused)),
10336
- const void *func_addr __attribute__ ((unused)),
10337
+ FuncVal *func_val __attribute__ ((unused)),
10338
_Bool is_interface __attribute__ ((unused)),
10339
_Bool is_method __attribute__ ((unused)),
10340
void **params __attribute__ ((unused)),
10341
Index: libgo/runtime/mfinal.c
10342
===================================================================
10343
--- a/src/libgo/runtime/mfinal.c (.../tags/gcc_4_8_1_release)
10344
+++ b/src/libgo/runtime/mfinal.c (.../branches/gcc-4_8-branch)
10346
typedef struct Fin Fin;
10349
- void (*fn)(void*);
10351
const struct __go_func_type *ft;
10358
-addfintab(Fintab *t, void *k, void (*fn)(void*), const struct __go_func_type *ft)
10359
+addfintab(Fintab *t, void *k, FuncVal *fn, const struct __go_func_type *ft)
10363
@@ -137,7 +137,7 @@
10367
-runtime_addfinalizer(void *p, void (*f)(void*), const struct __go_func_type *ft)
10368
+runtime_addfinalizer(void *p, FuncVal *f, const struct __go_func_type *ft)
10372
@@ -175,7 +175,7 @@
10373
// get finalizer; if del, delete finalizer.
10374
// caller is responsible for updating RefHasFinalizer (special) bit.
10376
-runtime_getfinalizer(void *p, bool del, void (**fn)(void*), const struct __go_func_type **ft)
10377
+runtime_getfinalizer(void *p, bool del, FuncVal **fn, const struct __go_func_type **ft)
10381
Index: libgo/runtime/malloc.h
10382
===================================================================
10383
--- a/src/libgo/runtime/malloc.h (.../tags/gcc_4_8_1_release)
10384
+++ b/src/libgo/runtime/malloc.h (.../branches/gcc-4_8-branch)
10385
@@ -485,7 +485,7 @@
10386
void runtime_gchelper(void);
10388
struct __go_func_type;
10389
-bool runtime_getfinalizer(void *p, bool del, void (**fn)(void*), const struct __go_func_type **ft);
10390
+bool runtime_getfinalizer(void *p, bool del, FuncVal **fn, const struct __go_func_type **ft);
10391
void runtime_walkfintab(void (*fn)(void*), void (*scan)(Obj));
10394
@@ -505,4 +505,3 @@
10395
void runtime_memorydump(void);
10397
void runtime_time_scan(void (*)(Obj));
10398
-void runtime_trampoline_scan(void (*)(Obj));
10399
Index: libgo/runtime/time.goc
10400
===================================================================
10401
--- a/src/libgo/runtime/time.goc (.../tags/gcc_4_8_1_release)
10402
+++ b/src/libgo/runtime/time.goc (.../branches/gcc-4_8-branch)
10403
@@ -49,13 +49,16 @@
10405
// Ready the goroutine e.data.
10407
-ready(int64 now, Eface e)
10408
+ready(int64 now, Eface e, void *closure)
10413
runtime_ready(e.__object);
10416
+static FuncVal readyv = {(void(*)(void))ready};
10418
// Put the current goroutine to sleep for ns nanoseconds.
10420
runtime_tsleep(int64 ns, const char *reason)
10423
t.when = runtime_nanotime() + ns;
10427
t.arg.__object = g;
10428
runtime_lock(&timers);
10430
@@ -158,7 +161,7 @@
10434
- void (*f)(int64, Eface);
10435
+ void (*f)(int64, Eface, void *);
10439
@@ -184,12 +187,12 @@
10441
t->i = -1; // mark as removed
10444
+ f = (void*)t->fv->fn;
10446
runtime_unlock(&timers);
10448
runtime_raceacquire(t);
10450
+ f(now, arg, &t->fv);
10451
runtime_lock(&timers);
10454
Index: libgo/runtime/runtime.h
10455
===================================================================
10456
--- a/src/libgo/runtime/runtime.h (.../tags/gcc_4_8_1_release)
10457
+++ b/src/libgo/runtime/runtime.h (.../branches/gcc-4_8-branch)
10459
typedef union Lock Lock;
10460
typedef struct M M;
10461
typedef union Note Note;
10462
+typedef struct FuncVal FuncVal;
10463
typedef struct SigTab SigTab;
10464
typedef struct MCache MCache;
10465
typedef struct FixAlloc FixAlloc;
10466
@@ -147,6 +148,11 @@
10472
+ void (*fn)(void);
10473
+ // variable-size, fn-specific data here
10477
// the struct must consist of only uint64's,
10478
@@ -313,7 +319,7 @@
10479
// a well-behaved function and not block.
10482
- void (*f)(int64, Eface);
10487
@@ -540,7 +546,7 @@
10488
void runtime_printcomplex(__complex double);
10490
struct __go_func_type;
10491
-void reflect_call(const struct __go_func_type *, const void *, _Bool, _Bool,
10492
+void reflect_call(const struct __go_func_type *, FuncVal *, _Bool, _Bool,
10494
__asm__ (GOSYM_PREFIX "reflect.call");
10496
@@ -570,7 +576,7 @@
10497
#define PREFETCH(p) __builtin_prefetch(p)
10499
struct __go_func_type;
10500
-bool runtime_addfinalizer(void*, void(*fn)(void*), const struct __go_func_type *);
10501
+bool runtime_addfinalizer(void*, FuncVal *fn, const struct __go_func_type *);
10502
#define runtime_getcallersp(p) __builtin_frame_address(1)
10503
int32 runtime_mcount(void);
10504
int32 runtime_gcount(void);
10505
Index: libgo/runtime/mgc0.c
10506
===================================================================
10507
--- a/src/libgo/runtime/mgc0.c (.../tags/gcc_4_8_1_release)
10508
+++ b/src/libgo/runtime/mgc0.c (.../branches/gcc-4_8-branch)
10509
@@ -120,7 +120,7 @@
10510
typedef struct Finalizer Finalizer;
10513
- void (*fn)(void*);
10516
const struct __go_func_type *ft;
10518
@@ -1130,7 +1130,6 @@
10519
addroot((Obj){(byte*)&runtime_allm, sizeof runtime_allm, 0});
10520
runtime_MProf_Mark(addroot);
10521
runtime_time_scan(addroot);
10522
- runtime_trampoline_scan(addroot);
10525
allspans = runtime_mheap.allspans;
10526
@@ -1182,7 +1181,7 @@
10528
handlespecial(byte *p, uintptr size)
10530
- void (*fn)(void*);
10532
const struct __go_func_type *ft;
10535
@@ -1731,11 +1730,12 @@
10536
for(; fb; fb=next) {
10538
for(i=0; i<(uint32)fb->cnt; i++) {
10543
params[0] = &f->arg;
10544
- reflect_call(f->ft, (void*)f->fn, 0, 0, params, nil);
10546
+ reflect_call(f->ft, f->fn, 0, 0, params, nil);
10550
Index: libgo/runtime/parfor.c
10551
===================================================================
10552
--- a/src/libgo/runtime/parfor.c (.../tags/gcc_4_8_1_release)
10553
+++ b/src/libgo/runtime/parfor.c (.../branches/gcc-4_8-branch)
10556
runtime_parforsetup2(ParFor *desc, uint32 nthr, uint32 n, void *ctx, bool wait, void *body)
10558
- runtime_parforsetup(desc, nthr, n, ctx, wait, (void(*)(ParFor*, uint32))body);
10559
+ runtime_parforsetup(desc, nthr, n, ctx, wait, *(void(**)(ParFor*, uint32))body);
10563
Index: libgo/configure.ac
10564
===================================================================
10565
--- a/src/libgo/configure.ac (.../tags/gcc_4_8_1_release)
10566
+++ b/src/libgo/configure.ac (.../branches/gcc-4_8-branch)
10568
AC_CONFIG_SRCDIR(Makefile.am)
10569
AC_CONFIG_HEADER(config.h)
10571
-libtool_VERSION=3:1:0
10572
+libtool_VERSION=4:0:0
10573
AC_SUBST(libtool_VERSION)
10575
AM_ENABLE_MULTILIB(, ..)
10576
Index: libgo/go/runtime/extern.go
10577
===================================================================
10578
--- a/src/libgo/go/runtime/extern.go (.../tags/gcc_4_8_1_release)
10579
+++ b/src/libgo/go/runtime/extern.go (.../branches/gcc-4_8-branch)
10581
// implemented in symtab.c
10582
func funcline_go(*Func, uintptr) (string, int)
10584
-// mid returns the current OS thread (m) id.
10587
// SetFinalizer sets the finalizer associated with x to f.
10588
// When the garbage collector finds an unreachable block
10589
// with an associated finalizer, it clears the association and runs
10590
Index: libgo/go/runtime/parfor_test.go
10591
===================================================================
10592
--- a/src/libgo/go/runtime/parfor_test.go (.../tags/gcc_4_8_1_release)
10593
+++ b/src/libgo/go/runtime/parfor_test.go (.../branches/gcc-4_8-branch)
10598
+var gdata []uint64
10600
// Simple serial sanity test for parallelfor.
10601
func TestParFor(t *testing.T) {
10606
desc := NewParFor(P)
10607
+ // Avoid making func a closure: parfor cannot invoke them.
10608
+ // Since it doesn't happen in the C code, it's not worth doing
10609
+ // just for the test.
10611
ParForSetup(desc, P, N, nil, true, func(desc *ParFor, i uint32) {
10613
data[i] = data[i]*data[i] + 1
10616
@@ -111,7 +118,9 @@
10617
P := GOMAXPROCS(-1)
10618
c := make(chan bool, P)
10619
desc := NewParFor(uint32(P))
10621
ParForSetup(desc, uint32(P), uint32(N), nil, false, func(desc *ParFor, i uint32) {
10623
data[i] = data[i]*data[i] + 1
10625
for p := 1; p < P; p++ {
10626
Index: libgo/go/reflect/value.go
10627
===================================================================
10628
--- a/src/libgo/go/reflect/value.go (.../tags/gcc_4_8_1_release)
10629
+++ b/src/libgo/go/reflect/value.go (.../branches/gcc-4_8-branch)
10630
@@ -377,7 +377,7 @@
10631
if iface.itab == nil {
10632
panic(method + " of method on nil interface value")
10634
- fn = iface.itab.fun[i]
10635
+ fn = unsafe.Pointer(&iface.itab.fun[i])
10638
ut := v.typ.uncommon()
10639
@@ -388,7 +388,7 @@
10640
if m.pkgPath != nil {
10641
panic(method + " of unexported method")
10644
+ fn = unsafe.Pointer(&m.tfn)
10648
@@ -462,6 +462,10 @@
10649
if v.flag&flagMethod != 0 {
10652
+ firstPointer := len(in) > 0 && Kind(t.In(0).(*rtype).kind) != Ptr && v.flag&flagMethod == 0 && isMethod(v.typ)
10653
+ if v.flag&flagMethod == 0 && !firstPointer {
10656
params := make([]unsafe.Pointer, nin)
10658
if v.flag&flagMethod != 0 {
10659
@@ -471,7 +475,6 @@
10660
params[0] = unsafe.Pointer(p)
10663
- first_pointer := false
10664
for i, pv := range in {
10665
pv.mustBeExported()
10666
targ := t.In(i).(*rtype)
10667
@@ -483,14 +486,17 @@
10669
params[off] = pv.val
10671
- if i == 0 && Kind(targ.kind) != Ptr && v.flag&flagMethod == 0 && isMethod(v.typ) {
10672
+ if i == 0 && firstPointer {
10673
p := new(unsafe.Pointer)
10675
params[off] = unsafe.Pointer(p)
10676
- first_pointer = true
10680
+ if v.flag&flagMethod == 0 && !firstPointer {
10681
+ // Closure argument.
10682
+ params[off] = unsafe.Pointer(&fn)
10685
ret := make([]Value, nout)
10686
results := make([]unsafe.Pointer, nout)
10687
@@ -509,7 +515,7 @@
10691
- call(t, fn, v.flag&flagMethod != 0, first_pointer, pp, pr)
10692
+ call(t, fn, v.flag&flagMethod != 0, firstPointer, pp, pr)
10696
@@ -1209,18 +1215,35 @@
10697
// code using reflect cannot obtain unsafe.Pointers
10698
// without importing the unsafe package explicitly.
10699
// It panics if v's Kind is not Chan, Func, Map, Ptr, Slice, or UnsafePointer.
10701
+// If v's Kind is Func, the returned pointer is an underlying
10702
+// code pointer, but not necessarily enough to identify a
10703
+// single function uniquely. The only guarantee is that the
10704
+// result is zero if and only if v is a nil func Value.
10705
func (v Value) Pointer() uintptr {
10708
- case Chan, Func, Map, Ptr, UnsafePointer:
10709
- if k == Func && v.flag&flagMethod != 0 {
10710
+ case Chan, Map, Ptr, UnsafePointer:
10712
+ if v.flag&flagIndir != 0 {
10713
+ p = *(*unsafe.Pointer)(p)
10715
+ return uintptr(p)
10717
+ if v.flag&flagMethod != 0 {
10718
panic("reflect.Value.Pointer of method Value")
10721
if v.flag&flagIndir != 0 {
10722
p = *(*unsafe.Pointer)(p)
10724
+ // Non-nil func value points at data block.
10725
+ // First word of data block is actual code.
10727
+ p = *(*unsafe.Pointer)(p)
10732
return (*SliceHeader)(v.val).Data
10734
Index: libgo/go/reflect/type.go
10735
===================================================================
10736
--- a/src/libgo/go/reflect/type.go (.../tags/gcc_4_8_1_release)
10737
+++ b/src/libgo/go/reflect/type.go (.../branches/gcc-4_8-branch)
10738
@@ -243,8 +243,8 @@
10739
size uintptr // size in bytes
10740
hash uint32 // hash of type; avoids computation in hash tables
10742
- hashfn func(unsafe.Pointer, uintptr) // hash function
10743
- equalfn func(unsafe.Pointer, unsafe.Pointer, uintptr) // equality function
10744
+ hashfn uintptr // hash function code
10745
+ equalfn uintptr // equality function code
10747
string *string // string form; unnecessary but undeniably useful
10748
*uncommonType // (relatively) uncommon fields
10749
@@ -485,7 +485,7 @@
10751
m.Type = toType(mt)
10752
x := new(unsafe.Pointer)
10754
+ *x = unsafe.Pointer(&p.tfn)
10755
m.Func = Value{mt, unsafe.Pointer(x), fl | flagIndir}
10758
Index: libgo/go/reflect/all_test.go
10759
===================================================================
10760
--- a/src/libgo/go/reflect/all_test.go (.../tags/gcc_4_8_1_release)
10761
+++ b/src/libgo/go/reflect/all_test.go (.../branches/gcc-4_8-branch)
10762
@@ -1891,6 +1891,7 @@
10763
func (*outer) m() {}
10765
func TestNestedMethods(t *testing.T) {
10766
+ t.Skip("fails on gccgo due to function wrappers")
10767
typ := TypeOf((*outer)(nil))
10768
if typ.NumMethod() != 1 || typ.Method(0).Func.Pointer() != ValueOf((*outer).m).Pointer() {
10769
t.Errorf("Wrong method table for outer: (m=%p)", (*outer).m)
10770
@@ -1915,6 +1916,7 @@
10773
func TestEmbeddedMethods(t *testing.T) {
10774
+ /* This part of the test fails on gccgo due to function wrappers.
10775
typ := TypeOf((*OuterInt)(nil))
10776
if typ.NumMethod() != 1 || typ.Method(0).Func.Pointer() != ValueOf((*OuterInt).M).Pointer() {
10777
t.Errorf("Wrong method table for OuterInt: (m=%p)", (*OuterInt).M)
10778
@@ -1923,6 +1925,7 @@
10779
t.Errorf("\t%d: %s %#x\n", i, m.Name, m.Func.Pointer())
10785
if v := ValueOf(i).Method(0).Call(nil)[0].Int(); v != 3 {
10786
Index: libgo/Makefile.am
10787
===================================================================
10788
--- a/src/libgo/Makefile.am (.../tags/gcc_4_8_1_release)
10789
+++ b/src/libgo/Makefile.am (.../branches/gcc-4_8-branch)
10790
@@ -487,7 +487,6 @@
10791
runtime/go-strplus.c \
10792
runtime/go-strslice.c \
10793
runtime/go-traceback.c \
10794
- runtime/go-trampoline.c \
10795
runtime/go-type-complex.c \
10796
runtime/go-type-eface.c \
10797
runtime/go-type-error.c \
10798
Index: libgfortran/ChangeLog
10799
===================================================================
10800
--- a/src/libgfortran/ChangeLog (.../tags/gcc_4_8_1_release)
10801
+++ b/src/libgfortran/ChangeLog (.../branches/gcc-4_8-branch)
10803
+2013-06-21 Uros Bizjak <ubizjak@gmail.com>
10805
+ Backport from mainline
10806
+ 2013-06-20 Uros Bizjak <ubizjak@gmail.com>
10808
+ * config/fpu-387.h (_FPU_MASK_ALL): New.
10809
+ (_FPU_EX_ALL): Ditto.
10810
+ (set_fpu): Use fstcw to store x87 FPU control word. Use fnclex to
10811
+ clear stalled exception flags. Correctly clear stalled SSE
10812
+ exception flags. Simplify code.
10814
+ Backport from mainline
10815
+ 2013-06-19 Uros Bizjak <ubizjak@gmail.com>
10817
+ * config/fpu-387.h: Use __asm__ and __volatile__ consistently.
10819
2013-05-31 Release Manager
10821
* GCC 4.8.1 released.
10822
Index: libgfortran/config/fpu-387.h
10823
===================================================================
10824
--- a/src/libgfortran/config/fpu-387.h (.../tags/gcc_4_8_1_release)
10825
+++ b/src/libgfortran/config/fpu-387.h (.../branches/gcc-4_8-branch)
10828
/* We need a single SSE instruction here so the handler can safely skip
10830
- __asm__ volatile ("movaps %xmm0,%xmm0");
10831
+ __asm__ __volatile__ ("movaps\t%xmm0,%xmm0");
10833
sigaction (SIGILL, &oact, NULL);
10835
@@ -95,42 +95,42 @@
10836
#define _FPU_MASK_OM 0x08
10837
#define _FPU_MASK_UM 0x10
10838
#define _FPU_MASK_PM 0x20
10839
+#define _FPU_MASK_ALL 0x3f
10841
+#define _FPU_EX_ALL 0x3f
10843
void set_fpu (void)
10848
- asm volatile ("fnstcw %0" : "=m" (cw));
10849
+ __asm__ __volatile__ ("fstcw\t%0" : "=m" (cw));
10851
- cw |= (_FPU_MASK_IM | _FPU_MASK_DM | _FPU_MASK_ZM | _FPU_MASK_OM
10852
- | _FPU_MASK_UM | _FPU_MASK_PM);
10853
+ if (options.fpe & GFC_FPE_INVALID) excepts |= _FPU_MASK_IM;
10854
+ if (options.fpe & GFC_FPE_DENORMAL) excepts |= _FPU_MASK_DM;
10855
+ if (options.fpe & GFC_FPE_ZERO) excepts |= _FPU_MASK_ZM;
10856
+ if (options.fpe & GFC_FPE_OVERFLOW) excepts |= _FPU_MASK_OM;
10857
+ if (options.fpe & GFC_FPE_UNDERFLOW) excepts |= _FPU_MASK_UM;
10858
+ if (options.fpe & GFC_FPE_INEXACT) excepts |= _FPU_MASK_PM;
10860
- if (options.fpe & GFC_FPE_INVALID) cw &= ~_FPU_MASK_IM;
10861
- if (options.fpe & GFC_FPE_DENORMAL) cw &= ~_FPU_MASK_DM;
10862
- if (options.fpe & GFC_FPE_ZERO) cw &= ~_FPU_MASK_ZM;
10863
- if (options.fpe & GFC_FPE_OVERFLOW) cw &= ~_FPU_MASK_OM;
10864
- if (options.fpe & GFC_FPE_UNDERFLOW) cw &= ~_FPU_MASK_UM;
10865
- if (options.fpe & GFC_FPE_INEXACT) cw &= ~_FPU_MASK_PM;
10866
+ cw |= _FPU_MASK_ALL;
10869
- asm volatile ("fldcw %0" : : "m" (cw));
10870
+ __asm__ __volatile__ ("fnclex\n\tfldcw\t%0" : : "m" (cw));
10874
unsigned int cw_sse;
10876
- asm volatile ("%vstmxcsr %0" : "=m" (cw_sse));
10877
+ __asm__ __volatile__ ("%vstmxcsr\t%0" : "=m" (cw_sse));
10879
- cw_sse &= 0xffff0000;
10880
- cw_sse |= (_FPU_MASK_IM | _FPU_MASK_DM | _FPU_MASK_ZM | _FPU_MASK_OM
10881
- | _FPU_MASK_UM | _FPU_MASK_PM ) << 7;
10882
+ /* The SSE exception masks are shifted by 7 bits. */
10883
+ cw_sse |= _FPU_MASK_ALL << 7;
10884
+ cw_sse &= ~(excepts << 7);
10886
- if (options.fpe & GFC_FPE_INVALID) cw_sse &= ~(_FPU_MASK_IM << 7);
10887
- if (options.fpe & GFC_FPE_DENORMAL) cw_sse &= ~(_FPU_MASK_DM << 7);
10888
- if (options.fpe & GFC_FPE_ZERO) cw_sse &= ~(_FPU_MASK_ZM << 7);
10889
- if (options.fpe & GFC_FPE_OVERFLOW) cw_sse &= ~(_FPU_MASK_OM << 7);
10890
- if (options.fpe & GFC_FPE_UNDERFLOW) cw_sse &= ~(_FPU_MASK_UM << 7);
10891
- if (options.fpe & GFC_FPE_INEXACT) cw_sse &= ~(_FPU_MASK_PM << 7);
10892
+ /* Clear stalled exception flags. */
10893
+ cw_sse &= ~_FPU_EX_ALL;
10895
- asm volatile ("%vldmxcsr %0" : : "m" (cw_sse));
10896
+ __asm__ __volatile__ ("%vldmxcsr\t%0" : : "m" (cw_sse));
10899
Index: fixincludes/ChangeLog
10900
===================================================================
10901
--- a/src/fixincludes/ChangeLog (.../tags/gcc_4_8_1_release)
10902
+++ b/src/fixincludes/ChangeLog (.../branches/gcc-4_8-branch)
10904
+2013-05-31 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
10906
+ Backport from mainline:
10907
+ 2013-05-17 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
10909
+ * inclhack.def (solaris_pow_int_overload): Update comment.
10910
+ Change guard to match <cmath>.
10911
+ * fixincl.x: Regenerate.
10912
+ * tests/base/iso/math_iso.h [SOLARIS_POW_INT_OVERLOAD_CHECK]:
10915
2013-05-31 Release Manager
10917
* GCC 4.8.1 released.
10918
Index: fixincludes/tests/base/iso/math_iso.h
10919
===================================================================
10920
--- a/src/fixincludes/tests/base/iso/math_iso.h (.../tags/gcc_4_8_1_release)
10921
+++ b/src/fixincludes/tests/base/iso/math_iso.h (.../branches/gcc-4_8-branch)
10925
#if defined( SOLARIS_POW_INT_OVERLOAD_CHECK )
10926
-#ifndef __GXX_EXPERIMENTAL_CXX0X__
10927
+#if __cplusplus < 201103L
10928
inline long double pow(long double __X, int __Y) { return
10929
__powl(__X, (long double) (__Y)); }
10931
Index: fixincludes/fixincl.x
10932
===================================================================
10933
--- a/src/fixincludes/fixincl.x (.../tags/gcc_4_8_1_release)
10934
+++ b/src/fixincludes/fixincl.x (.../branches/gcc-4_8-branch)
10937
* DO NOT EDIT THIS FILE (fixincl.x)
10939
- * It has been AutoGen-ed Saturday December 29, 2012 at 09:17:09 AM BRST
10940
+ * It has been AutoGen-ed Thursday May 16, 2013 at 03:34:25 PM MEST
10941
* From the definitions inclhack.def
10942
* and the template file fixincl
10944
-/* DO NOT SVN-MERGE THIS FILE, EITHER Sat Dec 29 09:17:10 BRST 2012
10945
+/* DO NOT SVN-MERGE THIS FILE, EITHER Thu May 16 15:34:25 MEST 2013
10947
* You must regenerate it. Use the ./genfixes script.
10949
@@ -6663,7 +6663,7 @@
10951
static const char* apzSolaris_Pow_Int_OverloadPatch[] = {
10953
- "#ifndef __GXX_EXPERIMENTAL_CXX0X__\n\
10954
+ "#if __cplusplus < 201103L\n\
10958
Index: fixincludes/inclhack.def
10959
===================================================================
10960
--- a/src/fixincludes/inclhack.def (.../tags/gcc_4_8_1_release)
10961
+++ b/src/fixincludes/inclhack.def (.../branches/gcc-4_8-branch)
10962
@@ -3447,7 +3447,7 @@
10966
- * The pow overloads with int were removed in C++ 2011.
10967
+ * The pow overloads with int were removed in C++ 2011 DR 550.
10970
hackname = solaris_pow_int_overload;
10971
@@ -3456,7 +3456,7 @@
10972
select = "^[ \t]*inline [a-z ]* pow\\([^()]*, int [^()]*\\)"
10973
" *\\{[^{}]*\n[^{}]*\\}";
10975
- c_fix_arg = "#ifndef __GXX_EXPERIMENTAL_CXX0X__\n%0\n#endif";
10976
+ c_fix_arg = "#if __cplusplus < 201103L\n%0\n#endif";
10979
" inline long double pow(long double __X, int __Y) { return\n"