~ubuntu-branches/debian/sid/gcc-4.8/sid

« back to all changes in this revision

Viewing changes to .svn/pristine/2f/2fc0513ec62fe2dd45efa9ba454bf4a5cb595c56.svn-base

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2014-12-19 19:48:34 UTC
  • Revision ID: package-import@ubuntu.com-20141219194834-4dz1q7rrn5pad823
Tags: 4.8.4-1
* GCC 4.8.4 release.
  - Fix PR target/61407 (darwin), PR middle-end/58624 (ice),
    PR sanitizer/64265 (wrong code).
* Require recent binutils to pass go test failures.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# DP: updates from the 4.8 branch upto 20120623 (r200352).
 
2
 
 
3
last_updated()
 
4
{
 
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)
 
8
EOF
 
9
}
 
10
 
 
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'
 
14
 
 
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)
 
19
@@ -330,7 +330,7 @@
 
20
       mips64*)
 
21
        abi_baseline_pair=mips64-linux-gnu
 
22
        ;;
 
23
-      powerpc64)
 
24
+      powerpc64*)
 
25
         abi_baseline_pair=powerpc64-linux-gnu
 
26
         ;;
 
27
       s390)
 
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)
 
32
@@ -434,8 +434,7 @@
 
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
 
39
 
 
40
 bits_host_headers = \
 
41
        ${glibcxx_srcdir}/${CPU_OPT_BITS_RANDOM}
 
42
@@ -795,8 +794,7 @@
 
43
        ${ext_srcdir}/vstring.tcc \
 
44
        ${ext_srcdir}/vstring_fwd.h \
 
45
        ${ext_srcdir}/vstring_util.h \
 
46
-       ${ext_compat_headers} \
 
47
-       ${ext_host_headers}
 
48
+       ${ext_compat_headers}
 
49
 
 
50
 ext_compat_headers = \
 
51
        ${backward_srcdir}/hash_set \
 
52
@@ -1461,13 +1459,14 @@
 
53
 
 
54
 stamp-${host_alias}:
 
55
        @-mkdir -p ${host_builddir}
 
56
+       @-mkdir -p ${host_builddir}/../ext
 
57
        @$(STAMP) stamp-${host_alias}
 
58
 
 
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 ;\
 
69
@@ -1477,6 +1476,9 @@
 
70
          $(LN_S) ${glibcxx_srcdir}/$(CMESSAGES_H) messages_members.h || true ;\
 
71
          $(LN_S) ${glibcxx_srcdir}/$(CTIME_H) time_members.h || true;\
 
72
        } 2>/dev/null
 
73
+       @cd ${host_builddir}/../ext && {\
 
74
+         $(LN_S) ${ext_host_headers} . || true ;\
 
75
+       } 2>/dev/null
 
76
        $(STAMP) stamp-host
 
77
 
 
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
 
90
 
 
91
 # To remove directories.
 
92
 clean-local:
 
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)
 
97
@@ -819,8 +819,21 @@
 
98
     inline valarray<_Tp>&
 
99
     valarray<_Tp>::operator=(const _Expr<_Dom, _Tp>& __e)
 
100
     {
 
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));
 
107
+      else
 
108
+       {
 
109
+         if (_M_data)
 
110
+           {
 
111
+             std::__valarray_destroy_elements(_M_data, _M_data + _M_size);
 
112
+             std::__valarray_release_memory(_M_data);
 
113
+           }
 
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));
 
117
+       }
 
118
       return *this;
 
119
     }
 
120
 
 
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
 
131
       constexpr _Tp 
 
132
       real() { return _M_real; }
 
133
 
 
134
-      __attribute ((__abi_tag__ ("cxx11")))
 
135
+      _GLIBCXX_ABI_TAG_CXX11
 
136
       constexpr _Tp 
 
137
       imag() { return _M_imag; }
 
138
 #else
 
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
 
146
 
 
147
-#include "opt_random.h"
 
148
+#include "ext/opt_random.h"
 
149
 #include "random.tcc"
 
150
 
 
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)
 
156
@@ -690,7 +690,8 @@
 
157
       erase(const_iterator __position)
 
158
       { return _M_t.erase(__position); }
 
159
 
 
160
-      // LWG 2059.
 
161
+      // LWG 2059
 
162
+      _GLIBCXX_ABI_TAG_CXX11
 
163
       iterator
 
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)
 
170
@@ -546,6 +546,7 @@
 
171
        *  touched in any way.  Managing the pointer is the user's
 
172
        *  responsibility.
 
173
        */
 
174
+      _GLIBCXX_ABI_TAG_CXX11
 
175
       iterator
 
176
       erase(const_iterator __position)
 
177
       { return _M_t.erase(__position); }
 
178
@@ -597,6 +598,7 @@
 
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.
 
181
        */
 
182
+      _GLIBCXX_ABI_TAG_CXX11
 
183
       iterator
 
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)
 
190
@@ -596,6 +596,7 @@
 
191
       { return _M_t.erase(__position); }
 
192
 
 
193
       // LWG 2059.
 
194
+      _GLIBCXX_ABI_TAG_CXX11
 
195
       iterator
 
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)
 
202
@@ -367,7 +367,7 @@
 
203
                                                    _Pair&&>::value>::type>
 
204
        std::pair<iterator, bool>
 
205
        insert(_Pair&& __x)
 
206
-       { return _M_h.insert(std::move(__x)); }
 
207
+        { return _M_h.insert(std::forward<_Pair>(__x)); }
 
208
       //@}
 
209
 
 
210
       //@{
 
211
@@ -401,7 +401,7 @@
 
212
                                                    _Pair&&>::value>::type>
 
213
        iterator
 
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)); }
 
217
       //@}
 
218
 
 
219
       /**
 
220
@@ -1032,7 +1032,7 @@
 
221
                                                    _Pair&&>::value>::type>
 
222
        iterator
 
223
        insert(_Pair&& __x)
 
224
-       { return _M_h.insert(std::move(__x)); }
 
225
+        { return _M_h.insert(std::forward<_Pair>(__x)); }
 
226
       //@}
 
227
 
 
228
       //@{
 
229
@@ -1064,7 +1064,7 @@
 
230
                                                    _Pair&&>::value>::type>
 
231
        iterator
 
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)); }
 
235
       //@}
 
236
 
 
237
       /**
 
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)
 
242
@@ -532,6 +532,7 @@
 
243
        *  not touched in any way.  Managing the pointer is the user's
 
244
        *  responsibility.
 
245
        */
 
246
+      _GLIBCXX_ABI_TAG_CXX11
 
247
       iterator
 
248
       erase(const_iterator __position)
 
249
       { return _M_t.erase(__position); }
 
250
@@ -583,6 +584,7 @@
 
251
        *  touched in any way.  Managing the pointer is the user's
 
252
        *  responsibility.
 
253
        */
 
254
+      _GLIBCXX_ABI_TAG_CXX11
 
255
       iterator
 
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)
 
262
@@ -84,6 +84,12 @@
 
263
 # define _GLIBCXX_DEPRECATED
 
264
 #endif
 
265
 
 
266
+// Macros for ABI tag attributes.
 
267
+#ifndef _GLIBCXX_ABI_TAG_CXX11
 
268
+# define _GLIBCXX_ABI_TAG_CXX11 __attribute ((__abi_tag__ ("cxx11")))
 
269
+#endif
 
270
+
 
271
+
 
272
 #if __cplusplus
 
273
 
 
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)
 
286
       {
 
287
        _IntType __x = 0;
 
288
        double __sum = 0.0;
 
289
@@ -1663,7 +1664,7 @@
 
290
            __sum += __e / (__t - __x);
 
291
            __x += 1;
 
292
          }
 
293
-       while (__sum <= _M_param._M_q);
 
294
+       while (__sum <= __q);
 
295
 
 
296
        return __x - 1;
 
297
       }
 
298
@@ -1784,12 +1785,13 @@
 
299
 
 
300
            __x += __np + __naf;
 
301
 
 
302
-           const _IntType __z = _M_waiting(__urng, __t - _IntType(__x));
 
303
+           const _IntType __z = _M_waiting(__urng, __t - _IntType(__x),
 
304
+                                           __param._M_q);
 
305
            __ret = _IntType(__x) + __z;
 
306
          }
 
307
        else
 
308
 #endif
 
309
-         __ret = _M_waiting(__urng, __t);
 
310
+         __ret = _M_waiting(__urng, __t, __param._M_q);
 
311
 
 
312
        if (__p12 != __p)
 
313
          __ret = __t - __ret;
 
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 @@
 
319
 
 
320
       template<typename _UniformRandomNumberGenerator>
 
321
        result_type
 
322
-       _M_waiting(_UniformRandomNumberGenerator& __urng, _IntType __t);
 
323
+       _M_waiting(_UniformRandomNumberGenerator& __urng,
 
324
+                  _IntType __t, double __q);
 
325
 
 
326
       param_type _M_param;
 
327
 
 
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 @@
 
333
               _Node_allocator;
 
334
 
 
335
     protected:
 
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;
 
340
 
 
341
     public:
 
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;
 
364
 
 
365
       _Node_allocator&
 
366
       _M_get_Node_allocator() _GLIBCXX_NOEXCEPT
 
367
@@ -800,6 +800,7 @@
 
368
 #if __cplusplus >= 201103L
 
369
       // _GLIBCXX_RESOLVE_LIB_DEFECTS
 
370
       // DR 130. Associative erase should return an iterator.
 
371
+      _GLIBCXX_ABI_TAG_CXX11
 
372
       iterator
 
373
       erase(const_iterator __position)
 
374
       {
 
375
@@ -810,6 +811,7 @@
 
376
       }
 
377
 
 
378
       // LWG 2059.
 
379
+      _GLIBCXX_ABI_TAG_CXX11
 
380
       iterator
 
381
       erase(iterator __position)
 
382
       {
 
383
@@ -833,6 +835,7 @@
 
384
 #if __cplusplus >= 201103L
 
385
       // _GLIBCXX_RESOLVE_LIB_DEFECTS
 
386
       // DR 130. Associative erase should return an iterator.
 
387
+      _GLIBCXX_ABI_TAG_CXX11
 
388
       iterator
 
389
       erase(const_iterator __first, const_iterator __last)
 
390
       {
 
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)
 
395
@@ -172,8 +172,7 @@
 
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
 
402
 
 
403
 bits_host_headers = \
 
404
        ${glibcxx_srcdir}/${CPU_OPT_BITS_RANDOM}
 
405
@@ -535,8 +534,7 @@
 
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}
 
412
 
 
413
 ext_compat_headers = \
 
414
        ${backward_srcdir}/hash_set \
 
415
@@ -1048,13 +1046,14 @@
 
416
 
 
417
 stamp-${host_alias}:
 
418
        @-mkdir -p ${host_builddir}
 
419
+       @-mkdir -p ${host_builddir}/../ext
 
420
        @$(STAMP) stamp-${host_alias}
 
421
 
 
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;\
 
435
        } 2>/dev/null
 
436
+       @cd ${host_builddir}/../ext && {\
 
437
+         $(LN_S) ${ext_host_headers} . || true ;\
 
438
+       } 2>/dev/null
 
439
        $(STAMP) stamp-host
 
440
 
 
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
 
453
 
 
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)
 
460
@@ -1,3 +1,90 @@
 
461
+2013-06-22  Paolo Carlini  <paolo.carlini@oracle.com>
 
462
+
 
463
+       PR libstdc++/57674
 
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.
 
472
+
 
473
+2013-06-21  Paolo Carlini  <paolo.carlini@oracle.com>
 
474
+
 
475
+       PR libstdc++/57666
 
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.
 
479
+
 
480
+2013-06-19  Alan Modra  <amodra@gmail.com>
 
481
+
 
482
+       Apply mainline patch
 
483
+       2013-06-14  Alan Modra  <amodra@gmail.com>
 
484
+       * configure.host (abi_baseline_pair): Match powerpc64*.
 
485
+
 
486
+2013-06-15  Paolo Carlini  <paolo.carlini@oracle.com>
 
487
+
 
488
+       PR libstdc++/57619
 
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.
 
493
+
 
494
+2013-06-12  Benjamin Kosnik  <bkoz@redhat.com>
 
495
+
 
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.
 
503
+
 
504
+       * testsuite/lib/libstdc++.exp: Disable inlinling with -fno-inline.
 
505
+       * testsuite/util/testsuite_containers.h (erase_external): New
 
506
+       declarations.
 
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:
 
522
+       New.
 
523
+       * testsuite/ext/profile/mutex_extensions_neg.cc: Adjust line number.
 
524
+
 
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.
 
533
+
 
534
+2013-06-11  Matthias Klose  <doko@ubuntu.com>
 
535
+
 
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.
 
543
+
 
544
+2013-06-07  Uros Bizjak  <ubizjak@gmail.com>
 
545
+
 
546
+       * config/abi/post/alpha-linux-gnu/baseline_symbols.txt: Update.
 
547
+
 
548
 2013-05-31  Release Manager
 
549
 
 
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)
 
555
@@ -43,6 +43,17 @@
 
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); } );
 
559
+
 
560
+  // libstdc++/57674
 
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); } );
 
565
+
 
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); } );
 
570
 }
 
571
 
 
572
 int main()
 
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)
 
577
@@ -0,0 +1,37 @@
 
578
+// Copyright (C) 2013 Free Software Foundation, Inc.
 
579
+//
 
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.
 
585
+
 
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.
 
590
+
 
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/>.
 
594
+
 
595
+#include <valarray>
 
596
+#include <testsuite_hooks.h>
 
597
+
 
598
+// libstdc++/57666
 
599
+void test01()
 
600
+{
 
601
+  bool test __attribute__((unused)) = true;
 
602
+
 
603
+  std::valarray<int> a(3), b(3), d1, d2;
 
604
+  d1 = a;
 
605
+  VERIFY( d1.size() == 3 );
 
606
+  d2 = a + b;
 
607
+  VERIFY( d2.size() == 3 );
 
608
+}
 
609
+
 
610
+int main()
 
611
+{
 
612
+  test01();
 
613
+  return 0;
 
614
+}
 
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)
 
619
@@ -25,4 +25,4 @@
 
620
 
 
621
 #include <vector>
 
622
 
 
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)
 
629
@@ -626,7 +626,7 @@
 
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"]]
 
635
                 != "" } {
 
636
                error "could not compile $f"
 
637
            }
 
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)
 
642
@@ -0,0 +1,51 @@
 
643
+// { dg-options "-std=gnu++11" }
 
644
+//
 
645
+// Copyright (C) 2013 Free Software Foundation, Inc.
 
646
+//
 
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.
 
652
+//
 
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.
 
657
+//
 
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/>.
 
661
+
 
662
+#include <unordered_map>
 
663
+#include <string>
 
664
+#include <testsuite_hooks.h>
 
665
+
 
666
+void test01()
 
667
+{
 
668
+  bool test __attribute__((unused)) = true;
 
669
+
 
670
+  {
 
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);
 
675
+
 
676
+    VERIFY( mypair.first.length() && mypair.second.length() );
 
677
+  }
 
678
+
 
679
+  {
 
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);
 
684
+
 
685
+    VERIFY( mypair.first.length() && mypair.second.length() );
 
686
+  }
 
687
+}
 
688
+
 
689
+int main()
 
690
+{
 
691
+  test01();
 
692
+  return 0;
 
693
+}
 
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)
 
698
@@ -1,87 +0,0 @@
 
699
-// { dg-options "-std=gnu++0x" }
 
700
-
 
701
-// Copyright (C) 2009-2013 Free Software Foundation, Inc.
 
702
-//
 
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.
 
708
-
 
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.
 
713
-
 
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/>.
 
717
-
 
718
-
 
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.
 
722
-
 
723
-#include <map>
 
724
-#include <vector>
 
725
-#include <testsuite_hooks.h>
 
726
-
 
727
-using namespace std;
 
728
-
 
729
-void
 
730
-test01()
 
731
-{
 
732
-  bool test __attribute__((unused)) = true;
 
733
-  using namespace std;
 
734
-
 
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;
 
740
-
 
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 ) ) );
 
745
-
 
746
-  iterator pos1 = mm0.erase(irt[1]);
 
747
-  VERIFY( pos1 == irt[2] );
 
748
-
 
749
-  iterator pos2 = mm0.erase(irt[2]);
 
750
-  VERIFY( pos2 == irt[3] );
 
751
-
 
752
-  iterator pos3 = mm0.erase(irt[9]);
 
753
-  VERIFY( pos3 == mm0.end() );
 
754
-}
 
755
-
 
756
-void
 
757
-test02()
 
758
-{
 
759
-  bool test __attribute__((unused)) = true;
 
760
-  using namespace std;
 
761
-
 
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;
 
767
-
 
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 ) ) );
 
772
-
 
773
-  iterator pos1 = mm0.erase(irt[3], irt[6]);
 
774
-  VERIFY( pos1 == irt[6] );
 
775
-
 
776
-  iterator pos2 = mm0.erase(irt[6], ++irt[9]);
 
777
-  VERIFY( pos2 == mm0.end() );
 
778
-}
 
779
-
 
780
-int
 
781
-main()
 
782
-{
 
783
-  test01();
 
784
-  test02();
 
785
-}
 
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)
 
790
@@ -0,0 +1,40 @@
 
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>
 
795
+//
 
796
+// Copyright (C) 2013 Free Software Foundation, Inc.
 
797
+//
 
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.
 
803
+//
 
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.
 
808
+//
 
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/>.
 
812
+
 
813
+#include <testsuite_containers.h>
 
814
+
 
815
+int main()
 
816
+{
 
817
+  typedef std::multimap<int, int>              container_type;
 
818
+
 
819
+  {
 
820
+    container_type s { {0,0} , {1,1} , {2,2} };
 
821
+    __gnu_test::linkage_check_cxx98_cxx11_erase(s);
 
822
+  }
 
823
+
 
824
+  {
 
825
+    container_type s { {0,0} , {1,1} , {2,2} };
 
826
+    __gnu_test::linkage_check_cxx98_cxx11_erase_iterators(s);
 
827
+  }
 
828
+
 
829
+  return 0;
 
830
+}
 
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)
 
835
@@ -0,0 +1,35 @@
 
836
+// { dg-do compile }
 
837
+// { dg-options -std=c++11 }
 
838
+
 
839
+// Copyright (C) 2013 Free Software Foundation, Inc.
 
840
+//
 
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.
 
846
+
 
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.
 
851
+
 
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.
 
855
+
 
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/>.
 
860
+
 
861
+// Test that the C++11 variants have an ABI tag
 
862
+
 
863
+#include <map>
 
864
+
 
865
+using container = std::multimap<int, int>;
 
866
+using iterator = typename container::iterator;
 
867
+using const_iterator = typename container::const_iterator;
 
868
+
 
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)
 
875
@@ -0,0 +1,87 @@
 
876
+// { dg-options "-std=gnu++0x" }
 
877
+
 
878
+// Copyright (C) 2009-2013 Free Software Foundation, Inc.
 
879
+//
 
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.
 
885
+
 
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.
 
890
+
 
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/>.
 
894
+
 
895
+
 
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.
 
899
+
 
900
+#include <map>
 
901
+#include <vector>
 
902
+#include <testsuite_hooks.h>
 
903
+
 
904
+using namespace std;
 
905
+
 
906
+void
 
907
+test01()
 
908
+{
 
909
+  bool test __attribute__((unused)) = true;
 
910
+  using namespace std;
 
911
+
 
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;
 
917
+
 
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 ) ) );
 
922
+
 
923
+  iterator pos1 = mm0.erase(irt[1]);
 
924
+  VERIFY( pos1 == irt[2] );
 
925
+
 
926
+  iterator pos2 = mm0.erase(irt[2]);
 
927
+  VERIFY( pos2 == irt[3] );
 
928
+
 
929
+  iterator pos3 = mm0.erase(irt[9]);
 
930
+  VERIFY( pos3 == mm0.end() );
 
931
+}
 
932
+
 
933
+void
 
934
+test02()
 
935
+{
 
936
+  bool test __attribute__((unused)) = true;
 
937
+  using namespace std;
 
938
+
 
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;
 
944
+
 
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 ) ) );
 
949
+
 
950
+  iterator pos1 = mm0.erase(irt[3], irt[6]);
 
951
+  VERIFY( pos1 == irt[6] );
 
952
+
 
953
+  iterator pos2 = mm0.erase(irt[6], ++irt[9]);
 
954
+  VERIFY( pos2 == mm0.end() );
 
955
+}
 
956
+
 
957
+int
 
958
+main()
 
959
+{
 
960
+  test01();
 
961
+  test02();
 
962
+}
 
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)
 
967
@@ -1,75 +0,0 @@
 
968
-// { dg-options "-std=gnu++0x" }
 
969
-// 2008-07-22  Edward Smith-Rowland  <3dw4rd@verizon.net>
 
970
-//
 
971
-// Copyright (C) 2009-2013 Free Software Foundation, Inc.
 
972
-//
 
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.
 
978
-//
 
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.
 
983
-//
 
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/>.
 
987
-
 
988
-#include <set>
 
989
-#include <testsuite_hooks.h>
 
990
-
 
991
-//  DR 130. Associative erase should return an iterator.
 
992
-void
 
993
-test01()
 
994
-{
 
995
-  bool test __attribute__((unused)) = true;
 
996
-  using namespace std;
 
997
-
 
998
-  set<int> s0;
 
999
-  typedef set<int>::iterator iterator;
 
1000
-  typedef set<int>::const_iterator const_iterator;
 
1001
-  typedef pair<iterator, bool> insert_return_type;
 
1002
-
 
1003
-  s0.insert(1);
 
1004
-  insert_return_type irt1 = s0.insert(2);
 
1005
-  insert_return_type irt2 = s0.insert(3);
 
1006
-
 
1007
-  iterator pos1 = s0.erase(irt1.first);
 
1008
-  VERIFY( pos1 == irt2.first );
 
1009
-
 
1010
-  iterator pos2 = s0.erase(irt2.first);
 
1011
-  VERIFY( pos2 == s0.end() );
 
1012
-}
 
1013
-
 
1014
-void
 
1015
-test02()
 
1016
-{
 
1017
-  bool test __attribute__((unused)) = true;
 
1018
-  using namespace std;
 
1019
-
 
1020
-  set<int> s0;
 
1021
-  typedef set<int>::iterator iterator;
 
1022
-  typedef set<int>::const_iterator const_iterator;
 
1023
-  typedef pair<iterator, bool> insert_return_type;
 
1024
-
 
1025
-  insert_return_type irt0 = s0.insert(1);
 
1026
-  s0.insert(2);
 
1027
-  insert_return_type irt2 = s0.insert(3);
 
1028
-  insert_return_type irt3 = s0.insert(4);
 
1029
-
 
1030
-  iterator pos1 = s0.erase(irt0.first, irt2.first);
 
1031
-  VERIFY( pos1 == irt2.first );
 
1032
-
 
1033
-  iterator pos2 = s0.erase(irt2.first, ++irt3.first);
 
1034
-  VERIFY( pos2 == s0.end() );
 
1035
-}
 
1036
-
 
1037
-int
 
1038
-main()
 
1039
-{
 
1040
-  test01();
 
1041
-  test02();
 
1042
-}
 
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)
 
1047
@@ -0,0 +1,40 @@
 
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>
 
1052
+//
 
1053
+// Copyright (C) 2013 Free Software Foundation, Inc.
 
1054
+//
 
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.
 
1060
+//
 
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.
 
1065
+//
 
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/>.
 
1069
+
 
1070
+#include <testsuite_containers.h>
 
1071
+
 
1072
+int main()
 
1073
+{
 
1074
+  typedef std::set<int>                        container_type;
 
1075
+
 
1076
+  {
 
1077
+    container_type s { 0, 1, 2 };
 
1078
+    __gnu_test::linkage_check_cxx98_cxx11_erase(s);
 
1079
+  }
 
1080
+
 
1081
+  {
 
1082
+    container_type s { 0, 1, 2 };
 
1083
+    __gnu_test::linkage_check_cxx98_cxx11_erase_iterators(s);
 
1084
+  }
 
1085
+
 
1086
+  return 0;
 
1087
+}
 
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)
 
1092
@@ -0,0 +1,38 @@
 
1093
+// { dg-do compile }
 
1094
+// { dg-options -std=c++11 }
 
1095
+
 
1096
+// Copyright (C) 2013 Free Software Foundation, Inc.
 
1097
+//
 
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.
 
1103
+
 
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.
 
1108
+
 
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.
 
1112
+
 
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/>.
 
1117
+
 
1118
+// Test that the C++11 variants have an ABI tag
 
1119
+
 
1120
+#include <set>
 
1121
+
 
1122
+using container = std::set<int>;
 
1123
+using iterator = typename container::iterator;
 
1124
+using const_iterator = typename container::const_iterator;
 
1125
+
 
1126
+// { dg-final { scan-assembler "_ZNSt3setIiSt4lessIiESaIiEE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIiE" } }
 
1127
+iterator (container::*p1)(const_iterator) = &container::erase;
 
1128
+
 
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)
 
1135
@@ -0,0 +1,75 @@
 
1136
+// { dg-options "-std=gnu++0x" }
 
1137
+// 2008-07-22  Edward Smith-Rowland  <3dw4rd@verizon.net>
 
1138
+//
 
1139
+// Copyright (C) 2009-2013 Free Software Foundation, Inc.
 
1140
+//
 
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.
 
1146
+//
 
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.
 
1151
+//
 
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/>.
 
1155
+
 
1156
+#include <set>
 
1157
+#include <testsuite_hooks.h>
 
1158
+
 
1159
+//  DR 130. Associative erase should return an iterator.
 
1160
+void
 
1161
+test01()
 
1162
+{
 
1163
+  bool test __attribute__((unused)) = true;
 
1164
+  using namespace std;
 
1165
+
 
1166
+  set<int> s0;
 
1167
+  typedef set<int>::iterator iterator;
 
1168
+  typedef set<int>::const_iterator const_iterator;
 
1169
+  typedef pair<iterator, bool> insert_return_type;
 
1170
+
 
1171
+  s0.insert(1);
 
1172
+  insert_return_type irt1 = s0.insert(2);
 
1173
+  insert_return_type irt2 = s0.insert(3);
 
1174
+
 
1175
+  iterator pos1 = s0.erase(irt1.first);
 
1176
+  VERIFY( pos1 == irt2.first );
 
1177
+
 
1178
+  iterator pos2 = s0.erase(irt2.first);
 
1179
+  VERIFY( pos2 == s0.end() );
 
1180
+}
 
1181
+
 
1182
+void
 
1183
+test02()
 
1184
+{
 
1185
+  bool test __attribute__((unused)) = true;
 
1186
+  using namespace std;
 
1187
+
 
1188
+  set<int> s0;
 
1189
+  typedef set<int>::iterator iterator;
 
1190
+  typedef set<int>::const_iterator const_iterator;
 
1191
+  typedef pair<iterator, bool> insert_return_type;
 
1192
+
 
1193
+  insert_return_type irt0 = s0.insert(1);
 
1194
+  s0.insert(2);
 
1195
+  insert_return_type irt2 = s0.insert(3);
 
1196
+  insert_return_type irt3 = s0.insert(4);
 
1197
+
 
1198
+  iterator pos1 = s0.erase(irt0.first, irt2.first);
 
1199
+  VERIFY( pos1 == irt2.first );
 
1200
+
 
1201
+  iterator pos2 = s0.erase(irt2.first, ++irt3.first);
 
1202
+  VERIFY( pos2 == s0.end() );
 
1203
+}
 
1204
+
 
1205
+int
 
1206
+main()
 
1207
+{
 
1208
+  test01();
 
1209
+  test02();
 
1210
+}
 
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)
 
1215
@@ -0,0 +1,51 @@
 
1216
+// { dg-options "-std=gnu++11" }
 
1217
+//
 
1218
+// Copyright (C) 2013 Free Software Foundation, Inc.
 
1219
+//
 
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.
 
1225
+//
 
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.
 
1230
+//
 
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/>.
 
1234
+
 
1235
+#include <unordered_map>
 
1236
+#include <string>
 
1237
+#include <testsuite_hooks.h>
 
1238
+
 
1239
+void test01()
 
1240
+{
 
1241
+  bool test __attribute__((unused)) = true;
 
1242
+
 
1243
+  {
 
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);
 
1248
+
 
1249
+    VERIFY( mypair.first.length() && mypair.second.length() );
 
1250
+  }
 
1251
+
 
1252
+  {
 
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);
 
1257
+
 
1258
+    VERIFY( mypair.first.length() && mypair.second.length() );
 
1259
+  }
 
1260
+}
 
1261
+
 
1262
+int main()
 
1263
+{
 
1264
+  test01();
 
1265
+  return 0;
 
1266
+}
 
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)
 
1271
@@ -1,85 +0,0 @@
 
1272
-// { dg-options "-std=gnu++0x" }
 
1273
-
 
1274
-// Copyright (C) 2009-2013 Free Software Foundation, Inc.
 
1275
-//
 
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.
 
1281
-
 
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.
 
1286
-
 
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/>.
 
1290
-
 
1291
-
 
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.
 
1295
-
 
1296
-#include <set>
 
1297
-#include <vector>
 
1298
-#include <testsuite_hooks.h>
 
1299
-
 
1300
-using namespace std;
 
1301
-
 
1302
-void
 
1303
-test01()
 
1304
-{
 
1305
-  bool test __attribute__((unused)) = true;
 
1306
-  using namespace std;
 
1307
-
 
1308
-  multiset<int> ms0;
 
1309
-  typedef multiset<int>::iterator iterator;
 
1310
-  typedef multiset<int>::const_iterator const_iterator;
 
1311
-  typedef iterator insert_return_type;
 
1312
-
 
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 ) );
 
1317
-
 
1318
-  iterator pos1 = ms0.erase(irt[1]);
 
1319
-  VERIFY( pos1 == irt[2] );
 
1320
-
 
1321
-  iterator pos2 = ms0.erase(irt[2]);
 
1322
-  VERIFY( pos2 == irt[3] );
 
1323
-
 
1324
-  iterator pos3 = ms0.erase(irt[9]);
 
1325
-  VERIFY( pos3 == ms0.end() );
 
1326
-}
 
1327
-
 
1328
-void
 
1329
-test02()
 
1330
-{
 
1331
-  bool test __attribute__((unused)) = true;
 
1332
-  using namespace std;
 
1333
-
 
1334
-  multiset<int> ms0;
 
1335
-  typedef multiset<int>::iterator iterator;
 
1336
-  typedef multiset<int>::const_iterator const_iterator;
 
1337
-  typedef iterator insert_return_type;
 
1338
-
 
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 ) );
 
1343
-
 
1344
-  iterator pos1 = ms0.erase(irt[3], irt[6]);
 
1345
-  VERIFY( pos1 == irt[6] );
 
1346
-
 
1347
-  iterator pos2 = ms0.erase(irt[6], ++irt[9]);
 
1348
-  VERIFY( pos2 == ms0.end() );
 
1349
-}
 
1350
-
 
1351
-int
 
1352
-main()
 
1353
-{
 
1354
-  test01();
 
1355
-  test02();
 
1356
-}
 
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)
 
1361
@@ -0,0 +1,40 @@
 
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>
 
1366
+//
 
1367
+// Copyright (C) 2013 Free Software Foundation, Inc.
 
1368
+//
 
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.
 
1374
+//
 
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.
 
1379
+//
 
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/>.
 
1383
+
 
1384
+#include <testsuite_containers.h>
 
1385
+
 
1386
+int main()
 
1387
+{
 
1388
+  typedef std::multiset<int>                   container_type;
 
1389
+
 
1390
+  {
 
1391
+    container_type s { 0, 1, 2 };
 
1392
+    __gnu_test::linkage_check_cxx98_cxx11_erase(s);
 
1393
+  }
 
1394
+
 
1395
+  {
 
1396
+    container_type s { 0, 1, 2 };
 
1397
+    __gnu_test::linkage_check_cxx98_cxx11_erase_iterators(s);
 
1398
+  }
 
1399
+
 
1400
+  return 0;
 
1401
+}
 
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)
 
1406
@@ -0,0 +1,38 @@
 
1407
+// { dg-do compile }
 
1408
+// { dg-options -std=c++11 }
 
1409
+
 
1410
+// Copyright (C) 2013 Free Software Foundation, Inc.
 
1411
+//
 
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.
 
1417
+
 
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.
 
1422
+
 
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.
 
1426
+
 
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/>.
 
1431
+
 
1432
+// Test that the C++11 variants have an ABI tag
 
1433
+
 
1434
+#include <set>
 
1435
+
 
1436
+using container = std::multiset<int>;
 
1437
+using iterator = typename container::iterator;
 
1438
+using const_iterator = typename container::const_iterator;
 
1439
+
 
1440
+// { dg-final { scan-assembler "_ZNSt8multisetIiSt4lessIiESaIiEE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIiE" } }
 
1441
+iterator (container::*p1)(const_iterator) = &container::erase;
 
1442
+
 
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)
 
1449
@@ -0,0 +1,85 @@
 
1450
+// { dg-options "-std=gnu++0x" }
 
1451
+
 
1452
+// Copyright (C) 2009-2013 Free Software Foundation, Inc.
 
1453
+//
 
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.
 
1459
+
 
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.
 
1464
+
 
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/>.
 
1468
+
 
1469
+
 
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.
 
1473
+
 
1474
+#include <set>
 
1475
+#include <vector>
 
1476
+#include <testsuite_hooks.h>
 
1477
+
 
1478
+using namespace std;
 
1479
+
 
1480
+void
 
1481
+test01()
 
1482
+{
 
1483
+  bool test __attribute__((unused)) = true;
 
1484
+  using namespace std;
 
1485
+
 
1486
+  multiset<int> ms0;
 
1487
+  typedef multiset<int>::iterator iterator;
 
1488
+  typedef multiset<int>::const_iterator const_iterator;
 
1489
+  typedef iterator insert_return_type;
 
1490
+
 
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 ) );
 
1495
+
 
1496
+  iterator pos1 = ms0.erase(irt[1]);
 
1497
+  VERIFY( pos1 == irt[2] );
 
1498
+
 
1499
+  iterator pos2 = ms0.erase(irt[2]);
 
1500
+  VERIFY( pos2 == irt[3] );
 
1501
+
 
1502
+  iterator pos3 = ms0.erase(irt[9]);
 
1503
+  VERIFY( pos3 == ms0.end() );
 
1504
+}
 
1505
+
 
1506
+void
 
1507
+test02()
 
1508
+{
 
1509
+  bool test __attribute__((unused)) = true;
 
1510
+  using namespace std;
 
1511
+
 
1512
+  multiset<int> ms0;
 
1513
+  typedef multiset<int>::iterator iterator;
 
1514
+  typedef multiset<int>::const_iterator const_iterator;
 
1515
+  typedef iterator insert_return_type;
 
1516
+
 
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 ) );
 
1521
+
 
1522
+  iterator pos1 = ms0.erase(irt[3], irt[6]);
 
1523
+  VERIFY( pos1 == irt[6] );
 
1524
+
 
1525
+  iterator pos2 = ms0.erase(irt[6], ++irt[9]);
 
1526
+  VERIFY( pos2 == ms0.end() );
 
1527
+}
 
1528
+
 
1529
+int
 
1530
+main()
 
1531
+{
 
1532
+  test01();
 
1533
+  test02();
 
1534
+}
 
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)
 
1539
@@ -1,77 +0,0 @@
 
1540
-// { dg-options "-std=gnu++0x" }
 
1541
-// 2008-07-22  Edward Smith-Rowland  <3dw4rd@verizon.net>
 
1542
-//
 
1543
-// Copyright (C) 2009-2013 Free Software Foundation, Inc.
 
1544
-//
 
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.
 
1550
-//
 
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.
 
1555
-//
 
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/>.
 
1559
-
 
1560
-#include <map>
 
1561
-#include <testsuite_hooks.h>
 
1562
-
 
1563
-//  DR 130. Associative erase should return an iterator.
 
1564
-void
 
1565
-test01()
 
1566
-{
 
1567
-  bool test __attribute__((unused)) = true;
 
1568
-  using namespace std;
 
1569
-
 
1570
-  map<int, int> m0;
 
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;
 
1575
-
 
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));
 
1579
-
 
1580
-  iterator pos1 = m0.erase(irt1.first);
 
1581
-  VERIFY( pos1 == irt2.first );
 
1582
-
 
1583
-  iterator pos2 = m0.erase(irt2.first);
 
1584
-  VERIFY( pos2 == m0.end() );
 
1585
-}
 
1586
-
 
1587
-void
 
1588
-test02()
 
1589
-{
 
1590
-  bool test __attribute__((unused)) = true;
 
1591
-  using namespace std;
 
1592
-
 
1593
-  map<int, int> m0;
 
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;
 
1598
-
 
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));
 
1603
-
 
1604
-  iterator pos1 = m0.erase(irt0.first, irt2.first);
 
1605
-  VERIFY( pos1 == irt2.first );
 
1606
-
 
1607
-  iterator pos2 = m0.erase(irt2.first, ++irt3.first);
 
1608
-  VERIFY( pos2 == m0.end() );
 
1609
-}
 
1610
-
 
1611
-int
 
1612
-main()
 
1613
-{
 
1614
-  test01();
 
1615
-  test02();
 
1616
-}
 
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)
 
1621
@@ -0,0 +1,40 @@
 
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>
 
1626
+//
 
1627
+// Copyright (C) 2013 Free Software Foundation, Inc.
 
1628
+//
 
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.
 
1634
+//
 
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.
 
1639
+//
 
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/>.
 
1643
+
 
1644
+#include <testsuite_containers.h>
 
1645
+
 
1646
+int main()
 
1647
+{
 
1648
+  typedef std::map<int, int>           container_type;
 
1649
+
 
1650
+  {
 
1651
+    container_type s { {0,0} , {1,1} , {2,2} };
 
1652
+    __gnu_test::linkage_check_cxx98_cxx11_erase(s);
 
1653
+  }
 
1654
+
 
1655
+  {
 
1656
+    container_type s { {0,0} , {1,1} , {2,2} };
 
1657
+    __gnu_test::linkage_check_cxx98_cxx11_erase_iterators(s);
 
1658
+  }
 
1659
+
 
1660
+  return 0;
 
1661
+}
 
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)
 
1666
@@ -0,0 +1,35 @@
 
1667
+// { dg-do compile }
 
1668
+// { dg-options -std=c++11 }
 
1669
+
 
1670
+// Copyright (C) 2013 Free Software Foundation, Inc.
 
1671
+//
 
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.
 
1677
+
 
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.
 
1682
+
 
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.
 
1686
+
 
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/>.
 
1691
+
 
1692
+// Test that the C++11 variants have an ABI tag
 
1693
+
 
1694
+#include <map>
 
1695
+
 
1696
+using container = std::map<int, int>;
 
1697
+using iterator = typename container::iterator;
 
1698
+using const_iterator = typename container::const_iterator;
 
1699
+
 
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)
 
1706
@@ -0,0 +1,77 @@
 
1707
+// { dg-options "-std=gnu++0x" }
 
1708
+// 2008-07-22  Edward Smith-Rowland  <3dw4rd@verizon.net>
 
1709
+//
 
1710
+// Copyright (C) 2009-2013 Free Software Foundation, Inc.
 
1711
+//
 
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.
 
1717
+//
 
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.
 
1722
+//
 
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/>.
 
1726
+
 
1727
+#include <map>
 
1728
+#include <testsuite_hooks.h>
 
1729
+
 
1730
+//  DR 130. Associative erase should return an iterator.
 
1731
+void
 
1732
+test01()
 
1733
+{
 
1734
+  bool test __attribute__((unused)) = true;
 
1735
+  using namespace std;
 
1736
+
 
1737
+  map<int, int> m0;
 
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;
 
1742
+
 
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));
 
1746
+
 
1747
+  iterator pos1 = m0.erase(irt1.first);
 
1748
+  VERIFY( pos1 == irt2.first );
 
1749
+
 
1750
+  iterator pos2 = m0.erase(irt2.first);
 
1751
+  VERIFY( pos2 == m0.end() );
 
1752
+}
 
1753
+
 
1754
+void
 
1755
+test02()
 
1756
+{
 
1757
+  bool test __attribute__((unused)) = true;
 
1758
+  using namespace std;
 
1759
+
 
1760
+  map<int, int> m0;
 
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;
 
1765
+
 
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));
 
1770
+
 
1771
+  iterator pos1 = m0.erase(irt0.first, irt2.first);
 
1772
+  VERIFY( pos1 == irt2.first );
 
1773
+
 
1774
+  iterator pos2 = m0.erase(irt2.first, ++irt3.first);
 
1775
+  VERIFY( pos2 == m0.end() );
 
1776
+}
 
1777
+
 
1778
+int
 
1779
+main()
 
1780
+{
 
1781
+  test01();
 
1782
+  test02();
 
1783
+}
 
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;
 
1791
 
 
1792
+  // DR 130 vs. C++98 vs. C++11.
 
1793
+  // Defined in testsuite_shared.cc.
 
1794
+  void 
 
1795
+  erase_external(std::set<int>& s);
 
1796
 
 
1797
+  void 
 
1798
+  erase_external(std::multiset<int>& s);
 
1799
+
 
1800
+  void 
 
1801
+  erase_external(std::map<int, int>& s);
 
1802
+
 
1803
+  void 
 
1804
+  erase_external(std::multimap<int, int>& s);
 
1805
+
 
1806
+  void 
 
1807
+  erase_external_iterators(std::set<int>& s);
 
1808
+
 
1809
+  void 
 
1810
+  erase_external_iterators(std::multiset<int>& s);
 
1811
+
 
1812
+  void 
 
1813
+  erase_external_iterators(std::map<int, int>& s);
 
1814
+
 
1815
+  void 
 
1816
+  erase_external_iterators(std::multimap<int, int>& s);
 
1817
+
 
1818
+// NB: "must be compiled with C++11"
 
1819
+#if __cplusplus >= 201103L
 
1820
+template<typename _Tp>
 
1821
+  void 
 
1822
+  linkage_check_cxx98_cxx11_erase(_Tp& container)
 
1823
+  {
 
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
 
1829
+  }
 
1830
+
 
1831
+template<typename _Tp>
 
1832
+  void 
 
1833
+  linkage_check_cxx98_cxx11_erase_iterators(_Tp& container)
 
1834
+  {
 
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
 
1839
+
 
1840
+    auto iter = container.begin();
 
1841
+    container.erase(iter, ++iter);     // C++11
 
1842
+  }
 
1843
+#endif
 
1844
+
 
1845
 } // namespace __gnu_test
 
1846
 
 
1847
 #endif
 
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)
 
1852
@@ -19,9 +19,13 @@
 
1853
 #include <stdexcept>
 
1854
 #include <iostream>
 
1855
 #include <sstream>
 
1856
+#include <set>
 
1857
+#include <map>
 
1858
 #include <ext/mt_allocator.h>
 
1859
 #include <bits/functexcept.h>
 
1860
 
 
1861
+namespace __gnu_test
 
1862
+{
 
1863
 // libstdc++/22309
 
1864
 extern "C" void
 
1865
 try_allocation()
 
1866
@@ -70,3 +74,57 @@
 
1867
   // Randomly throw. See if other threads cleanup.
 
1868
   std::__throw_bad_exception();
 
1869
 }
 
1870
+
 
1871
+#if __cplusplus < 201103L
 
1872
+// "must be compiled with C++98"
 
1873
+  void 
 
1874
+  erase_external(std::set<int>& s)
 
1875
+  { s.erase(s.begin()); }
 
1876
+
 
1877
+  void 
 
1878
+  erase_external(std::multiset<int>& s)
 
1879
+  { s.erase(s.begin()); }
 
1880
+  
 
1881
+  void 
 
1882
+  erase_external(std::map<int, int>& s)
 
1883
+  { s.erase(s.begin()); }
 
1884
+  
 
1885
+  void 
 
1886
+  erase_external(std::multimap<int, int>& s)
 
1887
+  { s.erase(s.begin()); }
 
1888
+
 
1889
+  void 
 
1890
+  erase_external_iterators(std::set<int>& s)
 
1891
+  {
 
1892
+    typedef typename std::set<int>::iterator iterator_type;
 
1893
+    iterator_type iter = s.begin();
 
1894
+    s.erase(iter, ++iter);
 
1895
+  }
 
1896
+
 
1897
+  void 
 
1898
+  erase_external_iterators(std::multiset<int>& s)
 
1899
+  {
 
1900
+    typedef typename std::multiset<int>::iterator iterator_type;
 
1901
+    iterator_type iter = s.begin();
 
1902
+    s.erase(iter, ++iter);
 
1903
+  }
 
1904
+
 
1905
+  void 
 
1906
+  erase_external_iterators(std::map<int, int>& s)
 
1907
+  {
 
1908
+    typedef typename std::map<int, int>::iterator iterator_type;
 
1909
+    iterator_type iter = s.begin();
 
1910
+    s.erase(iter, ++iter);
 
1911
+  }
 
1912
+
 
1913
+  
 
1914
+  void 
 
1915
+  erase_external_iterators(std::multimap<int, int>& s)
 
1916
+  {
 
1917
+    typedef typename std::multimap<int, int>::iterator iterator_type;
 
1918
+    iterator_type iter = s.begin();
 
1919
+    s.erase(iter, ++iter);
 
1920
+  }
 
1921
+#endif
 
1922
+
 
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)
 
1928
@@ -543,6 +543,7 @@
 
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
 
1936
@@ -732,6 +733,8 @@
 
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)
 
2012
@@ -6,7 +6,7 @@
 
2013
   succeeded=no
 
2014
 
 
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)
 
2018
   fi
 
2019
 
 
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 @@
 
2026
   succeeded=no
 
2027
 
 
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 @@
 
2038
   done
 
2039
 IFS=$as_save_IFS
 
2040
 
 
2041
-  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
 
2042
   ;;
 
2043
 esac
 
2044
 fi
 
2045
@@ -18820,8 +18820,65 @@
 
2046
 fi
 
2047
 
 
2048
 
 
2049
+fi
 
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
 
2058
+else
 
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.
 
2062
+  ;;
 
2063
+  *)
 
2064
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 
2065
+for as_dir in $PATH
 
2066
+do
 
2067
+  IFS=$as_save_IFS
 
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
 
2073
+    break 2
 
2074
   fi
 
2075
+done
 
2076
+  done
 
2077
+IFS=$as_save_IFS
 
2078
 
 
2079
+  ;;
 
2080
+esac
 
2081
+fi
 
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; }
 
2086
+else
 
2087
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 
2088
+$as_echo "no" >&6; }
 
2089
+fi
 
2090
+
 
2091
+  if test "x$ac_pt_PKG_CONFIG" = x; then
 
2092
+    PKG_CONFIG="no"
 
2093
+  else
 
2094
+    case $cross_compiling:$ac_tool_warned in
 
2095
+yes:)
 
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 ;;
 
2099
+esac
 
2100
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
 
2101
+  fi
 
2102
+else
 
2103
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
 
2104
+fi
 
2105
+
 
2106
+  fi
 
2107
+
 
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 @@
 
2112
   succeeded=no
 
2113
 
 
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 @@
 
2124
   done
 
2125
 IFS=$as_save_IFS
 
2126
 
 
2127
-  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
 
2128
   ;;
 
2129
 esac
 
2130
 fi
 
2131
@@ -18917,8 +18974,65 @@
 
2132
 fi
 
2133
 
 
2134
 
 
2135
+fi
 
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
 
2144
+else
 
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.
 
2148
+  ;;
 
2149
+  *)
 
2150
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 
2151
+for as_dir in $PATH
 
2152
+do
 
2153
+  IFS=$as_save_IFS
 
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
 
2159
+    break 2
 
2160
   fi
 
2161
+done
 
2162
+  done
 
2163
+IFS=$as_save_IFS
 
2164
 
 
2165
+  ;;
 
2166
+esac
 
2167
+fi
 
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; }
 
2172
+else
 
2173
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 
2174
+$as_echo "no" >&6; }
 
2175
+fi
 
2176
+
 
2177
+  if test "x$ac_pt_PKG_CONFIG" = x; then
 
2178
+    PKG_CONFIG="no"
 
2179
+  else
 
2180
+    case $cross_compiling:$ac_tool_warned in
 
2181
+yes:)
 
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 ;;
 
2185
+esac
 
2186
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
 
2187
+  fi
 
2188
+else
 
2189
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
 
2190
+fi
 
2191
+
 
2192
+  fi
 
2193
+
 
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 @@
 
2198
   succeeded=no
 
2199
 
 
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 @@
 
2210
   done
 
2211
 IFS=$as_save_IFS
 
2212
 
 
2213
-  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
 
2214
   ;;
 
2215
 esac
 
2216
 fi
 
2217
@@ -19792,8 +19906,65 @@
 
2218
 fi
 
2219
 
 
2220
 
 
2221
+fi
 
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
 
2230
+else
 
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.
 
2234
+  ;;
 
2235
+  *)
 
2236
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 
2237
+for as_dir in $PATH
 
2238
+do
 
2239
+  IFS=$as_save_IFS
 
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
 
2245
+    break 2
 
2246
   fi
 
2247
+done
 
2248
+  done
 
2249
+IFS=$as_save_IFS
 
2250
 
 
2251
+  ;;
 
2252
+esac
 
2253
+fi
 
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; }
 
2258
+else
 
2259
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 
2260
+$as_echo "no" >&6; }
 
2261
+fi
 
2262
+
 
2263
+  if test "x$ac_pt_PKG_CONFIG" = x; then
 
2264
+    PKG_CONFIG="no"
 
2265
+  else
 
2266
+    case $cross_compiling:$ac_tool_warned in
 
2267
+yes:)
 
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 ;;
 
2271
+esac
 
2272
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
 
2273
+  fi
 
2274
+else
 
2275
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
 
2276
+fi
 
2277
+
 
2278
+  fi
 
2279
+
 
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 @@
 
2284
   succeeded=no
 
2285
 
 
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 @@
 
2296
   done
 
2297
 IFS=$as_save_IFS
 
2298
 
 
2299
-  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
 
2300
   ;;
 
2301
 esac
 
2302
 fi
 
2303
@@ -19889,8 +20060,65 @@
 
2304
 fi
 
2305
 
 
2306
 
 
2307
+fi
 
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
 
2316
+else
 
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.
 
2320
+  ;;
 
2321
+  *)
 
2322
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 
2323
+for as_dir in $PATH
 
2324
+do
 
2325
+  IFS=$as_save_IFS
 
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
 
2331
+    break 2
 
2332
   fi
 
2333
+done
 
2334
+  done
 
2335
+IFS=$as_save_IFS
 
2336
 
 
2337
+  ;;
 
2338
+esac
 
2339
+fi
 
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; }
 
2344
+else
 
2345
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 
2346
+$as_echo "no" >&6; }
 
2347
+fi
 
2348
+
 
2349
+  if test "x$ac_pt_PKG_CONFIG" = x; then
 
2350
+    PKG_CONFIG="no"
 
2351
+  else
 
2352
+    case $cross_compiling:$ac_tool_warned in
 
2353
+yes:)
 
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 ;;
 
2357
+esac
 
2358
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
 
2359
+  fi
 
2360
+else
 
2361
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
 
2362
+fi
 
2363
+
 
2364
+  fi
 
2365
+
 
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 @@
 
2370
   succeeded=no
 
2371
 
 
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 @@
 
2382
   done
 
2383
 IFS=$as_save_IFS
 
2384
 
 
2385
-  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
 
2386
   ;;
 
2387
 esac
 
2388
 fi
 
2389
@@ -19986,8 +20214,65 @@
 
2390
 fi
 
2391
 
 
2392
 
 
2393
+fi
 
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
 
2402
+else
 
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.
 
2406
+  ;;
 
2407
+  *)
 
2408
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 
2409
+for as_dir in $PATH
 
2410
+do
 
2411
+  IFS=$as_save_IFS
 
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
 
2417
+    break 2
 
2418
   fi
 
2419
+done
 
2420
+  done
 
2421
+IFS=$as_save_IFS
 
2422
 
 
2423
+  ;;
 
2424
+esac
 
2425
+fi
 
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; }
 
2430
+else
 
2431
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 
2432
+$as_echo "no" >&6; }
 
2433
+fi
 
2434
+
 
2435
+  if test "x$ac_pt_PKG_CONFIG" = x; then
 
2436
+    PKG_CONFIG="no"
 
2437
+  else
 
2438
+    case $cross_compiling:$ac_tool_warned in
 
2439
+yes:)
 
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 ;;
 
2443
+esac
 
2444
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
 
2445
+  fi
 
2446
+else
 
2447
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
 
2448
+fi
 
2449
+
 
2450
+  fi
 
2451
+
 
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 @@
 
2456
   succeeded=no
 
2457
 
 
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 @@
 
2468
   done
 
2469
 IFS=$as_save_IFS
 
2470
 
 
2471
-  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
 
2472
   ;;
 
2473
 esac
 
2474
 fi
 
2475
@@ -20083,8 +20368,65 @@
 
2476
 fi
 
2477
 
 
2478
 
 
2479
+fi
 
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
 
2488
+else
 
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.
 
2492
+  ;;
 
2493
+  *)
 
2494
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 
2495
+for as_dir in $PATH
 
2496
+do
 
2497
+  IFS=$as_save_IFS
 
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
 
2503
+    break 2
 
2504
   fi
 
2505
+done
 
2506
+  done
 
2507
+IFS=$as_save_IFS
 
2508
 
 
2509
+  ;;
 
2510
+esac
 
2511
+fi
 
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; }
 
2516
+else
 
2517
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 
2518
+$as_echo "no" >&6; }
 
2519
+fi
 
2520
+
 
2521
+  if test "x$ac_pt_PKG_CONFIG" = x; then
 
2522
+    PKG_CONFIG="no"
 
2523
+  else
 
2524
+    case $cross_compiling:$ac_tool_warned in
 
2525
+yes:)
 
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 ;;
 
2529
+esac
 
2530
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
 
2531
+  fi
 
2532
+else
 
2533
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
 
2534
+fi
 
2535
+
 
2536
+  fi
 
2537
+
 
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 @@
 
2542
   succeeded=no
 
2543
 
 
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 @@
 
2554
   done
 
2555
 IFS=$as_save_IFS
 
2556
 
 
2557
-  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
 
2558
   ;;
 
2559
 esac
 
2560
 fi
 
2561
@@ -20286,8 +20628,65 @@
 
2562
 fi
 
2563
 
 
2564
 
 
2565
+fi
 
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
 
2574
+else
 
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.
 
2578
+  ;;
 
2579
+  *)
 
2580
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 
2581
+for as_dir in $PATH
 
2582
+do
 
2583
+  IFS=$as_save_IFS
 
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
 
2589
+    break 2
 
2590
   fi
 
2591
+done
 
2592
+  done
 
2593
+IFS=$as_save_IFS
 
2594
 
 
2595
+  ;;
 
2596
+esac
 
2597
+fi
 
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; }
 
2602
+else
 
2603
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 
2604
+$as_echo "no" >&6; }
 
2605
+fi
 
2606
+
 
2607
+  if test "x$ac_pt_PKG_CONFIG" = x; then
 
2608
+    PKG_CONFIG="no"
 
2609
+  else
 
2610
+    case $cross_compiling:$ac_tool_warned in
 
2611
+yes:)
 
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 ;;
 
2615
+esac
 
2616
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
 
2617
+  fi
 
2618
+else
 
2619
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
 
2620
+fi
 
2621
+
 
2622
+  fi
 
2623
+
 
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 @@
 
2628
   succeeded=no
 
2629
 
 
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 @@
 
2640
   done
 
2641
 IFS=$as_save_IFS
 
2642
 
 
2643
-  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
 
2644
   ;;
 
2645
 esac
 
2646
 fi
 
2647
@@ -20385,8 +20784,65 @@
 
2648
 fi
 
2649
 
 
2650
 
 
2651
+fi
 
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
 
2660
+else
 
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.
 
2664
+  ;;
 
2665
+  *)
 
2666
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 
2667
+for as_dir in $PATH
 
2668
+do
 
2669
+  IFS=$as_save_IFS
 
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
 
2675
+    break 2
 
2676
   fi
 
2677
+done
 
2678
+  done
 
2679
+IFS=$as_save_IFS
 
2680
 
 
2681
+  ;;
 
2682
+esac
 
2683
+fi
 
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; }
 
2688
+else
 
2689
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 
2690
+$as_echo "no" >&6; }
 
2691
+fi
 
2692
+
 
2693
+  if test "x$ac_pt_PKG_CONFIG" = x; then
 
2694
+    PKG_CONFIG="no"
 
2695
+  else
 
2696
+    case $cross_compiling:$ac_tool_warned in
 
2697
+yes:)
 
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 ;;
 
2701
+esac
 
2702
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
 
2703
+  fi
 
2704
+else
 
2705
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
 
2706
+fi
 
2707
+
 
2708
+  fi
 
2709
+
 
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 @@
 
2714
   succeeded=no
 
2715
 
 
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 @@
 
2726
   done
 
2727
 IFS=$as_save_IFS
 
2728
 
 
2729
-  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
 
2730
   ;;
 
2731
 esac
 
2732
 fi
 
2733
@@ -20494,8 +20950,65 @@
 
2734
 fi
 
2735
 
 
2736
 
 
2737
+fi
 
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
 
2746
+else
 
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.
 
2750
+  ;;
 
2751
+  *)
 
2752
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 
2753
+for as_dir in $PATH
 
2754
+do
 
2755
+  IFS=$as_save_IFS
 
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
 
2761
+    break 2
 
2762
   fi
 
2763
+done
 
2764
+  done
 
2765
+IFS=$as_save_IFS
 
2766
 
 
2767
+  ;;
 
2768
+esac
 
2769
+fi
 
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; }
 
2774
+else
 
2775
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 
2776
+$as_echo "no" >&6; }
 
2777
+fi
 
2778
+
 
2779
+  if test "x$ac_pt_PKG_CONFIG" = x; then
 
2780
+    PKG_CONFIG="no"
 
2781
+  else
 
2782
+    case $cross_compiling:$ac_tool_warned in
 
2783
+yes:)
 
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 ;;
 
2787
+esac
 
2788
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
 
2789
+  fi
 
2790
+else
 
2791
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
 
2792
+fi
 
2793
+
 
2794
+  fi
 
2795
+
 
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 @@
 
2800
   succeeded=no
 
2801
 
 
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 @@
 
2812
   done
 
2813
 IFS=$as_save_IFS
 
2814
 
 
2815
-  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
 
2816
   ;;
 
2817
 esac
 
2818
 fi
 
2819
@@ -20594,8 +21107,65 @@
 
2820
 fi
 
2821
 
 
2822
 
 
2823
+fi
 
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
 
2832
+else
 
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.
 
2836
+  ;;
 
2837
+  *)
 
2838
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 
2839
+for as_dir in $PATH
 
2840
+do
 
2841
+  IFS=$as_save_IFS
 
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
 
2847
+    break 2
 
2848
   fi
 
2849
+done
 
2850
+  done
 
2851
+IFS=$as_save_IFS
 
2852
 
 
2853
+  ;;
 
2854
+esac
 
2855
+fi
 
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; }
 
2860
+else
 
2861
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 
2862
+$as_echo "no" >&6; }
 
2863
+fi
 
2864
+
 
2865
+  if test "x$ac_pt_PKG_CONFIG" = x; then
 
2866
+    PKG_CONFIG="no"
 
2867
+  else
 
2868
+    case $cross_compiling:$ac_tool_warned in
 
2869
+yes:)
 
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 ;;
 
2873
+esac
 
2874
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
 
2875
+  fi
 
2876
+else
 
2877
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
 
2878
+fi
 
2879
+
 
2880
+  fi
 
2881
+
 
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 @@
 
2886
   succeeded=no
 
2887
 
 
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 @@
 
2898
   done
 
2899
 IFS=$as_save_IFS
 
2900
 
 
2901
-  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
 
2902
   ;;
 
2903
 esac
 
2904
 fi
 
2905
@@ -20694,8 +21264,65 @@
 
2906
 fi
 
2907
 
 
2908
 
 
2909
+fi
 
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
 
2918
+else
 
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.
 
2922
+  ;;
 
2923
+  *)
 
2924
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 
2925
+for as_dir in $PATH
 
2926
+do
 
2927
+  IFS=$as_save_IFS
 
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
 
2933
+    break 2
 
2934
   fi
 
2935
+done
 
2936
+  done
 
2937
+IFS=$as_save_IFS
 
2938
 
 
2939
+  ;;
 
2940
+esac
 
2941
+fi
 
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; }
 
2946
+else
 
2947
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 
2948
+$as_echo "no" >&6; }
 
2949
+fi
 
2950
+
 
2951
+  if test "x$ac_pt_PKG_CONFIG" = x; then
 
2952
+    PKG_CONFIG="no"
 
2953
+  else
 
2954
+    case $cross_compiling:$ac_tool_warned in
 
2955
+yes:)
 
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 ;;
 
2959
+esac
 
2960
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
 
2961
+  fi
 
2962
+else
 
2963
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
 
2964
+fi
 
2965
+
 
2966
+  fi
 
2967
+
 
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 @@
 
2972
   succeeded=no
 
2973
 
 
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 @@
 
2984
   done
 
2985
 IFS=$as_save_IFS
 
2986
 
 
2987
-  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
 
2988
   ;;
 
2989
 esac
 
2990
 fi
 
2991
@@ -20797,8 +21424,65 @@
 
2992
 fi
 
2993
 
 
2994
 
 
2995
+fi
 
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
 
3004
+else
 
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.
 
3008
+  ;;
 
3009
+  *)
 
3010
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 
3011
+for as_dir in $PATH
 
3012
+do
 
3013
+  IFS=$as_save_IFS
 
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
 
3019
+    break 2
 
3020
   fi
 
3021
+done
 
3022
+  done
 
3023
+IFS=$as_save_IFS
 
3024
 
 
3025
+  ;;
 
3026
+esac
 
3027
+fi
 
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; }
 
3032
+else
 
3033
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 
3034
+$as_echo "no" >&6; }
 
3035
+fi
 
3036
+
 
3037
+  if test "x$ac_pt_PKG_CONFIG" = x; then
 
3038
+    PKG_CONFIG="no"
 
3039
+  else
 
3040
+    case $cross_compiling:$ac_tool_warned in
 
3041
+yes:)
 
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 ;;
 
3045
+esac
 
3046
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
 
3047
+  fi
 
3048
+else
 
3049
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
 
3050
+fi
 
3051
+
 
3052
+  fi
 
3053
+
 
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 @@
 
3058
   succeeded=no
 
3059
 
 
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 @@
 
3070
   done
 
3071
 IFS=$as_save_IFS
 
3072
 
 
3073
-  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
 
3074
   ;;
 
3075
 esac
 
3076
 fi
 
3077
@@ -20904,8 +21588,65 @@
 
3078
 fi
 
3079
 
 
3080
 
 
3081
+fi
 
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
 
3090
+else
 
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.
 
3094
+  ;;
 
3095
+  *)
 
3096
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 
3097
+for as_dir in $PATH
 
3098
+do
 
3099
+  IFS=$as_save_IFS
 
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
 
3105
+    break 2
 
3106
   fi
 
3107
+done
 
3108
+  done
 
3109
+IFS=$as_save_IFS
 
3110
 
 
3111
+  ;;
 
3112
+esac
 
3113
+fi
 
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; }
 
3118
+else
 
3119
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 
3120
+$as_echo "no" >&6; }
 
3121
+fi
 
3122
+
 
3123
+  if test "x$ac_pt_PKG_CONFIG" = x; then
 
3124
+    PKG_CONFIG="no"
 
3125
+  else
 
3126
+    case $cross_compiling:$ac_tool_warned in
 
3127
+yes:)
 
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 ;;
 
3131
+esac
 
3132
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
 
3133
+  fi
 
3134
+else
 
3135
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
 
3136
+fi
 
3137
+
 
3138
+  fi
 
3139
+
 
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 @@
 
3144
   succeeded=no
 
3145
 
 
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 @@
 
3156
   done
 
3157
 IFS=$as_save_IFS
 
3158
 
 
3159
-  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
 
3160
   ;;
 
3161
 esac
 
3162
 fi
 
3163
@@ -21283,8 +22024,65 @@
 
3164
 fi
 
3165
 
 
3166
 
 
3167
+fi
 
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
 
3176
+else
 
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.
 
3180
+  ;;
 
3181
+  *)
 
3182
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 
3183
+for as_dir in $PATH
 
3184
+do
 
3185
+  IFS=$as_save_IFS
 
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
 
3191
+    break 2
 
3192
   fi
 
3193
+done
 
3194
+  done
 
3195
+IFS=$as_save_IFS
 
3196
 
 
3197
+  ;;
 
3198
+esac
 
3199
+fi
 
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; }
 
3204
+else
 
3205
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 
3206
+$as_echo "no" >&6; }
 
3207
+fi
 
3208
+
 
3209
+  if test "x$ac_pt_PKG_CONFIG" = x; then
 
3210
+    PKG_CONFIG="no"
 
3211
+  else
 
3212
+    case $cross_compiling:$ac_tool_warned in
 
3213
+yes:)
 
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 ;;
 
3217
+esac
 
3218
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
 
3219
+  fi
 
3220
+else
 
3221
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
 
3222
+fi
 
3223
+
 
3224
+  fi
 
3225
+
 
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 @@
 
3230
   succeeded=no
 
3231
 
 
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 @@
 
3242
   done
 
3243
 IFS=$as_save_IFS
 
3244
 
 
3245
-  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
 
3246
   ;;
 
3247
 esac
 
3248
 fi
 
3249
@@ -21381,8 +22179,65 @@
 
3250
 fi
 
3251
 
 
3252
 
 
3253
+fi
 
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
 
3262
+else
 
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.
 
3266
+  ;;
 
3267
+  *)
 
3268
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 
3269
+for as_dir in $PATH
 
3270
+do
 
3271
+  IFS=$as_save_IFS
 
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
 
3277
+    break 2
 
3278
   fi
 
3279
+done
 
3280
+  done
 
3281
+IFS=$as_save_IFS
 
3282
 
 
3283
+  ;;
 
3284
+esac
 
3285
+fi
 
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; }
 
3290
+else
 
3291
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 
3292
+$as_echo "no" >&6; }
 
3293
+fi
 
3294
+
 
3295
+  if test "x$ac_pt_PKG_CONFIG" = x; then
 
3296
+    PKG_CONFIG="no"
 
3297
+  else
 
3298
+    case $cross_compiling:$ac_tool_warned in
 
3299
+yes:)
 
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 ;;
 
3303
+esac
 
3304
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
 
3305
+  fi
 
3306
+else
 
3307
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
 
3308
+fi
 
3309
+
 
3310
+  fi
 
3311
+
 
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 @@
 
3316
   succeeded=no
 
3317
 
 
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 @@
 
3328
   done
 
3329
 IFS=$as_save_IFS
 
3330
 
 
3331
-  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
 
3332
   ;;
 
3333
 esac
 
3334
 fi
 
3335
@@ -21480,8 +22335,65 @@
 
3336
 fi
 
3337
 
 
3338
 
 
3339
+fi
 
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
 
3348
+else
 
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.
 
3352
+  ;;
 
3353
+  *)
 
3354
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 
3355
+for as_dir in $PATH
 
3356
+do
 
3357
+  IFS=$as_save_IFS
 
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
 
3363
+    break 2
 
3364
   fi
 
3365
+done
 
3366
+  done
 
3367
+IFS=$as_save_IFS
 
3368
 
 
3369
+  ;;
 
3370
+esac
 
3371
+fi
 
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; }
 
3376
+else
 
3377
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 
3378
+$as_echo "no" >&6; }
 
3379
+fi
 
3380
+
 
3381
+  if test "x$ac_pt_PKG_CONFIG" = x; then
 
3382
+    PKG_CONFIG="no"
 
3383
+  else
 
3384
+    case $cross_compiling:$ac_tool_warned in
 
3385
+yes:)
 
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 ;;
 
3389
+esac
 
3390
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
 
3391
+  fi
 
3392
+else
 
3393
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
 
3394
+fi
 
3395
+
 
3396
+  fi
 
3397
+
 
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 @@
 
3402
   succeeded=no
 
3403
 
 
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 @@
 
3414
   done
 
3415
 IFS=$as_save_IFS
 
3416
 
 
3417
-  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
 
3418
   ;;
 
3419
 esac
 
3420
 fi
 
3421
@@ -21579,8 +22491,65 @@
 
3422
 fi
 
3423
 
 
3424
 
 
3425
+fi
 
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
 
3434
+else
 
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.
 
3438
+  ;;
 
3439
+  *)
 
3440
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 
3441
+for as_dir in $PATH
 
3442
+do
 
3443
+  IFS=$as_save_IFS
 
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
 
3449
+    break 2
 
3450
   fi
 
3451
+done
 
3452
+  done
 
3453
+IFS=$as_save_IFS
 
3454
 
 
3455
+  ;;
 
3456
+esac
 
3457
+fi
 
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; }
 
3462
+else
 
3463
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 
3464
+$as_echo "no" >&6; }
 
3465
+fi
 
3466
+
 
3467
+  if test "x$ac_pt_PKG_CONFIG" = x; then
 
3468
+    PKG_CONFIG="no"
 
3469
+  else
 
3470
+    case $cross_compiling:$ac_tool_warned in
 
3471
+yes:)
 
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 ;;
 
3475
+esac
 
3476
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
 
3477
+  fi
 
3478
+else
 
3479
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
 
3480
+fi
 
3481
+
 
3482
+  fi
 
3483
+
 
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 @@
 
3488
   succeeded=no
 
3489
 
 
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 @@
 
3500
   done
 
3501
 IFS=$as_save_IFS
 
3502
 
 
3503
-  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
 
3504
   ;;
 
3505
 esac
 
3506
 fi
 
3507
@@ -21678,8 +22647,65 @@
 
3508
 fi
 
3509
 
 
3510
 
 
3511
+fi
 
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
 
3520
+else
 
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.
 
3524
+  ;;
 
3525
+  *)
 
3526
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 
3527
+for as_dir in $PATH
 
3528
+do
 
3529
+  IFS=$as_save_IFS
 
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
 
3535
+    break 2
 
3536
   fi
 
3537
+done
 
3538
+  done
 
3539
+IFS=$as_save_IFS
 
3540
 
 
3541
+  ;;
 
3542
+esac
 
3543
+fi
 
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; }
 
3548
+else
 
3549
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 
3550
+$as_echo "no" >&6; }
 
3551
+fi
 
3552
+
 
3553
+  if test "x$ac_pt_PKG_CONFIG" = x; then
 
3554
+    PKG_CONFIG="no"
 
3555
+  else
 
3556
+    case $cross_compiling:$ac_tool_warned in
 
3557
+yes:)
 
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 ;;
 
3561
+esac
 
3562
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
 
3563
+  fi
 
3564
+else
 
3565
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
 
3566
+fi
 
3567
+
 
3568
+  fi
 
3569
+
 
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 @@
 
3574
   succeeded=no
 
3575
 
 
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 @@
 
3586
   done
 
3587
 IFS=$as_save_IFS
 
3588
 
 
3589
-  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
 
3590
   ;;
 
3591
 esac
 
3592
 fi
 
3593
@@ -21777,8 +22803,65 @@
 
3594
 fi
 
3595
 
 
3596
 
 
3597
+fi
 
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
 
3606
+else
 
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.
 
3610
+  ;;
 
3611
+  *)
 
3612
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 
3613
+for as_dir in $PATH
 
3614
+do
 
3615
+  IFS=$as_save_IFS
 
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
 
3621
+    break 2
 
3622
   fi
 
3623
+done
 
3624
+  done
 
3625
+IFS=$as_save_IFS
 
3626
 
 
3627
+  ;;
 
3628
+esac
 
3629
+fi
 
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; }
 
3634
+else
 
3635
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 
3636
+$as_echo "no" >&6; }
 
3637
+fi
 
3638
+
 
3639
+  if test "x$ac_pt_PKG_CONFIG" = x; then
 
3640
+    PKG_CONFIG="no"
 
3641
+  else
 
3642
+    case $cross_compiling:$ac_tool_warned in
 
3643
+yes:)
 
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 ;;
 
3647
+esac
 
3648
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
 
3649
+  fi
 
3650
+else
 
3651
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
 
3652
+fi
 
3653
+
 
3654
+  fi
 
3655
+
 
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 @@
 
3660
   succeeded=no
 
3661
 
 
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 @@
 
3672
   done
 
3673
 IFS=$as_save_IFS
 
3674
 
 
3675
-  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
 
3676
   ;;
 
3677
 esac
 
3678
 fi
 
3679
@@ -21876,8 +22959,65 @@
 
3680
 fi
 
3681
 
 
3682
 
 
3683
+fi
 
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
 
3692
+else
 
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.
 
3696
+  ;;
 
3697
+  *)
 
3698
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 
3699
+for as_dir in $PATH
 
3700
+do
 
3701
+  IFS=$as_save_IFS
 
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
 
3707
+    break 2
 
3708
   fi
 
3709
+done
 
3710
+  done
 
3711
+IFS=$as_save_IFS
 
3712
 
 
3713
+  ;;
 
3714
+esac
 
3715
+fi
 
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; }
 
3720
+else
 
3721
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 
3722
+$as_echo "no" >&6; }
 
3723
+fi
 
3724
+
 
3725
+  if test "x$ac_pt_PKG_CONFIG" = x; then
 
3726
+    PKG_CONFIG="no"
 
3727
+  else
 
3728
+    case $cross_compiling:$ac_tool_warned in
 
3729
+yes:)
 
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 ;;
 
3733
+esac
 
3734
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
 
3735
+  fi
 
3736
+else
 
3737
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
 
3738
+fi
 
3739
+
 
3740
+  fi
 
3741
+
 
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 @@
 
3746
   succeeded=no
 
3747
 
 
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 @@
 
3758
   done
 
3759
 IFS=$as_save_IFS
 
3760
 
 
3761
-  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
 
3762
   ;;
 
3763
 esac
 
3764
 fi
 
3765
@@ -21978,8 +23118,65 @@
 
3766
 fi
 
3767
 
 
3768
 
 
3769
+fi
 
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
 
3778
+else
 
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.
 
3782
+  ;;
 
3783
+  *)
 
3784
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 
3785
+for as_dir in $PATH
 
3786
+do
 
3787
+  IFS=$as_save_IFS
 
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
 
3793
+    break 2
 
3794
   fi
 
3795
+done
 
3796
+  done
 
3797
+IFS=$as_save_IFS
 
3798
 
 
3799
+  ;;
 
3800
+esac
 
3801
+fi
 
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; }
 
3806
+else
 
3807
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 
3808
+$as_echo "no" >&6; }
 
3809
+fi
 
3810
+
 
3811
+  if test "x$ac_pt_PKG_CONFIG" = x; then
 
3812
+    PKG_CONFIG="no"
 
3813
+  else
 
3814
+    case $cross_compiling:$ac_tool_warned in
 
3815
+yes:)
 
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 ;;
 
3819
+esac
 
3820
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
 
3821
+  fi
 
3822
+else
 
3823
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
 
3824
+fi
 
3825
+
 
3826
+  fi
 
3827
+
 
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 @@
 
3832
   succeeded=no
 
3833
 
 
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 @@
 
3844
   done
 
3845
 IFS=$as_save_IFS
 
3846
 
 
3847
-  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
 
3848
   ;;
 
3849
 esac
 
3850
 fi
 
3851
@@ -22075,8 +23272,65 @@
 
3852
 fi
 
3853
 
 
3854
 
 
3855
+fi
 
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
 
3864
+else
 
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.
 
3868
+  ;;
 
3869
+  *)
 
3870
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 
3871
+for as_dir in $PATH
 
3872
+do
 
3873
+  IFS=$as_save_IFS
 
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
 
3879
+    break 2
 
3880
   fi
 
3881
+done
 
3882
+  done
 
3883
+IFS=$as_save_IFS
 
3884
 
 
3885
+  ;;
 
3886
+esac
 
3887
+fi
 
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; }
 
3892
+else
 
3893
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 
3894
+$as_echo "no" >&6; }
 
3895
+fi
 
3896
+
 
3897
+  if test "x$ac_pt_PKG_CONFIG" = x; then
 
3898
+    PKG_CONFIG="no"
 
3899
+  else
 
3900
+    case $cross_compiling:$ac_tool_warned in
 
3901
+yes:)
 
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 ;;
 
3905
+esac
 
3906
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
 
3907
+  fi
 
3908
+else
 
3909
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
 
3910
+fi
 
3911
+
 
3912
+  fi
 
3913
+
 
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" */
 
3923
 package java.lang;
 
3924
 
 
3925
 public class Object
 
3926
@@ -24139,7 +25393,7 @@
 
3927
 if uudecode$EXEEXT Test.uue; then
 
3928
         ac_cv_prog_uudecode_base64=yes
 
3929
 else
 
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
 
3933
         cat Test.uue >&5
 
3934
         ac_cv_prog_uudecode_base64=no
 
3935
@@ -24167,7 +25421,7 @@
 
3936
 CLASS_TEST=Test.class
 
3937
 TEST=Test
 
3938
 cat << \EOF > $JAVA_TEST
 
3939
-/* [#]line 24170 "configure" */
 
3940
+/* [#]line 25424 "configure" */
 
3941
 public class Test {
 
3942
 public static void main (String args[]) {
 
3943
         System.exit (0);
 
3944
@@ -24375,7 +25629,7 @@
 
3945
   JAVA_TEST=Test.java
 
3946
   CLASS_TEST=Test.class
 
3947
   cat << \EOF > $JAVA_TEST
 
3948
-  /* #line 24378 "configure" */
 
3949
+  /* #line 25632 "configure" */
 
3950
   public class Test
 
3951
   {
 
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)
 
3957
@@ -1,3 +1,10 @@
 
3958
+2013-06-19  Matthias Klose  <doko@ubuntu.com>
 
3959
+
 
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.
 
3964
+
 
3965
 2013-05-31  Release Manager
 
3966
 
 
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"
 
3978
 
 
3979
 
 
3980
 
 
3981
@@ -22806,8 +22806,9 @@
 
3982
   succeeded=no
 
3983
 
 
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 @@
 
3994
   done
 
3995
 IFS=$as_save_IFS
 
3996
 
 
3997
-  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
 
3998
   ;;
 
3999
 esac
 
4000
 fi
 
4001
@@ -22847,8 +22847,65 @@
 
4002
 fi
 
4003
 
 
4004
 
 
4005
+fi
 
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
 
4014
+else
 
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.
 
4018
+  ;;
 
4019
+  *)
 
4020
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 
4021
+for as_dir in $PATH
 
4022
+do
 
4023
+  IFS=$as_save_IFS
 
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
 
4029
+    break 2
 
4030
   fi
 
4031
+done
 
4032
+  done
 
4033
+IFS=$as_save_IFS
 
4034
 
 
4035
+  ;;
 
4036
+esac
 
4037
+fi
 
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; }
 
4042
+else
 
4043
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 
4044
+$as_echo "no" >&6; }
 
4045
+fi
 
4046
+
 
4047
+  if test "x$ac_pt_PKG_CONFIG" = x; then
 
4048
+    PKG_CONFIG="no"
 
4049
+  else
 
4050
+    case $cross_compiling:$ac_tool_warned in
 
4051
+yes:)
 
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 ;;
 
4055
+esac
 
4056
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
 
4057
+  fi
 
4058
+else
 
4059
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
 
4060
+fi
 
4061
+
 
4062
+  fi
 
4063
+
 
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 @@
 
4068
   succeeded=no
 
4069
 
 
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 @@
 
4080
   done
 
4081
 IFS=$as_save_IFS
 
4082
 
 
4083
-  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
 
4084
   ;;
 
4085
 esac
 
4086
 fi
 
4087
@@ -22947,8 +23004,65 @@
 
4088
 fi
 
4089
 
 
4090
 
 
4091
+fi
 
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
 
4100
+else
 
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.
 
4104
+  ;;
 
4105
+  *)
 
4106
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 
4107
+for as_dir in $PATH
 
4108
+do
 
4109
+  IFS=$as_save_IFS
 
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
 
4115
+    break 2
 
4116
   fi
 
4117
+done
 
4118
+  done
 
4119
+IFS=$as_save_IFS
 
4120
 
 
4121
+  ;;
 
4122
+esac
 
4123
+fi
 
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; }
 
4128
+else
 
4129
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 
4130
+$as_echo "no" >&6; }
 
4131
+fi
 
4132
+
 
4133
+  if test "x$ac_pt_PKG_CONFIG" = x; then
 
4134
+    PKG_CONFIG="no"
 
4135
+  else
 
4136
+    case $cross_compiling:$ac_tool_warned in
 
4137
+yes:)
 
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 ;;
 
4141
+esac
 
4142
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
 
4143
+  fi
 
4144
+else
 
4145
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
 
4146
+fi
 
4147
+
 
4148
+  fi
 
4149
+
 
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 @@
 
4154
   succeeded=no
 
4155
 
 
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 @@
 
4166
   done
 
4167
 IFS=$as_save_IFS
 
4168
 
 
4169
-  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
 
4170
   ;;
 
4171
 esac
 
4172
 fi
 
4173
@@ -23047,8 +23161,65 @@
 
4174
 fi
 
4175
 
 
4176
 
 
4177
+fi
 
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
 
4186
+else
 
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.
 
4190
+  ;;
 
4191
+  *)
 
4192
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 
4193
+for as_dir in $PATH
 
4194
+do
 
4195
+  IFS=$as_save_IFS
 
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
 
4201
+    break 2
 
4202
   fi
 
4203
+done
 
4204
+  done
 
4205
+IFS=$as_save_IFS
 
4206
 
 
4207
+  ;;
 
4208
+esac
 
4209
+fi
 
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; }
 
4214
+else
 
4215
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 
4216
+$as_echo "no" >&6; }
 
4217
+fi
 
4218
+
 
4219
+  if test "x$ac_pt_PKG_CONFIG" = x; then
 
4220
+    PKG_CONFIG="no"
 
4221
+  else
 
4222
+    case $cross_compiling:$ac_tool_warned in
 
4223
+yes:)
 
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 ;;
 
4227
+esac
 
4228
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
 
4229
+  fi
 
4230
+else
 
4231
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
 
4232
+fi
 
4233
+
 
4234
+  fi
 
4235
+
 
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)
 
4243
@@ -6,7 +6,7 @@
 
4244
   succeeded=no
 
4245
 
 
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)
 
4249
   fi
 
4250
 
 
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)
 
4256
@@ -316,7 +316,7 @@
 
4257
        md_unwind_header=alpha/vms-unwind.h
 
4258
        ;;
 
4259
 arm-wrs-vxworks)
 
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"
 
4263
        ;;
 
4264
 arm*-*-netbsdelf*)
 
4265
@@ -865,7 +865,7 @@
 
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"
 
4268
        ;;
 
4269
-powerpc-*-linux* | powerpc64-*-linux*)
 
4270
+powerpc*-*-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)
 
4278
@@ -1,3 +1,31 @@
 
4279
+2013-06-19  Alan Modra  <amodra@gmail.com>
 
4280
+
 
4281
+       Apply mainline patches
 
4282
+       2013-06-04  Alan Modra  <amodra@gmail.com>
 
4283
+       * config/rs6000/ibm-ldouble.c: Enable for little-endian.
 
4284
+
 
4285
+       2013-04-25  Alan Modra  <amodra@gmail.com>
 
4286
+       * config.host: Match little-endian powerpc-linux.
 
4287
+
 
4288
+2013-06-08  Walter Lee  <walt@tilera.com>
 
4289
+
 
4290
+       Backport from mainline:
 
4291
+       2013-06-08  Walter Lee  <walt@tilera.com>
 
4292
+
 
4293
+       * config/tilepro/atomic.h: Don't include stdint.h or features.h.
 
4294
+       Replace int64_t with long long.  Add __extension__ where
 
4295
+       appropriate.
 
4296
+
 
4297
+2013-06-06  Douglas B Rupp  <rupp@adacore.com>
 
4298
+
 
4299
+       * config.host (arm-wrs-vxworks): Configure with other soft float.
 
4300
+
 
4301
+2013-05-31  Richard Henderson  <rth@redhat.com>
 
4302
+
 
4303
+       PR target/49146
 
4304
+       * unwind-dw2.c (UNWIND_COLUMN_IN_RANGE): New macro.
 
4305
+       (execute_cfa_program): Use it when storing to fs->regs.
 
4306
+
 
4307
 2013-05-31  Release Manager
 
4308
 
 
4309
        * GCC 4.8.1 released.
 
4310
@@ -30,7 +58,7 @@
 
4311
 
 
4312
        Backport from mainline:
 
4313
        2013-03-26  Walter Lee  <walt@tilera.com>
 
4314
-       
 
4315
+
 
4316
        * config/tilegx/t-crtstuff: Add -fno-asynchronous-unwind-tables
 
4317
        -mcmodel=large to CRTSTUFF_T_CFLAGS_S variable.
 
4318
 
 
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)
 
4323
@@ -42,10 +42,10 @@
 
4324
    represented as (1.0, +0.0) or (1.0, -0.0), and the low part of a
 
4325
    NaN is don't-care.
 
4326
 
 
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.  */
 
4330
 
 
4331
-#if (!defined (__LITTLE_ENDIAN__) \
 
4332
-     && (defined (__MACH__) || defined (__powerpc__) || defined (_AIX)))
 
4333
+#if defined (__MACH__) || defined (__powerpc__) || defined (_AIX)
 
4334
 
 
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)
 
4341
@@ -92,8 +92,6 @@
 
4342
    compare-and-exchange routine, so may be potentially less efficient.  */
 
4343
 #endif
 
4344
 
 
4345
-#include <stdint.h>
 
4346
-#include <features.h>
 
4347
 #ifdef __tilegx__
 
4348
 #include <arch/spr_def.h>
 
4349
 #else
 
4350
@@ -122,9 +120,9 @@
 
4351
 
 
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,
 
4355
-                                                    int64_t oldval,
 
4356
-                                                    int64_t newval)
 
4357
+     long long arch_atomic_val_compare_and_exchange_8 (volatile long long
 
4358
+                                                      *mem, long long oldval,
 
4359
+                                                      long long newval)
 
4360
 {
 
4361
 #ifdef __tilegx__
 
4362
   __insn_mtspr (SPR_CMPEXCH_VALUE, oldval);
 
4363
@@ -139,7 +137,7 @@
 
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;
 
4369
 #endif
 
4370
 }
 
4371
 
 
4372
@@ -150,11 +148,11 @@
 
4373
 
 
4374
 
 
4375
 #define arch_atomic_val_compare_and_exchange(mem, o, n)                 \
 
4376
-  ({                                                                    \
 
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(                          \
 
4386
@@ -164,7 +162,7 @@
 
4387
   })
 
4388
 
 
4389
 #define arch_atomic_bool_compare_and_exchange(mem, o, n)                \
 
4390
-  ({                                                                    \
 
4391
+  __extension__ ({                                                      \
 
4392
     __typeof(o) __o = (o);                                              \
 
4393
     __builtin_expect(                                                   \
 
4394
       __o == arch_atomic_val_compare_and_exchange((mem), __o, (n)), 1); \
 
4395
@@ -174,7 +172,7 @@
 
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)                  \
 
4399
-  ({                                                                    \
 
4400
+  __extension__ ({                                                      \
 
4401
     __typeof(value) __value = (value);                                  \
 
4402
     __typeof(*(mem)) *__mem = (mem), __old = *__mem, __guess;           \
 
4403
     do {                                                                \
 
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)     \
 
4408
-  ({                                                                    \
 
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()));                        \
 
4420
   })
 
4421
 
 
4422
@@ -224,7 +224,7 @@
 
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)       \
 
4426
-  ({                                                                    \
 
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))
 
4433
 
 
4434
 #define arch_atomic_bit_set(mem, bit)                                   \
 
4435
-  ({                                                                    \
 
4436
+  __extension__ ({                                                      \
 
4437
     __typeof(*(mem)) __mask = (__typeof(*(mem)))1 << (bit);             \
 
4438
     __mask & arch_atomic_or((mem), __mask);                             \
 
4439
   })
 
4440
 
 
4441
 #define arch_atomic_bit_clear(mem, bit)                                 \
 
4442
-  ({                                                                    \
 
4443
+  __extension__ ({                                                      \
 
4444
     __typeof(*(mem)) __mask = (__typeof(*(mem)))1 << (bit);             \
 
4445
     __mask & arch_atomic_and((mem), ~__mask);                           \
 
4446
   })
 
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)
 
4451
@@ -59,6 +59,35 @@
 
4452
 #define DWARF_REG_TO_UNWIND_COLUMN(REGNO) (REGNO)
 
4453
 #endif
 
4454
 
 
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.
 
4458
+
 
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 
 
4468
+   call clobbered.
 
4469
+
 
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.
 
4475
+
 
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.  */
 
4480
+
 
4481
+#define UNWIND_COLUMN_IN_RANGE(x) \
 
4482
+    __builtin_expect((x) <= DWARF_FRAME_REGISTERS, 1)
 
4483
+
 
4484
 #ifdef REG_VALUE_IN_UNWIND_CONTEXT
 
4485
 typedef _Unwind_Word _Unwind_Context_Reg_Val;
 
4486
 
 
4487
@@ -939,14 +968,19 @@
 
4488
          reg = insn & 0x3f;
 
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))
 
4496
+           {
 
4497
+             fs->regs.reg[reg].how = REG_SAVED_OFFSET;
 
4498
+             fs->regs.reg[reg].loc.offset = offset;
 
4499
+           }
 
4500
        }
 
4501
       else if ((insn & 0xc0) == DW_CFA_restore)
 
4502
        {
 
4503
          reg = insn & 0x3f;
 
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;
 
4508
        }
 
4509
       else switch (insn)
 
4510
        {
 
4511
@@ -977,26 +1011,35 @@
 
4512
          insn_ptr = read_uleb128 (insn_ptr, &reg);
 
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))
 
4520
+           {
 
4521
+             fs->regs.reg[reg].how = REG_SAVED_OFFSET;
 
4522
+             fs->regs.reg[reg].loc.offset = offset;
 
4523
+           }
 
4524
          break;
 
4525
 
 
4526
        case DW_CFA_restore_extended:
 
4527
          insn_ptr = read_uleb128 (insn_ptr, &reg);
 
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;
 
4534
          break;
 
4535
 
 
4536
        case DW_CFA_same_value:
 
4537
          insn_ptr = read_uleb128 (insn_ptr, &reg);
 
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;
 
4542
          break;
 
4543
 
 
4544
        case DW_CFA_undefined:
 
4545
          insn_ptr = read_uleb128 (insn_ptr, &reg);
 
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;
 
4550
          break;
 
4551
 
 
4552
        case DW_CFA_nop:
 
4553
@@ -1007,9 +1050,12 @@
 
4554
            _uleb128_t reg2;
 
4555
            insn_ptr = read_uleb128 (insn_ptr, &reg);
 
4556
            insn_ptr = read_uleb128 (insn_ptr, &reg2);
 
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))
 
4562
+             {
 
4563
+               fs->regs.reg[reg].how = REG_SAVED_REG;
 
4564
+               fs->regs.reg[reg].loc.reg = (_Unwind_Word)reg2;
 
4565
+             }
 
4566
          }
 
4567
          break;
 
4568
 
 
4569
@@ -1067,8 +1113,12 @@
 
4570
 
 
4571
        case DW_CFA_expression:
 
4572
          insn_ptr = read_uleb128 (insn_ptr, &reg);
 
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))
 
4577
+           {
 
4578
+             fs->regs.reg[reg].how = REG_SAVED_EXP;
 
4579
+             fs->regs.reg[reg].loc.exp = insn_ptr;
 
4580
+           }
 
4581
          insn_ptr = read_uleb128 (insn_ptr, &utmp);
 
4582
          insn_ptr += utmp;
 
4583
          break;
 
4584
@@ -1078,9 +1128,12 @@
 
4585
          insn_ptr = read_uleb128 (insn_ptr, &reg);
 
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))
 
4593
+           {
 
4594
+             fs->regs.reg[reg].how = REG_SAVED_OFFSET;
 
4595
+             fs->regs.reg[reg].loc.offset = offset;
 
4596
+           }
 
4597
          break;
 
4598
 
 
4599
        case DW_CFA_def_cfa_sf:
 
4600
@@ -1103,25 +1156,34 @@
 
4601
          insn_ptr = read_uleb128 (insn_ptr, &reg);
 
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))
 
4609
+           {
 
4610
+             fs->regs.reg[reg].how = REG_SAVED_VAL_OFFSET;
 
4611
+             fs->regs.reg[reg].loc.offset = offset;
 
4612
+           }
 
4613
          break;
 
4614
 
 
4615
        case DW_CFA_val_offset_sf:
 
4616
          insn_ptr = read_uleb128 (insn_ptr, &reg);
 
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))
 
4624
+           {
 
4625
+             fs->regs.reg[reg].how = REG_SAVED_VAL_OFFSET;
 
4626
+             fs->regs.reg[reg].loc.offset = offset;
 
4627
+           }
 
4628
          break;
 
4629
 
 
4630
        case DW_CFA_val_expression:
 
4631
          insn_ptr = read_uleb128 (insn_ptr, &reg);
 
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))
 
4637
+           {
 
4638
+             fs->regs.reg[reg].how = REG_SAVED_VAL_EXP;
 
4639
+             fs->regs.reg[reg].loc.exp = insn_ptr;
 
4640
+           }
 
4641
          insn_ptr = read_uleb128 (insn_ptr, &utmp);
 
4642
          insn_ptr += utmp;
 
4643
          break;
 
4644
@@ -1147,9 +1209,12 @@
 
4645
          insn_ptr = read_uleb128 (insn_ptr, &reg);
 
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))
 
4653
+           {
 
4654
+             fs->regs.reg[reg].how = REG_SAVED_OFFSET;
 
4655
+             fs->regs.reg[reg].loc.offset = -offset;
 
4656
+           }
 
4657
          break;
 
4658
 
 
4659
        default:
 
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)
 
4664
@@ -38,7 +38,7 @@
 
4665
 };
 
4666
 
 
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)
 
4677
@@ -1 +1 @@
 
4678
-20130531
 
4679
+20130623
 
4680
Index: gcc/ipa-cp.c
 
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 @@
 
4685
   tree otr_type;
 
4686
   tree t;
 
4687
 
 
4688
-  if (param_index == -1)
 
4689
+  if (param_index == -1
 
4690
+      || known_vals.length () <= (unsigned int) param_index)
 
4691
     return NULL_TREE;
 
4692
 
 
4693
   if (!ie->indirect_info->polymorphic)
 
4694
@@ -1528,8 +1529,7 @@
 
4695
            t = NULL;
 
4696
        }
 
4697
       else
 
4698
-       t = (known_vals.length () > (unsigned int) param_index
 
4699
-            ? known_vals[param_index] : NULL);
 
4700
+       t = known_vals[param_index];
 
4701
 
 
4702
       if (t &&
 
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 @@
 
4709
        tls_first_major=0
 
4710
        tls_first_minor=0
 
4711
        ;;
 
4712
-  powerpc-*-*)
 
4713
+  powerpc64*-*-*)
 
4714
     conftest_s='
 
4715
        .section ".tdata","awT",@progbits
 
4716
-       .align 2
 
4717
-ld0:   .space 4
 
4718
-ld1:   .space 4
 
4719
-x1:    .space 4
 
4720
-x2:    .space 4
 
4721
-x3:    .space 4
 
4722
-       .text
 
4723
-       addi 3,31,ld0@got@tlsgd
 
4724
-       bl __tls_get_addr
 
4725
-       addi 3,31,x1@got@tlsld
 
4726
-       bl __tls_get_addr
 
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)
 
4731
-       add 9,9,x@tls
 
4732
-       addi 9,2,x1@tprel
 
4733
-       addis 9,2,x2@tprel@ha
 
4734
-       addi 9,9,x2@tprel@l'
 
4735
-       tls_first_major=2
 
4736
-       tls_first_minor=14
 
4737
-       tls_as_opt="-a32 --fatal-warnings"
 
4738
-       ;;
 
4739
-  powerpc64-*-*)
 
4740
-    conftest_s='
 
4741
-       .section ".tdata","awT",@progbits
 
4742
        .align 3
 
4743
 ld0:   .space 8
 
4744
 ld1:   .space 8
 
4745
@@ -23341,6 +23315,32 @@
 
4746
        tls_first_minor=14
 
4747
        tls_as_opt="-a64 --fatal-warnings"
 
4748
        ;;
 
4749
+  powerpc*-*-*)
 
4750
+    conftest_s='
 
4751
+       .section ".tdata","awT",@progbits
 
4752
+       .align 2
 
4753
+ld0:   .space 4
 
4754
+ld1:   .space 4
 
4755
+x1:    .space 4
 
4756
+x2:    .space 4
 
4757
+x3:    .space 4
 
4758
+       .text
 
4759
+       addi 3,31,ld0@got@tlsgd
 
4760
+       bl __tls_get_addr
 
4761
+       addi 3,31,x1@got@tlsld
 
4762
+       bl __tls_get_addr
 
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)
 
4767
+       add 9,9,x@tls
 
4768
+       addi 9,2,x1@tprel
 
4769
+       addis 9,2,x2@tprel@ha
 
4770
+       addi 9,9,x2@tprel@l'
 
4771
+       tls_first_major=2
 
4772
+       tls_first_minor=14
 
4773
+       tls_as_opt="-a32 --fatal-warnings"
 
4774
+       ;;
 
4775
   s390-*-*)
 
4776
     conftest_s='
 
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*)
 
4781
   case "$target" in
 
4782
+     *le-*-linux*)
 
4783
+     emul_name="-melf64lppc"
 
4784
+      ;;
 
4785
      *-*-linux*)
 
4786
      emul_name="-melf64ppc"
 
4787
       ;;
 
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)
 
4792
@@ -1,3 +1,221 @@
 
4793
+2013-06-21  Uros Bizjak  <ubizjak@gmail.com>
 
4794
+
 
4795
+       Backport from mainline
 
4796
+       2013-06-20  Uros Bizjak  <ubizjak@gmail.com>
 
4797
+
 
4798
+       PR target/57655
 
4799
+       * config/i386/i386.c (construct_container): Report error if
 
4800
+       long double is used with disabled x87 float returns.
 
4801
+
 
4802
+2013-06-20  Wei Mi  <wmi@google.com>
 
4803
+
 
4804
+       Backport from mainline
 
4805
+       2013-06-19  Wei Mi  <wmi@google.com>
 
4806
+
 
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.
 
4812
+
 
4813
+
 
4814
+2013-06-20  David Edelsohn  <dje.gcc@gmail.com>
 
4815
+
 
4816
+       Backport from mainline
 
4817
+       2013-06-19  David Edelsohn  <dje.gcc@gmail.com>
 
4818
+
 
4819
+       PR driver/57652
 
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.
 
4824
+       (do_wait): Same.
 
4825
+       * collect2.h (collect_exit): Delete.
 
4826
+       * tlink.c (do_tlink): Rename exit to ret. Change collect_exit to exit.
 
4827
+
 
4828
+2013-06-19  Matthias Klose  <doko@ubuntu.com>
 
4829
+
 
4830
+       PR driver/57651
 
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.
 
4836
+
 
4837
+2013-06-19  Igor Zamyatin  <igor.zamyatin@intel.com>
 
4838
+
 
4839
+       * doc/invoke.texi (core-avx2): Document.
 
4840
+       (atom): Updated with MOVBE.
 
4841
+
 
4842
+2013-06-19  Jakub Jelinek  <jakub@redhat.com>
 
4843
+
 
4844
+       PR driver/57651
 
4845
+       * gcc-ar.c (main): If not CROSS_DIRECTORY_STRUCTURE, look for
 
4846
+       PERSONALITY in $PATH derived prefixes.
 
4847
+
 
4848
+2013-06-19  Paolo Carlini  <paolo.carlini@oracle.com>
 
4849
+
 
4850
+       PR c++/56544
 
4851
+       * doc/cpp.texi [Standard Predefined Macros, __cplusplus]: Document
 
4852
+       that now in C++ the value is correct per the C++ standards.
 
4853
+
 
4854
+2013-06-19  Alan Modra  <amodra@gmail.com>
 
4855
+
 
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.
 
4863
+
 
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.
 
4867
+
 
4868
+       2013-06-07  Alan Modra  <amodra@gmail.com>
 
4869
+       * config/rs6000/rs6000.c (setup_incoming_varargs): Round up
 
4870
+       va_list_gpr_size.
 
4871
+
 
4872
+       2013-06-04  Alan Modra  <amodra@gmail.com>
 
4873
+       * config/rs6000/rs6000.c (output_toc): Correct little-endian float
 
4874
+       constant output.
 
4875
+
 
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.
 
4880
+
 
4881
+       2013-05-09  Alan Modra  <amodra@gmail.com>
 
4882
+       * configure.ac (HAVE_AS_TLS): Enable tests for powerpcle and
 
4883
+       powerpc64le.
 
4884
+       * configure: Regenerate.
 
4885
+
 
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.
 
4890
+
 
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.
 
4898
+
 
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.
 
4908
+
 
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.
 
4913
+
 
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.
 
4934
+
 
4935
+2013-06-12  Martin Jambor  <mjambor@suse.cz>
 
4936
+
 
4937
+       * ipa-cp.c (ipa_get_indirect_edge_target_1): Check that param_index is
 
4938
+       within bounds at the beginning of the function.
 
4939
+
 
4940
+2013-06-12  Jakub Jelinek  <jakub@redhat.com>
 
4941
+
 
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.
 
4945
+
 
4946
+2013-06-10  Uros Bizjak  <ubizjak@gmail.com>
 
4947
+
 
4948
+       Backport from mainline
 
4949
+       2013-06-10  Uros Bizjak  <ubizjak@gmail.com>
 
4950
+
 
4951
+       * config/alpha/alpha.c (alpha_emit_xfloating_compare): Also use
 
4952
+       cmp_code to construct REG_EQUAL note.
 
4953
+
 
4954
+2013-06-10  Oleg Endo  <olegendo@gcc.gnu.org>
 
4955
+
 
4956
+       Backport from mainline
 
4957
+       2013-05-20  Oleg Endo  <olegendo@gcc.gnu.org>
 
4958
+
 
4959
+       PR target/56547
 
4960
+       * config/sh/sh.md (fmasf4): Remove empty constraints strings.
 
4961
+       (*fmasf4, *fmasf4_media): New insns.
 
4962
+
 
4963
+2013-06-09  Jakub Jelinek  <jakub@redhat.com>
 
4964
+
 
4965
+       PR target/57568
 
4966
+       * config/i386/i386.md (TARGET_READ_MODIFY_WRITE peepholes): Ensure
 
4967
+       that operands[2] doesn't overlap with operands[0].
 
4968
+
 
4969
+2013-06-07  Richard Sandiford  <rsandifo@linux.vnet.ibm.com>
 
4970
+
 
4971
+       * recog.c (offsettable_address_addr_space_p): Fix calculation of
 
4972
+       address mode.  Move pointer mode initialization to the same place.
 
4973
+
 
4974
+2013-06-07  Uros Bizjak  <ubizjak@gmail.com>
 
4975
+
 
4976
+       Backport from mainline
 
4977
+       2013-06-05  Uros Bizjak  <ubizjak@gmail.com>
 
4978
+
 
4979
+       * config/alpha/alpha.c (alpha_emit_conditional_move): Swap all
 
4980
+       GE, GT, GEU and GTU compares, modulo DImode compares with zero.
 
4981
+
 
4982
+       Backport from mainline
 
4983
+       2013-05-23  Uros Bizjak  <ubizjak@gmail.com>
 
4984
+
 
4985
+       PR target/57379
 
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.
 
4989
+
 
4990
+2013-06-04  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
 
4991
+
 
4992
+       Backport from mainline.
 
4993
+       2013-05-22  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
 
4994
+
 
4995
+       * config/rs6000/rs6000.h (MALLOC_ABI_ALIGNMENT): New #define.
 
4996
+
 
4997
+2013-06-03  James Greenhalgh  <james.greenhalgh@arm.com>
 
4998
+
 
4999
+       Backport from mainline.
 
5000
+       2013-04-25  James Greenhalgh  <james.greenhalgh@arm.com>
 
5001
+
 
5002
+       * config/aarch64/aarch64.c (aarch64_print_operand): Fix asm_fprintf
 
5003
+       format specifier in 'X' case.
 
5004
+
 
5005
+2013-05-31  Richard Henderson  <rth@redhat.com>
 
5006
+
 
5007
+       PR target/56742
 
5008
+       * config/i386/i386.c (ix86_seh_fixup_eh_fallthru): New.
 
5009
+       (ix86_reorg): Call it.
 
5010
+
 
5011
 2013-05-31  Release Manager
 
5012
 
 
5013
        * GCC 4.8.1 released.
 
5014
@@ -7,7 +235,7 @@
 
5015
        Backport from mainline
 
5016
        2013-05-02  Greta Yorsh  <Greta.Yorsh@arm.com>
 
5017
 
 
5018
-        PR target/56732
 
5019
+       PR target/56732
 
5020
        * config/arm/arm.c (arm_expand_epilogue): Check really_return before
 
5021
        generating simple_return for naked functions.
 
5022
 
 
5023
@@ -203,14 +431,14 @@
 
5024
 
 
5025
 2013-05-09  Martin Jambor  <mjambor@suse.cz>
 
5026
 
 
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.
 
5042
 
 
5043
 2013-05-08  Diego Novillo  <dnovillo@google.com>
 
5044
 
 
5045
@@ -315,7 +543,7 @@
 
5046
        2013-04-25  Marek Polacek  <polacek@redhat.com>
 
5047
 
 
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.
 
5051
 
 
5052
 2013-05-02  Vladimir Makarov  <vmakarov@redhat.com>
 
5053
 
 
5054
@@ -351,40 +579,40 @@
 
5055
        Backport from mainline
 
5056
        2013-04-24  Vladimir Makarov  <vmakarov@redhat.com>
 
5057
 
 
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.
 
5064
 
 
5065
 2013-05-02  Vladimir Makarov  <vmakarov@redhat.com>
 
5066
 
 
5067
        Backport from mainline
 
5068
        2013-04-22  Vladimir Makarov  <vmakarov@redhat.com>
 
5069
 
 
5070
-        PR target/57018
 
5071
-        * lra-eliminations.c (mark_not_eliminable): Prevent elimination of
 
5072
-        a set sp if no stack realignment.
 
5073
+       PR target/57018
 
5074
+       * lra-eliminations.c (mark_not_eliminable): Prevent elimination of
 
5075
+       a set sp if no stack realignment.
 
5076
 
 
5077
 2013-05-02  Vladimir Makarov  <vmakarov@redhat.com>
 
5078
 
 
5079
        Backport from mainline
 
5080
        2013-04-18  Vladimir Makarov  <vmakarov@redhat.com>
 
5081
 
 
5082
-        PR rtl-optimization/56999
 
5083
-        * lra-coalesce.c (coalescable_pseudo_p): Remove 2nd parameter and
 
5084
-        related code.
 
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
 
5090
+       related code.
 
5091
+       (lra_coalesce): Remove split_origin_bitmap and related code.
 
5092
+       * lra.c (lra): Coalesce after undoing inheritance. Recreate live
 
5093
+       ranges if necessary.
 
5094
 
 
5095
 2013-05-02  Vladimir Makarov  <vmakarov@redhat.com>
 
5096
 
 
5097
        Backport from mainline
 
5098
        2013-04-19  Vladimir Makarov  <vmakarov@redhat.com>
 
5099
 
 
5100
-        PR rtl-optimization/56847
 
5101
-        * lra-constraints.c (process_alt_operands): Discourage alternative
 
5102
-        with non-matche doffsettable memory constraint fro memory with
 
5103
-        known offset.
 
5104
+       PR rtl-optimization/56847
 
5105
+       * lra-constraints.c (process_alt_operands): Discourage alternative
 
5106
+       with non-matche doffsettable memory constraint fro memory with
 
5107
+       known offset.
 
5108
 
 
5109
 2013-05-02  Ian Bolton  <ian.bolton@arm.com>
 
5110
 
 
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)
 
5115
@@ -0,0 +1,10 @@
 
5116
+/* { dg-do compile } */
 
5117
+/* { dg-options "-mavx -mvzeroupper -mno-fp-ret-in-387" }
 
5118
+
 
5119
+/* { dg-error "x87 register return with x87 disabled" "" { target { ! ia32 } } 8 } */
 
5120
+
 
5121
+long double
 
5122
+foo (long double x)
 
5123
+{
 
5124
+  return __builtin_ilogbl (x);
 
5125
+}
 
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)
 
5130
@@ -0,0 +1,18 @@
 
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 } } */
 
5137
+
 
5138
+float
 
5139
+test_00 (float a, float b)
 
5140
+{
 
5141
+  return a * b + a;
 
5142
+}
 
5143
+
 
5144
+float
 
5145
+test_01 (float a)
 
5146
+{
 
5147
+  return a * a + a;
 
5148
+}
 
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)
 
5153
@@ -0,0 +1,19 @@
 
5154
+/* Verify that the fmac insn is used for the expression 'a * b + a' and
 
5155
+   'a * a + a'.
 
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 } } */
 
5161
+
 
5162
+float
 
5163
+test_00 (float a, float b)
 
5164
+{
 
5165
+  return a * b + a;
 
5166
+}
 
5167
+
 
5168
+float
 
5169
+test_01 (float a)
 
5170
+{
 
5171
+  return a * a + a;
 
5172
+}
 
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)
 
5177
@@ -0,0 +1,29 @@
 
5178
+! { dg-compile }
 
5179
+!
 
5180
+! PR fortran/57508
 
5181
+!
 
5182
+module ForTrilinos_ref_counter
 
5183
+  type ref_counter
 
5184
+  contains
 
5185
+      procedure :: assign
 
5186
+      generic   :: assignment(=) => assign
 
5187
+  end type
 
5188
+contains
 
5189
+  subroutine assign (lhs, rhs)
 
5190
+    class (ref_counter), intent(inout) :: lhs
 
5191
+    class (ref_counter), intent(in) :: rhs
 
5192
+  end subroutine
 
5193
+end module
 
5194
+module FEpetra_BlockMap
 
5195
+  use ForTrilinos_ref_counter, only : ref_counter
 
5196
+  type :: Epetra_BlockMap 
 
5197
+    type(ref_counter) :: counter
 
5198
+  end type
 
5199
+contains
 
5200
+  function from_struct() result(new_Epetra_BlockMap)
 
5201
+    type(Epetra_BlockMap) :: new_Epetra_BlockMap
 
5202
+  end function
 
5203
+  type(Epetra_BlockMap) function create_arbitrary()
 
5204
+    create_arbitrary = from_struct()
 
5205
+  end function
 
5206
+end module
 
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)
 
5211
@@ -0,0 +1,36 @@
 
5212
+! { dg-do compile }
 
5213
+!
 
5214
+! PR fortran/57364
 
5215
+!
 
5216
+! Contributed by Damian Rouson
 
5217
+!
 
5218
+module ref_counter_implementation
 
5219
+  type ref_counter
 
5220
+  contains
 
5221
+    procedure :: assign
 
5222
+    generic :: assignment(=) => assign
 
5223
+  end type
 
5224
+contains
 
5225
+  subroutine assign (lhs, rhs)
 
5226
+    class (ref_counter), intent(inout) :: lhs
 
5227
+    class (ref_counter), intent(in) :: rhs
 
5228
+  end subroutine
 
5229
+end module
 
5230
+module foo_parent_implementation
 
5231
+  use ref_counter_implementation ,only: ref_counter
 
5232
+  type :: foo_parent
 
5233
+    type(ref_counter) :: counter
 
5234
+  end type
 
5235
+contains
 
5236
+  type(foo_parent) function new_foo_parent()
 
5237
+  end function
 
5238
+end module
 
5239
+module foo_implementation
 
5240
+  use foo_parent_implementation ,only: foo_parent,new_foo_parent
 
5241
+  type, extends(foo_parent) :: foo
 
5242
+  end type
 
5243
+contains
 
5244
+  type(foo) function new_foo()
 
5245
+    new_foo%foo_parent = new_foo_parent()
 
5246
+ end function
 
5247
+end module
 
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)
 
5252
@@ -0,0 +1,34 @@
 
5253
+! { dg-do compile }
 
5254
+!
 
5255
+! PR 57217: [4.7/4.8/4.9 Regression][OOP] Accepts invalid TBP overriding - lacking arguments check
 
5256
+!
 
5257
+! Contributed by Salvatore Filippone <filippone.salvatore@gmail.com>
 
5258
+
 
5259
+module base_mod
 
5260
+  implicit none
 
5261
+  type base_type
 
5262
+  contains
 
5263
+    procedure, pass(map)  :: clone    => base_clone
 
5264
+  end type
 
5265
+contains
 
5266
+  subroutine  base_clone(map,mapout)
 
5267
+    class(base_type) :: map
 
5268
+    class(base_type) :: mapout
 
5269
+  end subroutine
 
5270
+end module
 
5271
+
 
5272
+module r_mod
 
5273
+  use base_mod
 
5274
+  implicit none
 
5275
+  type, extends(base_type) :: r_type
 
5276
+  contains
 
5277
+    procedure, pass(map)  :: clone    => r_clone   ! { dg-error "Type/rank mismatch in argument" }
 
5278
+  end type
 
5279
+contains
 
5280
+  subroutine  r_clone(map,mapout)
 
5281
+    class(r_type) :: map
 
5282
+    class(r_type) :: mapout
 
5283
+  end subroutine
 
5284
+end module
 
5285
+
 
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)
 
5291
@@ -0,0 +1,12 @@
 
5292
+/* PR target/57568 */
 
5293
+
 
5294
+extern void abort (void);
 
5295
+int a[6][9] = { }, b = 1, *c = &a[3][5];
 
5296
+
 
5297
+int
 
5298
+main ()
 
5299
+{
 
5300
+  if (b && (*c = *c + *c))
 
5301
+    abort ();
 
5302
+  return 0;
 
5303
+}
 
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)
 
5308
@@ -0,0 +1,15 @@
 
5309
+/* PR rtl-optimization/57130 */
 
5310
+
 
5311
+/* { dg-do compile } */
 
5312
+/* { dg-options "-O2 -fdump-rtl-ira" } */
 
5313
+/* { dg-final { scan-rtl-dump-not "REG_EQUIV.*mem.*\"ip\"" "ira" } } */
 
5314
+
 
5315
+char ip[10];
 
5316
+int total;
 
5317
+
 
5318
+void foo() {
 
5319
+  int t;
 
5320
+
 
5321
+  t = ip[2];
 
5322
+  total = t & 0x3;
 
5323
+}
 
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)
 
5328
@@ -1,3 +1,57 @@
 
5329
+2013-06-21  Uros Bizjak  <ubizjak@gmail.com>
 
5330
+
 
5331
+       Backport from mainline
 
5332
+       2013-06-20  Uros Bizjak  <ubizjak@gmail.com>
 
5333
+
 
5334
+       PR target/57655
 
5335
+       * gcc.target/i386/pr57655.c: New test.
 
5336
+
 
5337
+2013-06-21  Paolo Carlini  <paolo.carlini@oracle.com>
 
5338
+
 
5339
+       PR c++/53211
 
5340
+       * g++.dg/cpp0x/decltype55.C: New.
 
5341
+
 
5342
+2013-06-20  Wei Mi  <wmi@google.com>
 
5343
+
 
5344
+       Backport from mainline
 
5345
+       2013-06-19  Wei Mi  <wmi@google.com>
 
5346
+
 
5347
+       PR rtl-optimization/57518
 
5348
+       * testsuite/gcc.dg/pr57518.c: New test.
 
5349
+
 
5350
+2013-06-11  Tobias Burnus  <burnus@net-b.de>
 
5351
+
 
5352
+       PR fortran/57508
 
5353
+       * gfortran.dg/defined_assignment_7.f90: New.
 
5354
+
 
5355
+2013-06-10  Oleg Endo  <olegendo@gcc.gnu.org>
 
5356
+
 
5357
+       Backport from mainline
 
5358
+       2013-05-20  Oleg Endo  <olegendo@gcc.gnu.org>
 
5359
+
 
5360
+       PR target/56547
 
5361
+       * gcc.target/sh/pr56547-1.c: New.
 
5362
+       * gcc.target/sh/pr56547-2.c: New.
 
5363
+
 
5364
+2013-06-09  Jakub Jelinek  <jakub@redhat.com>
 
5365
+
 
5366
+       PR target/57568
 
5367
+       * gcc.c-torture/execute/pr57568.c: New test.
 
5368
+
 
5369
+2013-06-04  Tobias Burnus  <burnus@net-b.de>
 
5370
+
 
5371
+       Backport from mainline
 
5372
+       2013-05-22  Tobias Burnus  <burnus@net-b.de>
 
5373
+
 
5374
+       PR fortran/57364
 
5375
+       * gfortran.dg/defined_assignment_6.f90: New.
 
5376
+
 
5377
+2013-05-31  Janus Weil  <janus@gcc.gnu.org>
 
5378
+           Tobias Burnus  <burnus@net-b.de>
 
5379
+
 
5380
+       PR fortran/57217
 
5381
+       * gfortran.dg/typebound_override_4.f90: New.
 
5382
+
 
5383
 2013-05-31  Release Manager
 
5384
 
 
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)
 
5390
@@ -0,0 +1,9 @@
 
5391
+// PR c++/56930
 
5392
+// { dg-require-effective-target c++11 }
 
5393
+// { dg-options -Wconversion }
 
5394
+
 
5395
+int main()
 
5396
+{
 
5397
+  int x = sizeof(int);
 
5398
+  int y { sizeof(int) };
 
5399
+}
 
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)
 
5404
@@ -0,0 +1,20 @@
 
5405
+// PR c++/53211
 
5406
+// { dg-do compile { target c++11 } }
 
5407
+
 
5408
+template<typename A, typename B>
 
5409
+  struct is_same { static const bool value = false; };
 
5410
+
 
5411
+template<typename A>
 
5412
+  struct is_same<A, A> { static const bool value = true; };
 
5413
+
 
5414
+template<typename... Args>
 
5415
+void func(Args... args)
 
5416
+{
 
5417
+  int arr[] = { args... };
 
5418
+  static_assert (is_same<decltype(arr), int[sizeof...(Args)]>::value, "");
 
5419
+}
 
5420
+
 
5421
+int main()
 
5422
+{
 
5423
+  func(1, 2, 3, 4);
 
5424
+}
 
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)
 
5429
@@ -0,0 +1,24 @@
 
5430
+// PR c++/57319
 
5431
+// { dg-require-effective-target c++11 }
 
5432
+
 
5433
+namespace N1 {
 
5434
+  struct A { };
 
5435
+  struct B: virtual A { };
 
5436
+  struct C: virtual B { };
 
5437
+
 
5438
+  struct D: C
 
5439
+  {
 
5440
+    void operator= (D &);
 
5441
+  };
 
5442
+}
 
5443
+
 
5444
+namespace N2 {
 
5445
+  struct A { A& operator=(A&&); };
 
5446
+  struct B: virtual A { };     // { dg-warning "move assignment" }
 
5447
+  struct C: virtual B { };     // { dg-warning "move assignment" }
 
5448
+
 
5449
+  struct D: C
 
5450
+  {
 
5451
+    void operator= (D &);
 
5452
+  };
 
5453
+}
 
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 @@
 
5459
   return false;
 
5460
 }
 
5461
 
 
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.  */
 
5466
+
 
5467
+bool
 
5468
+vbase_has_user_provided_move_assign (tree type)
 
5469
+{
 
5470
+  /* Does the type itself have a user-provided move assignment operator?  */
 
5471
+  for (tree fns
 
5472
+        = lookup_fnfields_slot_nolazy (type, ansi_assopname (NOP_EXPR));
 
5473
+       fns; fns = OVL_NEXT (fns))
 
5474
+    {
 
5475
+      tree fn = OVL_CURRENT (fns);
 
5476
+      if (move_fn_p (fn) && user_provided_p (fn))
 
5477
+       return true;
 
5478
+    }
 
5479
+
 
5480
+  /* Do any of its bases?  */
 
5481
+  tree binfo = TYPE_BINFO (type);
 
5482
+  tree base_binfo;
 
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)))
 
5485
+      return true;
 
5486
+
 
5487
+  /* Or non-static data members?  */
 
5488
+  for (tree field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field))
 
5489
+    {
 
5490
+      if (TREE_CODE (field) == FIELD_DECL
 
5491
+         && CLASS_TYPE_P (TREE_TYPE (field))
 
5492
+         && vbase_has_user_provided_move_assign (TREE_TYPE (field)))
 
5493
+       return true;
 
5494
+    }
 
5495
+
 
5496
+  /* Seems not.  */
 
5497
+  return false;
 
5498
+}
 
5499
+
 
5500
 /* If default-initialization leaves part of TYPE uninitialized, returns
 
5501
    a DECL for the field or TYPE itself (DR 253).  */
 
5502
 
 
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)
 
5521
@@ -1,3 +1,23 @@
 
5522
+2013-06-21  Paolo Carlini  <paolo.carlini@oracle.com>
 
5523
+
 
5524
+       PR c++/53211
 
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.
 
5528
+
 
5529
+2013-05-31  Jason Merrill  <jason@redhat.com>
 
5530
+
 
5531
+       PR c++/57319
 
5532
+       * class.c (vbase_has_user_provided_move_assign): New.
 
5533
+       * method.c (synthesized_method_walk): Check it.
 
5534
+       * cp-tree.h: Declare it.
 
5535
+
 
5536
+       PR c++/56930
 
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*.
 
5541
+
 
5542
 2013-05-31  Release Manager
 
5543
 
 
5544
        * GCC 4.8.1 released.
 
5545
Index: gcc/cp/pt.c
 
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))
 
5551
     return true;
 
5552
 
 
5553
+  /* An array of unknown bound depending on a variadic parameter, eg:
 
5554
+
 
5555
+     template<typename... Args>
 
5556
+       void foo (Args... args)
 
5557
+       {
 
5558
+         int arr[] = { args... };
 
5559
+       }
 
5560
+
 
5561
+     template<int... vals>
 
5562
+       void bar ()
 
5563
+       {
 
5564
+         int arr[] = { vals... };
 
5565
+       }
 
5566
+
 
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))
 
5574
+   return true;
 
5575
+
 
5576
   if (TREE_TYPE (expression) == unknown_type_node)
 
5577
     {
 
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 @@
 
5584
     case UNGT_EXPR:
 
5585
     case UNGE_EXPR:
 
5586
     case UNEQ_EXPR:
 
5587
+    case LTGT_EXPR:
 
5588
     case RANGE_EXPR:
 
5589
     case COMPLEX_EXPR:
 
5590
       r = cxx_eval_binary_expression (call, t, allow_non_constant, addr,
 
5591
@@ -8846,6 +8847,12 @@
 
5592
        }
 
5593
       return false;
 
5594
 
 
5595
+    case OMP_ATOMIC:
 
5596
+    case OMP_ATOMIC_READ:
 
5597
+    case OMP_ATOMIC_CAPTURE_OLD:
 
5598
+    case OMP_ATOMIC_CAPTURE_NEW:
 
5599
+      return false;
 
5600
+
 
5601
     default:
 
5602
       if (objc_is_property_ref (t))
 
5603
        return false;
 
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);
 
5627
 
 
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);
 
5632
   else
 
5633
     expr = convert (totype, expr);
 
5634
 
 
5635
Index: gcc/cp/cvt.c
 
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)
 
5639
@@ -620,6 +620,9 @@
 
5640
 
 
5641
   if (TREE_TYPE (expr) == type)
 
5642
     return expr;
 
5643
+
 
5644
+  if (TREE_CODE (expr) == SIZEOF_EXPR)
 
5645
+    expr = maybe_constant_value (expr);
 
5646
   
 
5647
   result = cp_convert (type, expr, complain);
 
5648
 
 
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 @@
 
5666
 #endif
 
5667
 
 
5668
 
 
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
 
5673
 #endif
 
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**);
 
5680
 
 
5681
   Bvariable*
 
5682
-  immutable_struct(const std::string&, bool, Btype*, Location);
 
5683
+  immutable_struct(const std::string&, bool, bool, Btype*, Location);
 
5684
 
 
5685
   void
 
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*);
 
5689
 
 
5690
   Bvariable*
 
5691
@@ -1454,8 +1454,8 @@
 
5692
 // Create a named immutable initialized data structure.
 
5693
 
 
5694
 Bvariable*
 
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)
 
5699
 {
 
5700
   tree type_tree = btype->get_tree();
 
5701
   if (type_tree == error_mark_node)
 
5702
@@ -1482,7 +1482,7 @@
 
5703
 
 
5704
 void
 
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*,
 
5708
                                       Location,
 
5709
                                       Bexpression* initializer)
 
5710
 {
 
5711
@@ -1495,7 +1495,10 @@
 
5712
 
 
5713
   // We can't call make_decl_one_only until we set DECL_INITIAL.
 
5714
   if (!is_common)
 
5715
-    TREE_PUBLIC(decl) = 1;
 
5716
+    {
 
5717
+      if (!is_hidden)
 
5718
+       TREE_PUBLIC(decl) = 1;
 
5719
+    }
 
5720
   else
 
5721
     {
 
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)
 
5727
@@ -1,3 +1,9 @@
 
5728
+2013-06-18  Ian Lance Taylor  <iant@google.com>
 
5729
+
 
5730
+       * go-gcc.cc (Gcc_backend::immutable_struct): Add is_hidden
 
5731
+       parameter.
 
5732
+       (Gcc_backend::immutable_struct_set_init): Likewise.
 
5733
+
 
5734
 2013-05-31  Release Manager
 
5735
 
 
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)
 
5741
@@ -364,7 +364,7 @@
 
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),
 
5748
                             uloc);
 
5749
     }
 
5750
@@ -819,7 +819,8 @@
 
5751
       char buf[30];
 
5752
       snprintf(buf, sizeof buf, ".$sink%d", sink_count);
 
5753
       ++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();
 
5757
     }
 
5758
   else if (!type->is_method())
 
5759
     {
 
5760
@@ -1599,8 +1600,9 @@
 
5761
   return TRAVERSE_CONTINUE;
 
5762
 }
 
5763
 
 
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.
 
5769
 
 
5770
 int
 
5771
 Lower_parse_tree::function(Named_object* no)
 
5772
@@ -1732,6 +1734,121 @@
 
5773
   lower.constant(no, false);
 
5774
 }
 
5775
 
 
5776
+// Traverse the tree to create function descriptors as needed.
 
5777
+
 
5778
+class Create_function_descriptors : public Traverse
 
5779
+{
 
5780
+ public:
 
5781
+  Create_function_descriptors(Gogo* gogo)
 
5782
+    : Traverse(traverse_functions | traverse_expressions),
 
5783
+      gogo_(gogo)
 
5784
+  { }
 
5785
+
 
5786
+  int
 
5787
+  function(Named_object*);
 
5788
+
 
5789
+  int
 
5790
+  expression(Expression**);
 
5791
+
 
5792
+ private:
 
5793
+  Gogo* gogo_;
 
5794
+};
 
5795
+
 
5796
+// Create a descriptor for every top-level exported function.
 
5797
+
 
5798
+int
 
5799
+Create_function_descriptors::function(Named_object* no)
 
5800
+{
 
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);
 
5807
+
 
5808
+  return TRAVERSE_CONTINUE;
 
5809
+}
 
5810
+
 
5811
+// If we see a function referenced in any way other than calling it,
 
5812
+// create a descriptor for it.
 
5813
+
 
5814
+int
 
5815
+Create_function_descriptors::expression(Expression** pexpr)
 
5816
+{
 
5817
+  Expression* expr = *pexpr;
 
5818
+
 
5819
+  Func_expression* fe = expr->func_expression();
 
5820
+  if (fe != NULL)
 
5821
+    {
 
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
 
5824
+      // descriptor.
 
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;
 
5835
+    }
 
5836
+
 
5837
+  Call_expression* ce = expr->call_expression();
 
5838
+  if (ce != NULL)
 
5839
+    {
 
5840
+      Expression* fn = ce->fn();
 
5841
+      if (fn->func_expression() != NULL)
 
5842
+       {
 
5843
+         // Traverse the arguments but not the function.
 
5844
+         Expression_list* args = ce->args();
 
5845
+         if (args != NULL)
 
5846
+           {
 
5847
+             if (args->traverse(this) == TRAVERSE_EXIT)
 
5848
+               return TRAVERSE_EXIT;
 
5849
+           }
 
5850
+         return TRAVERSE_SKIP_COMPONENTS;
 
5851
+       }
 
5852
+    }
 
5853
+
 
5854
+  return TRAVERSE_CONTINUE;
 
5855
+}
 
5856
+
 
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.
 
5860
+
 
5861
+void
 
5862
+Gogo::create_function_descriptors()
 
5863
+{
 
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();
 
5872
+       ++p)
 
5873
+    {
 
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);
 
5880
+    }
 
5881
+  for (std::vector<Named_object*>::const_iterator p = fndecls.begin();
 
5882
+       p != fndecls.end();
 
5883
+       ++p)
 
5884
+    (*p)->func_declaration_value()->descriptor(this, *p);
 
5885
+  fndecls.clear();
 
5886
+
 
5887
+  Create_function_descriptors cfd(this);
 
5888
+  this->traverse(&cfd);
 
5889
+}
 
5890
+
 
5891
 // Look for interface types to finalize methods of inherited
 
5892
 // interfaces.
 
5893
 
 
5894
@@ -2643,6 +2760,13 @@
 
5895
   Expression* closure = NULL;
 
5896
   if (orig_func->needs_closure())
 
5897
     {
 
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);
 
5914
 
 
5915
   Runtime::convert_types(this);
 
5916
@@ -3128,10 +3253,10 @@
 
5917
                   Location location)
 
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)
 
5928
 {
 
5929
 }
 
5930
 
 
5931
@@ -3206,6 +3331,7 @@
 
5932
 {
 
5933
   if (this->closure_var_ == NULL)
 
5934
     {
 
5935
+      go_assert(this->descriptor_ == NULL);
 
5936
       // We don't know the type of the variable yet.  We add fields as
 
5937
       // we find them.
 
5938
       Location loc = this->type_->location();
 
5939
@@ -3229,6 +3355,13 @@
 
5940
     return;
 
5941
   Named_object* closure = this->closure_var_;
 
5942
   Struct_type* st = closure->var_value()->type()->deref()->struct_type();
 
5943
+
 
5944
+  // The first field of a closure is always a pointer to the function
 
5945
+  // code.
 
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_)));
 
5949
+
 
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();
 
5955
 }
 
5956
 
 
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.
 
5964
+
 
5965
+Named_object*
 
5966
+Function::make_descriptor_wrapper(Gogo* gogo, Named_object* no,
 
5967
+                                 Function_type* orig_fntype)
 
5968
+{
 
5969
+  Location loc = no->location();
 
5970
+
 
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())
 
5974
+    {
 
5975
+      static int count;
 
5976
+      char buf[50];
 
5977
+      for (Typed_identifier_list::const_iterator p = orig_params->begin();
 
5978
+          p != orig_params->end();
 
5979
+          ++p)
 
5980
+       {
 
5981
+         snprintf(buf, sizeof buf, "pt.%u", count);
 
5982
+         ++count;
 
5983
+         new_params->push_back(Typed_identifier(buf, p->type(),
 
5984
+                                                p->location()));
 
5985
+       }
 
5986
+    }
 
5987
+  Type* vt = Type::make_pointer_type(Type::make_void_type());
 
5988
+  new_params->push_back(Typed_identifier("closure.0", vt, loc));
 
5989
+
 
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;
 
5994
+  else
 
5995
+    {
 
5996
+      new_results = new Typed_identifier_list();
 
5997
+      for (Typed_identifier_list::const_iterator p = orig_results->begin();
 
5998
+          p != orig_results->end();
 
5999
+          ++p)
 
6000
+       new_results->push_back(Typed_identifier("", p->type(),
 
6001
+                                               p->location()));
 
6002
+    }
 
6003
+
 
6004
+  Function_type* new_fntype = Type::make_function_type(NULL, new_params,
 
6005
+                                                      new_results,
 
6006
+                                                      loc);
 
6007
+
 
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;
 
6011
+
 
6012
+  gogo->start_block(loc);
 
6013
+
 
6014
+  Expression* fn = Expression::make_func_reference(no, NULL, loc);
 
6015
+
 
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())
 
6020
+    args = NULL;
 
6021
+  else
 
6022
+    {
 
6023
+      args = new Expression_list();
 
6024
+      for (Typed_identifier_list::const_iterator p = new_params->begin();
 
6025
+          p + 1 != new_params->end();
 
6026
+          ++p)
 
6027
+       {
 
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));
 
6033
+       }
 
6034
+    }
 
6035
+
 
6036
+  Call_expression* call = Expression::make_call(fn, args,
 
6037
+                                               orig_fntype->is_varargs(),
 
6038
+                                               loc);
 
6039
+  call->set_varargs_are_lowered();
 
6040
+
 
6041
+  Statement* s;
 
6042
+  if (orig_results == NULL || orig_results->empty())
 
6043
+    s = Statement::make_statement(call, true);
 
6044
+  else
 
6045
+    {
 
6046
+      Expression_list* vals = new Expression_list();
 
6047
+      size_t rc = orig_results->size();
 
6048
+      if (rc == 1)
 
6049
+       vals->push_back(call);
 
6050
+      else
 
6051
+       {
 
6052
+         for (size_t i = 0; i < rc; ++i)
 
6053
+           vals->push_back(Expression::make_call_result(call, i));
 
6054
+       }
 
6055
+      s = Statement::make_return_statement(vals, loc);
 
6056
+    }
 
6057
+
 
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);
 
6063
+
 
6064
+  return dno;
 
6065
+}
 
6066
+
 
6067
+// Return the function descriptor, the value you get when you refer to
 
6068
+// the function in Go code without calling it.
 
6069
+
 
6070
+Expression*
 
6071
+Function::descriptor(Gogo* gogo, Named_object* no)
 
6072
+{
 
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)
 
6077
+    {
 
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()))
 
6085
+       {
 
6086
+         Named_object* dno = Function::make_descriptor_wrapper(gogo, no,
 
6087
+                                                               this->type_);
 
6088
+         descriptor->set_descriptor_wrapper(dno);
 
6089
+       }
 
6090
+    }
 
6091
+  return this->descriptor_;
 
6092
+}
 
6093
+
 
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 @@
 
6098
     }
 
6099
 }
 
6100
 
 
6101
+// Class Function_declaration.
 
6102
+
 
6103
+// Return the function descriptor.
 
6104
+
 
6105
+Expression*
 
6106
+Function_declaration::descriptor(Gogo* gogo, Named_object* no)
 
6107
+{
 
6108
+  go_assert(!this->fntype_->is_method());
 
6109
+  if (this->descriptor_ == NULL)
 
6110
+    {
 
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()))
 
6118
+       {
 
6119
+         Named_object* dno = Function::make_descriptor_wrapper(gogo, no,
 
6120
+                                                               this->fntype_);
 
6121
+         descriptor->set_descriptor_wrapper(dno);
 
6122
+       }
 
6123
+    }
 
6124
+  return this->descriptor_;
 
6125
+}
 
6126
+
 
6127
 // Class Variable.
 
6128
 
 
6129
 Variable::Variable(Type* type, Expression* init, bool is_global,
 
6130
@@ -4755,6 +5051,12 @@
 
6131
 Named_object::set_function_value(Function* function)
 
6132
 {
 
6133
   go_assert(this->classification_ == NAMED_OBJECT_FUNC_DECLARATION);
 
6134
+  if (this->func_declaration_value()->has_descriptor())
 
6135
+    {
 
6136
+      Expression* descriptor =
 
6137
+       this->func_declaration_value()->descriptor(NULL, NULL);
 
6138
+      function->set_descriptor(descriptor);
 
6139
+    }
 
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))
 
6149
 
 
6150
 
 
6151
-// Allocate a trampoline for a function literal.
 
6152
-DEF_GO_RUNTIME(ALLOCATE_GO_TRAMPOLINE, "__go_allocate_trampoline",
 
6153
-              P2(UINTPTR, POINTER), R1(POINTER))
 
6154
-
 
6155
-
 
6156
 // Start a new goroutine.
 
6157
 DEF_GO_RUNTIME(GO, "__go_go", P2(FUNC_PTR, POINTER), R0())
 
6158
 
 
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 @@
 
6164
   void
 
6165
   lower_constant(Named_object*);
 
6166
 
 
6167
+  // Create all necessary function descriptors.
 
6168
+  void
 
6169
+  create_function_descriptors();
 
6170
+
 
6171
   // Finalize the method lists and build stub methods for named types.
 
6172
   void
 
6173
   finalize_methods();
 
6174
@@ -614,10 +618,6 @@
 
6175
   receive_from_channel(tree type_tree, tree type_descriptor_tree, tree channel,
 
6176
                       Location);
 
6177
 
 
6178
-  // Make a trampoline which calls FNADDR passing CLOSURE.
 
6179
-  tree
 
6180
-  make_trampoline(tree fnaddr, tree closure, Location);
 
6181
-
 
6182
  private:
 
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 @@
 
6186
   tree
 
6187
   ptr_go_string_constant_tree(const std::string&);
 
6188
 
 
6189
-  // Return the type of a trampoline.
 
6190
-  static tree
 
6191
-  trampoline_type_tree();
 
6192
-
 
6193
   // Type used to map import names to packages.
 
6194
   typedef std::map<std::string, Package*> Imports;
 
6195
 
 
6196
@@ -915,6 +911,14 @@
 
6197
   result_variables()
 
6198
   { return this->results_; }
 
6199
 
 
6200
+  bool
 
6201
+  is_sink() const
 
6202
+  { return this->is_sink_; }
 
6203
+
 
6204
+  void
 
6205
+  set_is_sink()
 
6206
+  { this->is_sink_ = true; }
 
6207
+
 
6208
   // Whether the result variables have names.
 
6209
   bool
 
6210
   results_are_named() const
 
6211
@@ -1046,6 +1050,12 @@
 
6212
   set_in_unique_section()
 
6213
   { this->in_unique_section_ = true; }
 
6214
 
 
6215
+  // Whether this function was created as a descriptor wrapper for
 
6216
+  // another function.
 
6217
+  bool
 
6218
+  is_descriptor_wrapper() const
 
6219
+  { return this->is_descriptor_wrapper_; }
 
6220
+
 
6221
   // Swap with another function.  Used only for the thunk which calls
 
6222
   // recover.
 
6223
   void
 
6224
@@ -1059,6 +1069,26 @@
 
6225
   void
 
6226
   determine_types();
 
6227
 
 
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.
 
6232
+  Expression*
 
6233
+  descriptor(Gogo*, Named_object*);
 
6234
+
 
6235
+  // Set the descriptor for this function.  This is used when a
 
6236
+  // function declaration is followed by a function definition.
 
6237
+  void
 
6238
+  set_descriptor(Expression* descriptor)
 
6239
+  {
 
6240
+    go_assert(this->descriptor_ == NULL);
 
6241
+    this->descriptor_ = descriptor;
 
6242
+  }
 
6243
+
 
6244
+  // Build a descriptor wrapper function.
 
6245
+  static Named_object*
 
6246
+  make_descriptor_wrapper(Gogo*, Named_object*, Function_type*);
 
6247
+
 
6248
   // Return the function's decl given an identifier.
 
6249
   tree
 
6250
   get_or_make_decl(Gogo*, Named_object*, tree id);
 
6251
@@ -1137,25 +1167,32 @@
 
6252
   Labels labels_;
 
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.
 
6258
   tree fndecl_;
 
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
 
6284
+  // descriptor.
 
6285
+  bool is_descriptor_wrapper_ : 1;
 
6286
 };
 
6287
 
 
6288
 // A snapshot of the current binding state.
 
6289
@@ -1198,7 +1235,8 @@
 
6290
 {
 
6291
  public:
 
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),
 
6295
+      fndecl_(NULL)
 
6296
   { }
 
6297
 
 
6298
   Function_type*
 
6299
@@ -1218,10 +1256,27 @@
 
6300
   set_asm_name(const std::string& asm_name)
 
6301
   { this->asm_name_ = asm_name; }
 
6302
 
 
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.
 
6307
+  Expression*
 
6308
+  descriptor(Gogo*, Named_object*);
 
6309
+
 
6310
+  // Return true if we have created a descriptor for this declaration.
 
6311
+  bool
 
6312
+  has_descriptor() const
 
6313
+  { return this->descriptor_ != NULL; }
 
6314
+
 
6315
   // Return a decl for the function given an identifier.
 
6316
   tree
 
6317
   get_or_make_decl(Gogo*, Named_object*, tree id);
 
6318
 
 
6319
+  // If there is a descriptor, build it into the backend
 
6320
+  // representation.
 
6321
+  void
 
6322
+  build_backend_descriptor(Gogo*);
 
6323
+
 
6324
   // Export a function declaration.
 
6325
   void
 
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.
 
6334
   tree fndecl_;
 
6335
 };
 
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)
 
6340
@@ -44,7 +44,7 @@
 
6341
 GO_EXTERN_C
 
6342
 void
 
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)
 
6346
 {
 
6347
   go_assert(filename_count > 0);
 
6348
 
 
6349
@@ -84,10 +84,16 @@
 
6350
   // Finalize method lists and build stub methods for named types.
 
6351
   ::gogo->finalize_methods();
 
6352
 
 
6353
+  // Check that functions have a terminating statement.
 
6354
+  ::gogo->check_return_statements();
 
6355
+
 
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();
 
6359
 
 
6360
+  // Create function descriptors as needed.
 
6361
+  ::gogo->create_function_descriptors();
 
6362
+
 
6363
   // Write out queued up functions for hash and comparison of types.
 
6364
   ::gogo->write_specific_type_functions();
 
6365
 
 
6366
@@ -104,10 +110,6 @@
 
6367
   if (only_check_syntax)
 
6368
     return;
 
6369
 
 
6370
-  // Check that functions have return statements.
 
6371
-  if (require_return_statement)
 
6372
-    ::gogo->check_return_statements();
 
6373
-
 
6374
   // Export global identifiers as appropriate.
 
6375
   ::gogo->do_exports();
 
6376
 
 
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 @@
 
6382
   static Type*
 
6383
   make_forward_declaration(Named_object*);
 
6384
 
 
6385
+  // Make a builtin struct type from a list of fields.
 
6386
+  static Struct_type*
 
6387
+  make_builtin_struct_type(int nfields, ...);
 
6388
+
 
6389
+  // Make a builtin named type.
 
6390
+  static Named_type*
 
6391
+  make_builtin_named_type(const char* name, Type* type);
 
6392
+
 
6393
   // Traverse a type.
 
6394
   static int
 
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);
 
6399
 
 
6400
-  // Make a builtin struct type from a list of fields.
 
6401
-  static Struct_type*
 
6402
-  make_builtin_struct_type(int nfields, ...);
 
6403
-
 
6404
-  // Make a builtin named type.
 
6405
-  static Named_type*
 
6406
-  make_builtin_named_type(const char* name, Type* type);
 
6407
-
 
6408
   // For the benefit of child class reflection string generation.
 
6409
   void
 
6410
   append_reflection(const Type* type, Gogo* gogo, std::string* ret) const
 
6411
@@ -1796,7 +1796,7 @@
 
6412
   int
 
6413
   do_traverse(Traverse*);
 
6414
 
 
6415
-  // A trampoline function has a pointer which matters for GC.
 
6416
+  // A function descriptor may be allocated on the heap.
 
6417
   bool
 
6418
   do_has_pointer() const
 
6419
   { return true; }
 
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();
 
6427
 
 
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);
 
6436
   if (ins.second)
 
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.
 
6446
 
 
6447
 Expression*
 
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();
 
6452
        ++p)
 
6453
-    ev[p->index()] = *p;
 
6454
+    {
 
6455
+      // Subtract 1 because index 0 is the function code.
 
6456
+      ev[p->index() - 1] = *p;
 
6457
+    }
 
6458
 
 
6459
   // Build an initializer for a composite literal of the closure's
 
6460
   // type.
 
6461
 
 
6462
   Named_object* enclosing_function = this->gogo_->current_function();
 
6463
   Expression_list* initializer = new Expression_list;
 
6464
+
 
6465
+  initializer->push_back(Expression::make_func_code_reference(function,
 
6466
+                                                             location));
 
6467
+
 
6468
   for (size_t i = 0; i < enclosing_var_count; ++i)
 
6469
     {
 
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();
 
6475
       Expression* ref;
 
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)
 
6481
@@ -32,6 +32,7 @@
 
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;
 
6489
@@ -67,6 +68,8 @@
 
6490
     EXPRESSION_SET_AND_USE_TEMPORARY,
 
6491
     EXPRESSION_SINK,
 
6492
     EXPRESSION_FUNC_REFERENCE,
 
6493
+    EXPRESSION_FUNC_DESCRIPTOR,
 
6494
+    EXPRESSION_FUNC_CODE_REFERENCE,
 
6495
     EXPRESSION_UNKNOWN_REFERENCE,
 
6496
     EXPRESSION_BOOLEAN,
 
6497
     EXPRESSION_STRING,
 
6498
@@ -150,10 +153,24 @@
 
6499
   static Expression*
 
6500
   make_sink(Location);
 
6501
 
 
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.
 
6506
   static Expression*
 
6507
   make_func_reference(Named_object*, Expression* closure, Location);
 
6508
 
 
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);
 
6515
+
 
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);
 
6520
+
 
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 @@
 
6525
   bool
 
6526
   is_local_variable() const;
 
6527
 
 
6528
+  // Make the builtin function descriptor type, so that it can be
 
6529
+  // converted.
 
6530
+  static void
 
6531
+  make_func_descriptor_type();
 
6532
+
 
6533
   // Traverse an expression.
 
6534
   static int
 
6535
   traverse(Expression**, Traverse*);
 
6536
@@ -1484,7 +1506,7 @@
 
6537
   { }
 
6538
 
 
6539
   // Return the object associated with the function.
 
6540
-  const Named_object*
 
6541
+  Named_object*
 
6542
   named_object() const
 
6543
   { return this->function_; }
 
6544
 
 
6545
@@ -1494,9 +1516,9 @@
 
6546
   closure()
 
6547
   { return this->closure_; }
 
6548
 
 
6549
-  // Return a tree for this function without evaluating the closure.
 
6550
-  tree
 
6551
-  get_tree_without_closure(Gogo*);
 
6552
+  // Return a tree for the code for a function.
 
6553
+  static tree
 
6554
+  get_code_pointer(Gogo*, Named_object* function, Location loc);
 
6555
 
 
6556
  protected:
 
6557
   int
 
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_;
 
6567
 };
 
6568
 
 
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.
 
6572
+
 
6573
+class Func_descriptor_expression : public Expression
 
6574
+{
 
6575
+ public:
 
6576
+  Func_descriptor_expression(Named_object* fn);
 
6577
+
 
6578
+  // Set the descriptor wrapper.
 
6579
+  void
 
6580
+  set_descriptor_wrapper(Named_object* dfn)
 
6581
+  {
 
6582
+    go_assert(this->dfn_ == NULL);
 
6583
+    this->dfn_ = dfn;
 
6584
+  }
 
6585
+
 
6586
+  // Make the function descriptor type, so that it can be converted.
 
6587
+  static void
 
6588
+  make_func_descriptor_type();
 
6589
+
 
6590
+ protected:
 
6591
+  int
 
6592
+  do_traverse(Traverse*);
 
6593
+
 
6594
+  Type*
 
6595
+  do_type();
 
6596
+
 
6597
+  void
 
6598
+  do_determine_type(const Type_context*)
 
6599
+  { }
 
6600
+
 
6601
+  Expression*
 
6602
+  do_copy();
 
6603
+
 
6604
+  bool
 
6605
+  do_is_addressable() const
 
6606
+  { return true; }
 
6607
+
 
6608
+  tree
 
6609
+  do_get_tree(Translate_context*);
 
6610
+
 
6611
+  void
 
6612
+  do_dump_expression(Ast_dump_context* context) const;
 
6613
+
 
6614
+ private:
 
6615
+  // The type of all function descriptors.
 
6616
+  static Type* descriptor_type;
 
6617
+
 
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.
 
6623
+  Bvariable* dvar_;
 
6624
+};
 
6625
+
 
6626
 // A reference to an unknown name.
 
6627
 
 
6628
 class Unknown_expression : public Parser_expression
 
6629
@@ -1847,7 +1926,7 @@
 
6630
   Field_reference_expression(Expression* expr, unsigned int field_index,
 
6631
                             Location location)
 
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)
 
6635
   { }
 
6636
 
 
6637
   // Return the struct expression.
 
6638
@@ -1860,6 +1939,15 @@
 
6639
   field_index() const
 
6640
   { return this->field_index_; }
 
6641
 
 
6642
+  // Return whether this node was implied by an anonymous field.
 
6643
+  bool
 
6644
+  implicit() const
 
6645
+  { return this->implicit_; }
 
6646
+
 
6647
+  void
 
6648
+  set_implicit(bool implicit)
 
6649
+  { this->implicit_ = implicit; }
 
6650
+
 
6651
   // Set the struct expression.  This is used when parsing.
 
6652
   void
 
6653
   set_struct_expression(Expression* expr)
 
6654
@@ -1914,6 +2002,9 @@
 
6655
   Expression* expr_;
 
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.
 
6660
+  bool implicit_;
 
6661
   // Whether we have already emitted a fieldtrack call.
 
6662
   bool called_fieldtrack_;
 
6663
 };
 
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();
 
6670
 }
 
6671
 
 
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.
 
6676
 
 
6677
 bool
 
6678
 Expression_statement::do_may_fall_through() const
 
6679
@@ -1717,22 +1717,28 @@
 
6680
   if (call != NULL)
 
6681
     {
 
6682
       const Expression* fn = call->fn();
 
6683
-      const Func_expression* fe = fn->func_expression();
 
6684
-      if (fe != NULL)
 
6685
+      // panic is still an unknown named object.
 
6686
+      const Unknown_expression* ue = fn->unknown_expression();
 
6687
+      if (ue != NULL)
 
6688
        {
 
6689
-         const Named_object* no = fe->named_object();
 
6690
+         Named_object* no = ue->named_object();
 
6691
 
 
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();
 
6697
-         else
 
6698
-           fntype = NULL;
 
6699
+          if (no->is_unknown())
 
6700
+            no = no->unknown_value()->real_named_object();
 
6701
+          if (no != NULL)
 
6702
+            {
 
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();
 
6708
+              else
 
6709
+                fntype = NULL;
 
6710
 
 
6711
-         // The builtin function panic does not return.
 
6712
-         if (fntype != NULL && fntype->is_builtin() && no->name() == "panic")
 
6713
-           return false;
 
6714
+              // The builtin function panic does not return.
 
6715
+              if (fntype != NULL && fntype->is_builtin() && no->name() == "panic")
 
6716
+                return false;
 
6717
+            }
 
6718
        }
 
6719
     }
 
6720
   return true;
 
6721
@@ -1953,12 +1959,17 @@
 
6722
              && results->begin()->type()->points_to() == NULL)))
 
6723
     return false;
 
6724
 
 
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
 
6727
   // need a thunk.
 
6728
   Expression* fn = this->call_->call_expression()->fn();
 
6729
-  if (fn->interface_field_reference_expression() != NULL)
 
6730
+  if (fn->func_expression() == NULL)
 
6731
     return false;
 
6732
 
 
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)
 
6736
+    return false;
 
6737
+
 
6738
   return true;
 
6739
 }
 
6740
 
 
6741
@@ -2496,7 +2507,11 @@
 
6742
 
 
6743
   Call_expression* ce = this->call_->call_expression();
 
6744
 
 
6745
-  *pfn = ce->fn();
 
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(),
 
6750
+                                             fe->location());
 
6751
 
 
6752
   const Expression_list* args = ce->args();
 
6753
   if (args == NULL || args->empty())
 
6754
@@ -3700,9 +3715,6 @@
 
6755
   void
 
6756
   do_check_types(Gogo*);
 
6757
 
 
6758
-  bool
 
6759
-  do_may_fall_through() const;
 
6760
-
 
6761
   Bstatement*
 
6762
   do_get_backend(Translate_context*);
 
6763
 
 
6764
@@ -3746,22 +3758,6 @@
 
6765
     this->set_is_error();
 
6766
 }
 
6767
 
 
6768
-// Return whether this switch may fall through.
 
6769
-
 
6770
-bool
 
6771
-Constant_switch_statement::do_may_fall_through() const
 
6772
-{
 
6773
-  if (this->clauses_ == NULL)
 
6774
-    return true;
 
6775
-
 
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)
 
6779
-    return true;
 
6780
-
 
6781
-  return this->clauses_->may_fall_through();
 
6782
-}
 
6783
-
 
6784
 // Convert to GENERIC.
 
6785
 
 
6786
 Bstatement*
 
6787
@@ -3911,6 +3907,22 @@
 
6788
   ast_dump_context->ostream() << std::endl;
 
6789
 }
 
6790
 
 
6791
+// Return whether this switch may fall through.
 
6792
+
 
6793
+bool
 
6794
+Switch_statement::do_may_fall_through() const
 
6795
+{
 
6796
+  if (this->clauses_ == NULL)
 
6797
+    return true;
 
6798
+
 
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)
 
6802
+    return true;
 
6803
+
 
6804
+  return this->clauses_->may_fall_through();
 
6805
+}
 
6806
+
 
6807
 // Make a switch statement.
 
6808
 
 
6809
 Switch_statement*
 
6810
@@ -4050,6 +4062,17 @@
 
6811
     }
 
6812
 }
 
6813
 
 
6814
+// Return true if this type clause may fall through to the statements
 
6815
+// following the switch.
 
6816
+
 
6817
+bool
 
6818
+Type_case_clauses::Type_case_clause::may_fall_through() const
 
6819
+{
 
6820
+  if (this->statements_ == NULL)
 
6821
+    return true;
 
6822
+  return this->statements_->may_fall_through();
 
6823
+}
 
6824
+
 
6825
 // Dump the AST representation for a type case clause
 
6826
 
 
6827
 void
 
6828
@@ -4148,6 +4171,25 @@
 
6829
                        NULL);
 
6830
 }
 
6831
 
 
6832
+// Return true if these clauses may fall through to the statements
 
6833
+// following the switch statement.
 
6834
+
 
6835
+bool
 
6836
+Type_case_clauses::may_fall_through() const
 
6837
+{
 
6838
+  bool found_default = false;
 
6839
+  for (Type_clauses::const_iterator p = this->clauses_.begin();
 
6840
+       p != this->clauses_.end();
 
6841
+       ++p)
 
6842
+    {
 
6843
+      if (p->may_fall_through())
 
6844
+       return true;
 
6845
+      if (p->is_default())
 
6846
+       found_default = true;
 
6847
+    }
 
6848
+  return !found_default;
 
6849
+}
 
6850
+
 
6851
 // Dump the AST representation for case clauses (from a switch statement)
 
6852
 
 
6853
 void
 
6854
@@ -4237,6 +4279,22 @@
 
6855
   return Statement::make_block_statement(b, loc);
 
6856
 }
 
6857
 
 
6858
+// Return whether this switch may fall through.
 
6859
+
 
6860
+bool
 
6861
+Type_switch_statement::do_may_fall_through() const
 
6862
+{
 
6863
+  if (this->clauses_ == NULL)
 
6864
+    return true;
 
6865
+
 
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)
 
6869
+    return true;
 
6870
+
 
6871
+  return this->clauses_->may_fall_through();
 
6872
+}
 
6873
+
 
6874
 // Return the break label for this type switch statement, creating it
 
6875
 // if necessary.
 
6876
 
 
6877
@@ -4954,6 +5012,19 @@
 
6878
   return Statement::make_block_statement(b, loc);
 
6879
 }
 
6880
 
 
6881
+// Whether the select statement itself may fall through to the following
 
6882
+// statement.
 
6883
+
 
6884
+bool
 
6885
+Select_statement::do_may_fall_through() const
 
6886
+{
 
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)
 
6890
+    return true;
 
6891
+  return this->clauses_->may_fall_through();
 
6892
+}
 
6893
+
 
6894
 // Return the backend representation for a select statement.
 
6895
 
 
6896
 Bstatement*
 
6897
@@ -5114,6 +5185,20 @@
 
6898
   this->continue_label_ = continue_label;
 
6899
 }
 
6900
 
 
6901
+// Whether the overall statement may fall through.
 
6902
+
 
6903
+bool
 
6904
+For_statement::do_may_fall_through() const
 
6905
+{
 
6906
+  // A for loop is terminating if it has no condition and
 
6907
+  // no break statement.
 
6908
+  if(this->cond_ != NULL)
 
6909
+    return true;
 
6910
+  if(this->break_label_ != NULL)
 
6911
+    return true;
 
6912
+  return false;
 
6913
+}
 
6914
+
 
6915
 // Dump the AST representation for a for statement.
 
6916
 
 
6917
 void
 
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();
 
6924
 
 
6925
   Bindings* bindings = this->current_bindings();
 
6926
+
 
6927
+  for (Bindings::const_declarations_iterator p = bindings->begin_declarations();
 
6928
+       p != bindings->end_declarations();
 
6929
+       ++p)
 
6930
+    {
 
6931
+      // If any function declarations needed a descriptor, make sure
 
6932
+      // we build it.
 
6933
+      Named_object* no = p->second;
 
6934
+      if (no->is_function_declaration())
 
6935
+       no->func_declaration_value()->build_backend_descriptor(this);
 
6936
+    }
 
6937
+
 
6938
   size_t count_definitions = bindings->size_definitions();
 
6939
   size_t count = count_definitions;
 
6940
 
 
6941
@@ -782,6 +794,8 @@
 
6942
     {
 
6943
       Named_object* no = *p;
 
6944
 
 
6945
+      go_assert(i < count);
 
6946
+
 
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 @@
 
6951
            }
 
6952
        }
 
6953
 
 
6954
+      // Skip blank named functions.
 
6955
+      if (no->is_function() && no->func_value()->is_sink())
 
6956
+        {
 
6957
+          --i;
 
6958
+          --count;
 
6959
+          continue;
 
6960
+        }
 
6961
+
 
6962
       if (!no->is_variable())
 
6963
        {
 
6964
          vec[i] = no->get_tree(this, NULL);
 
6965
@@ -1255,14 +1277,47 @@
 
6966
   if (this->fndecl_ == NULL_TREE)
 
6967
     {
 
6968
       tree functype = type_to_tree(this->type_->get_backend(gogo));
 
6969
+
 
6970
+      if (functype != error_mark_node)
 
6971
+       {
 
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);
 
6980
+
 
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
 
6985
+         // in that case.
 
6986
+         if (this->enclosing_ == NULL && !this->is_descriptor_wrapper_)
 
6987
+           {
 
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)
 
6994
+               {
 
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);
 
7000
+               }
 
7001
+             *pp = void_list_node;
 
7002
+             functype = build_function_type(TREE_TYPE(functype), new_params);
 
7003
+           }
 
7004
+       }
 
7005
+
 
7006
       if (functype == error_mark_node)
 
7007
        this->fndecl_ = error_mark_node;
 
7008
       else
 
7009
        {
 
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,
 
7015
                                  id, functype);
 
7016
 
 
7017
@@ -1308,9 +1363,6 @@
 
7018
          DECL_CONTEXT(resdecl) = decl;
 
7019
          DECL_RESULT(decl) = resdecl;
 
7020
 
 
7021
-         if (this->enclosing_ != NULL)
 
7022
-           DECL_STATIC_CHAIN(decl) = 1;
 
7023
-
 
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);
 
7029
 
 
7030
          go_preserve_from_gc(decl);
 
7031
-
 
7032
-         if (this->closure_var_ != NULL)
 
7033
-           {
 
7034
-             push_struct_function(decl);
 
7035
-
 
7036
-             Bvariable* bvar = this->closure_var_->get_backend_variable(gogo,
 
7037
-                                                                        no);
 
7038
-             tree closure_decl = var_to_tree(bvar);
 
7039
-             if (closure_decl == error_mark_node)
 
7040
-               this->fndecl_ = error_mark_node;
 
7041
-             else
 
7042
-               {
 
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;
 
7048
-
 
7049
-                 DECL_STRUCT_FUNCTION(decl)->static_chain_decl = closure_decl;
 
7050
-               }
 
7051
-
 
7052
-             pop_cfun();
 
7053
-           }
 
7054
        }
 
7055
     }
 
7056
   return this->fndecl_;
 
7057
@@ -1382,15 +1411,44 @@
 
7058
        }
 
7059
 
 
7060
       tree functype = type_to_tree(this->fntype_->get_backend(gogo));
 
7061
+
 
7062
+      if (functype != error_mark_node)
 
7063
+       {
 
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);
 
7072
+
 
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)
 
7083
+           {
 
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);
 
7089
+           }
 
7090
+         *pp = void_list_node;
 
7091
+         functype = build_function_type(TREE_TYPE(functype), new_params);
 
7092
+       }
 
7093
+
 
7094
       tree decl;
 
7095
       if (functype == error_mark_node)
 
7096
        decl = error_mark_node;
 
7097
       else
 
7098
        {
 
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,
 
7104
                             functype);
 
7105
          TREE_PUBLIC(decl) = 1;
 
7106
@@ -1599,6 +1657,32 @@
 
7107
            }
 
7108
        }
 
7109
     }
 
7110
+
 
7111
+  // The closure variable is passed last, if this is a function
 
7112
+  // literal or a descriptor wrapper.
 
7113
+  if (this->closure_var_ != NULL)
 
7114
+    {
 
7115
+      Bvariable* bvar =
 
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)
 
7119
+       {
 
7120
+         go_assert(TREE_CODE(var_decl) == PARM_DECL);
 
7121
+         *pp = var_decl;
 
7122
+         pp = &DECL_CHAIN(*pp);
 
7123
+       }
 
7124
+    }
 
7125
+  else if (this->enclosing_ != NULL || this->is_descriptor_wrapper_)
 
7126
+    {
 
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;
 
7132
+      *pp = parm_decl;
 
7133
+      pp = &DECL_CHAIN(*pp);
 
7134
+    }
 
7135
+
 
7136
   *pp = NULL_TREE;
 
7137
 
 
7138
   DECL_ARGUMENTS(fndecl) = params;
 
7139
@@ -1681,6 +1765,13 @@
 
7140
 
 
7141
       DECL_SAVED_TREE(fndecl) = code;
 
7142
     }
 
7143
+
 
7144
+  // If we created a descriptor for the function, make sure we emit it.
 
7145
+  if (this->descriptor_ != NULL)
 
7146
+    {
 
7147
+      Translate_context context(gogo, NULL, NULL, NULL);
 
7148
+      this->descriptor_->get_tree(&context);
 
7149
+    }
 
7150
 }
 
7151
 
 
7152
 // Build the wrappers around function code needed if the function has
 
7153
@@ -1844,6 +1935,20 @@
 
7154
     }
 
7155
 }
 
7156
 
 
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.
 
7161
+void
 
7162
+Function_declaration::build_backend_descriptor(Gogo* gogo)
 
7163
+{
 
7164
+  if (this->descriptor_ != NULL)
 
7165
+    {
 
7166
+      Translate_context context(gogo, NULL, NULL, NULL);
 
7167
+      this->descriptor_->get_tree(&context);
 
7168
+    }
 
7169
+}
 
7170
+
 
7171
 // Return the integer type to use for a size.
 
7172
 
 
7173
 GO_EXTERN_C
 
7174
@@ -2437,70 +2542,3 @@
 
7175
                    build2(COMPOUND_EXPR, type_tree, call, tmp));
 
7176
     }
 
7177
 }
 
7178
-
 
7179
-// Return the type of a function trampoline.  This is like
 
7180
-// get_trampoline_type in tree-nested.c.
 
7181
-
 
7182
-tree
 
7183
-Gogo::trampoline_type_tree()
 
7184
-{
 
7185
-  static tree type_tree;
 
7186
-  if (type_tree == NULL_TREE)
 
7187
-    {
 
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);
 
7193
-
 
7194
-      type_tree = Gogo::builtin_struct(NULL, "__go_trampoline", NULL_TREE, 1,
 
7195
-                                      "__data", t);
 
7196
-      t = TYPE_FIELDS(type_tree);
 
7197
-      DECL_ALIGN(t) = align;
 
7198
-      DECL_USER_ALIGN(t) = 1;
 
7199
-
 
7200
-      go_preserve_from_gc(type_tree);
 
7201
-    }
 
7202
-  return type_tree;
 
7203
-}
 
7204
-
 
7205
-// Make a trampoline which calls FNADDR passing CLOSURE.
 
7206
-
 
7207
-tree
 
7208
-Gogo::make_trampoline(tree fnaddr, tree closure, Location location)
 
7209
-{
 
7210
-  tree trampoline_type = Gogo::trampoline_type_tree();
 
7211
-  tree trampoline_size = TYPE_SIZE_UNIT(trampoline_type);
 
7212
-
 
7213
-  closure = save_expr(closure);
 
7214
-
 
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,
 
7219
-                             location,
 
7220
-                             "__go_allocate_trampoline",
 
7221
-                             2,
 
7222
-                             ptr_type_node,
 
7223
-                             size_type_node,
 
7224
-                             trampoline_size,
 
7225
-                             ptr_type_node,
 
7226
-                             fold_convert_loc(location.gcc_location(),
 
7227
-                                               ptr_type_node, closure));
 
7228
-  if (x == error_mark_node)
 
7229
-    return error_mark_node;
 
7230
-
 
7231
-  x = save_expr(x);
 
7232
-
 
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);
 
7236
-
 
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);
 
7242
-
 
7243
-  return build2(COMPOUND_EXPR, TREE_TYPE(x), ini, x);
 
7244
-}
 
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)
 
7249
@@ -894,8 +894,7 @@
 
7250
   { this->clauses_->check_types(); }
 
7251
 
 
7252
   bool
 
7253
-  do_may_fall_through() const
 
7254
-  { return this->clauses_->may_fall_through(); }
 
7255
+  do_may_fall_through() const;
 
7256
 
 
7257
   Bstatement*
 
7258
   do_get_backend(Translate_context*);
 
7259
@@ -1086,6 +1085,9 @@
 
7260
   Statement*
 
7261
   do_lower(Gogo*, Named_object*, Block*, Statement_inserter*);
 
7262
 
 
7263
+  bool
 
7264
+  do_may_fall_through() const;
 
7265
+
 
7266
   Bstatement*
 
7267
   do_get_backend(Translate_context*)
 
7268
   { go_unreachable(); }
 
7269
@@ -1399,6 +1401,9 @@
 
7270
   void
 
7271
   do_dump_statement(Ast_dump_context*) const;
 
7272
 
 
7273
+  bool
 
7274
+  do_may_fall_through() const;
 
7275
+
 
7276
  private:
 
7277
   // The value to switch on.  This may be NULL.
 
7278
   Expression* val_;
 
7279
@@ -1449,6 +1454,11 @@
 
7280
   lower(Type*, Block*, Temporary_statement* descriptor_temp,
 
7281
        Unnamed_label* break_label) const;
 
7282
 
 
7283
+  // Return true if these clauses may fall through to the statements
 
7284
+  // following the switch statement.
 
7285
+  bool
 
7286
+  may_fall_through() const;
 
7287
+
 
7288
   // Dump the AST representation to a dump context.
 
7289
   void
 
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;
 
7294
 
 
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.
 
7298
+    bool
 
7299
+    may_fall_through() const;
 
7300
+
 
7301
     // Dump the AST representation to a dump context.
 
7302
     void
 
7303
     dump_clause(Ast_dump_context*) const;
 
7304
@@ -1556,6 +1572,9 @@
 
7305
   void
 
7306
   do_dump_statement(Ast_dump_context*) const;
 
7307
 
 
7308
+  bool
 
7309
+  do_may_fall_through() const;
 
7310
+
 
7311
  private:
 
7312
   // The variable holding the value we are switching on.
 
7313
   Named_object* var_;
 
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)
 
7318
@@ -95,7 +95,10 @@
 
7319
 
 
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).
 
7327
   virtual Btype*
 
7328
   function_type(const Btyped_identifier& receiver,
 
7329
                const std::vector<Btyped_identifier>& parameters,
 
7330
@@ -388,18 +391,22 @@
 
7331
                     Bstatement** pstatement) = 0;
 
7332
 
 
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
 
7336
-  // variable in C.
 
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.
 
7340
   //
 
7341
   // NAME is the name to use for the initialized global variable which
 
7342
   // this call will create.
 
7343
   //
 
7344
+  // IS_HIDDEN will be true if the descriptor should only be visible
 
7345
+  // within the current object.
 
7346
+  //
 
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
 
7353
+  // true.
 
7354
   //
 
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.
 
7360
   virtual Bvariable*
 
7361
-  immutable_struct(const std::string& name, bool is_common, Btype* type,
 
7362
-                  Location) = 0;
 
7363
+  immutable_struct(const std::string& name, bool is_hidden, bool is_common,
 
7364
+                  Btype* type, Location) = 0;
 
7365
 
 
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.
 
7378
   virtual void
 
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;
 
7384
 
 
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.
 
7393
 
 
7394
   this->type_descriptor_var_ =
 
7395
-    gogo->backend()->immutable_struct(var_name, is_common, initializer_btype,
 
7396
-                                     loc);
 
7397
+    gogo->backend()->immutable_struct(var_name, false, is_common,
 
7398
+                                     initializer_btype, loc);
 
7399
   if (phash != NULL)
 
7400
     *phash = this->type_descriptor_var_;
 
7401
 
 
7402
@@ -1308,7 +1308,7 @@
 
7403
   Bexpression* binitializer = tree_to_expr(initializer->get_tree(&context));
 
7404
 
 
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,
 
7409
                                             binitializer);
 
7410
 }
 
7411
@@ -1528,26 +1528,6 @@
 
7412
 
 
7413
       // The type descriptor type.
 
7414
 
 
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));
 
7418
-
 
7419
-      Typed_identifier_list* results = new Typed_identifier_list();
 
7420
-      results->push_back(Typed_identifier("", uintptr_type, bloc));
 
7421
-
 
7422
-      Type* hashfn_type = Type::make_function_type(NULL, params, results, bloc);
 
7423
-
 
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));
 
7428
-
 
7429
-      results = new Typed_identifier_list();
 
7430
-      results->push_back(Typed_identifier("", Type::lookup_bool_type(), bloc));
 
7431
-
 
7432
-      Type* equalfn_type = Type::make_function_type(NULL, params, results,
 
7433
-                                                   bloc);
 
7434
-
 
7435
       Struct_type* type_descriptor_type =
 
7436
        Type::make_builtin_struct_type(10,
 
7437
                                       "Kind", uint8_type,
 
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,
 
7448
                                       "ptrToThis",
 
7449
@@ -1946,8 +1926,8 @@
 
7450
   Named_object* equal_fn;
 
7451
   this->type_functions(gogo, name, hash_fntype, equal_fntype, &hash_fn,
 
7452
                       &equal_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));
 
7457
 
 
7458
   ++p;
 
7459
   go_assert(p->is_field_name("string"));
 
7460
@@ -2207,7 +2187,7 @@
 
7461
 
 
7462
   ++p;
 
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));
 
7466
 
 
7467
   ++p;
 
7468
   go_assert(p == fields->end());
 
7469
@@ -3407,6 +3387,18 @@
 
7470
 Btype*
 
7471
 Function_type::do_get_backend(Gogo* gogo)
 
7472
 {
 
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.
 
7480
+
 
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);
 
7484
+
 
7485
   Backend::Btyped_identifier breceiver;
 
7486
   if (this->receiver_ != NULL)
 
7487
     {
 
7488
@@ -3422,9 +3414,15 @@
 
7489
     }
 
7490
 
 
7491
   std::vector<Backend::Btyped_identifier> bparameters;
 
7492
-  if (this->parameters_ != NULL)
 
7493
+  size_t last;
 
7494
+  if (this->parameters_ == NULL)
 
7495
     {
 
7496
-      bparameters.resize(this->parameters_->size());
 
7497
+      bparameters.resize(1);
 
7498
+      last = 0;
 
7499
+    }
 
7500
+  else
 
7501
+    {
 
7502
+      bparameters.resize(this->parameters_->size() + 1);
 
7503
       size_t i = 0;
 
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();
 
7509
        }
 
7510
-      go_assert(i == bparameters.size());
 
7511
+      last = i;
 
7512
     }
 
7513
+  go_assert(last + 1 == bparameters.size());
 
7514
+  bparameters[last].name = "$closure";
 
7515
+  bparameters[last].btype = ptr_struct_type;
 
7516
+  bparameters[last].location = loc;
 
7517
 
 
7518
   std::vector<Backend::Btyped_identifier> bresults;
 
7519
   if (this->results_ != NULL)
 
7520
@@ -3453,8 +3455,15 @@
 
7521
       go_assert(i == bresults.size());
 
7522
     }
 
7523
 
 
7524
-  return gogo->backend()->function_type(breceiver, bparameters, bresults,
 
7525
-                                       this->location());
 
7526
+  Btype* fntype = gogo->backend()->function_type(breceiver, bparameters,
 
7527
+                                                bresults, loc);
 
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;
 
7535
 }
 
7536
 
 
7537
 // The type of a function type descriptor.
 
7538
@@ -4532,6 +4541,7 @@
 
7539
              go_assert(sub != NULL);
 
7540
            }
 
7541
          sub->set_struct_expression(here);
 
7542
+          sub->set_implicit(true);
 
7543
        }
 
7544
       else if (subdepth > found_depth)
 
7545
        delete sub;
 
7546
@@ -6227,7 +6237,8 @@
 
7547
 
 
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,
 
7552
+                                                     true,
 
7553
                                                      map_descriptor_btype,
 
7554
                                                      bloc);
 
7555
 
 
7556
@@ -6235,7 +6246,7 @@
 
7557
   context.set_is_const();
 
7558
   Bexpression* binitializer = tree_to_expr(initializer->get_tree(&context));
 
7559
 
 
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,
 
7563
                                             binitializer);
 
7564
 
 
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 @@
 
7570
     go_unreachable();
 
7571
 }
 
7572
 
 
7573
-// Get the tree for a function expression without evaluating the
 
7574
-// closure.
 
7575
+// Get the tree for the code of a function expression.
 
7576
 
 
7577
 tree
 
7578
-Func_expression::get_tree_without_closure(Gogo* gogo)
 
7579
+Func_expression::get_code_pointer(Gogo* gogo, Named_object* no, Location loc)
 
7580
 {
 
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();
 
7590
   else
 
7591
     go_unreachable();
 
7592
 
 
7593
@@ -1273,14 +1272,12 @@
 
7594
   // can't take their address.
 
7595
   if (fntype->is_builtin())
 
7596
     {
 
7597
-      error_at(this->location(),
 
7598
+      error_at(loc,
 
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;
 
7603
     }
 
7604
 
 
7605
-  Named_object* no = this->function_;
 
7606
-
 
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;
 
7613
 
 
7614
-  return build_fold_addr_expr_loc(this->location().gcc_location(), fndecl);
 
7615
+  return build_fold_addr_expr_loc(loc.gcc_location(), fndecl);
 
7616
 }
 
7617
 
 
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.
 
7626
 
 
7627
 tree
 
7628
 Func_expression::do_get_tree(Translate_context* context)
 
7629
 {
 
7630
-  Gogo* gogo = context->gogo();
 
7631
+  // If there is no closure, just use the function descriptor.
 
7632
+  if (this->closure_ == NULL)
 
7633
+    {
 
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())
 
7640
+       {
 
7641
+         if (no->func_declaration_value()->type()->is_builtin())
 
7642
+           {
 
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;
 
7648
+           }
 
7649
+         descriptor = no->func_declaration_value()->descriptor(gogo, no);
 
7650
+       }
 
7651
+      else
 
7652
+       go_unreachable();
 
7653
 
 
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);
 
7661
+    }
 
7662
 
 
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;
 
7666
-
 
7667
-  // If there is no closure, that is all have to do.
 
7668
-  if (this->closure_ == NULL)
 
7669
-    return fnaddr;
 
7670
-
 
7671
   go_assert(this->function_->func_value()->enclosing() != NULL);
 
7672
 
 
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)));
 
7679
-
 
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.
 
7685
-
 
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);
 
7692
 }
 
7693
 
 
7694
 // Ast dump for function.
 
7695
@@ -1361,6 +1367,197 @@
 
7696
   return new Func_expression(function, closure, location);
 
7697
 }
 
7698
 
 
7699
+// Class Func_descriptor_expression.
 
7700
+
 
7701
+// Constructor.
 
7702
+
 
7703
+Func_descriptor_expression::Func_descriptor_expression(Named_object* fn)
 
7704
+  : Expression(EXPRESSION_FUNC_DESCRIPTOR, fn->location()),
 
7705
+    fn_(fn), dfn_(NULL), dvar_(NULL)
 
7706
+{
 
7707
+  go_assert(!fn->is_function() || !fn->func_value()->needs_closure());
 
7708
+}
 
7709
+
 
7710
+// Traversal.
 
7711
+
 
7712
+int
 
7713
+Func_descriptor_expression::do_traverse(Traverse*)
 
7714
+{
 
7715
+  return TRAVERSE_CONTINUE;
 
7716
+}
 
7717
+
 
7718
+// All function descriptors have the same type.
 
7719
+
 
7720
+Type* Func_descriptor_expression::descriptor_type;
 
7721
+
 
7722
+void
 
7723
+Func_descriptor_expression::make_func_descriptor_type()
 
7724
+{
 
7725
+  if (Func_descriptor_expression::descriptor_type != NULL)
 
7726
+    return;
 
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);
 
7731
+}
 
7732
+
 
7733
+Type*
 
7734
+Func_descriptor_expression::do_type()
 
7735
+{
 
7736
+  Func_descriptor_expression::make_func_descriptor_type();
 
7737
+  return Func_descriptor_expression::descriptor_type;
 
7738
+}
 
7739
+
 
7740
+// Copy a Func_descriptor_expression;
 
7741
+
 
7742
+Expression*
 
7743
+Func_descriptor_expression::do_copy()
 
7744
+{
 
7745
+  Func_descriptor_expression* fde =
 
7746
+    Expression::make_func_descriptor(this->fn_);
 
7747
+  if (this->dfn_ != NULL)
 
7748
+    fde->set_descriptor_wrapper(this->dfn_);
 
7749
+  return fde;
 
7750
+}
 
7751
+
 
7752
+// The tree for a function descriptor.
 
7753
+
 
7754
+tree
 
7755
+Func_descriptor_expression::do_get_tree(Translate_context* context)
 
7756
+{
 
7757
+  if (this->dvar_ != NULL)
 
7758
+    return var_to_tree(this->dvar_);
 
7759
+
 
7760
+  Gogo* gogo = context->gogo();
 
7761
+  Named_object* no = this->fn_;
 
7762
+  Location loc = no->location();
 
7763
+
 
7764
+  std::string var_name;
 
7765
+  if (no->package() == NULL)
 
7766
+    var_name = gogo->pkgpath_symbol();
 
7767
+  else
 
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");
 
7772
+
 
7773
+  Btype* btype = this->type()->get_backend(gogo);
 
7774
+
 
7775
+  Bvariable* bvar;
 
7776
+  if (no->package() != NULL
 
7777
+      || Linemap::is_predeclared_location(no->location()))
 
7778
+    {
 
7779
+      bvar = context->backend()->immutable_struct_reference(var_name, btype,
 
7780
+                                                           loc);
 
7781
+      go_assert(this->dfn_ == NULL);
 
7782
+    }
 
7783
+  else
 
7784
+    {
 
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,
 
7790
+                                                 btype, bloc);
 
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);
 
7801
+    }
 
7802
+
 
7803
+  this->dvar_ = bvar;
 
7804
+  return var_to_tree(bvar);
 
7805
+}
 
7806
+
 
7807
+// Print a function descriptor expression.
 
7808
+
 
7809
+void
 
7810
+Func_descriptor_expression::do_dump_expression(Ast_dump_context* context) const
 
7811
+{
 
7812
+  context->ostream() << "[descriptor " << this->fn_->name() << "]";
 
7813
+}
 
7814
+
 
7815
+// Make a function descriptor expression.
 
7816
+
 
7817
+Func_descriptor_expression*
 
7818
+Expression::make_func_descriptor(Named_object* fn)
 
7819
+{
 
7820
+  return new Func_descriptor_expression(fn);
 
7821
+}
 
7822
+
 
7823
+// Make the function descriptor type, so that it can be converted.
 
7824
+
 
7825
+void
 
7826
+Expression::make_func_descriptor_type()
 
7827
+{
 
7828
+  Func_descriptor_expression::make_func_descriptor_type();
 
7829
+}
 
7830
+
 
7831
+// A reference to just the code of a function.
 
7832
+
 
7833
+class Func_code_reference_expression : public Expression
 
7834
+{
 
7835
+ public:
 
7836
+  Func_code_reference_expression(Named_object* function, Location location)
 
7837
+    : Expression(EXPRESSION_FUNC_CODE_REFERENCE, location),
 
7838
+      function_(function)
 
7839
+  { }
 
7840
+
 
7841
+ protected:
 
7842
+  int
 
7843
+  do_traverse(Traverse*)
 
7844
+  { return TRAVERSE_CONTINUE; }
 
7845
+
 
7846
+  Type*
 
7847
+  do_type()
 
7848
+  { return Type::make_pointer_type(Type::make_void_type()); }
 
7849
+
 
7850
+  void
 
7851
+  do_determine_type(const Type_context*)
 
7852
+  { }
 
7853
+
 
7854
+  Expression*
 
7855
+  do_copy()
 
7856
+  {
 
7857
+    return Expression::make_func_code_reference(this->function_,
 
7858
+                                               this->location());
 
7859
+  }
 
7860
+
 
7861
+  tree
 
7862
+  do_get_tree(Translate_context*);
 
7863
+
 
7864
+  void
 
7865
+  do_dump_expression(Ast_dump_context* context) const
 
7866
+  { context->ostream() << "[raw " << this->function_->name() << "]" ; }
 
7867
+
 
7868
+ private:
 
7869
+  // The function.
 
7870
+  Named_object* function_;
 
7871
+};
 
7872
+
 
7873
+// Get the tree for a reference to function code.
 
7874
+
 
7875
+tree
 
7876
+Func_code_reference_expression::do_get_tree(Translate_context* context)
 
7877
+{
 
7878
+  return Func_expression::get_code_pointer(context->gogo(), this->function_,
 
7879
+                                          this->location());
 
7880
+}
 
7881
+
 
7882
+// Make a reference to the code of a function.
 
7883
+
 
7884
+Expression*
 
7885
+Expression::make_func_code_reference(Named_object* function, Location location)
 
7886
+{
 
7887
+  return new Func_code_reference_expression(function, location);
 
7888
+}
 
7889
+
 
7890
 // Class Unknown_expression.
 
7891
 
 
7892
 // Return the name of an unknown expression.
 
7893
@@ -6722,6 +6919,26 @@
 
7894
       return Expression::make_error(loc);
 
7895
     }
 
7896
 
 
7897
+  if (this->code_ == BUILTIN_OFFSETOF)
 
7898
+    {
 
7899
+      Expression* arg = this->one_arg();
 
7900
+      Field_reference_expression* farg = arg->field_reference_expression();
 
7901
+      while (farg != NULL)
 
7902
+       {
 
7903
+         if (!farg->implicit())
 
7904
+           break;
 
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())
 
7908
+           {
 
7909
+             this->report_error(_("argument of Offsetof implies indirection of an embedded field"));
 
7910
+             return this;
 
7911
+           }
 
7912
+         // Go up until we reach the original base.
 
7913
+         farg = farg->expr()->field_reference_expression();
 
7914
+       }
 
7915
+    }
 
7916
 
7917
   if (this->is_constant())
 
7918
     {
 
7919
       Numeric_constant nc;
 
7920
@@ -7279,19 +7496,31 @@
 
7921
       Field_reference_expression* farg = arg->field_reference_expression();
 
7922
       if (farg == NULL)
 
7923
        return false;
 
7924
-      Expression* struct_expr = farg->expr();
 
7925
-      Type* st = struct_expr->type();
 
7926
-      if (st->struct_type() == NULL)
 
7927
-       return false;
 
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(),
 
7933
-                                                  &offset))
 
7934
-       return false;
 
7935
+      unsigned int total_offset = 0;
 
7936
+      while (true)
 
7937
+        {
 
7938
+          Expression* struct_expr = farg->expr();
 
7939
+          Type* st = struct_expr->type();
 
7940
+          if (st->struct_type() == NULL)
 
7941
+            return false;
 
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(),
 
7947
+                                                      &offset))
 
7948
+            return false;
 
7949
+          total_offset += offset;
 
7950
+          if (farg->implicit() && struct_expr->field_reference_expression() != NULL)
 
7951
+            {
 
7952
+              // Go up until we reach the original base.
 
7953
+              farg = struct_expr->field_reference_expression();
 
7954
+              continue;
 
7955
+            }
 
7956
+          break;
 
7957
+        }
 
7958
       nc->set_unsigned_long(Type::lookup_integer_type("uintptr"),
 
7959
-                           static_cast<unsigned long>(offset));
 
7960
+                           static_cast<unsigned long>(total_offset));
 
7961
       return true;
 
7962
     }
 
7963
   else if (this->code_ == BUILTIN_REAL || this->code_ == BUILTIN_IMAG)
 
7964
@@ -8509,6 +8738,74 @@
 
7965
 
 
7966
 // Class Call_expression.
 
7967
 
 
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
 
7972
+// struct.
 
7973
+
 
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
 
7979
+// closure.
 
7980
+
 
7981
+// There are a few cases to consider.
 
7982
+
 
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.
 
7987
+
 
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.
 
7993
+
 
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.
 
7997
+
 
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.
 
8001
+
 
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.
 
8013
+
 
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.
 
8019
+
 
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.
 
8023
+
 
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.
 
8031
+
 
8032
+// Note that the Go code retains the Go types.  The extra final
 
8033
+// argument only appears when we convert to the backend
 
8034
+// representation.
 
8035
+
 
8036
 // Traversal.
 
8037
 
 
8038
 int
 
8039
@@ -9117,11 +9414,21 @@
 
8040
   const bool has_closure = func != NULL && func->closure() != NULL;
 
8041
   const bool is_interface_method = interface_method != NULL;
 
8042
 
 
8043
+  int closure_arg;
 
8044
+  if (has_closure)
 
8045
+    closure_arg = 1;
 
8046
+  else if (func != NULL)
 
8047
+    closure_arg = 0;
 
8048
+  else if (is_interface_method)
 
8049
+    closure_arg = 0;
 
8050
+  else
 
8051
+    closure_arg = 1;
 
8052
+
 
8053
   int nargs;
 
8054
   tree* args;
 
8055
   if (this->args_ == NULL || this->args_->empty())
 
8056
     {
 
8057
-      nargs = is_interface_method ? 1 : 0;
 
8058
+      nargs = (is_interface_method ? 1 : 0) + closure_arg;
 
8059
       args = nargs == 0 ? NULL : new tree[nargs];
 
8060
     }
 
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);
 
8066
-      nargs = 1;
 
8067
+      nargs = 1 + closure_arg;
 
8068
       args = new tree[nargs];
 
8069
       args[0] = this->args_->front()->get_tree(context);
 
8070
     }
 
8071
@@ -9141,6 +9448,7 @@
 
8072
       nargs = this->args_->size();
 
8073
       int i = is_interface_method ? 1 : 0;
 
8074
       nargs += i;
 
8075
+      nargs += closure_arg;
 
8076
       args = new tree[nargs];
 
8077
 
 
8078
       Typed_identifier_list::const_iterator pp = params->begin();
 
8079
@@ -9161,36 +9469,71 @@
 
8080
                                                       arg_val,
 
8081
                                                       location);
 
8082
          if (args[i] == error_mark_node)
 
8083
-           {
 
8084
-             delete[] args;
 
8085
-             return error_mark_node;
 
8086
-           }
 
8087
+           return error_mark_node;
 
8088
        }
 
8089
       go_assert(pp == params->end());
 
8090
-      go_assert(i == nargs);
 
8091
+      go_assert(i + closure_arg == nargs);
 
8092
     }
 
8093
 
 
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;
 
8109
+
 
8110
+  tree fn;
 
8111
+  if (func != NULL)
 
8112
     {
 
8113
-      delete[] args;
 
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);
 
8119
+      if (has_closure)
 
8120
+       {
 
8121
+         go_assert(closure_arg == 1 && nargs > 0);
 
8122
+         args[nargs - 1] = func->closure()->get_tree(context);
 
8123
+       }
 
8124
     }
 
8125
-
 
8126
-  tree fn;
 
8127
-  if (has_closure)
 
8128
-    fn = func->get_tree_without_closure(gogo);
 
8129
   else if (!is_interface_method)
 
8130
-    fn = this->fn_->get_tree(context);
 
8131
+    {
 
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,
 
8136
+                                 closure_tree);
 
8137
+      go_assert(POINTER_TYPE_P(TREE_TYPE(fnc))
 
8138
+               && (TREE_CODE(TREE_TYPE(TREE_TYPE(fnc)))
 
8139
+                   == RECORD_TYPE));
 
8140
+      tree field = TYPE_FIELDS(TREE_TYPE(TREE_TYPE(fnc)));
 
8141
+      fn = fold_build3_loc(location.gcc_location(), COMPONENT_REF,
 
8142
+                          TREE_TYPE(field),
 
8143
+                          build_fold_indirect_ref_loc(location.gcc_location(),
 
8144
+                                                      fnc),
 
8145
+                          field, NULL_TREE);
 
8146
+      go_assert(closure_arg == 1 && nargs > 0);
 
8147
+      args[nargs - 1] = closure_tree;
 
8148
+    }      
 
8149
   else
 
8150
-    fn = this->interface_method_function(context, interface_method, &args[0]);
 
8151
-
 
8152
-  if (fn == error_mark_node || TREE_TYPE(fn) == error_mark_node)
 
8153
     {
 
8154
-      delete[] args;
 
8155
-      return error_mark_node;
 
8156
+      fn = this->interface_method_function(context, interface_method,
 
8157
+                                          &args[0]);
 
8158
+      if (fn == error_mark_node)
 
8159
+       return error_mark_node;
 
8160
+      go_assert(closure_arg == 0);
 
8161
     }
 
8162
 
 
8163
+  if (fn == error_mark_node || TREE_TYPE(fn) == error_mark_node)
 
8164
+    return error_mark_node;
 
8165
+
 
8166
   tree fndecl = fn;
 
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))
 
8173
-    {
 
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);
 
8178
-    }
 
8179
+    fn = fold_convert_loc(location.gcc_location(), fnfield_type, fn);
 
8180
 
 
8181
   // This is to support builtin math functions when using 80387 math.
 
8182
   tree excess_type = NULL_TREE;
 
8183
@@ -9247,13 +9585,6 @@
 
8184
 
 
8185
   SET_EXPR_LOCATION(ret, location.gcc_location());
 
8186
 
 
8187
-  if (has_closure)
 
8188
-    {
 
8189
-      tree closure_tree = func->closure()->get_tree(context);
 
8190
-      if (closure_tree != error_mark_node)
 
8191
-       CALL_EXPR_STATIC_CHAIN(ret) = closure_tree;
 
8192
-    }
 
8193
-
 
8194
   // If this is a recursive function type which returns itself, as in
 
8195
   //   type F func() F
 
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);
 
8200
 
 
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.
 
8203
-  if (func == NULL)
 
8204
-    {
 
8205
-      tree compare = fold_build2_loc(location.gcc_location(), EQ_EXPR,
 
8206
-                                    boolean_type_node, fn,
 
8207
-                                    fold_convert_loc(location.gcc_location(),
 
8208
-                                                     TREE_TYPE(fn),
 
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,
 
8213
-                                                 location),
 
8214
-                             NULL_TREE);
 
8215
-      ret = fold_build2_loc(location.gcc_location(), COMPOUND_EXPR,
 
8216
-                           TREE_TYPE(ret), crash, ret);
 
8217
-    }
 
8218
-
 
8219
   this->tree_ = ret;
 
8220
 
 
8221
   return 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.
 
8226
-
 
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)
 
8232
     {
 
8233
       Named_object* mno = (method->needs_stub_method()
 
8234
                           ? method->stub_object()
 
8235
Index: gcc/recog.c
 
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);
 
8245
-#endif
 
8246
 
 
8247
   if (CONSTANT_ADDRESS_P (y))
 
8248
     return 1;
 
8249
@@ -1962,6 +1959,13 @@
 
8250
   if (mode_dependent_address_p (y, as))
 
8251
     return 0;
 
8252
 
 
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);
 
8258
+#endif
 
8259
+
 
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 @@
 
8264
       int good;
 
8265
 
 
8266
       y1 = *y2;
 
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
 
8274
       && mode != BLKmode
 
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),
 
8280
                                       mode_sz - 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),
 
8289
                                            mode_sz - 1));
 
8290
 #endif
 
8291
   else
 
8292
-    z = plus_constant (GET_MODE (y), y, mode_sz - 1);
 
8293
+    z = plus_constant (address_mode, y, mode_sz - 1);
 
8294
 
 
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)
 
8301
@@ -436,7 +436,7 @@
 
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.
 
8304
 
 
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
 
8309
    --  clauses).
 
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)
 
8314
@@ -1,3 +1,20 @@
 
8315
+2013-06-13  Eric Botcazou  <ebotcazou@adacore.com>
 
8316
+
 
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
 
8325
+       dereference.
 
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.
 
8331
+
 
8332
 2013-05-31  Release Manager
 
8333
 
 
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 @@
 
8340
 
 
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
 
8345
-   passed.  */
 
8346
+   pointer type of GNU_EXPR.  GNAT_SUBPROG is the subprogram to which the
 
8347
+   descriptor is passed.  */
 
8348
 
 
8349
 tree
 
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)
 
8353
 {
 
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;
 
8361
 
 
8362
-  if (by_ref)
 
8363
-    real_type = TREE_TYPE (gnu_type);
 
8364
-  else
 
8365
-    real_type = gnu_type;
 
8366
-
 
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)
 
8370
     {
 
8371
-      tree ret = convert_vms_descriptor32 (real_type, gnu_expr, gnat_subprog);
 
8372
-      if (by_ref)
 
8373
-       ret = build_unary_op (ADDR_EXPR, gnu_type, ret);
 
8374
+      tree ret = convert_vms_descriptor32 (gnu_type, gnu_expr, gnat_subprog);
 
8375
       return ret;
 
8376
     }
 
8377
 
 
8378
@@ -4116,14 +4108,9 @@
 
8379
                                        integer_minus_one_node));
 
8380
 
 
8381
   /* Build the 2 possible end results.  */
 
8382
-  gnu_expr64 = convert_vms_descriptor64 (real_type, gnu_expr, gnat_subprog);
 
8383
-  if (by_ref)
 
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);
 
8388
-  if (by_ref)
 
8389
-    gnu_expr32 =  build_unary_op (ADDR_EXPR, gnu_type, gnu_expr32);
 
8390
-
 
8391
+  gnu_expr32 = convert_vms_descriptor32 (gnu_type, gnu_expr, gnat_subprog);
 
8392
   return build3 (COND_EXPR, gnu_type, is64bit, gnu_expr64, gnu_expr32);
 
8393
 }
 
8394
 
 
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);
 
8401
                        saved = true;
 
8402
                        annotate_object (gnat_entity, gnu_type, NULL_TREE,
 
8403
-                                        false, false);
 
8404
+                                        false);
 
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);
 
8413
+                        used_by_ref);
 
8414
       }
 
8415
       break;
 
8416
 
 
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;
 
8423
   tree gnu_param;
 
8424
 
 
8425
   /* Copy-return is used only for the first parameter of a valued procedure.
 
8426
@@ -5720,19 +5720,6 @@
 
8427
        gnu_param_type
 
8428
          = build_qualified_type (gnu_param_type, TYPE_QUAL_RESTRICT);
 
8429
       by_ref = true;
 
8430
-
 
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),
 
8437
-                                             gnu_param_type,
 
8438
-                                             true))
 
8439
-       {
 
8440
-          gnu_param_type = build_reference_type (gnu_param_type);
 
8441
-          by_double_ref = true;
 
8442
-       }
 
8443
     }
 
8444
 
 
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.  */
 
8461
 
 
8462
 void
 
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)
 
8466
 {
 
8467
   if (by_ref)
 
8468
     {
 
8469
-      if (by_double_ref)
 
8470
-       gnu_type = TREE_TYPE (gnu_type);
 
8471
-
 
8472
       if (TYPE_IS_FAT_POINTER_P (gnu_type))
 
8473
        gnu_type = TYPE_UNCONSTRAINED_ARRAY (gnu_type);
 
8474
       else
 
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);
 
8488
+                            bool by_ref);
 
8489
 
 
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 @@
 
8493
 
 
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
 
8498
-   passed.  */
 
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);
 
8505
 
 
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))
 
8514
 
 
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))
 
8518
-
 
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))
 
8521
 
 
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 @@
 
8527
     {
 
8528
       const bool read_only = DECL_POINTS_TO_READONLY_P (gnu_result);
 
8529
 
 
8530
-      /* First do the first dereference if needed.  */
 
8531
-      if (TREE_CODE (gnu_result) == PARM_DECL
 
8532
-         && DECL_BY_DOUBLE_REF_P (gnu_result))
 
8533
-       {
 
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;
 
8537
-
 
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;
 
8541
-       }
 
8542
-
 
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),
 
8548
                                      gnu_stub_param,
 
8549
                                      DECL_PARM_ALT_TYPE (gnu_stub_param),
 
8550
-                                     DECL_BY_DOUBLE_REF_P (gnu_subprog_param),
 
8551
                                      gnat_subprog);
 
8552
        }
 
8553
       else
 
8554
@@ -3546,8 +3532,7 @@
 
8555
       bool is_var_decl = (TREE_CODE (gnu_param) == VAR_DECL);
 
8556
 
 
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));
 
8561
 
 
8562
       if (is_var_decl)
 
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);
 
8568
-
 
8569
-         if (DECL_BY_DOUBLE_REF_P (gnu_formal))
 
8570
-           gnu_actual
 
8571
-             = build_unary_op (ADDR_EXPR, TREE_TYPE (gnu_formal_type),
 
8572
-                               gnu_actual);
 
8573
-
 
8574
          gnu_actual = build_unary_op (ADDR_EXPR, gnu_formal_type, gnu_actual);
 
8575
        }
 
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)
 
8583
 {
 
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)))
 
8588
     {
 
8589
       snprintf (errmsg, err_len, "Type/rank mismatch in argument '%s'",
 
8590
                s1->name);
 
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)
 
8595
@@ -1,3 +1,23 @@
 
8596
+2013-06-11  Tobias Burnus  <burnus@net-b.de>
 
8597
+
 
8598
+       PR fortran/57508
 
8599
+       * resolve.c (get_temp_from_expr): Don't copy function
 
8600
+       result attributes to temporary.
 
8601
+
 
8602
+2013-06-04  Tobias Burnus  <burnus@net-b.de>
 
8603
+
 
8604
+       Backport from mainline
 
8605
+       2013-05-22  Tobias Burnus  <burnus@net-b.de>
 
8606
+
 
8607
+       PR fortran/57364
 
8608
+       * resolve.c (get_temp_from_expr): Commit created sym.
 
8609
+
 
8610
+2013-05-31  Janus Weil  <janus@gcc.gnu.org>
 
8611
+           Tobias Burnus  <burnus@net-b.de>
 
8612
+
 
8613
+       PR fortran/57217
 
8614
+       * interface.c (check_dummy_characteristics): Symmetrize type check.
 
8615
+
 
8616
 2013-05-31  Release Manager
 
8617
 
 
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 @@
 
8624
 
 
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;
 
8630
+
 
8631
   if (as)
 
8632
     {
 
8633
       tmp->n.sym->as = gfc_copy_array_spec (as);
 
8634
@@ -9759,6 +9763,7 @@
 
8635
 
 
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);
 
8640
 
 
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 @@
 
8647
        tls_first_major=0
 
8648
        tls_first_minor=0
 
8649
        ;;
 
8650
-  powerpc-*-*)
 
8651
+  powerpc64*-*-*)
 
8652
     conftest_s='
 
8653
        .section ".tdata","awT",@progbits
 
8654
-       .align 2
 
8655
-ld0:   .space 4
 
8656
-ld1:   .space 4
 
8657
-x1:    .space 4
 
8658
-x2:    .space 4
 
8659
-x3:    .space 4
 
8660
-       .text
 
8661
-       addi 3,31,ld0@got@tlsgd
 
8662
-       bl __tls_get_addr
 
8663
-       addi 3,31,x1@got@tlsld
 
8664
-       bl __tls_get_addr
 
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)
 
8669
-       add 9,9,x@tls
 
8670
-       addi 9,2,x1@tprel
 
8671
-       addis 9,2,x2@tprel@ha
 
8672
-       addi 9,9,x2@tprel@l'
 
8673
-       tls_first_major=2
 
8674
-       tls_first_minor=14
 
8675
-       tls_as_opt="-a32 --fatal-warnings"
 
8676
-       ;;
 
8677
-  powerpc64-*-*)
 
8678
-    conftest_s='
 
8679
-       .section ".tdata","awT",@progbits
 
8680
        .align 3
 
8681
 ld0:   .space 8
 
8682
 ld1:   .space 8
 
8683
@@ -3104,6 +3078,32 @@
 
8684
        tls_first_minor=14
 
8685
        tls_as_opt="-a64 --fatal-warnings"
 
8686
        ;;
 
8687
+  powerpc*-*-*)
 
8688
+    conftest_s='
 
8689
+       .section ".tdata","awT",@progbits
 
8690
+       .align 2
 
8691
+ld0:   .space 4
 
8692
+ld1:   .space 4
 
8693
+x1:    .space 4
 
8694
+x2:    .space 4
 
8695
+x3:    .space 4
 
8696
+       .text
 
8697
+       addi 3,31,ld0@got@tlsgd
 
8698
+       bl __tls_get_addr
 
8699
+       addi 3,31,x1@got@tlsld
 
8700
+       bl __tls_get_addr
 
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)
 
8705
+       add 9,9,x@tls
 
8706
+       addi 9,2,x1@tprel
 
8707
+       addis 9,2,x2@tprel@ha
 
8708
+       addi 9,9,x2@tprel@l'
 
8709
+       tls_first_major=2
 
8710
+       tls_first_minor=14
 
8711
+       tls_as_opt="-a32 --fatal-warnings"
 
8712
+       ;;
 
8713
   s390-*-*)
 
8714
     conftest_s='
 
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*)
 
8719
   case "$target" in
 
8720
+     *le-*-linux*)
 
8721
+     emul_name="-melf64lppc"
 
8722
+      ;;
 
8723
      *-*-linux*)
 
8724
      emul_name="-melf64ppc"
 
8725
       ;;
 
8726
@@ -4611,7 +4614,7 @@
 
8727
     ])
 
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.])
 
8732
     fi
 
8733
     ;;
 
8734
 esac
 
8735
Index: gcc/gcc-ar.c
 
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)
 
8739
@@ -136,7 +136,7 @@
 
8740
   setup_prefixes (av[0]);
 
8741
 
 
8742
   /* Find the GCC LTO plugin */
 
8743
-  plugin = find_a_file (&target_path, LTOPLUGINSONAME);
 
8744
+  plugin = find_a_file (&target_path, LTOPLUGINSONAME, R_OK);
 
8745
   if (!plugin)
 
8746
     {
 
8747
       fprintf (stderr, "%s: Cannot find plugin '%s'\n", av[0], LTOPLUGINSONAME);
 
8748
@@ -144,24 +144,20 @@
 
8749
     }
 
8750
 
 
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);
 
8754
   if (!exe_name)
 
8755
     {
 
8756
+      const char *real_exe_name = PERSONALITY;
 
8757
 #ifdef CROSS_DIRECTORY_STRUCTURE
 
8758
-      const char *cross_exe_name;
 
8759
-
 
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);
 
8763
+#endif
 
8764
+      exe_name = find_a_file (&path, real_exe_name, X_OK);
 
8765
       if (!exe_name)
 
8766
        {
 
8767
          fprintf (stderr, "%s: Cannot find binary '%s'\n", av[0],
 
8768
-                  cross_exe_name);
 
8769
+                  real_exe_name);
 
8770
          exit (1);
 
8771
        }
 
8772
-#else
 
8773
-      fprintf (stderr, "%s: Cannot find binary '%s'\n", av[0], PERSONALITY);
 
8774
-      exit (1);
 
8775
-#endif
 
8776
     }
 
8777
 
 
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;
 
8788
+       {
 
8789
+         half_type1 = half_type0;
 
8790
+         oprnd1 = fold_convert (half_type1, oprnd1);
 
8791
+       }
 
8792
       else
 
8793
         return NULL;
 
8794
     }
 
8795
Index: gcc/ira.c
 
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 @@
 
8800
     }
 
8801
 }
 
8802
 
 
8803
+/* Check whether the SUBREG is a paradoxical subreg and set the result
 
8804
+   in PDX_SUBREGS.  */
 
8805
+
 
8806
+static int
 
8807
+set_paradoxical_subreg (rtx *subreg, void *pdx_subregs)
 
8808
+{
 
8809
+  rtx reg;
 
8810
+
 
8811
+  if ((*subreg) == NULL_RTX)
 
8812
+    return 1;
 
8813
+  if (GET_CODE (*subreg) != SUBREG)
 
8814
+    return 0;
 
8815
+  reg = SUBREG_REG (*subreg);
 
8816
+  if (!REG_P (reg))
 
8817
+    return 0;
 
8818
+
 
8819
+  if (paradoxical_subreg_p (*subreg))
 
8820
+    ((bool *)pdx_subregs)[REGNO (reg)] = true;
 
8821
+
 
8822
+  return 0;
 
8823
+}
 
8824
+
 
8825
 /* In DEBUG_INSN location adjust REGs from CLEARED_REGS bitmap to the
 
8826
    equivalent replacement.  */
 
8827
 
 
8828
@@ -2901,16 +2923,33 @@
 
8829
   basic_block bb;
 
8830
   int loop_depth;
 
8831
   bitmap cleared_regs;
 
8832
+  bool *pdx_subregs;
 
8833
 
 
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;
 
8837
 
 
8838
+  /* Use pdx_subregs to show whether a reg is used in a paradoxical
 
8839
+     subreg.  */
 
8840
+  pdx_subregs = XCNEWVEC (bool, max_regno);
 
8841
+
 
8842
   reg_equiv = XCNEWVEC (struct equivalence, max_regno);
 
8843
   grow_reg_equivs ();
 
8844
 
 
8845
   init_alias_analysis ();
 
8846
 
 
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.  */
 
8851
+  FOR_EACH_BB (bb)
 
8852
+    FOR_BB_INSNS (bb, insn)
 
8853
+      {
 
8854
+       if (! INSN_P (insn))
 
8855
+         continue;
 
8856
+       for_each_rtx (&insn, set_paradoxical_subreg, (void *)pdx_subregs);
 
8857
+      }
 
8858
+
 
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 @@
 
8863
              continue;
 
8864
            }
 
8865
 
 
8866
+         /* Don't set reg (if pdx_subregs[regno] == true) equivalent to a mem.  */
 
8867
+         if (MEM_P (src) && pdx_subregs[regno])
 
8868
+           {
 
8869
+             note_stores (set, no_equiv, NULL);
 
8870
+             continue;
 
8871
+           }
 
8872
+
 
8873
          note = find_reg_note (insn, REG_EQUAL, NULL_RTX);
 
8874
 
 
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])
 
8883
        {
 
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 @@
 
8887
 
 
8888
   end_alias_analysis ();
 
8889
   free (reg_equiv);
 
8890
+  free (pdx_subregs);
 
8891
   return recorded_label_ref;
 
8892
 }
 
8893
 
 
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"
 
8901
        ;;
 
8902
-powerpc-*-linux* | powerpc64-*-linux*)
 
8903
+powerpc*-*-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"
 
8907
+       case ${target} in
 
8908
+           powerpc*le-*-*)
 
8909
+           tm_file="${tm_file} rs6000/sysv4le.h" ;;
 
8910
+       esac
 
8911
        maybe_biarch=yes
 
8912
        case ${target} in
 
8913
-           powerpc64-*-linux*spe* | powerpc64-*-linux*paired*)
 
8914
+           powerpc64*-*-linux*spe* | powerpc64*-*-linux*paired*)
 
8915
                echo "*** Configuration ${target} not supported" 1>&2
 
8916
                exit 1
 
8917
                ;;
 
8918
-           powerpc-*-linux*spe* | powerpc-*-linux*paired*)
 
8919
+           powerpc*-*-linux*spe* | powerpc*-*-linux*paired*)
 
8920
                maybe_biarch=
 
8921
                ;;
 
8922
-           powerpc64-*-linux*)
 
8923
+           powerpc64*-*-linux*)
 
8924
                test x$with_cpu != x || cpu_is_64bit=yes
 
8925
                maybe_biarch=always
 
8926
                ;;
 
8927
Index: gcc/tlink.c
 
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 @@
 
8932
 void
 
8933
 do_tlink (char **ld_argv, char **object_lst ATTRIBUTE_UNUSED)
 
8934
 {
 
8935
-  int exit = tlink_execute ("ld", ld_argv, ldout, lderrout);
 
8936
+  int ret = tlink_execute ("ld", ld_argv, ldout, lderrout);
 
8937
 
 
8938
   tlink_init ();
 
8939
 
 
8940
-  if (exit)
 
8941
+  if (ret)
 
8942
     {
 
8943
       int i = 0;
 
8944
 
 
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)
 
8950
          {
 
8951
            if (tlink_verbose >= 3)
 
8952
              {
 
8953
@@ -843,7 +843,7 @@
 
8954
              break;
 
8955
            if (tlink_verbose)
 
8956
              fprintf (stderr, _("collect: relinking\n"));
 
8957
-           exit = tlink_execute ("ld", ld_argv, ldout, lderrout);
 
8958
+           ret = tlink_execute ("ld", ld_argv, ldout, lderrout);
 
8959
          }
 
8960
     }
 
8961
 
 
8962
@@ -851,10 +851,10 @@
 
8963
   unlink (ldout);
 
8964
   dump_ld_file (lderrout, stderr);
 
8965
   unlink (lderrout);
 
8966
-  if (exit)
 
8967
+  if (ret)
 
8968
     {
 
8969
-      error ("ld returned %d exit status", exit);
 
8970
-      collect_exit (exit);
 
8971
+      error ("ld returned %d exit status", ret);
 
8972
+      exit (ret);
 
8973
     }
 
8974
   else
 
8975
     {
 
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)
 
8980
@@ -23,6 +23,7 @@
 
8981
 ;; Uses of UNSPEC in this file:
 
8982
 
 
8983
 (define_c_enum "unspec" [
 
8984
+  UNSPEC_XFLT_COMPARE
 
8985
   UNSPEC_ARG_HOME
 
8986
   UNSPEC_LDGP1
 
8987
   UNSPEC_INSXH
 
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 @@
 
8993
       break;
 
8994
 
 
8995
     case GE:  case GT:  case GEU:  case GTU:
 
8996
-      /* These must be swapped.  */
 
8997
-      if (op1 != CONST0_RTX (cmp_mode))
 
8998
-       {
 
8999
-         code = swap_condition (code);
 
9000
-         tem = op0, op0 = op1, op1 = tem;
 
9001
-       }
 
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)
 
9005
+       break;
 
9006
+      code = swap_condition (code);
 
9007
+      tem = op0, op0 = op1, op1 = tem;
 
9008
       break;
 
9009
 
 
9010
     default:
 
9011
@@ -3067,12 +3067,9 @@
 
9012
   operands[1] = op1;
 
9013
   out = gen_reg_rtx (DImode);
 
9014
 
 
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);
 
9025
 
 
9026
   return out;
 
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 @@
 
9052
 
 
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 @@
 
9061
     }
 
9062
 }
 
9063
 
 
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.  */
 
9068
+
 
9069
+static void
 
9070
+ix86_seh_fixup_eh_fallthru (void)
 
9071
+{
 
9072
+  edge e;
 
9073
+  edge_iterator ei;
 
9074
+
 
9075
+  FOR_EACH_EDGE (e, ei, EXIT_BLOCK_PTR->preds)
 
9076
+    {
 
9077
+      rtx insn, next;
 
9078
+
 
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)
 
9082
+         break;
 
9083
+      if (insn == NULL)
 
9084
+       continue;
 
9085
+
 
9086
+      /* We only care about preceeding insns that can throw.  */
 
9087
+      insn = prev_active_insn (insn);
 
9088
+      if (insn == NULL || !can_throw_internal (insn))
 
9089
+       continue;
 
9090
+
 
9091
+      /* Do not separate calls from their debug information.  */
 
9092
+      for (next = NEXT_INSN (insn); next != NULL; next = NEXT_INSN (next))
 
9093
+       if (NOTE_P (next)
 
9094
+            && (NOTE_KIND (next) == NOTE_INSN_VAR_LOCATION
 
9095
+                || NOTE_KIND (next) == NOTE_INSN_CALL_ARG_LOCATION))
 
9096
+         insn = next;
 
9097
+       else
 
9098
+         break;
 
9099
+
 
9100
+      emit_insn_after (gen_nops (const1_rtx), insn);
 
9101
+    }
 
9102
+}
 
9103
+
 
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.  */
 
9106
 static void
 
9107
@@ -35453,6 +35493,9 @@
 
9108
      with old MDEP_REORGS that are not CFG based.  Recompute it now.  */
 
9109
   compute_bb_for_insn ();
 
9110
 
 
9111
+  if (TARGET_SEH && current_function_has_exception_handlers ())
 
9112
+    ix86_seh_fixup_eh_fallthru ();
 
9113
+
 
9114
   if (optimize && optimize_function_for_speed_p (cfun))
 
9115
     {
 
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 @@
 
9122
 
 
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"
 
9134
 {
 
9135
   if (TARGET_SH2E)
 
9136
@@ -12107,6 +12107,43 @@
 
9137
   "fmac.s %1, %2, %0"
 
9138
   [(set_attr "type" "fparith_media")])
 
9139
 
 
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"
 
9150
+  "fmac        %1,%2,%0"
 
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))])]
 
9155
+{
 
9156
+  /* Change 'b * a + a' into 'a * b + a'.
 
9157
+     This is better for register allocation.  */
 
9158
+  if (REGNO (operands[2]) == REGNO (operands[3]))
 
9159
+    {
 
9160
+      rtx tmp = operands[1];
 
9161
+      operands[1] = operands[2];
 
9162
+      operands[2] = tmp;
 
9163
+    }
 
9164
+}
 
9165
+  [(set_attr "type" "fp")
 
9166
+   (set_attr "fp_mode" "single")])
 
9167
+
 
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")])
 
9176
+
 
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);
 
9186
          return;
 
9187
        }
 
9188
-      asm_fprintf (f, "0x%x", UINTVAL (x));
 
9189
+      asm_fprintf (f, "0x%wx", UINTVAL (x));
 
9190
       break;
 
9191
 
 
9192
     case 'w':
 
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)
 
9197
@@ -79,6 +79,24 @@
 
9198
 #undef LINK_OS_DEFAULT_SPEC
 
9199
 #define LINK_OS_DEFAULT_SPEC "%(link_os_linux)"
 
9200
 
 
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")
 
9207
+#else
 
9208
+#define DEFAULT_ASM_ENDIAN " -mbig"
 
9209
+#define LINK_OS_LINUX_EMUL ENDIAN_SELECT(" -m elf32ppclinux",  \
 
9210
+                                        " -m elf32lppclinux",  \
 
9211
+                                        " -m elf32ppclinux")
 
9212
+#endif
 
9213
+
 
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 "}}"
 
9218
+
 
9219
 #define LINK_GCC_C_SEQUENCE_SPEC \
 
9220
   "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
 
9221
 
 
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)
 
9226
@@ -20,8 +20,13 @@
 
9227
    <http://www.gnu.org/licenses/>.  */
 
9228
 
 
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)
 
9233
+#else
 
9234
+#undef TARGET_DEFAULT
 
9235
 #define TARGET_DEFAULT MASK_STRICT_ALIGN
 
9236
+#endif
 
9237
 
 
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)
 
9244
@@ -18,5 +18,10 @@
 
9245
 along with GCC; see the file COPYING3.  If not see
 
9246
 <http://www.gnu.org/licenses/>.  */
 
9247
 
 
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)
 
9251
+#else
 
9252
+#undef TARGET_DEFAULT
 
9253
 #define TARGET_DEFAULT (MASK_PPC_GFXOPT | MASK_POWERPC64 | MASK_64BIT)
 
9254
+#endif
 
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"
 
9261
   "
 
9262
 {
 
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"
 
9272
   "
 
9273
 {
 
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)
 
9285
@@ -20,8 +20,13 @@
 
9286
    <http://www.gnu.org/licenses/>.  */
 
9287
 
 
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)
 
9292
+#else
 
9293
+#undef TARGET_DEFAULT
 
9294
 #define        TARGET_DEFAULT MASK_ALTIVEC
 
9295
+#endif
 
9296
 
 
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 @@
 
9304
 #endif
 
9305
 
 
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} \
 
9314
-}}}}"
 
9315
+%{mrelocatable} %{mrelocatable-lib} %{fpic|fpie|fPIC|fPIE:-K PIC} \
 
9316
+%{memb|msdata=eabi: -memb}"
 
9317
 
 
9318
 #define ASM_SPEC64 "-a64"
 
9319
 
 
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)
 
9325
 
 
9326
 #undef SUBSUBTARGET_EXTRA_SPECS
 
9327
 #define SUBSUBTARGET_EXTRA_SPECS \
 
9328
@@ -212,10 +206,6 @@
 
9329
 
 
9330
 #ifndef RS6000_BI_ARCH
 
9331
 
 
9332
-/* 64-bit PowerPC Linux is always big-endian.  */
 
9333
-#undef OPTION_LITTLE_ENDIAN
 
9334
-#define OPTION_LITTLE_ENDIAN   0
 
9335
-
 
9336
 /* 64-bit PowerPC Linux always has a TOC.  */
 
9337
 #undef  TARGET_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)
 
9342
 
 
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",             \
 
9351
+                                          " -m elf64lppc")
 
9352
+#else
 
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",             \
 
9359
+                                          " -m elf64ppc")
 
9360
+#endif
 
9361
 
 
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 "}}"
 
9366
 
 
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 "}}"
 
9371
 
 
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)
 
9378
     {
 
9379
       int nregs = GP_ARG_NUM_REG - first_reg_offset;
 
9380
+      int n_gpr;
 
9381
 
 
9382
       if (va_list_gpr_counter_field)
 
9383
        {
 
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;
 
9388
        }
 
9389
       else
 
9390
        {
 
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;
 
9395
        }
 
9396
+      if (nregs > n_gpr)
 
9397
+       nregs = n_gpr;
 
9398
 
 
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);
 
9410
   *pshift = shift;
 
9411
 
 
9412
   /* Mask for insertion.  */
 
9413
@@ -22151,20 +22153,22 @@
 
9414
 
 
9415
       if (TARGET_64BIT)
 
9416
        {
 
9417
-         if (TARGET_MINIMAL_TOC)
 
9418
+         if (TARGET_ELF || TARGET_MINIMAL_TOC)
 
9419
            fputs (DOUBLE_INT_ASM_OP, file);
 
9420
          else
 
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);
 
9431
          return;
 
9432
        }
 
9433
       else
 
9434
        {
 
9435
-         if (TARGET_MINIMAL_TOC)
 
9436
+         if (TARGET_ELF || TARGET_MINIMAL_TOC)
 
9437
            fputs ("\t.long ", file);
 
9438
          else
 
9439
            fprintf (file, "\t.tc FT_%lx_%lx_%lx_%lx[TC],",
 
9440
@@ -22191,18 +22195,19 @@
 
9441
 
 
9442
       if (TARGET_64BIT)
 
9443
        {
 
9444
-         if (TARGET_MINIMAL_TOC)
 
9445
+         if (TARGET_ELF || TARGET_MINIMAL_TOC)
 
9446
            fputs (DOUBLE_INT_ASM_OP, file);
 
9447
          else
 
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);
 
9454
          return;
 
9455
        }
 
9456
       else
 
9457
        {
 
9458
-         if (TARGET_MINIMAL_TOC)
 
9459
+         if (TARGET_ELF || TARGET_MINIMAL_TOC)
 
9460
            fputs ("\t.long ", file);
 
9461
          else
 
9462
            fprintf (file, "\t.tc FD_%lx_%lx[TC],",
 
9463
@@ -22226,16 +22231,19 @@
 
9464
 
 
9465
       if (TARGET_64BIT)
 
9466
        {
 
9467
-         if (TARGET_MINIMAL_TOC)
 
9468
+         if (TARGET_ELF || TARGET_MINIMAL_TOC)
 
9469
            fputs (DOUBLE_INT_ASM_OP, file);
 
9470
          else
 
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);
 
9475
+         else
 
9476
+           fprintf (file, "0x%lx\n", l & 0xffffffff);
 
9477
          return;
 
9478
        }
 
9479
       else
 
9480
        {
 
9481
-         if (TARGET_MINIMAL_TOC)
 
9482
+         if (TARGET_ELF || TARGET_MINIMAL_TOC)
 
9483
            fputs ("\t.long ", file);
 
9484
          else
 
9485
            fprintf (file, "\t.tc FS_%lx[TC],", l & 0xffffffff);
 
9486
@@ -22267,9 +22275,8 @@
 
9487
        }
 
9488
 #endif
 
9489
 
 
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));
 
9501
 
 
9502
-      if (POINTER_SIZE > GET_MODE_BITSIZE (mode))
 
9503
+      if (WORDS_BIG_ENDIAN && POINTER_SIZE > GET_MODE_BITSIZE (mode))
 
9504
        {
 
9505
 #if HOST_BITS_PER_WIDE_INT == 32
 
9506
          lshift_double (low, high, POINTER_SIZE - GET_MODE_BITSIZE (mode),
 
9507
@@ -22295,7 +22302,7 @@
 
9508
 
 
9509
       if (TARGET_64BIT)
 
9510
        {
 
9511
-         if (TARGET_MINIMAL_TOC)
 
9512
+         if (TARGET_ELF || TARGET_MINIMAL_TOC)
 
9513
            fputs (DOUBLE_INT_ASM_OP, file);
 
9514
          else
 
9515
            fprintf (file, "\t.tc ID_%lx_%lx[TC],",
 
9516
@@ -22308,7 +22315,7 @@
 
9517
        {
 
9518
          if (POINTER_SIZE < GET_MODE_BITSIZE (mode))
 
9519
            {
 
9520
-             if (TARGET_MINIMAL_TOC)
 
9521
+             if (TARGET_ELF || TARGET_MINIMAL_TOC)
 
9522
                fputs ("\t.long ", file);
 
9523
              else
 
9524
                fprintf (file, "\t.tc ID_%lx_%lx[TC],",
 
9525
@@ -22318,7 +22325,7 @@
 
9526
            }
 
9527
          else
 
9528
            {
 
9529
-             if (TARGET_MINIMAL_TOC)
 
9530
+             if (TARGET_ELF || TARGET_MINIMAL_TOC)
 
9531
                fputs ("\t.long ", file);
 
9532
              else
 
9533
                fprintf (file, "\t.tc IS_%lx[TC],", (long) low & 0xffffffff);
 
9534
@@ -22356,7 +22363,7 @@
 
9535
       gcc_unreachable ();
 
9536
     }
 
9537
 
 
9538
-  if (TARGET_MINIMAL_TOC)
 
9539
+  if (TARGET_ELF || TARGET_MINIMAL_TOC)
 
9540
     fputs (TARGET_32BIT ? "\t.long " : DOUBLE_INT_ASM_OP, file);
 
9541
   else
 
9542
     {
 
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
 
9550
 
 
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
 
9555
+
 
9556
 #define MAX_BITS_PER_WORD 64
 
9557
 
 
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)
 
9562
 
 
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)
 
9569
+
 
9570
 /* Pick up the return address upon entry to a procedure. Used for
 
9571
    dwarf2 unwind information.  This also enables the table driven
 
9572
    mechanism.  */
 
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)
 
9577
@@ -25,12 +25,12 @@
 
9578
 #undef CC1_ENDIAN_DEFAULT_SPEC
 
9579
 #define        CC1_ENDIAN_DEFAULT_SPEC "%(cc1_endian_little)"
 
9580
 
 
9581
+#undef DEFAULT_ASM_ENDIAN
 
9582
+#define        DEFAULT_ASM_ENDIAN " -mlittle"
 
9583
+
 
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} \
 
9589
-  }}}}"
 
9590
+#define        LINK_TARGET_SPEC \
 
9591
+  ENDIAN_SELECT(" --oformat elf32-powerpc", "", "")
 
9592
 
 
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,*")])
 
9602
 
 
9603
+;; We are always BITS_BIG_ENDIAN, so the (const_int 16) below is
 
9604
+;; correct for -mlittle as well as -mbig.
 
9605
 (define_split
 
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,*")])
 
9611
 
 
9612
+;; We are always BITS_BIG_ENDIAN, so the bit positions below in
 
9613
+;; zero_extract insns do not change for -mlittle.
 
9614
 (define_split
 
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);
 
9627
   rtx addr1;
 
9628
   rtx addr2;
 
9629
   rtx word_high;
 
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);
 
9640
   rtx addr1;
 
9641
   rtx addr2;
 
9642
   rtx word_high;
 
9643
@@ -2221,16 +2229,14 @@
 
9644
     {
 
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));
 
9649
     }
 
9650
   else
 
9651
     {
 
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));
 
9656
     }
 
9657
+  emit_insn (gen_bswapsi2 (word_high, src_si));
 
9658
+  emit_insn (gen_bswapsi2 (word_low, op3_si));
 
9659
 }")
 
9660
 
 
9661
 (define_split
 
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);
 
9675
 
 
9676
   emit_insn (gen_lshrdi3 (op2, src, GEN_INT (32)));
 
9677
   emit_insn (gen_bswapsi2 (dest_si, src_si));
 
9678
@@ -2275,15 +2282,15 @@
 
9679
   [(const_int 0)]
 
9680
   "
 
9681
 {
 
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);
 
9692
   rtx addr1;
 
9693
   rtx addr2;
 
9694
-  rtx word_high;
 
9695
-  rtx word_low;
 
9696
+  rtx word1;
 
9697
+  rtx word2;
 
9698
 
 
9699
   addr1 = XEXP (src, 0);
 
9700
   if (GET_CODE (addr1) == PLUS)
 
9701
@@ -2308,19 +2315,11 @@
 
9702
       addr2 = gen_rtx_PLUS (SImode, op2, addr1);
 
9703
     }
 
9704
 
 
9705
-  if (BYTES_BIG_ENDIAN)
 
9706
-    {
 
9707
-      word_high = change_address (src, SImode, addr1);
 
9708
-      word_low  = change_address (src, SImode, addr2);
 
9709
-    }
 
9710
-  else
 
9711
-    {
 
9712
-      word_high = change_address (src, SImode, addr2);
 
9713
-      word_low  = change_address (src, SImode, addr1);
 
9714
-    }
 
9715
+  word1 = change_address (src, SImode, addr1);
 
9716
+  word2 = change_address (src, SImode, addr2);
 
9717
 
 
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));
 
9722
 }")
 
9723
 
 
9724
 (define_split
 
9725
@@ -2331,15 +2330,15 @@
 
9726
   [(const_int 0)]
 
9727
   "
 
9728
 {
 
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);
 
9739
   rtx addr1;
 
9740
   rtx addr2;
 
9741
-  rtx word_high;
 
9742
-  rtx word_low;
 
9743
+  rtx word1;
 
9744
+  rtx word2;
 
9745
 
 
9746
   addr1 = XEXP (dest, 0);
 
9747
   if (GET_CODE (addr1) == PLUS)
 
9748
@@ -2364,19 +2363,11 @@
 
9749
       addr2 = gen_rtx_PLUS (SImode, op2, addr1);
 
9750
     }
 
9751
 
 
9752
-  if (BYTES_BIG_ENDIAN)
 
9753
-    {
 
9754
-      word_high = change_address (dest, SImode, addr1);
 
9755
-      word_low  = change_address (dest, SImode, addr2);
 
9756
-    }
 
9757
-  else
 
9758
-    {
 
9759
-      word_high = change_address (dest, SImode, addr2);
 
9760
-      word_low  = change_address (dest, SImode, addr1);
 
9761
-    }
 
9762
+  word1 = change_address (dest, SImode, addr1);
 
9763
+  word2 = change_address (dest, SImode, addr2);
 
9764
 
 
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));
 
9769
 }")
 
9770
 
 
9771
 (define_split
 
9772
@@ -2387,15 +2378,15 @@
 
9773
   [(const_int 0)]
 
9774
   "
 
9775
 {
 
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);
 
9788
 
 
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));
 
9793
 }")
 
9794
 
 
9795
 (define_insn "mulsi3"
 
9796
@@ -4682,6 +4673,41 @@
 
9797
   "frsqrtes %0,%1"
 
9798
   [(set_attr "type" "fp")])
 
9799
 
 
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)
 
9809
+       (match_dup 5))
 
9810
+   (set (match_operand:SI 0 "gpc_reg_operand" "")
 
9811
+       (match_dup 6))]
 
9812
+  "!TARGET_IEEEQUAD
 
9813
+   && TARGET_HARD_FLOAT
 
9814
+   && (TARGET_FPRS || TARGET_E500_DOUBLE)
 
9815
+   && TARGET_LONG_DOUBLE_128"
 
9816
+{
 
9817
+  operands[2] = gen_reg_rtx (DFmode);
 
9818
+  operands[3] = gen_reg_rtx (DImode);
 
9819
+  if (TARGET_POWERPC64)
 
9820
+    {
 
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);
 
9825
+    }
 
9826
+  else
 
9827
+    {
 
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));
 
9832
+    }
 
9833
+})
 
9834
+
 
9835
 (define_expand "copysign<mode>3"
 
9836
   [(set (match_dup 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"
 
9843
-  "@
 
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"
 
9847
+  "*
 
9848
+{
 
9849
+  switch (which_alternative)
 
9850
+    {
 
9851
+    default:
 
9852
+      gcc_unreachable ();
 
9853
+    case 0:
 
9854
+      if (WORDS_BIG_ENDIAN)
 
9855
+        return \"srawi %0,%1,31\;srawi %L0,%1,%h2\";
 
9856
+      else
 
9857
+        return \"srawi %L0,%L1,31\;srawi %0,%L1,%h2\";
 
9858
+    case 1:
 
9859
+      if (WORDS_BIG_ENDIAN)
 
9860
+       return \"srwi %L0,%L1,%h2\;insrwi %L0,%1,%h2,0\;srawi %0,%1,%h2\";
 
9861
+      else
 
9862
+       return \"srwi %0,%1,%h2\;insrwi %0,%L1,%h2,0\;srawi %L0,%L1,%h2\";
 
9863
+    }
 
9864
+}"
 
9865
   [(set_attr "type" "two,three")
 
9866
    (set_attr "length" "8,12")])
 
9867
 
 
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"
 
9873
+  ""
 
9874
   "
 
9875
 {
 
9876
   if (TARGET_POWERPC64)
 
9877
     ;
 
9878
-  else if (TARGET_32BIT && GET_CODE (operands[2]) == CONST_INT
 
9879
-          && WORDS_BIG_ENDIAN)
 
9880
+  else if (GET_CODE (operands[2]) == CONST_INT)
 
9881
     {
 
9882
       emit_insn (gen_ashrdi3_no_power (operands[0], operands[1], operands[2]));
 
9883
       DONE;
 
9884
@@ -8277,8 +8317,8 @@
 
9885
   "&& reload_completed"
 
9886
   [(pc)]
 
9887
 {
 
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),
 
9893
                  operands[1]);
 
9894
   emit_move_insn (simplify_gen_subreg (DFmode, operands[0], TFmode, lo_word),
 
9895
@@ -8507,8 +8547,8 @@
 
9896
    && TARGET_LONG_DOUBLE_128"
 
9897
   "
 
9898
 {
 
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 @@
 
9907
    (match_dup 13)]
 
9908
 {
 
9909
   REAL_VALUE_TYPE rv;
 
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);
 
9914
 
 
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 @@
 
9922
             rs6000_abi_name);                                          \
 
9923
     }                                                                  \
 
9924
                                                                        \
 
9925
-  if (rs6000_current_abi == ABI_AIX && TARGET_LITTLE_ENDIAN)           \
 
9926
-    {                                                                  \
 
9927
-      rs6000_isa_flags &= ~OPTION_MASK_LITTLE_ENDIAN;                  \
 
9928
-      error ("-mcall-aixdesc must be big endian");                     \
 
9929
-    }                                                                  \
 
9930
-                                                                       \
 
9931
   if (TARGET_SECURE_PLT != secure_plt)                                 \
 
9932
     {                                                                  \
 
9933
       error ("-msecure-plt not supported by your assembler");          \
 
9934
@@ -523,19 +517,24 @@
 
9935
   while (0)
 
9936
 #endif
 
9937
 
 
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 "}"
 
9947
+
 
9948
+#define DEFAULT_ASM_ENDIAN " -mbig"
 
9949
+
 
9950
 #undef ASM_SPEC
 
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;    \
 
9957
-  mcall-aixdesc |                 \
 
9958
-  mcall-freebsd |                 \
 
9959
-  mcall-netbsd  |                 \
 
9960
-  mcall-openbsd |                 \
 
9961
-  mcall-linux           :-mbig;    \
 
9962
-  mcall-i960-old        :-mlittle}"
 
9963
+%{memb|msdata=eabi: -memb}" \
 
9964
+ENDIAN_SELECT(" -mbig", " -mlittle", DEFAULT_ASM_ENDIAN)
 
9965
 
 
9966
 #define        CC1_ENDIAN_BIG_SPEC ""
 
9967
 
 
9968
@@ -553,17 +552,10 @@
 
9969
 #endif
 
9970
 
 
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);              \
 
9975
-  mcall-aixdesc |                                        \
 
9976
-  mcall-freebsd |                                        \
 
9977
-  mcall-netbsd  |                                        \
 
9978
-  mcall-openbsd |                                        \
 
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 }"
 
9992
 
 
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} \
 
9998
-  }}}}"
 
9999
+#define        LINK_TARGET_SPEC \
 
10000
+  ENDIAN_SELECT("", " --oformat elf32-powerpcle", "")
 
10001
 
 
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 @@
 
10009
 
 
10010
 /* Delete tempfiles and exit function.  */
 
10011
 
 
10012
-void
 
10013
-collect_exit (int status)
 
10014
+static void
 
10015
+collect_atexit (void)
 
10016
 {
 
10017
   if (c_file != 0 && c_file[0])
 
10018
     maybe_unlink (c_file);
 
10019
@@ -395,13 +395,8 @@
 
10020
       maybe_unlink (lderrout);
 
10021
     }
 
10022
 
 
10023
-  if (status != 0 && output_file != 0 && output_file[0])
 
10024
-    maybe_unlink (output_file);
 
10025
-
 
10026
   if (response_file)
 
10027
     maybe_unlink (response_file);
 
10028
-
 
10029
-  exit (status);
 
10030
 }
 
10031
 
 
10032
 
 
10033
@@ -970,6 +965,9 @@
 
10034
   signal (SIGCHLD, SIG_DFL);
 
10035
 #endif
 
10036
 
 
10037
+  if (atexit (collect_atexit) != 0)
 
10038
+    fatal_error ("atexit failed");
 
10039
+
 
10040
   /* Unlock the stdio streams.  */
 
10041
   unlock_std_streams ();
 
10042
 
 
10043
@@ -1110,55 +1108,55 @@
 
10044
   if (ld_file_name == 0)
 
10045
 #endif
 
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)
 
10050
 #endif
 
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)
 
10056
     {
 
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;
 
10060
     }
 
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);
 
10071
 
 
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)
 
10076
 #endif
 
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);
 
10088
 
 
10089
 #ifdef LDD_SUFFIX
 
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);
 
10095
 #endif
 
10096
 
 
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)
 
10101
 #endif
 
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);
 
10113
 
 
10114
   /* Determine the full path name of the C compiler to use.  */
 
10115
   c_file_name = getenv ("COLLECT_GCC");
 
10116
@@ -1171,12 +1169,12 @@
 
10117
 #endif
 
10118
     }
 
10119
 
 
10120
-  p = find_a_file (&cpath, c_file_name);
 
10121
+  p = find_a_file (&cpath, c_file_name, X_OK);
 
10122
 
 
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.  */
 
10125
   if (p == 0)
 
10126
-    p = find_a_file (&path, c_file_name);
 
10127
+    p = find_a_file (&path, c_file_name, X_OK);
 
10128
 
 
10129
   if (p)
 
10130
     c_file_name = p;
 
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);
 
10137
        }
 
10138
 
 
10139
       if (WIFEXITED (status))
 
10140
@@ -1829,7 +1827,7 @@
 
10141
   if (ret != 0)
 
10142
     {
 
10143
       error ("%s returned %d exit status", prog, ret);
 
10144
-      collect_exit (ret);
 
10145
+      exit (ret);
 
10146
     }
 
10147
 
 
10148
   if (response_file)
 
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)
 
10153
@@ -25,8 +25,6 @@
 
10154
 extern struct pex_obj *collect_execute (const char *, char **, const char *,
 
10155
                                        const char *, int flags);
 
10156
 
 
10157
-extern void collect_exit (int) ATTRIBUTE_NORETURN;
 
10158
-
 
10159
 extern int collect_wait (const char *, struct pex_obj *);
 
10160
 
 
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)
 
10166
@@ -31,7 +31,7 @@
 
10167
 }
 
10168
 
 
10169
 char *
 
10170
-find_a_file (struct path_prefix *pprefix, const char *name)
 
10171
+find_a_file (struct path_prefix *pprefix, const char *name, int mode)
 
10172
 {
 
10173
   char *temp;
 
10174
   struct prefix_list *pl;
 
10175
@@ -50,7 +50,7 @@
 
10176
 
 
10177
   if (IS_ABSOLUTE_PATH (name))
 
10178
     {
 
10179
-      if (access (name, X_OK) == 0)
 
10180
+      if (access (name, mode) == 0)
 
10181
        {
 
10182
          strcpy (temp, name);
 
10183
 
 
10184
@@ -66,7 +66,7 @@
 
10185
       strcpy (temp, name);
 
10186
        strcat (temp, HOST_EXECUTABLE_SUFFIX);
 
10187
 
 
10188
-       if (access (temp, X_OK) == 0)
 
10189
+       if (access (temp, mode) == 0)
 
10190
          return temp;
 
10191
 #endif
 
10192
 
 
10193
@@ -83,7 +83,7 @@
 
10194
 
 
10195
        if (stat (temp, &st) >= 0
 
10196
            && ! S_ISDIR (st.st_mode)
 
10197
-           && access (temp, X_OK) == 0)
 
10198
+           && access (temp, mode) == 0)
 
10199
          return temp;
 
10200
 
 
10201
 #ifdef HOST_EXECUTABLE_SUFFIX
 
10202
@@ -93,7 +93,7 @@
 
10203
 
 
10204
        if (stat (temp, &st) >= 0
 
10205
            && ! S_ISDIR (st.st_mode)
 
10206
-           && access (temp, X_OK) == 0)
 
10207
+           && access (temp, mode) == 0)
 
10208
          return temp;
 
10209
 #endif
 
10210
       }
 
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"
 
10217
 
 
10218
 
 
10219
-libtool_VERSION=3:1:0
 
10220
+libtool_VERSION=4:0:0
 
10221
 
 
10222
 
 
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
 
10256
 
 
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
 
10263
-
 
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);
 
10274
 
 
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 *));
 
10280
   i = 0;
 
10281
   off = 0;
 
10282
@@ -319,6 +321,12 @@
 
10283
   for (; i < num_params; ++i)
 
10284
     args[i + off] = go_type_to_ffi (in_types[i]);
 
10285
 
 
10286
+  if (!is_interface && !is_method)
 
10287
+    {
 
10288
+      // There is a closure argument, a pointer.
 
10289
+      args[i + off] = &ffi_type_pointer;
 
10290
+    }
 
10291
+
 
10292
   rettype = go_func_return_ffi (func);
 
10293
 
 
10294
   status = ffi_prep_cif (cif, FFI_DEFAULT_ABI, num_args, rettype, args);
 
10295
@@ -491,11 +499,24 @@
 
10296
 }
 
10297
 
 
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.
 
10303
 
 
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.
 
10307
+
 
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.
 
10311
+
 
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
 
10315
+   FUNC_TYPE.  */
 
10316
+
 
10317
 void
 
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,
 
10321
              void **results)
 
10322
 {
 
10323
@@ -507,7 +528,7 @@
 
10324
 
 
10325
   call_result = (unsigned char *) malloc (go_results_size (func_type));
 
10326
 
 
10327
-  ffi_call (&cif, func_addr, call_result, params);
 
10328
+  ffi_call (&cif, func_val->fn, call_result, params);
 
10329
 
 
10330
   /* Some day we may need to free result values if RESULTS is
 
10331
      NULL.  */
 
10332
@@ -521,7 +542,7 @@
 
10333
 
 
10334
 void
 
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)
 
10345
@@ -11,7 +11,7 @@
 
10346
 typedef struct Fin Fin;
 
10347
 struct Fin
 
10348
 {
 
10349
-       void (*fn)(void*);
 
10350
+       FuncVal *fn;
 
10351
        const struct __go_func_type *ft;
 
10352
 };
 
10353
 
 
10354
@@ -42,7 +42,7 @@
 
10355
 } fintab[TABSZ];
 
10356
 
 
10357
 static void
 
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)
 
10360
 {
 
10361
        int32 i, j;
 
10362
 
 
10363
@@ -137,7 +137,7 @@
 
10364
 }
 
10365
 
 
10366
 bool
 
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)
 
10369
 {
 
10370
        Fintab *tab;
 
10371
        byte *base;
 
10372
@@ -175,7 +175,7 @@
 
10373
 // get finalizer; if del, delete finalizer.
 
10374
 // caller is responsible for updating RefHasFinalizer (special) bit.
 
10375
 bool
 
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)
 
10378
 {
 
10379
        Fintab *tab;
 
10380
        bool res;
 
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);
 
10387
 
 
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));
 
10392
 
 
10393
 enum
 
10394
@@ -505,4 +505,3 @@
 
10395
 void   runtime_memorydump(void);
 
10396
 
 
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 @@
 
10404
 
 
10405
 // Ready the goroutine e.data.
 
10406
 static void
 
10407
-ready(int64 now, Eface e)
 
10408
+ready(int64 now, Eface e, void *closure)
 
10409
 {
 
10410
        USED(now);
 
10411
+       USED(closure);
 
10412
 
 
10413
        runtime_ready(e.__object);
 
10414
 }
 
10415
 
 
10416
+static FuncVal readyv = {(void(*)(void))ready};
 
10417
+
 
10418
 // Put the current goroutine to sleep for ns nanoseconds.
 
10419
 void
 
10420
 runtime_tsleep(int64 ns, const char *reason)
 
10421
@@ -70,7 +73,7 @@
 
10422
 
 
10423
        t.when = runtime_nanotime() + ns;
 
10424
        t.period = 0;
 
10425
-       t.f = ready;
 
10426
+       t.fv = &readyv;
 
10427
        t.arg.__object = g;
 
10428
        runtime_lock(&timers);
 
10429
        addtimer(&t);
 
10430
@@ -158,7 +161,7 @@
 
10431
 {
 
10432
        int64 delta, now;
 
10433
        Timer *t;
 
10434
-       void (*f)(int64, Eface);
 
10435
+       void (*f)(int64, Eface, void *);
 
10436
        Eface arg;
 
10437
 
 
10438
        for(;;) {
 
10439
@@ -184,12 +187,12 @@
 
10440
                                siftdown(0);
 
10441
                                t->i = -1;  // mark as removed
 
10442
                        }
 
10443
-                       f = t->f;
 
10444
+                       f = (void*)t->fv->fn;
 
10445
                        arg = t->arg;
 
10446
                        runtime_unlock(&timers);
 
10447
                        if(raceenabled)
 
10448
                                runtime_raceacquire(t);
 
10449
-                       f(now, arg);
 
10450
+                       f(now, arg, &t->fv);
 
10451
                        runtime_lock(&timers);
 
10452
                }
 
10453
                if(delta < 0) {
 
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)
 
10458
@@ -57,6 +57,7 @@
 
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 @@
 
10467
        const byte*     str;
 
10468
        intgo           len;
 
10469
 };
 
10470
+struct FuncVal
 
10471
+{
 
10472
+       void    (*fn)(void);
 
10473
+       // variable-size, fn-specific data here
 
10474
+};
 
10475
 struct GCStats
 
10476
 {
 
10477
        // the struct must consist of only uint64's,
 
10478
@@ -313,7 +319,7 @@
 
10479
        // a well-behaved function and not block.
 
10480
        int64   when;
 
10481
        int64   period;
 
10482
-       void    (*f)(int64, Eface);
 
10483
+       FuncVal *fv;
 
10484
        Eface   arg;
 
10485
 };
 
10486
 
 
10487
@@ -540,7 +546,7 @@
 
10488
 void   runtime_printcomplex(__complex double);
 
10489
 
 
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,
 
10493
                  void **, void **)
 
10494
   __asm__ (GOSYM_PREFIX "reflect.call");
 
10495
 
 
10496
@@ -570,7 +576,7 @@
 
10497
 #define PREFETCH(p) __builtin_prefetch(p)
 
10498
 
 
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;
 
10511
 struct Finalizer
 
10512
 {
 
10513
-       void (*fn)(void*);
 
10514
+       FuncVal *fn;
 
10515
        void *arg;
 
10516
        const struct __go_func_type *ft;
 
10517
 };
 
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);
 
10523
 
 
10524
        // MSpan.types
 
10525
        allspans = runtime_mheap.allspans;
 
10526
@@ -1182,7 +1181,7 @@
 
10527
 static bool
 
10528
 handlespecial(byte *p, uintptr size)
 
10529
 {
 
10530
-       void (*fn)(void*);
 
10531
+       FuncVal *fn;
 
10532
        const struct __go_func_type *ft;
 
10533
        FinBlock *block;
 
10534
        Finalizer *f;
 
10535
@@ -1731,11 +1730,12 @@
 
10536
                for(; fb; fb=next) {
 
10537
                        next = fb->next;
 
10538
                        for(i=0; i<(uint32)fb->cnt; i++) {
 
10539
-                               void *params[1];
 
10540
+                               void *params[2];
 
10541
 
 
10542
                                f = &fb->fin[i];
 
10543
                                params[0] = &f->arg;
 
10544
-                               reflect_call(f->ft, (void*)f->fn, 0, 0, params, nil);
 
10545
+                               params[1] = f;
 
10546
+                               reflect_call(f->ft, f->fn, 0, 0, params, nil);
 
10547
                                f->fn = nil;
 
10548
                                f->arg = nil;
 
10549
                        }
 
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)
 
10554
@@ -83,7 +83,7 @@
 
10555
 void
 
10556
 runtime_parforsetup2(ParFor *desc, uint32 nthr, uint32 n, void *ctx, bool wait, void *body)
 
10557
 {
 
10558
-       runtime_parforsetup(desc, nthr, n, ctx, wait, (void(*)(ParFor*, uint32))body);
 
10559
+       runtime_parforsetup(desc, nthr, n, ctx, wait, *(void(**)(ParFor*, uint32))body);
 
10560
 }
 
10561
 
 
10562
 void
 
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)
 
10567
@@ -11,7 +11,7 @@
 
10568
 AC_CONFIG_SRCDIR(Makefile.am)
 
10569
 AC_CONFIG_HEADER(config.h)
 
10570
 
 
10571
-libtool_VERSION=3:1:0
 
10572
+libtool_VERSION=4:0:0
 
10573
 AC_SUBST(libtool_VERSION)
 
10574
 
 
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)
 
10580
@@ -59,9 +59,6 @@
 
10581
 // implemented in symtab.c
 
10582
 func funcline_go(*Func, uintptr) (string, int)
 
10583
 
 
10584
-// mid returns the current OS thread (m) id.
 
10585
-func mid() uint32
 
10586
-
 
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)
 
10594
@@ -13,6 +13,8 @@
 
10595
        "unsafe"
 
10596
 )
 
10597
 
 
10598
+var gdata []uint64
 
10599
+
 
10600
 // Simple serial sanity test for parallelfor.
 
10601
 func TestParFor(t *testing.T) {
 
10602
        const P = 1
 
10603
@@ -22,7 +24,12 @@
 
10604
                data[i] = i
 
10605
        }
 
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.
 
10610
+       gdata = data
 
10611
        ParForSetup(desc, P, N, nil, true, func(desc *ParFor, i uint32) {
 
10612
+               data := gdata
 
10613
                data[i] = data[i]*data[i] + 1
 
10614
        })
 
10615
        ParForDo(desc)
 
10616
@@ -111,7 +118,9 @@
 
10617
        P := GOMAXPROCS(-1)
 
10618
        c := make(chan bool, P)
 
10619
        desc := NewParFor(uint32(P))
 
10620
+       gdata = data
 
10621
        ParForSetup(desc, uint32(P), uint32(N), nil, false, func(desc *ParFor, i uint32) {
 
10622
+               data := gdata
 
10623
                data[i] = data[i]*data[i] + 1
 
10624
        })
 
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")
 
10633
                        }
 
10634
-                       fn = iface.itab.fun[i]
 
10635
+                       fn = unsafe.Pointer(&iface.itab.fun[i])
 
10636
                        rcvr = iface.word
 
10637
                } else {
 
10638
                        ut := v.typ.uncommon()
 
10639
@@ -388,7 +388,7 @@
 
10640
                        if m.pkgPath != nil {
 
10641
                                panic(method + " of unexported method")
 
10642
                        }
 
10643
-                       fn = m.tfn
 
10644
+                       fn = unsafe.Pointer(&m.tfn)
 
10645
                        t = m.mtyp
 
10646
                        rcvr = v.iword()
 
10647
                }
 
10648
@@ -462,6 +462,10 @@
 
10649
        if v.flag&flagMethod != 0 {
 
10650
                nin++
 
10651
        }
 
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 {
 
10654
+               nin++
 
10655
+       }
 
10656
        params := make([]unsafe.Pointer, nin)
 
10657
        off := 0
 
10658
        if v.flag&flagMethod != 0 {
 
10659
@@ -471,7 +475,6 @@
 
10660
                params[0] = unsafe.Pointer(p)
 
10661
                off = 1
 
10662
        }
 
10663
-       first_pointer := false
 
10664
        for i, pv := range in {
 
10665
                pv.mustBeExported()
 
10666
                targ := t.In(i).(*rtype)
 
10667
@@ -483,14 +486,17 @@
 
10668
                } else {
 
10669
                        params[off] = pv.val
 
10670
                }
 
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)
 
10674
                        *p = params[off]
 
10675
                        params[off] = unsafe.Pointer(p)
 
10676
-                       first_pointer = true
 
10677
                }
 
10678
                off++
 
10679
        }
 
10680
+       if v.flag&flagMethod == 0 && !firstPointer {
 
10681
+               // Closure argument.
 
10682
+               params[off] = unsafe.Pointer(&fn)
 
10683
+       }
 
10684
 
 
10685
        ret := make([]Value, nout)
 
10686
        results := make([]unsafe.Pointer, nout)
 
10687
@@ -509,7 +515,7 @@
 
10688
                pr = &results[0]
 
10689
        }
 
10690
 
 
10691
-       call(t, fn, v.flag&flagMethod != 0, first_pointer, pp, pr)
 
10692
+       call(t, fn, v.flag&flagMethod != 0, firstPointer, pp, pr)
 
10693
 
 
10694
        return ret
 
10695
 }
 
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.
 
10700
+//
 
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 {
 
10706
        k := v.kind()
 
10707
        switch k {
 
10708
-       case Chan, Func, Map, Ptr, UnsafePointer:
 
10709
-               if k == Func && v.flag&flagMethod != 0 {
 
10710
+       case Chan, Map, Ptr, UnsafePointer:
 
10711
+               p := v.val
 
10712
+               if v.flag&flagIndir != 0 {
 
10713
+                       p = *(*unsafe.Pointer)(p)
 
10714
+               }
 
10715
+               return uintptr(p)
 
10716
+       case Func:
 
10717
+               if v.flag&flagMethod != 0 {
 
10718
                        panic("reflect.Value.Pointer of method Value")
 
10719
                }
 
10720
                p := v.val
 
10721
                if v.flag&flagIndir != 0 {
 
10722
                        p = *(*unsafe.Pointer)(p)
 
10723
                }
 
10724
+               // Non-nil func value points at data block.
 
10725
+               // First word of data block is actual code.
 
10726
+               if p != nil {
 
10727
+                       p = *(*unsafe.Pointer)(p)
 
10728
+               }
 
10729
                return uintptr(p)
 
10730
+
 
10731
        case Slice:
 
10732
                return (*SliceHeader)(v.val).Data
 
10733
        }
 
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
 
10741
 
 
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
 
10746
 
 
10747
        string        *string // string form; unnecessary  but undeniably useful
 
10748
        *uncommonType         // (relatively) uncommon fields
 
10749
@@ -485,7 +485,7 @@
 
10750
        mt := p.typ
 
10751
        m.Type = toType(mt)
 
10752
        x := new(unsafe.Pointer)
 
10753
-       *x = p.tfn
 
10754
+       *x = unsafe.Pointer(&p.tfn)
 
10755
        m.Func = Value{mt, unsafe.Pointer(x), fl | flagIndir}
 
10756
        m.Index = i
 
10757
        return
 
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() {}
 
10764
 
 
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 @@
 
10771
 }
 
10772
 
 
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())
 
10780
                }
 
10781
        }
 
10782
+       */
 
10783
 
 
10784
        i := &InnerInt{3}
 
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)
 
10802
@@ -1,3 +1,19 @@
 
10803
+2013-06-21  Uros Bizjak  <ubizjak@gmail.com>
 
10804
+
 
10805
+       Backport from mainline
 
10806
+       2013-06-20  Uros Bizjak  <ubizjak@gmail.com>
 
10807
+
 
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.
 
10813
+
 
10814
+       Backport from mainline
 
10815
+       2013-06-19  Uros Bizjak  <ubizjak@gmail.com>
 
10816
+
 
10817
+       * config/fpu-387.h: Use __asm__ and __volatile__ consistently.
 
10818
+
 
10819
 2013-05-31  Release Manager
 
10820
 
 
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)
 
10826
@@ -73,7 +73,7 @@
 
10827
 
 
10828
       /* We need a single SSE instruction here so the handler can safely skip
 
10829
         over it.  */
 
10830
-      __asm__ volatile ("movaps %xmm0,%xmm0");
 
10831
+      __asm__ __volatile__ ("movaps\t%xmm0,%xmm0");
 
10832
 
 
10833
       sigaction (SIGILL, &oact, NULL);
 
10834
 
 
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
 
10840
 
 
10841
+#define _FPU_EX_ALL   0x3f
 
10842
+
 
10843
 void set_fpu (void)
 
10844
 {
 
10845
+  int excepts = 0;
 
10846
   unsigned short cw;
 
10847
 
 
10848
-  asm volatile ("fnstcw %0" : "=m" (cw));
 
10849
+  __asm__ __volatile__ ("fstcw\t%0" : "=m" (cw));
 
10850
 
 
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;
 
10859
 
 
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;
 
10867
+  cw &= ~excepts;
 
10868
 
 
10869
-  asm volatile ("fldcw %0" : : "m" (cw));
 
10870
+  __asm__ __volatile__ ("fnclex\n\tfldcw\t%0" : : "m" (cw));
 
10871
 
 
10872
   if (has_sse())
 
10873
     {
 
10874
       unsigned int cw_sse;
 
10875
 
 
10876
-      asm volatile ("%vstmxcsr %0" : "=m" (cw_sse));
 
10877
+      __asm__ __volatile__ ("%vstmxcsr\t%0" : "=m" (cw_sse));
 
10878
 
 
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);
 
10885
 
 
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;
 
10894
 
 
10895
-      asm volatile ("%vldmxcsr %0" : : "m" (cw_sse));
 
10896
+      __asm__ __volatile__ ("%vldmxcsr\t%0" : : "m" (cw_sse));
 
10897
     }
 
10898
 }
 
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)
 
10903
@@ -1,3 +1,14 @@
 
10904
+2013-05-31  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
10905
+
 
10906
+       Backport from mainline:
 
10907
+       2013-05-17  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
10908
+
 
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]:
 
10913
+       Matching change.
 
10914
+
 
10915
 2013-05-31  Release Manager
 
10916
 
 
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)
 
10922
@@ -10,7 +10,7 @@
 
10923
 
 
10924
 
 
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)); }
 
10930
 #endif
 
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)
 
10935
@@ -2,11 +2,11 @@
 
10936
  * 
 
10937
  * DO NOT EDIT THIS FILE   (fixincl.x)
 
10938
  * 
 
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
 
10943
  */
 
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
 
10946
  *
 
10947
  * You must regenerate it.  Use the ./genfixes script.
 
10948
  *
 
10949
@@ -6663,7 +6663,7 @@
 
10950
  */
 
10951
 static const char* apzSolaris_Pow_Int_OverloadPatch[] = {
 
10952
     "format",
 
10953
-    "#ifndef __GXX_EXPERIMENTAL_CXX0X__\n\
 
10954
+    "#if __cplusplus < 201103L\n\
 
10955
 %0\n\
 
10956
 #endif",
 
10957
     (char*)NULL };
 
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 @@
 
10963
 
 
10964
 
 
10965
 /*
 
10966
- *  The pow overloads with int were removed in C++ 2011.
 
10967
+ *  The pow overloads with int were removed in C++ 2011 DR 550.
 
10968
  */
 
10969
 fix = {
 
10970
     hackname  = solaris_pow_int_overload;
 
10971
@@ -3456,7 +3456,7 @@
 
10972
     select    = "^[ \t]*inline [a-z ]* pow\\([^()]*, int [^()]*\\)"
 
10973
                " *\\{[^{}]*\n[^{}]*\\}";
 
10974
     c_fix     = format;
 
10975
-    c_fix_arg = "#ifndef __GXX_EXPERIMENTAL_CXX0X__\n%0\n#endif";
 
10976
+    c_fix_arg = "#if __cplusplus < 201103L\n%0\n#endif";
 
10977
 
 
10978
     test_text =
 
10979
     "  inline long double pow(long double __X, int __Y) { return\n"