]> git.pld-linux.org Git - packages/gcc.git/blob - gcc-branch.diff
- release 1.
[packages/gcc.git] / gcc-branch.diff
1 Index: libgomp/ChangeLog
2 ===================================================================
3 --- libgomp/ChangeLog   (.../tags/gcc_4_7_0_release)    (wersja 185750)
4 +++ libgomp/ChangeLog   (.../branches/gcc-4_7-branch)   (wersja 185750)
5 @@ -1,3 +1,8 @@
6 +2012-03-22  Jakub Jelinek  <jakub@redhat.com>
7 +
8 +       PR middle-end/52547
9 +       * testsuite/libgomp.c/pr52547.c: New test.
10 +
11  2012-03-22  Release Manager
12  
13         * GCC 4.7.0 released.
14 Index: libgomp/testsuite/libgomp.c/pr52547.c
15 ===================================================================
16 --- libgomp/testsuite/libgomp.c/pr52547.c       (.../tags/gcc_4_7_0_release)    (wersja 0)
17 +++ libgomp/testsuite/libgomp.c/pr52547.c       (.../branches/gcc-4_7-branch)   (wersja 185750)
18 @@ -0,0 +1,36 @@
19 +/* PR middle-end/52547 */
20 +/* { dg-do run } */
21 +
22 +extern void abort (void);
23 +
24 +__attribute__((noinline, noclone)) int
25 +baz (int *x, int (*fn) (int *))
26 +{
27 +  return fn (x);
28 +}
29 +
30 +__attribute__((noinline, noclone)) int
31 +foo (int x, int *y)
32 +{
33 +  int i, e = 0;
34 +#pragma omp parallel for reduction(|:e)
35 +  for (i = 0; i < x; ++i)
36 +    {
37 +      __label__ lab;
38 +      int bar (int *z) { return z - y; }
39 +      if (baz (&y[i], bar) != i)
40 +       e |= 1;
41 +    }
42 +  return e;
43 +}
44 +
45 +int
46 +main ()
47 +{
48 +  int a[100], i;
49 +  for (i = 0; i < 100; i++)
50 +    a[i] = i;
51 +  if (foo (100, a))
52 +    abort ();
53 +  return 0;
54 +}
55 Index: libstdc++-v3/include/Makefile.in
56 ===================================================================
57 --- libstdc++-v3/include/Makefile.in    (.../tags/gcc_4_7_0_release)    (wersja 185750)
58 +++ libstdc++-v3/include/Makefile.in    (.../branches/gcc-4_7-branch)   (wersja 185750)
59 @@ -1497,7 +1497,7 @@
60         sed -e "s,define __GLIBCXX__,define __GLIBCXX__ $$date," \
61         -e "s,define _GLIBCXX_INLINE_VERSION, define _GLIBCXX_INLINE_VERSION $$ns_version," \
62         -e "s,define _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY, define _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY $$visibility," \
63 -       -e "s,define _GLIBCXX_EXTERN_TEMPLATE, define _GLIBCXX_EXTERN_TEMPLATE $$externtemplate," \
64 +       -e "s,define _GLIBCXX_EXTERN_TEMPLATE$$, define _GLIBCXX_EXTERN_TEMPLATE $$externtemplate," \
65         -e "$$ldbl_compat" \
66             < ${glibcxx_srcdir}/include/bits/c++config > $@ ;\
67         sed -e 's/HAVE_/_GLIBCXX_HAVE_/g' \
68 Index: libstdc++-v3/include/debug/safe_iterator.h
69 ===================================================================
70 --- libstdc++-v3/include/debug/safe_iterator.h  (.../tags/gcc_4_7_0_release)    (wersja 185750)
71 +++ libstdc++-v3/include/debug/safe_iterator.h  (.../branches/gcc-4_7-branch)   (wersja 185750)
72 @@ -1,6 +1,6 @@
73  // Safe iterator implementation  -*- C++ -*-
74  
75 -// Copyright (C) 2003, 2004, 2005, 2006, 2009, 2010, 2011
76 +// Copyright (C) 2003, 2004, 2005, 2006, 2009, 2010, 2011, 2012
77  // Free Software Foundation, Inc.
78  //
79  // This file is part of the GNU ISO C++ Library.  This library is free
80 @@ -169,7 +169,25 @@
81                               ._M_iterator(__x, "other"));
82        }
83  
84 +#ifdef __GXX_EXPERIMENTAL_CXX0X__
85        /**
86 +       * @brief Move construction.
87 +       * @post __x is singular and unattached
88 +       */
89 +      _Safe_iterator(_Safe_iterator&& __x) : _M_current()
90 +      {
91 +       _GLIBCXX_DEBUG_VERIFY(!__x._M_singular()
92 +                             || __x._M_current == _Iterator(),
93 +                             _M_message(__msg_init_copy_singular)
94 +                             ._M_iterator(*this, "this")
95 +                             ._M_iterator(__x, "other"));
96 +       std::swap(_M_current, __x._M_current);
97 +       this->_M_attach(__x._M_sequence);
98 +       __x._M_detach();
99 +      }
100 +#endif
101 +
102 +      /**
103         *  @brief Converting constructor from a mutable iterator to a
104         *  constant iterator.
105        */
106 @@ -208,7 +226,28 @@
107         return *this;
108        }
109  
110 +#ifdef __GXX_EXPERIMENTAL_CXX0X__
111        /**
112 +       * @brief Move assignment.
113 +       * @post __x is singular and unattached
114 +       */
115 +      _Safe_iterator&
116 +      operator=(_Safe_iterator&& __x)
117 +      {
118 +       _GLIBCXX_DEBUG_VERIFY(!__x._M_singular()
119 +                             || __x._M_current == _Iterator(),
120 +                             _M_message(__msg_copy_singular)
121 +                             ._M_iterator(*this, "this")
122 +                             ._M_iterator(__x, "other"));
123 +       _M_current = __x._M_current;
124 +       _M_attach(__x._M_sequence);
125 +       __x._M_detach();
126 +       __x._M_current = _Iterator();
127 +       return *this;
128 +      }
129 +#endif
130 +
131 +      /**
132         *  @brief Iterator dereference.
133         *  @pre iterator is dereferenceable
134         */
135 @@ -422,7 +461,9 @@
136        /// Is this iterator equal to the sequence's before_begin() iterator if
137        /// any?
138        bool _M_is_before_begin() const
139 -      { return _BeforeBeginHelper<_Sequence>::_M_Is(base(), _M_get_sequence()); }
140 +      {
141 +       return _BeforeBeginHelper<_Sequence>::_M_Is(base(), _M_get_sequence());
142 +      }
143      };
144  
145    template<typename _IteratorL, typename _IteratorR, typename _Sequence>
146 Index: libstdc++-v3/include/std/array
147 ===================================================================
148 --- libstdc++-v3/include/std/array      (.../tags/gcc_4_7_0_release)    (wersja 185750)
149 +++ libstdc++-v3/include/std/array      (.../branches/gcc-4_7-branch)   (wersja 185750)
150 @@ -1,6 +1,7 @@
151  // <array> -*- C++ -*-
152  
153 -// Copyright (C) 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
154 +// Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012
155 +// Free Software Foundation, Inc.
156  //
157  // This file is part of the GNU ISO C++ Library.  This library is free
158  // software; you can redistribute it and/or modify it under the
159 @@ -174,8 +175,9 @@
160        const_reference
161        at(size_type __n) const
162        {
163 -       return __n < _Nm ?
164 -              _M_instance[__n] : __throw_out_of_range(__N("array::at"));
165 +       if (__n >= _Nm)
166 +         std::__throw_out_of_range(__N("array::at"));
167 +       return _M_instance[__n];
168        }
169  #endif
170  
171 Index: libstdc++-v3/include/bits/forward_list.h
172 ===================================================================
173 --- libstdc++-v3/include/bits/forward_list.h    (.../tags/gcc_4_7_0_release)    (wersja 185750)
174 +++ libstdc++-v3/include/bits/forward_list.h    (.../branches/gcc-4_7-branch)   (wersja 185750)
175 @@ -1,6 +1,6 @@
176  // <forward_list.h> -*- C++ -*-
177  
178 -// Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
179 +// Copyright (C) 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
180  //
181  // This file is part of the GNU ISO C++ Library.  This library is free
182  // software; you can redistribute it and/or modify it under the
183 @@ -606,8 +606,8 @@
184         *  in the range [@a __first,@a __last).
185         *
186         *  Note that the assignment completely changes the %forward_list and
187 -       *  that the resulting %forward_list's size is the same as the number
188 -       *  of elements assigned.  Old data may be lost.
189 +       *  that the number of elements of the resulting %forward_list's is the
190 +       *  same as the number of elements assigned.  Old data is lost.
191         */
192        template<typename _InputIterator>
193          void
194 @@ -622,10 +622,10 @@
195         *  @param  __n  Number of elements to be assigned.
196         *  @param  __val  Value to be assigned.
197         *
198 -       *  This function fills a %forward_list with @a __n copies of the given
199 -       *  value.  Note that the assignment completely changes the
200 -       *  %forward_list and that the resulting %forward_list's size is the
201 -       *  same as the number of elements assigned.  Old data may be lost.
202 +       *  This function fills a %forward_list with @a __n copies of the
203 +       *  given value.  Note that the assignment completely changes the
204 +       *  %forward_list, and that the resulting %forward_list has __n
205 +       *  elements.  Old data is lost.
206         */
207        void
208        assign(size_type __n, const _Tp& __val)
209 @@ -744,7 +744,7 @@
210        { return this->_M_impl._M_head._M_next == 0; }
211  
212        /**
213 -       *  Returns the largest possible size of %forward_list.
214 +       *  Returns the largest possible number of elements of %forward_list.
215         */
216        size_type
217        max_size() const noexcept
218 @@ -997,9 +997,9 @@
219         *
220         *  This function will %resize the %forward_list to the specified
221         *  number of elements.  If the number is smaller than the
222 -       *  %forward_list's current size the %forward_list is truncated,
223 -       *  otherwise the %forward_list is extended and the new elements
224 -       *  are default constructed.
225 +       *  %forward_list's current number of elements the %forward_list
226 +       *  is truncated, otherwise the %forward_list is extended and the
227 +       *  new elements are default constructed.
228         */
229        void
230        resize(size_type __sz);
231 @@ -1012,9 +1012,9 @@
232         *
233         *  This function will %resize the %forward_list to the specified
234         *  number of elements.  If the number is smaller than the
235 -       *  %forward_list's current size the %forward_list is truncated,
236 -       *  otherwise the %forward_list is extended and new elements are
237 -       *  populated with given data.
238 +       *  %forward_list's current number of elements the %forward_list
239 +       *  is truncated, otherwise the %forward_list is extended and new
240 +       *  elements are populated with given data.
241         */
242        void
243        resize(size_type __sz, const value_type& __val);
244 @@ -1240,11 +1240,11 @@
245     *  @brief  Forward list equality comparison.
246     *  @param  __lx  A %forward_list
247     *  @param  __ly  A %forward_list of the same type as @a __lx.
248 -   *  @return  True iff the size and elements of the forward lists are equal.
249 +   *  @return  True iff the elements of the forward lists are equal.
250     *
251 -   *  This is an equivalence relation.  It is linear in the size of the
252 -   *  forward lists.  Deques are considered equivalent if corresponding
253 -   *  elements compare equal.
254 +   *  This is an equivalence relation.  It is linear in the number of 
255 +   *  elements of the forward lists.  Deques are considered equivalent
256 +   *  if corresponding elements compare equal.
257     */
258    template<typename _Tp, typename _Alloc>
259      bool
260 @@ -1257,8 +1257,9 @@
261     *  @param  __ly  A %forward_list of the same type as @a __lx.
262     *  @return  True iff @a __lx is lexicographically less than @a __ly.
263     *
264 -   *  This is a total ordering relation.  It is linear in the size of the
265 -   *  forward lists.  The elements must be comparable with @c <.
266 +   *  This is a total ordering relation.  It is linear in the number of 
267 +   *  elements of the forward lists.  The elements must be comparable
268 +   *  with @c <.
269     *
270     *  See std::lexicographical_compare() for how the determination is made.
271     */
272 Index: libstdc++-v3/include/Makefile.am
273 ===================================================================
274 --- libstdc++-v3/include/Makefile.am    (.../tags/gcc_4_7_0_release)    (wersja 185750)
275 +++ libstdc++-v3/include/Makefile.am    (.../branches/gcc-4_7-branch)   (wersja 185750)
276 @@ -1,7 +1,7 @@
277  ## Makefile for the include subdirectory of the GNU C++ Standard library.
278  ##
279  ## Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
280 -## 2011
281 +## 2011, 2012
282  ## Free Software Foundation, Inc.
283  ##
284  ## This file is part of the libstdc++ version 3 distribution.
285 @@ -1105,7 +1105,7 @@
286         sed -e "s,define __GLIBCXX__,define __GLIBCXX__ $$date," \
287         -e "s,define _GLIBCXX_INLINE_VERSION, define _GLIBCXX_INLINE_VERSION $$ns_version," \
288         -e "s,define _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY, define _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY $$visibility," \
289 -       -e "s,define _GLIBCXX_EXTERN_TEMPLATE, define _GLIBCXX_EXTERN_TEMPLATE $$externtemplate," \
290 +       -e "s,define _GLIBCXX_EXTERN_TEMPLATE$$, define _GLIBCXX_EXTERN_TEMPLATE $$externtemplate," \
291         -e "$$ldbl_compat" \
292             < ${glibcxx_srcdir}/include/bits/c++config > $@ ;\
293         sed -e 's/HAVE_/_GLIBCXX_HAVE_/g' \
294 Index: libstdc++-v3/ChangeLog
295 ===================================================================
296 --- libstdc++-v3/ChangeLog      (.../tags/gcc_4_7_0_release)    (wersja 185750)
297 +++ libstdc++-v3/ChangeLog      (.../branches/gcc-4_7-branch)   (wersja 185750)
298 @@ -1,3 +1,30 @@
299 +2012-03-23  David S. Miller  <davem@davemloft.net>
300 +
301 +       * config/abi/post/sparc-linux-gnu/baseline_symbols.txt: Update.
302 +
303 +2012-03-23  Paolo Carlini  <paolo.carlini@oracle.com>
304 +
305 +       * include/bits/forward_list.h: Fix comments.
306 +
307 +2012-03-23  PaweÅ‚ Sikora  <pawel.sikora@agmk.net>
308 +
309 +       PR libstdc++/52540
310 +       * include/Makefile.am (c++config.h): Fix sed rule to not break
311 +       the _GLIBCXX_EXTERN_TEMPLATE redefinition.
312 +       * include/Makefile.in: Regenerate.
313 +
314 +2012-03-22  Jonathan Wakely  <jwakely.gcc@gmail.com>
315 +
316 +       PR libstdc++/52433
317 +       * include/debug/safe_iterator.h (_Safe_iterator): Add move
318 +       constructor and move assignment operator.
319 +       * testsuite/23_containers/vector/debug/52433.cc: New.
320 +
321 +2012-03-22  Paolo Carlini  <paolo.carlini@oracle.com>
322 +
323 +       * include/std/array (array<>::at(size_type) const): Fix version
324 +       for undefined __EXCEPTIONS.
325 +
326  2012-03-22  Release Manager
327  
328         * GCC 4.7.0 released.
329 Index: libstdc++-v3/testsuite/23_containers/vector/debug/52433.cc
330 ===================================================================
331 --- libstdc++-v3/testsuite/23_containers/vector/debug/52433.cc  (.../tags/gcc_4_7_0_release)    (wersja 0)
332 +++ libstdc++-v3/testsuite/23_containers/vector/debug/52433.cc  (.../branches/gcc-4_7-branch)   (wersja 185750)
333 @@ -0,0 +1,43 @@
334 +// Copyright (C) 2012 Free Software Foundation, Inc.
335 +//
336 +// This file is part of the GNU ISO C++ Library.  This library is free
337 +// software; you can redistribute it and/or modify it under the
338 +// terms of the GNU General Public License as published by the
339 +// Free Software Foundation; either version 3, or (at your option)
340 +// any later version.
341 +//
342 +// This library is distributed in the hope that it will be useful,
343 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
344 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
345 +// GNU General Public License for more details.
346 +//
347 +// You should have received a copy of the GNU General Public License along
348 +// with this library; see the file COPYING3.  If not see
349 +// <http://www.gnu.org/licenses/>.
350 +//
351 +// { dg-require-debug-mode "" }
352 +// { dg-options "-std=gnu++0x" }
353 +// { dg-do compile }
354 +
355 +// PR libstdc++/52433
356 +
357 +#include <vector>
358 +
359 +struct X
360 +{
361 +    std::vector<int>::iterator i;
362 +
363 +    X() = default;
364 +    X(const X&) = default;
365 +    X(X&&) = default;
366 +    X& operator=(const X&) = default;
367 +    X& operator=(X&&) = default;
368 +};
369 +
370 +X test01()
371 +{
372 +    X x;
373 +    x = X();
374 +    return x;
375 +}
376 +
377 Index: libstdc++-v3/config/abi/post/sparc-linux-gnu/baseline_symbols.txt
378 ===================================================================
379 --- libstdc++-v3/config/abi/post/sparc-linux-gnu/baseline_symbols.txt   (.../tags/gcc_4_7_0_release)    (wersja 185750)
380 +++ libstdc++-v3/config/abi/post/sparc-linux-gnu/baseline_symbols.txt   (.../branches/gcc-4_7-branch)   (wersja 185750)
381 @@ -43,6 +43,10 @@
382  FUNC:_ZN11__gnu_debug19_Safe_sequence_base18_M_detach_singularEv@@GLIBCXX_3.4
383  FUNC:_ZN11__gnu_debug19_Safe_sequence_base22_M_revalidate_singularEv@@GLIBCXX_3.4
384  FUNC:_ZN11__gnu_debug19_Safe_sequence_base7_M_swapERS0_@@GLIBCXX_3.4
385 +FUNC:_ZN11__gnu_debug25_Safe_local_iterator_base9_M_attachEPNS_19_Safe_sequence_baseEb@@GLIBCXX_3.4.17
386 +FUNC:_ZN11__gnu_debug25_Safe_local_iterator_base9_M_detachEv@@GLIBCXX_3.4.17
387 +FUNC:_ZN11__gnu_debug30_Safe_unordered_container_base13_M_detach_allEv@@GLIBCXX_3.4.17
388 +FUNC:_ZN11__gnu_debug30_Safe_unordered_container_base7_M_swapERS0_@@GLIBCXX_3.4.17
389  FUNC:_ZN14__gnu_parallel9_Settings3getEv@@GLIBCXX_3.4.10
390  FUNC:_ZN14__gnu_parallel9_Settings3setERS0_@@GLIBCXX_3.4.10
391  FUNC:_ZN9__gnu_cxx12__atomic_addEPVii@@GLIBCXX_3.4
392 @@ -877,6 +881,7 @@
393  FUNC:_ZNSaIwEC2Ev@@GLIBCXX_3.4
394  FUNC:_ZNSaIwED1Ev@@GLIBCXX_3.4
395  FUNC:_ZNSaIwED2Ev@@GLIBCXX_3.4
396 +FUNC:_ZNSbIwSt11char_traitsIwESaIwEE10_S_compareEjj@@GLIBCXX_3.4.16
397  FUNC:_ZNSbIwSt11char_traitsIwESaIwEE12_Alloc_hiderC1EPwRKS1_@@GLIBCXX_3.4
398  FUNC:_ZNSbIwSt11char_traitsIwESaIwEE12_Alloc_hiderC2EPwRKS1_@@GLIBCXX_3.4
399  FUNC:_ZNSbIwSt11char_traitsIwESaIwEE12_M_leak_hardEv@@GLIBCXX_3.4
400 @@ -961,6 +966,7 @@
401  FUNC:_ZNSbIwSt11char_traitsIwESaIwEE7replaceEjjRKS2_jj@@GLIBCXX_3.4
402  FUNC:_ZNSbIwSt11char_traitsIwESaIwEE7replaceEjjjw@@GLIBCXX_3.4
403  FUNC:_ZNSbIwSt11char_traitsIwESaIwEE7reserveEj@@GLIBCXX_3.4
404 +FUNC:_ZNSbIwSt11char_traitsIwESaIwEE8pop_backEv@@GLIBCXX_3.4.17
405  FUNC:_ZNSbIwSt11char_traitsIwESaIwEE9_M_assignEPwjw@@GLIBCXX_3.4.5
406  FUNC:_ZNSbIwSt11char_traitsIwESaIwEE9_M_assignEPwjw@GLIBCXX_3.4
407  FUNC:_ZNSbIwSt11char_traitsIwESaIwEE9_M_mutateEjjj@@GLIBCXX_3.4
408 @@ -1116,6 +1122,7 @@
409  FUNC:_ZNSolsEt@@GLIBCXX_3.4
410  FUNC:_ZNSolsEx@@GLIBCXX_3.4
411  FUNC:_ZNSolsEy@@GLIBCXX_3.4
412 +FUNC:_ZNSs10_S_compareEjj@@GLIBCXX_3.4.16
413  FUNC:_ZNSs12_Alloc_hiderC1EPcRKSaIcE@@GLIBCXX_3.4
414  FUNC:_ZNSs12_Alloc_hiderC2EPcRKSaIcE@@GLIBCXX_3.4
415  FUNC:_ZNSs12_M_leak_hardEv@@GLIBCXX_3.4
416 @@ -1200,6 +1207,7 @@
417  FUNC:_ZNSs7replaceEjjRKSsjj@@GLIBCXX_3.4
418  FUNC:_ZNSs7replaceEjjjc@@GLIBCXX_3.4
419  FUNC:_ZNSs7reserveEj@@GLIBCXX_3.4
420 +FUNC:_ZNSs8pop_backEv@@GLIBCXX_3.4.17
421  FUNC:_ZNSs9_M_assignEPcjc@@GLIBCXX_3.4.5
422  FUNC:_ZNSs9_M_assignEPcjc@GLIBCXX_3.4
423  FUNC:_ZNSs9_M_mutateEjjj@@GLIBCXX_3.4
424 @@ -1433,6 +1441,9 @@
425  FUNC:_ZNSt13__future_base12_Result_baseD0Ev@@GLIBCXX_3.4.15
426  FUNC:_ZNSt13__future_base12_Result_baseD1Ev@@GLIBCXX_3.4.15
427  FUNC:_ZNSt13__future_base12_Result_baseD2Ev@@GLIBCXX_3.4.15
428 +FUNC:_ZNSt13__future_base19_Async_state_commonD0Ev@@GLIBCXX_3.4.17
429 +FUNC:_ZNSt13__future_base19_Async_state_commonD1Ev@@GLIBCXX_3.4.17
430 +FUNC:_ZNSt13__future_base19_Async_state_commonD2Ev@@GLIBCXX_3.4.17
431  FUNC:_ZNSt13bad_exceptionD0Ev@@GLIBCXX_3.4
432  FUNC:_ZNSt13bad_exceptionD1Ev@@GLIBCXX_3.4
433  FUNC:_ZNSt13bad_exceptionD2Ev@@GLIBCXX_3.4
434 @@ -1741,6 +1752,8 @@
435  FUNC:_ZNSt15__exception_ptrneERKNS_13exception_ptrES2_@@CXXABI_1.3.3
436  FUNC:_ZNSt15basic_streambufIcSt11char_traitsIcEE10pubseekoffExSt12_Ios_SeekdirSt13_Ios_Openmode@@GLIBCXX_3.4
437  FUNC:_ZNSt15basic_streambufIcSt11char_traitsIcEE10pubseekposESt4fposI11__mbstate_tESt13_Ios_Openmode@@GLIBCXX_3.4
438 +FUNC:_ZNSt15basic_streambufIcSt11char_traitsIcEE12__safe_gbumpEi@@GLIBCXX_3.4.16
439 +FUNC:_ZNSt15basic_streambufIcSt11char_traitsIcEE12__safe_pbumpEi@@GLIBCXX_3.4.16
440  FUNC:_ZNSt15basic_streambufIcSt11char_traitsIcEE4setgEPcS3_S3_@@GLIBCXX_3.4
441  FUNC:_ZNSt15basic_streambufIcSt11char_traitsIcEE4setpEPcS3_@@GLIBCXX_3.4
442  FUNC:_ZNSt15basic_streambufIcSt11char_traitsIcEE4syncEv@@GLIBCXX_3.4
443 @@ -1780,6 +1793,8 @@
444  FUNC:_ZNSt15basic_streambufIcSt11char_traitsIcEEaSERKS2_@@GLIBCXX_3.4
445  FUNC:_ZNSt15basic_streambufIwSt11char_traitsIwEE10pubseekoffExSt12_Ios_SeekdirSt13_Ios_Openmode@@GLIBCXX_3.4
446  FUNC:_ZNSt15basic_streambufIwSt11char_traitsIwEE10pubseekposESt4fposI11__mbstate_tESt13_Ios_Openmode@@GLIBCXX_3.4
447 +FUNC:_ZNSt15basic_streambufIwSt11char_traitsIwEE12__safe_gbumpEi@@GLIBCXX_3.4.16
448 +FUNC:_ZNSt15basic_streambufIwSt11char_traitsIwEE12__safe_pbumpEi@@GLIBCXX_3.4.16
449  FUNC:_ZNSt15basic_streambufIwSt11char_traitsIwEE4setgEPwS3_S3_@@GLIBCXX_3.4
450  FUNC:_ZNSt15basic_streambufIwSt11char_traitsIwEE4setpEPwS3_@@GLIBCXX_3.4
451  FUNC:_ZNSt15basic_streambufIwSt11char_traitsIwEE4syncEv@@GLIBCXX_3.4
452 @@ -1824,6 +1839,7 @@
453  FUNC:_ZNSt15basic_stringbufIcSt11char_traitsIcESaIcEE7_M_syncEPcjj@@GLIBCXX_3.4
454  FUNC:_ZNSt15basic_stringbufIcSt11char_traitsIcESaIcEE7seekoffExSt12_Ios_SeekdirSt13_Ios_Openmode@@GLIBCXX_3.4
455  FUNC:_ZNSt15basic_stringbufIcSt11char_traitsIcESaIcEE7seekposESt4fposI11__mbstate_tESt13_Ios_Openmode@@GLIBCXX_3.4
456 +FUNC:_ZNSt15basic_stringbufIcSt11char_traitsIcESaIcEE8_M_pbumpEPcS4_x@@GLIBCXX_3.4.16
457  FUNC:_ZNSt15basic_stringbufIcSt11char_traitsIcESaIcEE8overflowEi@@GLIBCXX_3.4
458  FUNC:_ZNSt15basic_stringbufIcSt11char_traitsIcESaIcEE9pbackfailEi@@GLIBCXX_3.4
459  FUNC:_ZNSt15basic_stringbufIcSt11char_traitsIcESaIcEE9showmanycEv@@GLIBCXX_3.4.6
460 @@ -1841,6 +1857,7 @@
461  FUNC:_ZNSt15basic_stringbufIwSt11char_traitsIwESaIwEE7_M_syncEPwjj@@GLIBCXX_3.4
462  FUNC:_ZNSt15basic_stringbufIwSt11char_traitsIwESaIwEE7seekoffExSt12_Ios_SeekdirSt13_Ios_Openmode@@GLIBCXX_3.4
463  FUNC:_ZNSt15basic_stringbufIwSt11char_traitsIwESaIwEE7seekposESt4fposI11__mbstate_tESt13_Ios_Openmode@@GLIBCXX_3.4
464 +FUNC:_ZNSt15basic_stringbufIwSt11char_traitsIwESaIwEE8_M_pbumpEPwS4_x@@GLIBCXX_3.4.16
465  FUNC:_ZNSt15basic_stringbufIwSt11char_traitsIwESaIwEE8overflowEj@@GLIBCXX_3.4
466  FUNC:_ZNSt15basic_stringbufIwSt11char_traitsIwESaIwEE9pbackfailEj@@GLIBCXX_3.4
467  FUNC:_ZNSt15basic_stringbufIwSt11char_traitsIwESaIwEE9showmanycEv@@GLIBCXX_3.4.6
468 @@ -2145,6 +2162,7 @@
469  FUNC:_ZNSt6localeD2Ev@@GLIBCXX_3.4
470  FUNC:_ZNSt6localeaSERKS_@@GLIBCXX_3.4
471  FUNC:_ZNSt6thread15_M_start_threadESt10shared_ptrINS_10_Impl_baseEE@@GLIBCXX_3.4.11
472 +FUNC:_ZNSt6thread20hardware_concurrencyEv@@GLIBCXX_3.4.17
473  FUNC:_ZNSt6thread4joinEv@@GLIBCXX_3.4.11
474  FUNC:_ZNSt6thread6detachEv@@GLIBCXX_3.4.11
475  FUNC:_ZNSt7codecvtIcc11__mbstate_tEC1EP15__locale_structj@@GLIBCXX_3.4
476 @@ -2640,14 +2658,17 @@
477  FUNC:_ZnwjRKSt9nothrow_t@@GLIBCXX_3.4
478  FUNC:__atomic_flag_for_address@@GLIBCXX_3.4.11
479  FUNC:__atomic_flag_wait_explicit@@GLIBCXX_3.4.11
480 +FUNC:__cxa_allocate_dependent_exception@@CXXABI_1.3.6
481  FUNC:__cxa_allocate_exception@@CXXABI_1.3
482  FUNC:__cxa_bad_cast@@CXXABI_1.3
483  FUNC:__cxa_bad_typeid@@CXXABI_1.3
484  FUNC:__cxa_begin_catch@@CXXABI_1.3
485  FUNC:__cxa_call_unexpected@@CXXABI_1.3
486  FUNC:__cxa_current_exception_type@@CXXABI_1.3
487 +FUNC:__cxa_deleted_virtual@@CXXABI_1.3.6
488  FUNC:__cxa_demangle@@CXXABI_1.3
489  FUNC:__cxa_end_catch@@CXXABI_1.3
490 +FUNC:__cxa_free_dependent_exception@@CXXABI_1.3.6
491  FUNC:__cxa_free_exception@@CXXABI_1.3
492  FUNC:__cxa_get_exception_ptr@@CXXABI_1.3.1
493  FUNC:__cxa_get_globals@@CXXABI_1.3
494 @@ -2658,6 +2679,7 @@
495  FUNC:__cxa_pure_virtual@@CXXABI_1.3
496  FUNC:__cxa_rethrow@@CXXABI_1.3
497  FUNC:__cxa_throw@@CXXABI_1.3
498 +FUNC:__cxa_tm_cleanup@@CXXABI_TM_1
499  FUNC:__cxa_vec_cctor@@CXXABI_1.3
500  FUNC:__cxa_vec_cleanup@@CXXABI_1.3
501  FUNC:__cxa_vec_ctor@@CXXABI_1.3
502 @@ -2701,7 +2723,9 @@
503  OBJECT:0:CXXABI_1.3.3
504  OBJECT:0:CXXABI_1.3.4
505  OBJECT:0:CXXABI_1.3.5
506 +OBJECT:0:CXXABI_1.3.6
507  OBJECT:0:CXXABI_LDBL_1.3
508 +OBJECT:0:CXXABI_TM_1
509  OBJECT:0:GLIBCXX_3.4
510  OBJECT:0:GLIBCXX_3.4.1
511  OBJECT:0:GLIBCXX_3.4.10
512 @@ -2710,6 +2734,8 @@
513  OBJECT:0:GLIBCXX_3.4.13
514  OBJECT:0:GLIBCXX_3.4.14
515  OBJECT:0:GLIBCXX_3.4.15
516 +OBJECT:0:GLIBCXX_3.4.16
517 +OBJECT:0:GLIBCXX_3.4.17
518  OBJECT:0:GLIBCXX_3.4.2
519  OBJECT:0:GLIBCXX_3.4.3
520  OBJECT:0:GLIBCXX_3.4.4
521 @@ -2737,6 +2763,7 @@
522  OBJECT:12:_ZTIN9__gnu_cxx13stdio_filebufIwSt11char_traitsIwEEE@@GLIBCXX_3.4
523  OBJECT:12:_ZTIN9__gnu_cxx18stdio_sync_filebufIcSt11char_traitsIcEEE@@GLIBCXX_3.4
524  OBJECT:12:_ZTIN9__gnu_cxx18stdio_sync_filebufIwSt11char_traitsIwEEE@@GLIBCXX_3.4
525 +OBJECT:12:_ZTINSt13__future_base19_Async_state_commonE@@GLIBCXX_3.4.17
526  OBJECT:12:_ZTINSt17__gnu_cxx_ldbl1287num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEEE@@GLIBCXX_LDBL_3.4
527  OBJECT:12:_ZTINSt17__gnu_cxx_ldbl1287num_getIwSt19istreambuf_iteratorIwSt11char_traitsIwEEEE@@GLIBCXX_LDBL_3.4
528  OBJECT:12:_ZTINSt17__gnu_cxx_ldbl1287num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEEE@@GLIBCXX_LDBL_3.4
529 @@ -3245,6 +3272,7 @@
530  OBJECT:20:_ZTSSt15underflow_error@@GLIBCXX_3.4
531  OBJECT:20:_ZTVNSt13__future_base11_State_baseE@@GLIBCXX_3.4.15
532  OBJECT:20:_ZTVNSt13__future_base12_Result_baseE@@GLIBCXX_3.4.15
533 +OBJECT:20:_ZTVNSt13__future_base19_Async_state_commonE@@GLIBCXX_3.4.17
534  OBJECT:20:_ZTVNSt8ios_base7failureE@@GLIBCXX_3.4
535  OBJECT:20:_ZTVSt10bad_typeid@@GLIBCXX_3.4
536  OBJECT:20:_ZTVSt10lock_error@@GLIBCXX_3.4.11
537 @@ -3437,6 +3465,7 @@
538  OBJECT:40:_ZTVSt19basic_ostringstreamIwSt11char_traitsIwESaIwEE@@GLIBCXX_3.4
539  OBJECT:40:_ZTVSt8time_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE@@GLIBCXX_3.4
540  OBJECT:40:_ZTVSt8time_getIwSt19istreambuf_iteratorIwSt11char_traitsIwEEE@@GLIBCXX_3.4
541 +OBJECT:41:_ZTSNSt13__future_base19_Async_state_commonE@@GLIBCXX_3.4.17
542  OBJECT:41:_ZTSSt15basic_streambufIcSt11char_traitsIcEE@@GLIBCXX_3.4
543  OBJECT:41:_ZTSSt15basic_streambufIwSt11char_traitsIwEE@@GLIBCXX_3.4
544  OBJECT:44:_ZTVN10__cxxabiv117__class_type_infoE@@CXXABI_1.3
545 Index: libiberty/ChangeLog
546 ===================================================================
547 --- libiberty/ChangeLog (.../tags/gcc_4_7_0_release)    (wersja 185750)
548 +++ libiberty/ChangeLog (.../branches/gcc-4_7-branch)   (wersja 185750)
549 @@ -1,3 +1,8 @@
550 +2012-03-22  Jason Merrill  <jason@redhat.com>
551 +
552 +       * cp-demangle.c (cplus_demangle_operators): Add li.
553 +       (d_unqualified_name): Handle it specially.
554 +
555  2012-03-22  Release Manager
556  
557         * GCC 4.7.0 released.
558 Index: libiberty/testsuite/demangle-expected
559 ===================================================================
560 --- libiberty/testsuite/demangle-expected       (.../tags/gcc_4_7_0_release)    (wersja 185750)
561 +++ libiberty/testsuite/demangle-expected       (.../branches/gcc-4_7-branch)   (wersja 185750)
562 @@ -4073,6 +4073,8 @@
563  _Z2f1IiEDTnw_T_ilEES0_
564  decltype (new int{}) f1<int>(int)
565  --format=gnu-v3
566 +_Zli2_wPKc
567 +operator"" _w(char const*)
568  _Z1fIiEDTnw_Dapifp_EET_
569  decltype (new auto({parm#1})) f<int>(int)
570  --format=gnu-v3
571 Index: libiberty/cp-demangle.c
572 ===================================================================
573 --- libiberty/cp-demangle.c     (.../tags/gcc_4_7_0_release)    (wersja 185750)
574 +++ libiberty/cp-demangle.c     (.../branches/gcc-4_7-branch)   (wersja 185750)
575 @@ -1419,7 +1419,12 @@
576  
577        ret = d_operator_name (di);
578        if (ret != NULL && ret->type == DEMANGLE_COMPONENT_OPERATOR)
579 -       di->expansion += sizeof "operator" + ret->u.s_operator.op->len - 2;
580 +       {
581 +         di->expansion += sizeof "operator" + ret->u.s_operator.op->len - 2;
582 +         if (!strcmp (ret->u.s_operator.op->code, "li"))
583 +           ret = d_make_comp (di, DEMANGLE_COMPONENT_UNARY, ret,
584 +                              d_source_name (di));
585 +       }
586        return ret;
587      }
588    else if (peek == 'C' || peek == 'D')
589 @@ -1596,6 +1601,7 @@
590    { "ix", NL ("[]"),        2 },
591    { "lS", NL ("<<="),       2 },
592    { "le", NL ("<="),        2 },
593 +  { "li", NL ("operator\"\" "), 1 },
594    { "ls", NL ("<<"),        2 },
595    { "lt", NL ("<"),         2 },
596    { "mI", NL ("-="),        2 },
597 Index: libgcc/ChangeLog
598 ===================================================================
599 --- libgcc/ChangeLog    (.../tags/gcc_4_7_0_release)    (wersja 185750)
600 +++ libgcc/ChangeLog    (.../branches/gcc-4_7-branch)   (wersja 185750)
601 @@ -1,3 +1,30 @@
602 +2012-03-22  Georg-Johann Lay  <avr@gjlay.de>
603 +
604 +       Backport from 2012-03-07 mainline r185033.
605 +
606 +       PR target/52507
607 +       * config/avr/lib1funcs.S (__movmemx_hi): Fix loop label in RAM-part.
608 +
609 +       Backport from 2012-03-07 mainline r185031.
610 +
611 +       PR target/52505
612 +       * config/avr/lib1funcs.S (__xload_1): Don't read unintentionally
613 +       from RAM.
614 +
615 +       Backport from 2012-03-07 mainline r185030.
616 +
617 +       PR target/52461
618 +       PR target/52508
619 +       * config/avr/lib1funcs.S (__do_copy_data): Clear RAMPZ after usage
620 +       if RAMPZ affects reading from RAM.
621 +       (__tablejump_elpm__): Ditto.
622 +       (.xload): Ditto.
623 +       (__movmemx_hi): Ditto.
624 +       (__do_global_ctors): Right condition for RAMPZ usage is "have ELPM".
625 +       (__do_global_dtors): Ditto.
626 +       (__xload_1, __xload_2, __xload_3, __xload_4): Ditto.
627 +       (__movmemx_hi): Ditto.
628 +
629  2012-03-22  Release Manager
630  
631         * GCC 4.7.0 released.
632 Index: libgcc/config/avr/lib1funcs.S
633 ===================================================================
634 --- libgcc/config/avr/lib1funcs.S       (.../tags/gcc_4_7_0_release)    (wersja 185750)
635 +++ libgcc/config/avr/lib1funcs.S       (.../branches/gcc-4_7-branch)   (wersja 185750)
636 @@ -1893,6 +1893,10 @@
637         cpc     r27, r17
638         brne    .L__do_copy_data_loop
639  #endif /* !defined(__AVR_HAVE_ELPMX__) && !defined(__AVR_HAVE_ELPM__) */
640 +#if defined (__AVR_HAVE_ELPM__) && defined (__AVR_HAVE_RAMPD__)
641 +       ;; Reset RAMPZ to 0 so that EBI devices don't read garbage from RAM
642 +       out     __RAMPZ__, __zero_reg__
643 +#endif /* ELPM && RAMPD */
644  ENDF __do_copy_data
645  #endif /* L_copy_data */
646  
647 @@ -1920,7 +1924,7 @@
648  #ifdef L_ctors
649         .section .init6,"ax",@progbits
650  DEFUN __do_global_ctors
651 -#if defined(__AVR_HAVE_RAMPZ__)
652 +#if defined(__AVR_HAVE_ELPM__)
653         ldi     r17, hi8(__ctors_start)
654         ldi     r28, lo8(__ctors_end)
655         ldi     r29, hi8(__ctors_end)
656 @@ -1953,14 +1957,14 @@
657         cpi     r28, lo8(__ctors_start)
658         cpc     r29, r17
659         brne    .L__do_global_ctors_loop
660 -#endif /* defined(__AVR_HAVE_RAMPZ__) */
661 +#endif /* defined(__AVR_HAVE_ELPM__) */
662  ENDF __do_global_ctors
663  #endif /* L_ctors */
664  
665  #ifdef L_dtors
666         .section .fini6,"ax",@progbits
667  DEFUN __do_global_dtors
668 -#if defined(__AVR_HAVE_RAMPZ__)
669 +#if defined(__AVR_HAVE_ELPM__)
670         ldi     r17, hi8(__dtors_end)
671         ldi     r28, lo8(__dtors_start)
672         ldi     r29, hi8(__dtors_start)
673 @@ -1993,7 +1997,7 @@
674         cpi     r28, lo8(__dtors_end)
675         cpc     r29, r17
676         brne    .L__do_global_dtors_loop
677 -#endif /* defined(__AVR_HAVE_RAMPZ__) */
678 +#endif /* defined(__AVR_HAVE_ELPM__) */
679  ENDF __do_global_dtors
680  #endif /* L_dtors */
681  
682 @@ -2001,18 +2005,21 @@
683      
684  #ifdef L_tablejump_elpm
685  DEFUN __tablejump_elpm__
686 -#if defined (__AVR_HAVE_ELPM__)
687 -#if defined (__AVR_HAVE_LPMX__)
688 +#if defined (__AVR_HAVE_ELPMX__)
689         elpm    __tmp_reg__, Z+
690         elpm    r31, Z
691         mov     r30, __tmp_reg__
692 +#if defined (__AVR_HAVE_RAMPD__)
693 +       ;; Reset RAMPZ to 0 so that EBI devices don't read garbage from RAM
694 +       out     __RAMPZ__, __zero_reg__
695 +#endif /* RAMPD */
696  #if defined (__AVR_HAVE_EIJMP_EICALL__)
697         eijmp
698  #else
699         ijmp
700  #endif
701  
702 -#else
703 +#elif defined (__AVR_HAVE_ELPM__)
704         elpm
705         adiw    r30, 1
706         push    r0
707 @@ -2024,7 +2031,6 @@
708  #endif
709         ret
710  #endif
711 -#endif /* defined (__AVR_HAVE_ELPM__) */
712  ENDF __tablejump_elpm__
713  #endif /* defined (L_tablejump_elpm) */
714  
715 @@ -2114,11 +2120,18 @@
716      adiw    r30, 1
717  .endif
718  #endif
719 +#if defined (__AVR_HAVE_ELPM__) && defined (__AVR_HAVE_RAMPD__)
720 +.if \dest == D0+\n-1
721 +    ;; Reset RAMPZ to 0 so that EBI devices don't read garbage from RAM
722 +    out     __RAMPZ__, __zero_reg__
723 +.endif
724 +#endif
725  .endm ; .xload
726  
727  #if defined (L_xload_1)
728  DEFUN __xload_1
729 -#if defined (__AVR_HAVE_LPMX__) && !defined (__AVR_HAVE_RAMPZ__)
730 +#if defined (__AVR_HAVE_LPMX__) && !defined (__AVR_HAVE_ELPM__)
731 +    sbrc    HHI8, 7
732      ld      D0, Z
733      sbrs    HHI8, 7
734      lpm     D0, Z
735 @@ -2126,14 +2139,14 @@
736  #else
737      sbrc    HHI8, 7
738      rjmp    1f
739 -#if defined (__AVR_HAVE_RAMPZ__)
740 +#if defined (__AVR_HAVE_ELPM__)
741      out     __RAMPZ__, HHI8
742 -#endif /* __AVR_HAVE_RAMPZ__ */
743 +#endif /* __AVR_HAVE_ELPM__ */
744      .xload  D0, 1
745      ret
746  1:  ld      D0, Z
747      ret
748 -#endif /* LPMx && ! RAMPZ */
749 +#endif /* LPMx && ! ELPM */
750  ENDF __xload_1
751  #endif /* L_xload_1 */
752  
753 @@ -2141,9 +2154,9 @@
754  DEFUN __xload_2
755      sbrc    HHI8, 7
756      rjmp    1f
757 -#if defined (__AVR_HAVE_RAMPZ__)
758 +#if defined (__AVR_HAVE_ELPM__)
759      out     __RAMPZ__, HHI8
760 -#endif /* __AVR_HAVE_RAMPZ__ */
761 +#endif /* __AVR_HAVE_ELPM__ */
762      .xload  D0, 2
763      .xload  D1, 2
764      ret
765 @@ -2157,9 +2170,9 @@
766  DEFUN __xload_3
767      sbrc    HHI8, 7
768      rjmp    1f
769 -#if defined (__AVR_HAVE_RAMPZ__)
770 +#if defined (__AVR_HAVE_ELPM__)
771      out     __RAMPZ__, HHI8
772 -#endif /* __AVR_HAVE_RAMPZ__ */
773 +#endif /* __AVR_HAVE_ELPM__ */
774      .xload  D0, 3
775      .xload  D1, 3
776      .xload  D2, 3
777 @@ -2175,9 +2188,9 @@
778  DEFUN __xload_4
779      sbrc    HHI8, 7
780      rjmp    1f
781 -#if defined (__AVR_HAVE_RAMPZ__)
782 +#if defined (__AVR_HAVE_ELPM__)
783      out     __RAMPZ__, HHI8
784 -#endif /* __AVR_HAVE_RAMPZ__ */
785 +#endif /* __AVR_HAVE_ELPM__ */
786      .xload  D0, 4
787      .xload  D1, 4
788      .xload  D2, 4
789 @@ -2219,7 +2232,7 @@
790  
791  ;; Read from Flash
792  
793 -#if defined (__AVR_HAVE_RAMPZ__)
794 +#if defined (__AVR_HAVE_ELPM__)
795      out     __RAMPZ__, HHI8
796  #endif
797  
798 @@ -2243,6 +2256,10 @@
799      st      X+, r0
800      sbiw    LOOP, 1
801      brne    0b
802 +#if defined (__AVR_HAVE_ELPM__) && defined (__AVR_HAVE_RAMPD__)
803 +    ;; Reset RAMPZ to 0 so that EBI devices don't read garbage from RAM
804 +    out        __RAMPZ__, __zero_reg__
805 +#endif /* ELPM && RAMPD */
806      ret
807  
808  ;; Read from RAM
809 @@ -2252,7 +2269,7 @@
810      ;; and store that Byte to RAM Destination
811      st      X+, r0
812      sbiw    LOOP, 1
813 -    brne    0b
814 +    brne    1b
815      ret
816  ENDF __movmemx_hi
817  
818 Index: gcc/c-family/ChangeLog
819 ===================================================================
820 --- gcc/c-family/ChangeLog      (.../tags/gcc_4_7_0_release)    (wersja 185750)
821 +++ gcc/c-family/ChangeLog      (.../branches/gcc-4_7-branch)   (wersja 185750)
822 @@ -1,3 +1,8 @@
823 +2012-03-23  William Bader  <williambader@hotmail.com>
824 +
825 +       PR c/52682
826 +       * c-lex.c (c_lex_with_flags): Avoid declarations after stmts.
827 +
828  2012-03-22  Release Manager
829  
830         * GCC 4.7.0 released.
831 Index: gcc/c-family/c-lex.c
832 ===================================================================
833 --- gcc/c-family/c-lex.c        (.../tags/gcc_4_7_0_release)    (wersja 185750)
834 +++ gcc/c-family/c-lex.c        (.../branches/gcc-4_7-branch)   (wersja 185750)
835 @@ -342,6 +342,8 @@
836  
837         if (flags & CPP_N_USERDEF)
838           {
839 +           char *str;
840 +           tree literal;
841             tree suffix_id = get_identifier (suffix);
842             int len = tok->val.str.len - strlen (suffix);
843             /* If this is going to be used as a C string to pass to a
844 @@ -350,9 +352,9 @@
845                                             (const char *) tok->val.str.text);
846             TREE_TYPE (num_string) = char_array_type_node;
847             num_string = fix_string_type (num_string);
848 -           char *str = CONST_CAST (char *, TREE_STRING_POINTER (num_string));
849 +           str = CONST_CAST (char *, TREE_STRING_POINTER (num_string));
850             str[len] = '\0';
851 -           tree literal = build_userdef_literal (suffix_id, *value,
852 +           literal = build_userdef_literal (suffix_id, *value,
853                                                   num_string);
854             *value = literal;
855           }
856 Index: gcc/DATESTAMP
857 ===================================================================
858 --- gcc/DATESTAMP       (.../tags/gcc_4_7_0_release)    (wersja 185750)
859 +++ gcc/DATESTAMP       (.../branches/gcc-4_7-branch)   (wersja 185750)
860 @@ -1 +1 @@
861 -20120322
862 +20120323
863 Index: gcc/DEV-PHASE
864 ===================================================================
865 --- gcc/DEV-PHASE       (.../tags/gcc_4_7_0_release)    (wersja 185750)
866 +++ gcc/DEV-PHASE       (.../branches/gcc-4_7-branch)   (wersja 185750)
867 @@ -0,0 +1 @@
868 +prerelease
869 Index: gcc/ChangeLog
870 ===================================================================
871 --- gcc/ChangeLog       (.../tags/gcc_4_7_0_release)    (wersja 185750)
872 +++ gcc/ChangeLog       (.../branches/gcc-4_7-branch)   (wersja 185750)
873 @@ -1,3 +1,173 @@
874 +2012-03-23  Michael Meissner  <meissner@linux.vnet.ibm.com>
875 +
876 +       Backported from mainline
877 +       2012-03-06  Michael Meissner  <meissner@linux.vnet.ibm.com>
878 +
879 +       PR target/50310
880 +       * config/rs6000/vector.md (vector_uneq<mode>): Add support for
881 +       UNEQ, LTGT, ORDERED, and UNORDERED IEEE vector comparisons.
882 +       (vector_ltgt<mode>): Likewise.
883 +       (vector_ordered<mode>): Likewise.
884 +       (vector_unordered<mode>): Likewise.
885 +       * config/rs6000/rs6000.c (rs6000_emit_vector_compare_inner): Likewise.
886 +
887 +2012-03-23  Joern Rennecke  <joern.rennecke@embecosm.com>
888 +
889 +       * config/epiphany/epiphany.c (epiphany_function_value_regno_p):
890 +       Make static.
891 +
892 +2012-03-22  Kaz Kojima  <kkojima@gcc.gnu.org>
893 +
894 +       Backported from mainline
895 +       2012-03-02  Kaz Kojima  <kkojima@gcc.gnu.org>
896 +
897 +       PR target/48596
898 +       PR target/48806
899 +       * config/sh/sh.c (sh_register_move_cost): Increase cost between
900 +       GENERAL_REGS and FP_REGS for SImode.
901 +
902 +2012-03-22  Jakub Jelinek  <jakub@redhat.com>
903 +
904 +       PR middle-end/52547
905 +       * tree-nested.c (convert_tramp_reference_stmt): Call declare_vars
906 +       on any new_local_var_chain vars declared during recursing on
907 +       GIMPLE_OMP_PARALLEL or GIMPLE_OMP_TASK body.
908 +
909 +2012-03-22  Georg-Johann Lay  <avr@gjlay.de>
910 +
911 +       Backport from 2012-03-22 mainline r185692.
912 +
913 +       PR target/52496
914 +       * config/avr/avr.md (unspec): Remove UNSPEC_MEMORY_BARRIER.
915 +       (unspecv): Add UNSPECV_MEMORY_BARRIER.
916 +       (cli_sei): Use unspec_volatile instead of unspec for memory barrier.
917 +       (delay_cycles_1, delay_cycles_2): Ditto.
918 +       (delay_cycles_3, delay_cycles_4): Ditto.
919 +       (nopv, *nopv): Ditto.
920 +       (sleep, *sleep): Ditto.
921 +       (wdr, *wdr): Ditto.
922 +
923 +       Backport from 2012-03-21 mainline r185605.
924 +
925 +       PR rtl-optimization/52543
926 +       PR target/52461
927 +       * config/avr/avr-protos.h (avr_load_lpm): New prototype.
928 +       * config/avr/avr.c (avr_mode_dependent_address_p): New function.
929 +       (TARGET_MODE_DEPENDENT_ADDRESS_P): New define.
930 +       (avr_load_libgcc_p): Restrict to __flash loads.
931 +       (avr_out_lpm): Only handle 1-byte loads from __flash.
932 +       (avr_load_lpm): New function.
933 +       (avr_find_unused_d_reg): Remove.
934 +       (avr_out_lpm_no_lpmx): Remove.
935 +       (adjust_insn_length): Handle ADJUST_LEN_LOAD_LPM.
936 +       * config/avr/avr.md (unspec): Add UNSPEC_LPM.
937 +       (load_<mode>_libgcc): Use UNSPEC_LPM instead of MEM.
938 +       (load_<mode>, load_<mode>_clobber): New insns.
939 +       (mov<mode>): For multi-byte move from non-generic
940 +       16-bit address spaces: Expand to load_<mode> resp.
941 +       load_<mode>_clobber.
942 +       (load<mode>_libgcc): Remove expander.
943 +       (split-lpmx): Remove split.
944 +
945 +       Backport from 2012-03-13 mainline r185329.
946 +
947 +       PR target/52488
948 +       * config/avr/avr.c (avr_prologue_setup_frame): Cut down stack
949 +       offset (size) to a value the insns can deal with.
950 +       (expand_epilogue): Ditto.
951 +
952 +       Backport from 2012-03-12 mainline r185256.
953 +
954 +       PR target/52499
955 +       * config/avr/avr.c (avr_mode_code_base_reg_class): Change return
956 +       type from reg_class_t to enum reg_class.
957 +       * config/avr/avr-protos.h (avr_mode_code_base_reg_class): Ditto.
958 +
959 +       Backport from 2012-03-12 mainline r185253.
960 +
961 +       PR target/52148
962 +       * config/avr/avr.c (avr_out_movmem): Fix typo in output template
963 +       for the case ADDR_SPACE_FLASH and AVR_HAVE_LPMX introduced in
964 +       r184615 from 2012-02-28.
965 +
966 +       Backport from 2012-03-08 mainline r185105.
967 +
968 +       * config/avr/avr.md (*addhi3, addhi3_clobber): Add "w" alternative
969 +       for constants in [-63,63].
970 +
971 +       Backport from 2012-03-08 mainline r185100.
972 +
973 +       PR target/52496
974 +       * config/avr/avr.c (avr_mem_clobber): New static function.
975 +       (avr_expand_delay_cycles): Add memory clobber operand to
976 +       delay_cycles_1, delay_cycles_2, delay_cycles_3, delay_cycles_4.
977 +       * config/avr/avr.md (unspec): Add UNSPEC_MEMORY_BARRIER.
978 +       (enable_interrupt, disable_interrupt): New expander.
979 +       (nopv, sleep, wdr): New expanders.
980 +       (delay_cycles_1): Add memory clobber.
981 +       (delay_cycles_2): Add memory clobber.
982 +       (delay_cycles_3): Add memory clobber.
983 +       (delay_cycles_4): Add memory clobber.
984 +       (cli_sei): New insn from former "enable_interrupt",
985 +       "disable_interrupt" with memory clobber.
986 +       (*wdt): New insn from former "wdt" with memory clobber.
987 +       (*nopv): Similar, but for "nopv".
988 +       (*sleep): Similar, but for "sleep".
989 +
990 +       Backport from 2012-03-07 mainline r185043.
991 +
992 +       PR target/52484
993 +       * config/avr/avr.md (xload<mode>_A): Add R22... to register footprint.
994 +
995 +       Backport from 2012-03-07 mainline r185032.
996 +
997 +       PR target/52506
998 +       * gcc/config/avr/avr.c (expand_epilogue): Fix order of restoration
999 +       to: RAMPZ, RAMPY, RAMPX, RAMPD.
1000 +       (expand_prologue): Only clear RAMPZ if it has effect on RAM-read.
1001 +
1002 +       Backport from 2012-03-07 mainline r185031.
1003 +
1004 +       PR target/52505
1005 +       * config/avr/avr.c (avr_out_xload): Don't read unintentionally
1006 +       from RAM.
1007 +       * config/avr/avr.md (xload_8): Adjust insn length.
1008 +
1009 +       Backport from 2012-03-07 mainline r185030.
1010 +
1011 +       PR target/52461
1012 +       * gcc/config/avr/avr.c (avr_out_lpm): Clear RAMPZ after usage
1013 +       if RAMPZ affects reading from RAM.
1014 +
1015 +       Backport from 2012-03-05 mainline r184919.
1016 +
1017 +       * config/avr/avr.md (*umaddqihi4.2): New insn-and-split.
1018 +
1019 +2012-03-22  Georg-Johann Lay  <avr@gjlay.de>
1020 +
1021 +       Backport from mainline r185259.
1022 +
1023 +       PR other/52545
1024 +       * output.h (SECTION_EXCLUDE, SECTION_MACH_DEP): Don't use
1025 +       SECTION_MACH_DEP reserved bits for SECTION_EXCLUDE.
1026 +
1027 +2012-03-22  Jakub Jelinek  <jakub@redhat.com>
1028 +
1029 +       Backported from mainline
1030 +       2012-03-13  Jakub Jelinek  <jakub@redhat.com>
1031
1032 +       PR c/52577
1033 +       * c-parser.c (c_parser_postfix_expression)
1034 +       <case RID_BUILTIN_SHUFFLE>: Call mark_exp_read on argument values.
1035 +
1036 +       * config/i386/smmintrin.h: Avoid /* within a comment.
1037 +       * config/i386/nmmintrin.h: Likewise.
1038 +
1039 +2012-03-22  Richard Guenther  <rguenther@suse.de>
1040 +
1041 +       * BASE-VER: Set to 4.7.1.
1042 +       * DEV-PHASE: Set to prerelease.
1043 +
1044  2012-03-22  Release Manager
1045  
1046         * GCC 4.7.0 released.
1047 Index: gcc/testsuite/gcc.target/avr/torture/addr-space-1-0.c
1048 ===================================================================
1049 --- gcc/testsuite/gcc.target/avr/torture/addr-space-1-0.c       (.../tags/gcc_4_7_0_release)    (wersja 0)
1050 +++ gcc/testsuite/gcc.target/avr/torture/addr-space-1-0.c       (.../branches/gcc-4_7-branch)   (wersja 185750)
1051 @@ -0,0 +1,6 @@
1052 +/* { dg-options "-std=gnu99" } */
1053 +/* { dg-do run } */
1054 +
1055 +#define __as __flash
1056 +
1057 +#include "addr-space-1.h"
1058 Index: gcc/testsuite/gcc.target/avr/torture/addr-space-1-1.c
1059 ===================================================================
1060 --- gcc/testsuite/gcc.target/avr/torture/addr-space-1-1.c       (.../tags/gcc_4_7_0_release)    (wersja 0)
1061 +++ gcc/testsuite/gcc.target/avr/torture/addr-space-1-1.c       (.../branches/gcc-4_7-branch)   (wersja 185750)
1062 @@ -0,0 +1,6 @@
1063 +/* { dg-options "-std=gnu99 -Tavr51-flash1.x" } */
1064 +/* { dg-do run } */
1065 +
1066 +#define __as __flash1
1067 +
1068 +#include "addr-space-1.h"
1069 Index: gcc/testsuite/gcc.target/avr/torture/addr-space-2-0.c
1070 ===================================================================
1071 --- gcc/testsuite/gcc.target/avr/torture/addr-space-2-0.c       (.../tags/gcc_4_7_0_release)    (wersja 0)
1072 +++ gcc/testsuite/gcc.target/avr/torture/addr-space-2-0.c       (.../branches/gcc-4_7-branch)   (wersja 185750)
1073 @@ -0,0 +1,6 @@
1074 +/* { dg-options "-std=gnu99" } */
1075 +/* { dg-do run } */
1076 +
1077 +#define __as __flash
1078 +
1079 +#include "addr-space-2.h"
1080 Index: gcc/testsuite/gcc.target/avr/torture/addr-space-2-1.c
1081 ===================================================================
1082 --- gcc/testsuite/gcc.target/avr/torture/addr-space-2-1.c       (.../tags/gcc_4_7_0_release)    (wersja 0)
1083 +++ gcc/testsuite/gcc.target/avr/torture/addr-space-2-1.c       (.../branches/gcc-4_7-branch)   (wersja 185750)
1084 @@ -0,0 +1,6 @@
1085 +/* { dg-options "-std=gnu99 -Tavr51-flash1.x" } */
1086 +/* { dg-do run } */
1087 +
1088 +#define __as __flash1
1089 +
1090 +#include "addr-space-2.h"
1091 Index: gcc/testsuite/gcc.target/avr/torture/addr-space-1-x.c
1092 ===================================================================
1093 --- gcc/testsuite/gcc.target/avr/torture/addr-space-1-x.c       (.../tags/gcc_4_7_0_release)    (wersja 0)
1094 +++ gcc/testsuite/gcc.target/avr/torture/addr-space-1-x.c       (.../branches/gcc-4_7-branch)   (wersja 185750)
1095 @@ -0,0 +1,6 @@
1096 +/* { dg-options "-std=gnu99" } */
1097 +/* { dg-do run } */
1098 +
1099 +#define __as __memx
1100 +
1101 +#include "addr-space-1.h"
1102 Index: gcc/testsuite/gcc.target/avr/torture/addr-space-1.h
1103 ===================================================================
1104 --- gcc/testsuite/gcc.target/avr/torture/addr-space-1.h (.../tags/gcc_4_7_0_release)    (wersja 0)
1105 +++ gcc/testsuite/gcc.target/avr/torture/addr-space-1.h (.../branches/gcc-4_7-branch)   (wersja 185750)
1106 @@ -0,0 +1,83 @@
1107 +#include <stdlib.h>
1108 +#include <string.h>
1109 +
1110 +typedef struct
1111 +{
1112 +  char i1;
1113 +  short i2;
1114 +  long i4;
1115 +  long long i8;
1116 +  char str[2][10];
1117 +} a_t;
1118 +
1119 +const __as a_t A =
1120 +  {
1121 +    12, 345, 678910, 1234567891011ll,
1122 +    {
1123 +      "xxx..xxx",
1124 +      "yyy..yyy"
1125 +    }
1126 +  };
1127 +
1128 +const __as volatile a_t V =
1129 +  {
1130 +    12+1, 345+1, 678910+1, 1234567891011ll+1,
1131 +    {
1132 +      "XXX..XXX",
1133 +      "YYY..YYY"
1134 +    }
1135 +  };
1136 +
1137 +a_t A2;
1138 +volatile a_t V2;
1139 +
1140 +int main (void)
1141 +{
1142 +  if (A.i1 != 12
1143 +      || A.i1 != V.i1 -1)
1144 +    abort();
1145 +
1146 +  if (A.i2 != 345
1147 +      || A.i2 != V.i2 -1)
1148 +    abort();
1149 +
1150 +  if (A.i4 != 678910
1151 +      || A.i4 != V.i4 -1)
1152 +    abort();
1153 +
1154 +  if (A.i8 != 1234567891011ll
1155 +      || A.i8 != V.i8 -1)
1156 +    abort();
1157 +
1158 +  A2 = A;
1159 +  V2 = V;
1160 +
1161 +  if (A2.i1 != 12
1162 +      || A2.i1 != V2.i1 -1)
1163 +    abort();
1164 +
1165 +  if (A2.i2 != 345
1166 +      || A2.i2 != V2.i2 -1)
1167 +    abort();
1168 +
1169 +  if (A2.i4 != 678910
1170 +      || A2.i4 != V2.i4 -1)
1171 +    abort();
1172 +
1173 +  if (A2.i8 != 1234567891011ll
1174 +      || A2.i8 != V2.i8 -1)
1175 +    abort();
1176 +
1177 +  if (strcmp (A2.str[0], "xxx..xxx"))
1178 +    abort();
1179 +  if (strcmp (A2.str[1], "yyy..yyy"))
1180 +    abort();
1181 +
1182 +  if (strcmp ((const char*) V2.str[0], "XXX..XXX"))
1183 +    abort();
1184 +  if (strcmp ((const char*) V2.str[1], "YYY..YYY"))
1185 +   abort();
1186 +  
1187 +  exit (0);
1188 +  return 0;
1189 +}
1190 Index: gcc/testsuite/gcc.target/avr/torture/addr-space-2-x.c
1191 ===================================================================
1192 --- gcc/testsuite/gcc.target/avr/torture/addr-space-2-x.c       (.../tags/gcc_4_7_0_release)    (wersja 0)
1193 +++ gcc/testsuite/gcc.target/avr/torture/addr-space-2-x.c       (.../branches/gcc-4_7-branch)   (wersja 185750)
1194 @@ -0,0 +1,9 @@
1195 +/* { dg-options "-std=gnu99 -Wa,--no-warn" } */
1196 +/* { dg-do run } */
1197 +
1198 +/* --no-warn because: "assembling 24-bit address needs binutils extension"
1199 +   see binutils PR13503.  */
1200 +
1201 +#define __as __memx
1202 +
1203 +#include "addr-space-2.h"
1204 Index: gcc/testsuite/gcc.target/avr/torture/addr-space-2.h
1205 ===================================================================
1206 --- gcc/testsuite/gcc.target/avr/torture/addr-space-2.h (.../tags/gcc_4_7_0_release)    (wersja 0)
1207 +++ gcc/testsuite/gcc.target/avr/torture/addr-space-2.h (.../branches/gcc-4_7-branch)   (wersja 185750)
1208 @@ -0,0 +1,106 @@
1209 +extern void exit (int);
1210 +extern void abort (void);
1211 +
1212 +typedef struct T
1213 +{
1214 +  char val;
1215 +  const __as struct T *l, *r;
1216 +} tree;
1217 +
1218 +/*
1219 +                    abcd   
1220 +                   /    \
1221 +                 ab      cd
1222 +                /  \    /  \
1223 +               a    b  c    d
1224 +*/
1225 +
1226 +const __as tree a = { 'a', 0, 0 };
1227 +const __as tree b = { 'b', 0, 0 };
1228 +const __as tree c = { 'c', 0, 0 };
1229 +const __as tree d = { 'd', 0, 0 };
1230 +
1231 +const __as tree ab = { 'A', &a, &b };
1232 +const __as tree cd = { 'C', &c, &d };
1233 +
1234 +const __as tree abcd = { '*', &ab, &cd };
1235 +
1236 +static void
1237 +test1 (void)
1238 +{
1239 +  if (abcd.val != '*')
1240 +    abort();
1241 +
1242 +  if (abcd.l->val != 'A')
1243 +    abort();
1244 +  if (abcd.r->val != 'C')
1245 +    abort();
1246 +
1247 +  if (abcd.l->l->val != 'a')
1248 +    abort();
1249 +  if (abcd.l->r->val != 'b')
1250 +    abort();
1251 +  if (abcd.r->l->val != 'c')
1252 +    abort();
1253 +  if (abcd.r->r->val != 'd')
1254 +    abort();
1255 +}
1256 +
1257 +static void
1258 +test2 (const __as tree *t)
1259 +{
1260 +  if (t->val != '*')
1261 +    abort();
1262 +
1263 +  if (t->l->val != 'A')
1264 +    abort();
1265 +  if (t->r->val != 'C')
1266 +    abort();
1267 +
1268 +  if (t->l->l->val != 'a')
1269 +    abort();
1270 +  if (t->l->r->val != 'b')
1271 +    abort();
1272 +  if (t->r->l->val != 'c')
1273 +    abort();
1274 +  if (t->r->r->val != 'd')
1275 +    abort();
1276 +}
1277 +
1278 +static void
1279 +test3 (const __as tree *pt)
1280 +{
1281 +  tree t = *pt;
1282 +  
1283 +  if (t.val != '*')
1284 +    abort();
1285 +
1286 +  if (t.l->val != 'A')
1287 +    abort();
1288 +  if (t.r->val != 'C')
1289 +    abort();
1290 +
1291 +  if (t.l->l->val != 'a')
1292 +    abort();
1293 +  if (t.l->r->val != 'b')
1294 +    abort();
1295 +  if (t.r->l->val != 'c')
1296 +    abort();
1297 +  if (t.r->r->val != 'd')
1298 +    abort();
1299 +}
1300 +
1301 +int main (void)
1302 +{
1303 +  const __as tree *t = &abcd;
1304 +  test1();
1305 +  test2 (&abcd);
1306 +  test3 (&abcd);
1307 +
1308 +  __asm ("" : "+r" (t));
1309 +  test2 (t);
1310 +  test3 (t);
1311 +  
1312 +  exit (0);
1313 +  return 0;
1314 +}
1315 Index: gcc/testsuite/gcc.target/avr/torture/addr-space-1-g.c
1316 ===================================================================
1317 --- gcc/testsuite/gcc.target/avr/torture/addr-space-1-g.c       (.../tags/gcc_4_7_0_release)    (wersja 0)
1318 +++ gcc/testsuite/gcc.target/avr/torture/addr-space-1-g.c       (.../branches/gcc-4_7-branch)   (wersja 185750)
1319 @@ -0,0 +1,6 @@
1320 +/* { dg-options "-std=gnu99" } */
1321 +/* { dg-do run } */
1322 +
1323 +#define __as
1324 +
1325 +#include "addr-space-1.h"
1326 Index: gcc/testsuite/gcc.target/avr/torture/addr-space-2-g.c
1327 ===================================================================
1328 --- gcc/testsuite/gcc.target/avr/torture/addr-space-2-g.c       (.../tags/gcc_4_7_0_release)    (wersja 0)
1329 +++ gcc/testsuite/gcc.target/avr/torture/addr-space-2-g.c       (.../branches/gcc-4_7-branch)   (wersja 185750)
1330 @@ -0,0 +1,6 @@
1331 +/* { dg-options "-std=gnu99" } */
1332 +/* { dg-do run } */
1333 +
1334 +#define __as
1335 +
1336 +#include "addr-space-2.h"
1337 Index: gcc/testsuite/gcc.target/avr/progmem.h
1338 ===================================================================
1339 --- gcc/testsuite/gcc.target/avr/progmem.h      (.../tags/gcc_4_7_0_release)    (wersja 185750)
1340 +++ gcc/testsuite/gcc.target/avr/progmem.h      (.../branches/gcc-4_7-branch)   (wersja 185750)
1341 @@ -5,6 +5,7 @@
1342              static const char __c[] PROGMEM = (s);          \
1343              &__c[0];}))
1344  
1345 +#ifdef __AVR_HAVE_LPMX__
1346  #define pgm_read_char(addr)                                 \
1347      (__extension__({                                        \
1348              unsigned int __addr16 = (unsigned int)(addr);   \
1349 @@ -12,3 +13,13 @@
1350              __asm__ ("lpm %0, %a1"                          \
1351                       : "=r" (__result) : "z" (__addr16));   \
1352              __result; }))
1353 +#else
1354 +#define pgm_read_char(addr)                                 \
1355 +    (__extension__({                                        \
1356 +            unsigned int __addr16 = (unsigned int)(addr);   \
1357 +            char __result;                                  \
1358 +            __asm__ ("lpm" "\n\t"                           \
1359 +                     "mov %0, r0"                           \
1360 +                     : "=r" (__result) : "z" (__addr16));   \
1361 +            __result; }))
1362 +#endif
1363 Index: gcc/testsuite/gfortran.dg/intrinsic_8.f90
1364 ===================================================================
1365 --- gcc/testsuite/gfortran.dg/intrinsic_8.f90   (.../tags/gcc_4_7_0_release)    (wersja 0)
1366 +++ gcc/testsuite/gfortran.dg/intrinsic_8.f90   (.../branches/gcc-4_7-branch)   (wersja 185750)
1367 @@ -0,0 +1,23 @@
1368 +! { dg-do compile }
1369 +!
1370 +! PR fortran/52452
1371 +!
1372 +! Contributed by Roger Ferrer Ibanez
1373 +!
1374 +PROGRAM test_etime
1375 +    IMPLICIT NONE
1376 +    INTRINSIC :: etime
1377 +    REAL(4) :: tarray(1:2)
1378 +    REAL(4) :: result
1379 +
1380 +    CALL etime(tarray, result)
1381 +END PROGRAM test_etime
1382 +
1383 +subroutine test_etime2
1384 +    IMPLICIT NONE
1385 +    INTRINSIC :: etime
1386 +    REAL(4) :: tarray(1:2)
1387 +    REAL(4) :: result
1388 +
1389 +    result = etime(tarray)
1390 +END subroutine test_etime2
1391 Index: gcc/testsuite/gcc.dg/Wunused-var-3.c
1392 ===================================================================
1393 --- gcc/testsuite/gcc.dg/Wunused-var-3.c        (.../tags/gcc_4_7_0_release)    (wersja 0)
1394 +++ gcc/testsuite/gcc.dg/Wunused-var-3.c        (.../branches/gcc-4_7-branch)   (wersja 185750)
1395 @@ -0,0 +1,34 @@
1396 +/* PR c/52577 */
1397 +/* { dg-do compile } */
1398 +/* { dg-options "-Wunused" } */
1399 +
1400 +typedef int V __attribute__((vector_size (sizeof (int) * 4)));
1401 +
1402 +void
1403 +f1 (V *p)
1404 +{
1405 +  V mask = { 1, 2, 3, 0 };
1406 +  *p = __builtin_shuffle (*p, mask);
1407 +}
1408 +
1409 +void
1410 +f2 (V *p, V *q)
1411 +{
1412 +  V mask = { 1, 2, 3, 0 };
1413 +  *p = __builtin_shuffle (*p, *q, mask);
1414 +}
1415 +
1416 +void
1417 +f3 (V *p, V *mask)
1418 +{
1419 +  V a = { 1, 2, 3, 0 };
1420 +  *p = __builtin_shuffle (a, *mask);
1421 +}
1422 +
1423 +void
1424 +f4 (V *p, V *mask)
1425 +{
1426 +  V a = { 1, 2, 3, 0 };
1427 +  V b = { 2, 3, 4, 1 };
1428 +  *p = __builtin_shuffle (a, b, *mask);
1429 +}
1430 Index: gcc/testsuite/ChangeLog
1431 ===================================================================
1432 --- gcc/testsuite/ChangeLog     (.../tags/gcc_4_7_0_release)    (wersja 185750)
1433 +++ gcc/testsuite/ChangeLog     (.../branches/gcc-4_7-branch)   (wersja 185750)
1434 @@ -1,3 +1,60 @@
1435 +2012-03-22  Paolo Carlini  <paolo.carlini@oracle.com>
1436 +
1437 +       PR c++/52487
1438 +       * g++.dg/cpp0x/lambda/lambda-ice7.C: New.
1439 +
1440 +2012-03-22  Tobias Burnus  <burnus@net-b.de>
1441 +
1442 +       PR fortran/52452
1443 +       * gfortran.dg/intrinsic_8.f90: New.
1444 +
1445 +2012-03-22  Jakub Jelinek  <jakub@redhat.com>
1446 +
1447 +       PR c++/52671
1448 +       * g++.dg/ext/attrib44.C: New test.
1449 +
1450 +2012-03-22  Jason Merrill  <jason@redhat.com>
1451 +
1452 +       * g++.dg/torture/pr52582.C: New.
1453 +
1454 +2012-03-22  Georg-Johann Lay  <avr@gjlay.de>
1455 +
1456 +       Backport from 2012-03-20 mainline r185583.
1457 +
1458 +       * gcc.target/avr/progmem.h (pgm_read_char): Define depending on
1459 +       __AVR_HAVE_LPMX__
1460 +
1461 +       Backport from 2012-03-20 mainline r185570.
1462 +
1463 +       PR target/49868
1464 +       * gcc.target/avr/torture/addr-space-2.h: New file.
1465 +       * gcc.target/avr/torture/addr-space-2-g.h: New test.
1466 +       * gcc.target/avr/torture/addr-space-2-0.h: New test.
1467 +       * gcc.target/avr/torture/addr-space-2-1.h: New test.
1468 +       * gcc.target/avr/torture/addr-space-2-x.h: New test.
1469 +
1470 +       Backport from 2012-03-12 mainline r185255.
1471 +
1472 +       PR target/49868
1473 +       * gcc.target/avr/torture/addr-space-1.h: New file.
1474 +       * gcc.target/avr/torture/addr-space-g.h: New test.
1475 +       * gcc.target/avr/torture/addr-space-0.h: New test.
1476 +       * gcc.target/avr/torture/addr-space-1.h: New test.
1477 +       * gcc.target/avr/torture/addr-space-x.h: New test.
1478 +
1479 +2012-03-22  Jakub Jelinek  <jakub@redhat.com>
1480 +
1481 +       Backported from mainline
1482 +       2012-03-14  Jakub Jelinek  <jakub@redhat.com>
1483 +
1484 +       PR c++/52521
1485 +       * g++.dg/cpp0x/udlit-args2.C: New test.
1486 +
1487 +       2012-03-13  Jakub Jelinek  <jakub@redhat.com>
1488 +
1489 +       PR c/52577
1490 +       * gcc.dg/Wunused-var-3.c: New test.
1491 +
1492  2012-03-22  Release Manager
1493  
1494         * GCC 4.7.0 released.
1495 Index: gcc/testsuite/g++.dg/ext/attrib44.C
1496 ===================================================================
1497 --- gcc/testsuite/g++.dg/ext/attrib44.C (.../tags/gcc_4_7_0_release)    (wersja 0)
1498 +++ gcc/testsuite/g++.dg/ext/attrib44.C (.../branches/gcc-4_7-branch)   (wersja 185750)
1499 @@ -0,0 +1,4 @@
1500 +// PR c++/52671
1501 +// { dg-do compile }
1502 +__attribute__ ((deprecated)) enum E { E0 };    // { dg-warning "attribute ignored in declaration of" }
1503 +// { dg-message "must follow the" "" { target *-*-* } 3 }
1504 Index: gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice7.C
1505 ===================================================================
1506 --- gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice7.C     (.../tags/gcc_4_7_0_release)    (wersja 0)
1507 +++ gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice7.C     (.../branches/gcc-4_7-branch)   (wersja 185750)
1508 @@ -0,0 +1,9 @@
1509 +// PR c++/52487
1510 +// { dg-options "-std=c++0x" }
1511 +
1512 +struct A;         // { dg-error "forward declaration" }
1513 +
1514 +void foo(A& a)
1515 +{
1516 +  [=](){a;};      // { dg-error "invalid use of incomplete type" }
1517 +}
1518 Index: gcc/testsuite/g++.dg/cpp0x/udlit-args2.C
1519 ===================================================================
1520 --- gcc/testsuite/g++.dg/cpp0x/udlit-args2.C    (.../tags/gcc_4_7_0_release)    (wersja 0)
1521 +++ gcc/testsuite/g++.dg/cpp0x/udlit-args2.C    (.../branches/gcc-4_7-branch)   (wersja 185750)
1522 @@ -0,0 +1,15 @@
1523 +// PR c++/52521
1524 +// { dg-do compile }
1525 +// { dg-options -std=c++11 }
1526 +
1527 +#include <cstddef>
1528 +
1529 +int operator "" _a (const char *);
1530 +int operator "" _a (const char *, std::size_t);
1531 +int a = 123_a;
1532 +int a2 = "abc"_a;
1533 +
1534 +int operator "" _b (const char *, std::size_t);
1535 +int operator "" _b (const char *);
1536 +int b = 123_b;
1537 +int b2 = "abc"_b;
1538 Index: gcc/testsuite/g++.dg/torture/pr52582.C
1539 ===================================================================
1540 --- gcc/testsuite/g++.dg/torture/pr52582.C      (.../tags/gcc_4_7_0_release)    (wersja 0)
1541 +++ gcc/testsuite/g++.dg/torture/pr52582.C      (.../branches/gcc-4_7-branch)   (wersja 185750)
1542 @@ -0,0 +1,23 @@
1543 +// PR c++/52582
1544 +
1545 +inline void *operator new (__SIZE_TYPE__, void *p) throw ()
1546 +{
1547 +  return p;
1548 +}
1549 +struct B
1550 +{
1551 +  virtual ~B ();
1552 +  B ();
1553 +};
1554 +struct A : B
1555 +{
1556 +  A () : B () {}
1557 +  virtual void bar ();
1558 +};
1559 +void
1560 +foo ()
1561 +{
1562 +  char a[64];
1563 +  B *b = new (&a) A ();
1564 +  b->~B ();
1565 +}
1566 Index: gcc/cp/class.c
1567 ===================================================================
1568 --- gcc/cp/class.c      (.../tags/gcc_4_7_0_release)    (wersja 185750)
1569 +++ gcc/cp/class.c      (.../branches/gcc-4_7-branch)   (wersja 185750)
1570 @@ -3145,8 +3145,9 @@
1571         CLASSTYPE_NON_AGGREGATE (t) = 1;
1572  
1573        /* If at least one non-static data member is non-literal, the whole
1574 -         class becomes non-literal.  */
1575 -      if (!literal_type_p (type))
1576 +         class becomes non-literal.  Note: if the type is incomplete we
1577 +        will complain later on.  */
1578 +      if (COMPLETE_TYPE_P (type) && !literal_type_p (type))
1579          CLASSTYPE_LITERAL_P (t) = false;
1580  
1581        /* A standard-layout class is a class that:
1582 Index: gcc/cp/decl.c
1583 ===================================================================
1584 --- gcc/cp/decl.c       (.../tags/gcc_4_7_0_release)    (wersja 185750)
1585 +++ gcc/cp/decl.c       (.../branches/gcc-4_7-branch)   (wersja 185750)
1586 @@ -4219,7 +4219,8 @@
1587    if (declspecs->attributes)
1588      {
1589        location_t loc = input_location;
1590 -      if (!CLASSTYPE_TEMPLATE_INSTANTIATION (declared_type))
1591 +      if (!CLASS_TYPE_P (declared_type)
1592 +         || !CLASSTYPE_TEMPLATE_INSTANTIATION (declared_type))
1593         /* For a non-template class, use the name location; for a template
1594            class (an explicit instantiation), use the current location.  */
1595         input_location = location_of (declared_type);
1596 Index: gcc/cp/method.c
1597 ===================================================================
1598 --- gcc/cp/method.c     (.../tags/gcc_4_7_0_release)    (wersja 185750)
1599 +++ gcc/cp/method.c     (.../branches/gcc-4_7-branch)   (wersja 185750)
1600 @@ -1590,6 +1590,7 @@
1601        DECL_DELETED_FN (fn) = deleted_p;
1602        DECL_DECLARED_CONSTEXPR_P (fn) = constexpr_p;
1603      }
1604 +  DECL_EXTERNAL (fn) = true;
1605    DECL_NOT_REALLY_EXTERN (fn) = 1;
1606    DECL_DECLARED_INLINE_P (fn) = 1;
1607    gcc_assert (!TREE_USED (fn));
1608 Index: gcc/cp/ChangeLog
1609 ===================================================================
1610 --- gcc/cp/ChangeLog    (.../tags/gcc_4_7_0_release)    (wersja 185750)
1611 +++ gcc/cp/ChangeLog    (.../branches/gcc-4_7-branch)   (wersja 185750)
1612 @@ -1,3 +1,30 @@
1613 +2012-03-22  Paolo Carlini  <paolo.carlini@oracle.com>
1614 +
1615 +       PR c++/52487
1616 +       * class.c (check_field_decls): Call literal_type_p only
1617 +       on complete types.
1618 +
1619 +2012-03-22  Jakub Jelinek  <jakub@redhat.com>
1620 +
1621 +       PR c++/52671
1622 +       * decl.c (check_tag_decl): Only use CLASSTYPE_TEMPLATE_INSTANTIATION
1623 +       on CLASS_TYPE_P types.
1624 +
1625 +2012-03-22  Jason Merrill  <jason@redhat.com>
1626 +
1627 +       PR c++/52582
1628 +       * method.c (implicitly_declare_fn): Set DECL_EXTERNAL.
1629 +
1630 +2012-03-22  Jakub Jelinek  <jakub@redhat.com>
1631 +
1632 +       Backported from mainline
1633 +       2012-03-14  Jakub Jelinek  <jakub@redhat.com>
1634 +
1635 +       PR c++/52521
1636 +       * parser.c (lookup_literal_operator): Return fn only if
1637 +       processed all arguments from args vector and argtypes is
1638 +       void_list_node.
1639 +
1640  2012-03-22  Release Manager
1641  
1642         * GCC 4.7.0 released.
1643 Index: gcc/cp/parser.c
1644 ===================================================================
1645 --- gcc/cp/parser.c     (.../tags/gcc_4_7_0_release)    (wersja 185750)
1646 +++ gcc/cp/parser.c     (.../branches/gcc-4_7-branch)   (wersja 185750)
1647 @@ -1,6 +1,6 @@
1648  /* C++ Parser.
1649     Copyright (C) 2000, 2001, 2002, 2003, 2004,
1650 -   2005, 2007, 2008, 2009, 2010, 2011  Free Software Foundation, Inc.
1651 +   2005, 2007, 2008, 2009, 2010, 2011, 2012  Free Software Foundation, Inc.
1652     Written by Mark Mitchell <mark@codesourcery.com>.
1653  
1654     This file is part of GCC.
1655 @@ -3581,7 +3581,13 @@
1656                                        TREE_TYPE (tparm))))
1657                 found = false;
1658             }
1659 -         if (found)
1660 +         if (found
1661 +             && ix == VEC_length (tree, args)
1662 +             /* May be this should be sufficient_parms_p instead,
1663 +                depending on how exactly should user-defined literals
1664 +                work in presence of default arguments on the literal
1665 +                operator parameters.  */
1666 +             && argtypes == void_list_node)
1667             return fn;
1668         }
1669      }
1670 Index: gcc/fortran/ChangeLog
1671 ===================================================================
1672 --- gcc/fortran/ChangeLog       (.../tags/gcc_4_7_0_release)    (wersja 185750)
1673 +++ gcc/fortran/ChangeLog       (.../branches/gcc-4_7-branch)   (wersja 185750)
1674 @@ -1,3 +1,9 @@
1675 +2012-03-22  Tobias Burnus  <burnus@net-b.de>
1676 +
1677 +       PR fortran/52452
1678 +       * resolve.c (resolve_intrinsic): Don't search for a
1679 +       function if we know that it is a subroutine.
1680 +
1681  2012-03-22  Release Manager
1682  
1683         * GCC 4.7.0 released.
1684 Index: gcc/fortran/resolve.c
1685 ===================================================================
1686 --- gcc/fortran/resolve.c       (.../tags/gcc_4_7_0_release)    (wersja 185750)
1687 +++ gcc/fortran/resolve.c       (.../branches/gcc-4_7-branch)   (wersja 185750)
1688 @@ -1496,7 +1496,7 @@
1689  
1690    if (sym->intmod_sym_id)
1691      isym = gfc_intrinsic_function_by_id ((gfc_isym_id) sym->intmod_sym_id);
1692 -  else
1693 +  else if (!sym->attr.subroutine)
1694      isym = gfc_find_function (sym->name);
1695  
1696    if (isym)
1697 Index: gcc/BASE-VER
1698 ===================================================================
1699 --- gcc/BASE-VER        (.../tags/gcc_4_7_0_release)    (wersja 185750)
1700 +++ gcc/BASE-VER        (.../branches/gcc-4_7-branch)   (wersja 185750)
1701 @@ -1 +1 @@
1702 -4.7.0
1703 +4.7.1
1704 Index: gcc/tree-nested.c
1705 ===================================================================
1706 --- gcc/tree-nested.c   (.../tags/gcc_4_7_0_release)    (wersja 185750)
1707 +++ gcc/tree-nested.c   (.../branches/gcc-4_7-branch)   (wersja 185750)
1708 @@ -1954,6 +1954,7 @@
1709  convert_tramp_reference_stmt (gimple_stmt_iterator *gsi, bool *handled_ops_p,
1710                               struct walk_stmt_info *wi)
1711  {
1712 +  struct nesting_info *info = (struct nesting_info *) wi->info;
1713    gimple stmt = gsi_stmt (*gsi);
1714  
1715    switch (gimple_code (stmt))
1716 @@ -1966,16 +1967,33 @@
1717         for (i = 0; i < nargs; i++)
1718           walk_tree (gimple_call_arg_ptr (stmt, i), convert_tramp_reference_op,
1719                      wi, NULL);
1720 +       break;
1721 +      }
1722  
1723 -       *handled_ops_p = true;
1724 -       return NULL_TREE;
1725 +    case GIMPLE_OMP_PARALLEL:
1726 +    case GIMPLE_OMP_TASK:
1727 +      {
1728 +       tree save_local_var_chain;
1729 +        walk_gimple_op (stmt, convert_tramp_reference_op, wi);
1730 +       save_local_var_chain = info->new_local_var_chain;
1731 +       info->new_local_var_chain = NULL;
1732 +        walk_body (convert_tramp_reference_stmt, convert_tramp_reference_op,
1733 +                  info, gimple_omp_body (stmt));
1734 +       if (info->new_local_var_chain)
1735 +         declare_vars (info->new_local_var_chain,
1736 +                       gimple_seq_first_stmt (gimple_omp_body (stmt)),
1737 +                       false);
1738 +       info->new_local_var_chain = save_local_var_chain;
1739        }
1740 +      break;
1741  
1742      default:
1743 +      *handled_ops_p = false;
1744 +      return NULL_TREE;
1745        break;
1746      }
1747  
1748 -  *handled_ops_p = false;
1749 +  *handled_ops_p = true;
1750    return NULL_TREE;
1751  }
1752  
1753 Index: gcc/output.h
1754 ===================================================================
1755 --- gcc/output.h        (.../tags/gcc_4_7_0_release)    (wersja 185750)
1756 +++ gcc/output.h        (.../branches/gcc-4_7-branch)   (wersja 185750)
1757 @@ -446,8 +446,8 @@
1758  #define SECTION_STYLE_MASK 0x600000    /* bits used for SECTION_STYLE */
1759  #define SECTION_COMMON   0x800000      /* contains common data */
1760  #define SECTION_RELRO   0x1000000      /* data is readonly after relocation processing */
1761 -#define SECTION_MACH_DEP 0x2000000     /* subsequent bits reserved for target */
1762 -#define SECTION_EXCLUDE  0x4000000      /* discarded by the linker */
1763 +#define SECTION_EXCLUDE  0x2000000     /* discarded by the linker */
1764 +#define SECTION_MACH_DEP 0x4000000     /* subsequent bits reserved for target */
1765  
1766  /* This SECTION_STYLE is used for unnamed sections that we can switch
1767     to using a special assembler directive.  */
1768 Index: gcc/c-parser.c
1769 ===================================================================
1770 --- gcc/c-parser.c      (.../tags/gcc_4_7_0_release)    (wersja 185750)
1771 +++ gcc/c-parser.c      (.../branches/gcc-4_7-branch)   (wersja 185750)
1772 @@ -1,7 +1,7 @@
1773  /* Parser for C and Objective-C.
1774     Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
1775 -   1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011
1776 -   Free Software Foundation, Inc.
1777 +   1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011,
1778 +   2012 Free Software Foundation, Inc.
1779  
1780     Parser actions based on the old Bison parser; structure somewhat
1781     influenced by and fragments based on the C++ parser.
1782 @@ -6647,6 +6647,8 @@
1783         case RID_BUILTIN_SHUFFLE:
1784           {
1785             VEC(c_expr_t,gc) *cexpr_list;
1786 +           unsigned int i;
1787 +           c_expr_t *p;
1788  
1789             c_parser_consume_token (parser);
1790             if (!c_parser_get_builtin_args (parser,
1791 @@ -6657,6 +6659,9 @@
1792                 break;
1793               }
1794  
1795 +           FOR_EACH_VEC_ELT (c_expr_t, cexpr_list, i, p)
1796 +             mark_exp_read (p->value);
1797 +
1798             if (VEC_length (c_expr_t, cexpr_list) == 2)
1799               expr.value =
1800                 c_build_vec_perm_expr
1801 Index: gcc/config/i386/nmmintrin.h
1802 ===================================================================
1803 --- gcc/config/i386/nmmintrin.h (.../tags/gcc_4_7_0_release)    (wersja 185750)
1804 +++ gcc/config/i386/nmmintrin.h (.../branches/gcc-4_7-branch)   (wersja 185750)
1805 @@ -1,4 +1,4 @@
1806 -/* Copyright (C) 2007, 2009 Free Software Foundation, Inc.
1807 +/* Copyright (C) 2007, 2009, 2012 Free Software Foundation, Inc.
1808  
1809     This file is part of GCC.
1810  
1811 @@ -19,7 +19,7 @@
1812     You should have received a copy of the GNU General Public License and
1813     a copy of the GCC Runtime Library Exception along with this program;
1814     see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
1815 -   <http://www.gnu.org/licenses/>.
1816 +   <http://www.gnu.org/licenses/>.  */
1817  
1818  /* Implemented from the specification included in the Intel C++ Compiler
1819     User Guide and Reference, version 10.0.  */
1820 Index: gcc/config/i386/smmintrin.h
1821 ===================================================================
1822 --- gcc/config/i386/smmintrin.h (.../tags/gcc_4_7_0_release)    (wersja 185750)
1823 +++ gcc/config/i386/smmintrin.h (.../branches/gcc-4_7-branch)   (wersja 185750)
1824 @@ -1,4 +1,4 @@
1825 -/* Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
1826 +/* Copyright (C) 2007, 2008, 2009, 2010, 2012 Free Software Foundation, Inc.
1827  
1828     This file is part of GCC.
1829  
1830 @@ -19,9 +19,8 @@
1831     You should have received a copy of the GNU General Public License and
1832     a copy of the GCC Runtime Library Exception along with this program;
1833     see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
1834 -   <http://www.gnu.org/licenses/>.
1835 +   <http://www.gnu.org/licenses/>.  */
1836  
1837 -
1838  /* Implemented from the specification included in the Intel C++ Compiler
1839     User Guide and Reference, version 10.0.  */
1840  
1841 Index: gcc/config/sh/sh.c
1842 ===================================================================
1843 --- gcc/config/sh/sh.c  (.../tags/gcc_4_7_0_release)    (wersja 185750)
1844 +++ gcc/config/sh/sh.c  (.../branches/gcc-4_7-branch)   (wersja 185750)
1845 @@ -1,6 +1,6 @@
1846  /* Output routines for GCC for Renesas / SuperH SH.
1847     Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
1848 -   2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
1849 +   2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
1850     Free Software Foundation, Inc.
1851     Contributed by Steve Chamberlain (sac@cygnus.com).
1852     Improved by Jim Wilson (wilson@cygnus.com).
1853 @@ -11497,9 +11497,16 @@
1854         && REGCLASS_HAS_GENERAL_REG (srcclass))
1855        || (REGCLASS_HAS_GENERAL_REG (dstclass)
1856           && REGCLASS_HAS_FP_REG (srcclass)))
1857 -    return ((TARGET_SHMEDIA ? 4 : TARGET_FMOVD ? 8 : 12)
1858 -           * ((GET_MODE_SIZE (mode) + 7) / 8U));
1859 +    {
1860 +      /* Discourage trying to use fp regs for a pointer.  This also
1861 +        discourages fp regs with SImode because Pmode is an alias
1862 +        of SImode on this target.  See PR target/48596.  */
1863 +      int addend = (mode == Pmode) ? 40 : 0;
1864  
1865 +      return (((TARGET_SHMEDIA ? 4 : TARGET_FMOVD ? 8 : 12) + addend)
1866 +             * ((GET_MODE_SIZE (mode) + 7) / 8U));
1867 +    }
1868 +
1869    if ((dstclass == FPUL_REGS
1870         && REGCLASS_HAS_GENERAL_REG (srcclass))
1871        || (srcclass == FPUL_REGS
1872 Index: gcc/config/avr/avr.md
1873 ===================================================================
1874 --- gcc/config/avr/avr.md       (.../tags/gcc_4_7_0_release)    (wersja 185750)
1875 +++ gcc/config/avr/avr.md       (.../branches/gcc-4_7-branch)   (wersja 185750)
1876 @@ -63,6 +63,7 @@
1877    [UNSPEC_STRLEN
1878     UNSPEC_MOVMEM
1879     UNSPEC_INDEX_JMP
1880 +   UNSPEC_LPM
1881     UNSPEC_FMUL
1882     UNSPEC_FMULS
1883     UNSPEC_FMULSU
1884 @@ -77,6 +78,7 @@
1885     UNSPECV_WRITE_SP
1886     UNSPECV_GOTO_RECEIVER
1887     UNSPECV_ENABLE_IRQS
1888 +   UNSPECV_MEMORY_BARRIER
1889     UNSPECV_NOP
1890     UNSPECV_SLEEP
1891     UNSPECV_WDR
1892 @@ -139,7 +141,7 @@
1893    "out_bitop, out_plus, out_plus_noclobber, plus64, addto_sp,
1894     tsthi, tstpsi, tstsi, compare, compare64, call,
1895     mov8, mov16, mov24, mov32, reload_in16, reload_in24, reload_in32,
1896 -   xload, movmem,
1897 +   xload, movmem, load_lpm,
1898     ashlqi, ashrqi, lshrqi,
1899     ashlhi, ashrhi, lshrhi,
1900     ashlsi, ashrsi, lshrsi,
1901 @@ -363,36 +365,63 @@
1902  ;;========================================================================
1903  ;; Move stuff around
1904  
1905 -(define_expand "load<mode>_libgcc"
1906 -  [(set (match_dup 3)
1907 -        (match_dup 2))
1908 -   (set (reg:MOVMODE 22)
1909 -        (match_operand:MOVMODE 1 "memory_operand" ""))
1910 -   (set (match_operand:MOVMODE 0 "register_operand" "")
1911 -        (reg:MOVMODE 22))]
1912 -  "avr_load_libgcc_p (operands[1])"
1913 -  {
1914 -    operands[3] = gen_rtx_REG (HImode, REG_Z);
1915 -    operands[2] = force_operand (XEXP (operands[1], 0), NULL_RTX);
1916 -    operands[1] = replace_equiv_address (operands[1], operands[3]);
1917 -    set_mem_addr_space (operands[1], ADDR_SPACE_FLASH);
1918 -  })
1919 -    
1920 +;; Represent a load from __flash that needs libgcc support as UNSPEC.
1921 +;; This is legal because we read from non-changing memory.
1922 +;; For rationale see the FIXME below.
1923 +
1924 +;; "load_psi_libgcc"    
1925 +;; "load_si_libgcc"    
1926 +;; "load_sf_libgcc"    
1927  (define_insn "load_<mode>_libgcc"
1928    [(set (reg:MOVMODE 22)
1929 -        (match_operand:MOVMODE 0 "memory_operand" "m,m"))]
1930 -  "avr_load_libgcc_p (operands[0])
1931 -   && REG_P (XEXP (operands[0], 0))
1932 -   && REG_Z == REGNO (XEXP (operands[0], 0))"
1933 +        (unspec:MOVMODE [(reg:HI REG_Z)]
1934 +                        UNSPEC_LPM))]
1935 +  ""
1936    {
1937 -    operands[0] = GEN_INT (GET_MODE_SIZE (<MODE>mode));
1938 -    return "%~call __load_%0";
1939 +    rtx n_bytes = GEN_INT (GET_MODE_SIZE (<MODE>mode));
1940 +    output_asm_insn ("%~call __load_%0", &n_bytes);
1941 +    return "";
1942    }
1943 -  [(set_attr "length" "1,2")
1944 -   (set_attr "isa" "rjmp,jmp")
1945 +  [(set_attr "type" "xcall")
1946     (set_attr "cc" "clobber")])
1947  
1948  
1949 +;; Similar for inline reads from flash.  We use UNSPEC instead
1950 +;; of MEM for the same reason as above: PR52543.
1951 +;; $1 contains the memory segment.
1952 +
1953 +(define_insn "load_<mode>"
1954 +  [(set (match_operand:MOVMODE 0 "register_operand" "=r")
1955 +        (unspec:MOVMODE [(reg:HI REG_Z)
1956 +                         (match_operand:QI 1 "reg_or_0_operand" "rL")]
1957 +                        UNSPEC_LPM))]
1958 +  "(CONST_INT_P (operands[1]) && AVR_HAVE_LPMX)
1959 +   || (REG_P (operands[1]) && AVR_HAVE_ELPMX)"
1960 +  {
1961 +    return avr_load_lpm (insn, operands, NULL);
1962 +  }
1963 +  [(set_attr "adjust_len" "load_lpm")
1964 +   (set_attr "cc" "clobber")])
1965 +
1966 +
1967 +;; Similar to above for the complementary situation when there is no [E]LPMx.
1968 +;; Clobber Z in that case.
1969 +
1970 +(define_insn "load_<mode>_clobber"
1971 +  [(set (match_operand:MOVMODE 0 "register_operand" "=r")
1972 +        (unspec:MOVMODE [(reg:HI REG_Z)
1973 +                         (match_operand:QI 1 "reg_or_0_operand" "rL")]
1974 +                        UNSPEC_LPM))
1975 +   (clobber (reg:HI REG_Z))]
1976 +  "!((CONST_INT_P (operands[1]) && AVR_HAVE_LPMX)
1977 +     || (REG_P (operands[1]) && AVR_HAVE_ELPMX))"
1978 +  {
1979 +    return avr_load_lpm (insn, operands, NULL);
1980 +  }
1981 +  [(set_attr "adjust_len" "load_lpm")
1982 +   (set_attr "cc" "clobber")])
1983 +
1984 +
1985  (define_insn_and_split "xload8_A"
1986    [(set (match_operand:QI 0 "register_operand" "=r")
1987          (match_operand:QI 1 "memory_operand"    "m"))
1988 @@ -418,9 +447,15 @@
1989      DONE;
1990    })
1991  
1992 +;; "xloadqi_A"
1993 +;; "xloadhi_A"
1994 +;; "xloadpsi_A"
1995 +;; "xloadsi_A"
1996 +;; "xloadsf_A"
1997  (define_insn_and_split "xload<mode>_A"
1998    [(set (match_operand:MOVMODE 0 "register_operand" "=r")
1999          (match_operand:MOVMODE 1 "memory_operand"    "m"))
2000 +   (clobber (reg:MOVMODE 22))
2001     (clobber (reg:QI 21))
2002     (clobber (reg:HI REG_Z))]
2003    "can_create_pseudo_p()
2004 @@ -461,7 +496,7 @@
2005    {
2006      return avr_out_xload (insn, operands, NULL);
2007    }
2008 -  [(set_attr "length" "3,4")
2009 +  [(set_attr "length" "4,4")
2010     (set_attr "adjust_len" "*,xload")
2011     (set_attr "isa" "lpmx,lpm")
2012     (set_attr "cc" "none")])
2013 @@ -532,12 +567,55 @@
2014        DONE;
2015      }
2016  
2017 +    /* For old devices without LPMx, prefer __flash loads per libcall.  */
2018 +
2019      if (avr_load_libgcc_p (src))
2020        {
2021 -        /* For the small devices, do loads per libgcc call.  */
2022 -        emit_insn (gen_load<mode>_libgcc (dest, src));
2023 +        emit_move_insn (gen_rtx_REG (Pmode, REG_Z),
2024 +                        force_reg (Pmode, XEXP (src, 0)));
2025 +
2026 +        emit_insn (gen_load_<mode>_libgcc ());
2027 +        emit_move_insn (dest, gen_rtx_REG (<MODE>mode, 22));
2028          DONE;
2029        }
2030 +
2031 +    /* ; FIXME:  Hack around PR rtl-optimization/52543.
2032 +       ; lower-subreg.c splits loads from the 16-bit address spaces which
2033 +       ; causes code bloat because each load need his setting of RAMPZ.
2034 +       ; Moreover, the split will happen in such a way that the loads don't
2035 +       ; take advantage of POST_INC addressing.  Thus, we use UNSPEC to
2036 +       ; represent these loads instead.  Notice that this is legitimate
2037 +       ; because the memory content does not change:  Loads from the same
2038 +       ; address will yield the same value.
2039 +       ; POST_INC addressing would make the addresses mode_dependent and could
2040 +       ; work around that PR, too.  However, notice that it is *not* legitimate
2041 +       ; to expand to POST_INC at expand time:  The following passes assert
2042 +       ; that pre-/post-modify addressing is introduced by .auto_inc_dec and
2043 +       ; does not exist before that pass.  */
2044 +
2045 +    if (avr_mem_flash_p (src)
2046 +        && (GET_MODE_SIZE (<MODE>mode) > 1
2047 +            || MEM_ADDR_SPACE (src) != ADDR_SPACE_FLASH))
2048 +      {
2049 +        rtx xsegment = GEN_INT (avr_addrspace[MEM_ADDR_SPACE (src)].segment);
2050 +        if (!AVR_HAVE_ELPM)
2051 +          xsegment = const0_rtx;
2052 +        if (xsegment != const0_rtx)
2053 +          xsegment = force_reg (QImode, xsegment);
2054 +
2055 +        emit_move_insn (gen_rtx_REG (Pmode, REG_Z),
2056 +                        force_reg (Pmode, XEXP (src, 0)));
2057 +
2058 +        if ((CONST_INT_P (xsegment) && AVR_HAVE_LPMX)
2059 +            || (REG_P (xsegment) && AVR_HAVE_ELPMX))
2060 +          emit_insn (gen_load_<mode> (dest, xsegment));
2061 +        else
2062 +          emit_insn (gen_load_<mode>_clobber (dest, xsegment));
2063 +        DONE;
2064 +      }
2065 +
2066 +    /* ; The only address-space for which we use plain MEM and reload
2067 +       ; machinery are 1-byte loads from __flash.  */
2068    })
2069  
2070  ;;========================================================================
2071 @@ -677,40 +755,6 @@
2072      operands[5] = gen_rtx_REG (HImode, REGNO (operands[3]));
2073    })
2074  
2075 -;; For LPM loads from AS1 we split 
2076 -;;    R = *Z
2077 -;; to
2078 -;;    R = *Z++
2079 -;;    Z = Z - sizeof (R)
2080 -;;
2081 -;; so that the second instruction can be optimized out.
2082 -
2083 -(define_split ; "split-lpmx"
2084 -  [(set (match_operand:HISI 0 "register_operand" "")
2085 -        (match_operand:HISI 1 "memory_operand" ""))]
2086 -  "reload_completed
2087 -   && AVR_HAVE_LPMX"
2088 -  [(set (match_dup 0)
2089 -        (match_dup 2))
2090 -   (set (match_dup 3)
2091 -        (plus:HI (match_dup 3)
2092 -                 (match_dup 4)))]
2093 -  {
2094 -     rtx addr = XEXP (operands[1], 0);
2095 -
2096 -     if (!avr_mem_flash_p (operands[1])
2097 -         || !REG_P (addr)
2098 -         || reg_overlap_mentioned_p (addr, operands[0]))
2099 -       {
2100 -         FAIL;
2101 -       }
2102 -
2103 -    operands[2] = replace_equiv_address (operands[1],
2104 -                                         gen_rtx_POST_INC (Pmode, addr));
2105 -    operands[3] = addr;
2106 -    operands[4] = gen_int_mode (-GET_MODE_SIZE (<MODE>mode), HImode);
2107 -  })
2108 -
2109  ;;==========================================================================
2110  ;; xpointer move (24 bit)
2111    
2112 @@ -1081,15 +1125,16 @@
2113     (set_attr "adjust_len" "addto_sp")])
2114  
2115  (define_insn "*addhi3"
2116 -  [(set (match_operand:HI 0 "register_operand"          "=r,d,d")
2117 -        (plus:HI (match_operand:HI 1 "register_operand" "%0,0,0")
2118 -                 (match_operand:HI 2 "nonmemory_operand" "r,s,n")))]
2119 +  [(set (match_operand:HI 0 "register_operand"          "=r,d,!w,d")
2120 +        (plus:HI (match_operand:HI 1 "register_operand" "%0,0,0 ,0")
2121 +                 (match_operand:HI 2 "nonmemory_operand" "r,s,IJ,n")))]
2122    ""
2123    {
2124      static const char * const asm_code[] =
2125        {
2126          "add %A0,%A2\;adc %B0,%B2",
2127          "subi %A0,lo8(-(%2))\;sbci %B0,hi8(-(%2))",
2128 +        "",
2129          ""
2130        };
2131  
2132 @@ -1098,9 +1143,9 @@
2133  
2134      return avr_out_plus_noclobber (operands, NULL, NULL);
2135    }
2136 -  [(set_attr "length" "2,2,2")
2137 -   (set_attr "adjust_len" "*,*,out_plus_noclobber")
2138 -   (set_attr "cc" "set_n,set_czn,out_plus_noclobber")])
2139 +  [(set_attr "length" "2,2,2,2")
2140 +   (set_attr "adjust_len" "*,*,out_plus_noclobber,out_plus_noclobber")
2141 +   (set_attr "cc" "set_n,set_czn,out_plus_noclobber,out_plus_noclobber")])
2142  
2143  ;; Adding a constant to NO_LD_REGS might have lead to a reload of
2144  ;; that constant to LD_REGS.  We don't add a scratch to *addhi3
2145 @@ -1138,10 +1183,10 @@
2146                (clobber (match_dup 2))])])
2147  
2148  (define_insn "addhi3_clobber"
2149 -  [(set (match_operand:HI 0 "register_operand"           "=d,l")
2150 -        (plus:HI (match_operand:HI 1 "register_operand"  "%0,0")
2151 -                 (match_operand:HI 2 "const_int_operand"  "n,n")))
2152 -   (clobber (match_scratch:QI 3                          "=X,&d"))]
2153 +  [(set (match_operand:HI 0 "register_operand"           "=!w,d,r")
2154 +        (plus:HI (match_operand:HI 1 "register_operand"   "%0,0,0")
2155 +                 (match_operand:HI 2 "const_int_operand"  "IJ,n,n")))
2156 +   (clobber (match_scratch:QI 3                           "=X,X,&d"))]
2157    ""
2158    {
2159      gcc_assert (REGNO (operands[0]) == REGNO (operands[1]));
2160 @@ -1692,6 +1737,29 @@
2161  
2162  ;; Handle small constants
2163  
2164 +;; Special case of a += 2*b as frequently seen with accesses to int arrays.
2165 +;; This is shorter, faster than MUL and has lower register pressure.
2166 +
2167 +(define_insn_and_split "*umaddqihi4.2"
2168 +  [(set (match_operand:HI 0 "register_operand"                                  "=r")
2169 +        (plus:HI (mult:HI (zero_extend:HI (match_operand:QI 1 "register_operand" "r"))
2170 +                          (const_int 2))
2171 +                 (match_operand:HI 2 "register_operand"                          "r")))]
2172 +  "!reload_completed
2173 +   && !reg_overlap_mentioned_p (operands[0], operands[1])"
2174 +  { gcc_unreachable(); }
2175 +  "&& 1"
2176 +  [(set (match_dup 0)
2177 +        (match_dup 2))
2178 +   ; *addhi3_zero_extend
2179 +   (set (match_dup 0)
2180 +        (plus:HI (zero_extend:HI (match_dup 1))
2181 +                 (match_dup 0)))
2182 +   ; *addhi3_zero_extend
2183 +   (set (match_dup 0)
2184 +        (plus:HI (zero_extend:HI (match_dup 1))
2185 +                 (match_dup 0)))])
2186 +
2187  ;; "umaddqihi4.uconst"
2188  ;; "maddqihi4.sconst"
2189  (define_insn_and_split "*<extend_u>maddqihi4.<extend_su>const"
2190 @@ -5198,18 +5266,36 @@
2191     (set_attr "length" "1")])
2192  
2193  ;; Enable Interrupts
2194 -(define_insn "enable_interrupt"
2195 -  [(unspec_volatile [(const_int 1)] UNSPECV_ENABLE_IRQS)]
2196 +(define_expand "enable_interrupt"
2197 +  [(clobber (const_int 0))]
2198    ""
2199 -  "sei"
2200 -  [(set_attr "length" "1")
2201 -   (set_attr "cc" "none")])
2202 +  {
2203 +    rtx mem = gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (Pmode));
2204 +    MEM_VOLATILE_P (mem) = 1;
2205 +    emit_insn (gen_cli_sei (const1_rtx, mem));
2206 +    DONE;
2207 +  })
2208  
2209  ;; Disable Interrupts
2210 -(define_insn "disable_interrupt"
2211 -  [(unspec_volatile [(const_int 0)] UNSPECV_ENABLE_IRQS)]
2212 +(define_expand "disable_interrupt"
2213 +  [(clobber (const_int 0))]
2214    ""
2215 -  "cli"
2216 +  {
2217 +    rtx mem = gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (Pmode));
2218 +    MEM_VOLATILE_P (mem) = 1;
2219 +    emit_insn (gen_cli_sei (const0_rtx, mem));
2220 +    DONE;
2221 +  })
2222 +
2223 +(define_insn "cli_sei"
2224 +  [(unspec_volatile [(match_operand:QI 0 "const_int_operand" "L,P")]
2225 +                    UNSPECV_ENABLE_IRQS)
2226 +   (set (match_operand:BLK 1 "" "")
2227 +       (unspec_volatile:BLK [(match_dup 1)] UNSPECV_MEMORY_BARRIER))]
2228 +  ""
2229 +  "@
2230 +       cli
2231 +       sei"
2232    [(set_attr "length" "1")
2233     (set_attr "cc" "none")])
2234  
2235 @@ -5316,10 +5402,12 @@
2236    [(unspec_volatile [(match_operand:QI 0 "const_int_operand" "n")
2237                       (const_int 1)]
2238                      UNSPECV_DELAY_CYCLES)
2239 -   (clobber (match_scratch:QI 1 "=&d"))]
2240 +   (set (match_operand:BLK 1 "" "")
2241 +       (unspec_volatile:BLK [(match_dup 1)] UNSPECV_MEMORY_BARRIER))
2242 +   (clobber (match_scratch:QI 2 "=&d"))]
2243    ""
2244 -  "ldi %1,lo8(%0)
2245 -       1: dec %1
2246 +  "ldi %2,lo8(%0)
2247 +       1: dec %2
2248         brne 1b"
2249    [(set_attr "length" "3")
2250     (set_attr "cc" "clobber")])
2251 @@ -5328,11 +5416,13 @@
2252    [(unspec_volatile [(match_operand:HI 0 "const_int_operand" "n")
2253                       (const_int 2)]
2254                      UNSPECV_DELAY_CYCLES)
2255 -   (clobber (match_scratch:HI 1 "=&w"))]
2256 +   (set (match_operand:BLK 1 "" "")
2257 +       (unspec_volatile:BLK [(match_dup 1)] UNSPECV_MEMORY_BARRIER))
2258 +   (clobber (match_scratch:HI 2 "=&w"))]
2259    ""
2260 -  "ldi %A1,lo8(%0)
2261 -       ldi %B1,hi8(%0)
2262 -       1: sbiw %A1,1
2263 +  "ldi %A2,lo8(%0)
2264 +       ldi %B2,hi8(%0)
2265 +       1: sbiw %A2,1
2266         brne 1b"
2267    [(set_attr "length" "4")
2268     (set_attr "cc" "clobber")])
2269 @@ -5341,16 +5431,18 @@
2270    [(unspec_volatile [(match_operand:SI 0 "const_int_operand" "n")
2271                       (const_int 3)]
2272                      UNSPECV_DELAY_CYCLES)
2273 -   (clobber (match_scratch:QI 1 "=&d"))
2274 +   (set (match_operand:BLK 1 "" "")
2275 +       (unspec_volatile:BLK [(match_dup 1)] UNSPECV_MEMORY_BARRIER))
2276     (clobber (match_scratch:QI 2 "=&d"))
2277 -   (clobber (match_scratch:QI 3 "=&d"))]
2278 +   (clobber (match_scratch:QI 3 "=&d"))
2279 +   (clobber (match_scratch:QI 4 "=&d"))]
2280    ""
2281 -  "ldi %1,lo8(%0)
2282 -       ldi %2,hi8(%0)
2283 -       ldi %3,hlo8(%0)
2284 -       1: subi %1,1
2285 -       sbci %2,0
2286 +  "ldi %2,lo8(%0)
2287 +       ldi %3,hi8(%0)
2288 +       ldi %4,hlo8(%0)
2289 +       1: subi %2,1
2290         sbci %3,0
2291 +       sbci %4,0
2292         brne 1b"
2293    [(set_attr "length" "7")
2294     (set_attr "cc" "clobber")])
2295 @@ -5359,19 +5451,21 @@
2296    [(unspec_volatile [(match_operand:SI 0 "const_int_operand" "n")
2297                       (const_int 4)]
2298                      UNSPECV_DELAY_CYCLES)
2299 -   (clobber (match_scratch:QI 1 "=&d"))
2300 +   (set (match_operand:BLK 1 "" "")
2301 +       (unspec_volatile:BLK [(match_dup 1)] UNSPECV_MEMORY_BARRIER))
2302     (clobber (match_scratch:QI 2 "=&d"))
2303     (clobber (match_scratch:QI 3 "=&d"))
2304 -   (clobber (match_scratch:QI 4 "=&d"))]
2305 +   (clobber (match_scratch:QI 4 "=&d"))
2306 +   (clobber (match_scratch:QI 5 "=&d"))]
2307    ""
2308 -  "ldi %1,lo8(%0)
2309 -       ldi %2,hi8(%0)
2310 -       ldi %3,hlo8(%0)
2311 -       ldi %4,hhi8(%0)
2312 -       1: subi %1,1
2313 -       sbci %2,0
2314 +  "ldi %2,lo8(%0)
2315 +       ldi %3,hi8(%0)
2316 +       ldi %4,hlo8(%0)
2317 +       ldi %5,hhi8(%0)
2318 +       1: subi %2,1
2319         sbci %3,0
2320         sbci %4,0
2321 +       sbci %5,0
2322         brne 1b"
2323    [(set_attr "length" "9")
2324     (set_attr "cc" "clobber")])
2325 @@ -5757,9 +5851,23 @@
2326  ;; CPU instructions
2327  
2328  ;; NOP taking 1 or 2 Ticks 
2329 -(define_insn "nopv"
2330 +(define_expand "nopv"
2331 +  [(parallel [(unspec_volatile [(match_operand:SI 0 "const_int_operand" "")] 
2332 +                               UNSPECV_NOP)
2333 +              (set (match_dup 1)
2334 +                   (unspec_volatile:BLK [(match_dup 1)]
2335 +                                        UNSPECV_MEMORY_BARRIER))])]
2336 +  ""
2337 +  {
2338 +    operands[1] = gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (Pmode));
2339 +    MEM_VOLATILE_P (operands[1]) = 1;
2340 +  })
2341 +
2342 +(define_insn "*nopv"
2343    [(unspec_volatile [(match_operand:SI 0 "const_int_operand" "P,K")] 
2344 -                    UNSPECV_NOP)]
2345 +                    UNSPECV_NOP)
2346 +   (set (match_operand:BLK 1 "" "")
2347 +       (unspec_volatile:BLK [(match_dup 1)] UNSPECV_MEMORY_BARRIER))]
2348    ""
2349    "@
2350         nop
2351 @@ -5768,17 +5876,43 @@
2352     (set_attr "cc" "none")])
2353  
2354  ;; SLEEP
2355 -(define_insn "sleep"
2356 -  [(unspec_volatile [(const_int 0)] UNSPECV_SLEEP)]
2357 +(define_expand "sleep"
2358 +  [(parallel [(unspec_volatile [(const_int 0)] UNSPECV_SLEEP)
2359 +              (set (match_dup 0)
2360 +                   (unspec_volatile:BLK [(match_dup 0)]
2361 +                                        UNSPECV_MEMORY_BARRIER))])]
2362    ""
2363 +  {
2364 +    operands[0] = gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (Pmode));
2365 +    MEM_VOLATILE_P (operands[0]) = 1;
2366 +  })
2367 +
2368 +(define_insn "*sleep"
2369 +  [(unspec_volatile [(const_int 0)] UNSPECV_SLEEP)
2370 +   (set (match_operand:BLK 0 "" "")
2371 +       (unspec_volatile:BLK [(match_dup 0)] UNSPECV_MEMORY_BARRIER))]
2372 +  ""
2373    "sleep"
2374    [(set_attr "length" "1")
2375     (set_attr "cc" "none")])
2376   
2377  ;; WDR
2378 -(define_insn "wdr"
2379 -  [(unspec_volatile [(const_int 0)] UNSPECV_WDR)]
2380 +(define_expand "wdr"
2381 +  [(parallel [(unspec_volatile [(const_int 0)] UNSPECV_WDR)
2382 +              (set (match_dup 0)
2383 +                   (unspec_volatile:BLK [(match_dup 0)]
2384 +                                        UNSPECV_MEMORY_BARRIER))])]
2385    ""
2386 +  {
2387 +    operands[0] = gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (Pmode));
2388 +    MEM_VOLATILE_P (operands[0]) = 1;
2389 +  })
2390 +
2391 +(define_insn "*wdr"
2392 +  [(unspec_volatile [(const_int 0)] UNSPECV_WDR)
2393 +   (set (match_operand:BLK 0 "" "")
2394 +       (unspec_volatile:BLK [(match_dup 0)] UNSPECV_MEMORY_BARRIER))]
2395 +  ""
2396    "wdr"
2397    [(set_attr "length" "1")
2398     (set_attr "cc" "none")])
2399 Index: gcc/config/avr/avr-protos.h
2400 ===================================================================
2401 --- gcc/config/avr/avr-protos.h (.../tags/gcc_4_7_0_release)    (wersja 185750)
2402 +++ gcc/config/avr/avr-protos.h (.../branches/gcc-4_7-branch)   (wersja 185750)
2403 @@ -75,6 +75,8 @@
2404  extern const char *avr_out_ashrpsi3 (rtx, rtx*, int*);
2405  extern const char *avr_out_lshrpsi3 (rtx, rtx*, int*);
2406  
2407 +extern const char* avr_load_lpm (rtx, rtx*, int*);
2408 +
2409  extern bool avr_rotate_bytes (rtx operands[]);
2410  
2411  extern void expand_prologue (void);
2412 @@ -115,7 +117,7 @@
2413  extern RTX_CODE avr_normalize_condition (RTX_CODE condition);
2414  extern void out_shift_with_cnt (const char *templ, rtx insn,
2415                                 rtx operands[], int *len, int t_len);
2416 -extern reg_class_t avr_mode_code_base_reg_class (enum machine_mode, addr_space_t, RTX_CODE, RTX_CODE);
2417 +extern enum reg_class avr_mode_code_base_reg_class (enum machine_mode, addr_space_t, RTX_CODE, RTX_CODE);
2418  extern bool avr_regno_mode_code_ok_for_base_p (int, enum machine_mode, addr_space_t, RTX_CODE, RTX_CODE);
2419  extern rtx avr_incoming_return_addr_rtx (void);
2420  extern rtx avr_legitimize_reload_address (rtx*, enum machine_mode, int, int, int, int, rtx (*)(rtx,int));
2421 Index: gcc/config/avr/avr.c
2422 ===================================================================
2423 --- gcc/config/avr/avr.c        (.../tags/gcc_4_7_0_release)    (wersja 185750)
2424 +++ gcc/config/avr/avr.c        (.../branches/gcc-4_7-branch)   (wersja 185750)
2425 @@ -827,7 +827,11 @@
2426    bool isr_p = cfun->machine->is_interrupt || cfun->machine->is_signal;
2427    int live_seq = sequent_regs_live ();
2428  
2429 +  HOST_WIDE_INT size_max
2430 +    = (HOST_WIDE_INT) GET_MODE_MASK (AVR_HAVE_8BIT_SP ? QImode : Pmode);
2431 +
2432    bool minimize = (TARGET_CALL_PROLOGUES
2433 +                   && size < size_max
2434                     && live_seq
2435                     && !isr_p
2436                     && !cfun->machine->is_OS_task
2437 @@ -933,6 +937,7 @@
2438                leaf function and thus X has already been saved.  */
2439                
2440            int irq_state = -1;
2441 +          HOST_WIDE_INT size_cfa = size;
2442            rtx fp_plus_insns, fp, my_fp;
2443  
2444            gcc_assert (frame_pointer_needed
2445 @@ -951,6 +956,27 @@
2446                my_fp = all_regs_rtx[FRAME_POINTER_REGNUM];
2447              }
2448  
2449 +          /* Cut down size and avoid size = 0 so that we don't run
2450 +             into ICE like PR52488 in the remainder.  */
2451 +
2452 +          if (size > size_max)
2453 +            {
2454 +              /* Don't error so that insane code from newlib still compiles
2455 +                 and does not break building newlib.  As PR51345 is implemented
2456 +                 now, there are multilib variants with -mtiny-stack.
2457 +                 
2458 +                 If user wants sanity checks he can use -Wstack-usage=
2459 +                 or similar options.
2460 +
2461 +                 For CFA we emit the original, non-saturated size so that
2462 +                 the generic machinery is aware of the real stack usage and
2463 +                 will print the above diagnostic as expected.  */
2464 +              
2465 +              size = size_max;
2466 +            }
2467 +
2468 +          size = trunc_int_for_mode (size, GET_MODE (my_fp));
2469 +          
2470            /************  Method 1: Adjust frame pointer  ************/
2471            
2472            start_sequence ();
2473 @@ -975,7 +1001,7 @@
2474                RTX_FRAME_RELATED_P (insn) = 1;
2475                add_reg_note (insn, REG_CFA_ADJUST_CFA,
2476                              gen_rtx_SET (VOIDmode, fp,
2477 -                                         plus_constant (fp, -size)));
2478 +                                         plus_constant (fp, -size_cfa)));
2479              }
2480            
2481            /* Copy to stack pointer.  Note that since we've already
2482 @@ -1003,7 +1029,7 @@
2483                add_reg_note (insn, REG_CFA_ADJUST_CFA,
2484                              gen_rtx_SET (VOIDmode, stack_pointer_rtx,
2485                                           plus_constant (stack_pointer_rtx,
2486 -                                                        -size)));
2487 +                                                        -size_cfa)));
2488              }
2489            
2490            fp_plus_insns = get_insns ();
2491 @@ -1026,7 +1052,7 @@
2492                add_reg_note (insn, REG_CFA_ADJUST_CFA,
2493                              gen_rtx_SET (VOIDmode, stack_pointer_rtx,
2494                                           plus_constant (stack_pointer_rtx,
2495 -                                                        -size)));
2496 +                                                        -size_cfa)));
2497                if (frame_pointer_needed)
2498                  {
2499                    insn = emit_move_insn (fp, stack_pointer_rtx);
2500 @@ -1048,7 +1074,7 @@
2501                emit_insn (fp_plus_insns);
2502              }
2503  
2504 -          cfun->machine->stack_usage += size;
2505 +          cfun->machine->stack_usage += size_cfa;
2506          } /* !minimize && size != 0 */
2507      } /* !minimize */
2508  }
2509 @@ -1123,11 +1149,11 @@
2510            emit_push_sfr (rampy_rtx, false /* frame-related */, true /* clr */);
2511          }
2512  
2513 -      if (AVR_HAVE_RAMPZ 
2514 +      if (AVR_HAVE_RAMPZ
2515            && TEST_HARD_REG_BIT (set, REG_Z)
2516            && TEST_HARD_REG_BIT (set, REG_Z + 1))
2517          {
2518 -          emit_push_sfr (rampz_rtx, false /* frame-related */, true /* clr */);
2519 +          emit_push_sfr (rampz_rtx, false /* frame-related */, AVR_HAVE_RAMPD);
2520          }
2521      }  /* is_interrupt is_signal */
2522  
2523 @@ -1261,6 +1287,7 @@
2524        int irq_state = -1;
2525        rtx fp, my_fp;
2526        rtx fp_plus_insns;
2527 +      HOST_WIDE_INT size_max;
2528  
2529        gcc_assert (frame_pointer_needed
2530                    || !isr_p
2531 @@ -1277,6 +1304,13 @@
2532                    
2533            my_fp = all_regs_rtx[FRAME_POINTER_REGNUM];
2534          }
2535 +
2536 +      /* For rationale see comment in prologue generation.  */
2537 +
2538 +      size_max = (HOST_WIDE_INT) GET_MODE_MASK (GET_MODE (my_fp));
2539 +      if (size > size_max)
2540 +        size = size_max;
2541 +      size = trunc_int_for_mode (size, GET_MODE (my_fp));
2542                
2543        /********** Method 1: Adjust fp register  **********/
2544                
2545 @@ -1347,12 +1381,12 @@
2546        /* Restore RAMPZ/Y/X/D using tmp_reg as scratch.
2547           The conditions to restore them must be tha same as in prologue.  */
2548        
2549 -      if (AVR_HAVE_RAMPX
2550 -          && TEST_HARD_REG_BIT (set, REG_X)
2551 -          && TEST_HARD_REG_BIT (set, REG_X + 1))
2552 +      if (AVR_HAVE_RAMPZ
2553 +          && TEST_HARD_REG_BIT (set, REG_Z)
2554 +          && TEST_HARD_REG_BIT (set, REG_Z + 1))
2555          {
2556            emit_pop_byte (TMP_REGNO);
2557 -          emit_move_insn (rampx_rtx, tmp_reg_rtx);
2558 +          emit_move_insn (rampz_rtx, tmp_reg_rtx);
2559          }
2560  
2561        if (AVR_HAVE_RAMPY
2562 @@ -1364,12 +1398,12 @@
2563            emit_move_insn (rampy_rtx, tmp_reg_rtx);
2564          }
2565  
2566 -      if (AVR_HAVE_RAMPZ
2567 -          && TEST_HARD_REG_BIT (set, REG_Z)
2568 -          && TEST_HARD_REG_BIT (set, REG_Z + 1))
2569 +      if (AVR_HAVE_RAMPX
2570 +          && TEST_HARD_REG_BIT (set, REG_X)
2571 +          && TEST_HARD_REG_BIT (set, REG_X + 1))
2572          {
2573            emit_pop_byte (TMP_REGNO);
2574 -          emit_move_insn (rampz_rtx, tmp_reg_rtx);
2575 +          emit_move_insn (rampx_rtx, tmp_reg_rtx);
2576          }
2577  
2578        if (AVR_HAVE_RAMPD)
2579 @@ -1423,6 +1457,22 @@
2580  }
2581  
2582  
2583 +/* Implement `TARGET_MODE_DEPENDENT_ADDRESS_P'.  */
2584 +
2585 +/* FIXME:  PSImode addresses are not mode-dependent in themselves.
2586 +      This hook just serves to hack around PR rtl-optimization/52543 by
2587 +      claiming that PSImode addresses (which are used for the 24-bit
2588 +      address space __memx) were mode-dependent so that lower-subreg.s
2589 +      will skip these addresses.  See also the similar FIXME comment along
2590 +      with mov<mode> expanders in avr.md.  */
2591 +
2592 +static bool
2593 +avr_mode_dependent_address_p (const_rtx addr)
2594 +{
2595 +  return GET_MODE (addr) != Pmode;
2596 +}
2597 +
2598 +
2599  /* Helper function for `avr_legitimate_address_p'.  */
2600  
2601  static inline bool
2602 @@ -2435,7 +2485,8 @@
2603          
2604    return (n_bytes > 2
2605            && !AVR_HAVE_LPMX
2606 -          && avr_mem_flash_p (op));
2607 +          && MEM_P (op)
2608 +          && MEM_ADDR_SPACE (op) == ADDR_SPACE_FLASH);
2609  }
2610  
2611  /* Return true if a value of mode MODE is read by __xload_* function.  */
2612 @@ -2450,155 +2501,6 @@
2613  }
2614  
2615  
2616 -/* Find an unused d-register to be used as scratch in INSN.
2617 -   EXCLUDE is either NULL_RTX or some register. In the case where EXCLUDE
2618 -   is a register, skip all possible return values that overlap EXCLUDE.
2619 -   The policy for the returned register is similar to that of
2620 -   `reg_unused_after', i.e. the returned register may overlap the SET_DEST
2621 -   of INSN.
2622 -
2623 -   Return a QImode d-register or NULL_RTX if nothing found.  */
2624 -
2625 -static rtx
2626 -avr_find_unused_d_reg (rtx insn, rtx exclude)
2627 -{
2628 -  int regno;
2629 -  bool isr_p = (interrupt_function_p (current_function_decl)
2630 -                || signal_function_p (current_function_decl));
2631 -
2632 -  for (regno = 16; regno < 32; regno++)
2633 -    {
2634 -      rtx reg = all_regs_rtx[regno];
2635 -      
2636 -      if ((exclude
2637 -           && reg_overlap_mentioned_p (exclude, reg))
2638 -          || fixed_regs[regno])
2639 -        {
2640 -          continue;
2641 -        }
2642 -
2643 -      /* Try non-live register */
2644 -
2645 -      if (!df_regs_ever_live_p (regno)
2646 -          && (TREE_THIS_VOLATILE (current_function_decl)
2647 -              || cfun->machine->is_OS_task
2648 -              || cfun->machine->is_OS_main
2649 -              || (!isr_p && call_used_regs[regno])))
2650 -        {
2651 -          return reg;
2652 -        }
2653 -
2654 -      /* Any live register can be used if it is unused after.
2655 -         Prologue/epilogue will care for it as needed.  */
2656 -      
2657 -      if (df_regs_ever_live_p (regno)
2658 -          && reg_unused_after (insn, reg))
2659 -        {
2660 -          return reg;
2661 -        }
2662 -    }
2663 -
2664 -  return NULL_RTX;
2665 -}
2666 -
2667 -
2668 -/* Helper function for the next function in the case where only restricted
2669 -   version of LPM instruction is available.  */
2670 -
2671 -static const char*
2672 -avr_out_lpm_no_lpmx (rtx insn, rtx *xop, int *plen)
2673 -{
2674 -  rtx dest = xop[0];
2675 -  rtx addr = xop[1];
2676 -  int n_bytes = GET_MODE_SIZE (GET_MODE (dest));
2677 -  int regno_dest;
2678 -
2679 -  regno_dest = REGNO (dest);
2680 -
2681 -  /* The implicit target register of LPM.  */
2682 -  xop[3] = lpm_reg_rtx;
2683 -
2684 -  switch (GET_CODE (addr))
2685 -    {
2686 -    default:
2687 -      gcc_unreachable();
2688 -
2689 -    case REG:
2690 -
2691 -      gcc_assert (REG_Z == REGNO (addr));
2692 -
2693 -      switch (n_bytes)
2694 -        {
2695 -        default:
2696 -          gcc_unreachable();
2697 -
2698 -        case 1:
2699 -          avr_asm_len ("%4lpm", xop, plen, 1);
2700 -
2701 -          if (regno_dest != LPM_REGNO)
2702 -            avr_asm_len ("mov %0,%3", xop, plen, 1);
2703 -
2704 -          return "";
2705 -
2706 -        case 2:
2707 -          if (REGNO (dest) == REG_Z)
2708 -            return avr_asm_len ("%4lpm"      CR_TAB
2709 -                                "push %3"    CR_TAB
2710 -                                "adiw %2,1"  CR_TAB
2711 -                                "%4lpm"      CR_TAB
2712 -                                "mov %B0,%3" CR_TAB
2713 -                                "pop %A0", xop, plen, 6);
2714 -          
2715 -          avr_asm_len ("%4lpm"      CR_TAB
2716 -                       "mov %A0,%3" CR_TAB
2717 -                       "adiw %2,1"  CR_TAB
2718 -                       "%4lpm"      CR_TAB
2719 -                       "mov %B0,%3", xop, plen, 5);
2720 -                
2721 -          if (!reg_unused_after (insn, addr))
2722 -            avr_asm_len ("sbiw %2,1", xop, plen, 1);
2723 -          
2724 -          break; /* 2 */
2725 -        }
2726 -      
2727 -      break; /* REG */
2728 -
2729 -    case POST_INC:
2730 -
2731 -      gcc_assert (REG_Z == REGNO (XEXP (addr, 0))
2732 -                  && n_bytes <= 4);
2733 -
2734 -      if (regno_dest == LPM_REGNO)
2735 -        avr_asm_len ("%4lpm"      CR_TAB
2736 -                     "adiw %2,1", xop, plen, 2);
2737 -      else
2738 -        avr_asm_len ("%4lpm"      CR_TAB
2739 -                     "mov %A0,%3" CR_TAB
2740 -                     "adiw %2,1", xop, plen, 3);
2741 -
2742 -      if (n_bytes >= 2)
2743 -        avr_asm_len ("%4lpm"      CR_TAB
2744 -                     "mov %B0,%3" CR_TAB
2745 -                     "adiw %2,1", xop, plen, 3);
2746 -
2747 -      if (n_bytes >= 3)
2748 -        avr_asm_len ("%4lpm"      CR_TAB
2749 -                     "mov %C0,%3" CR_TAB
2750 -                     "adiw %2,1", xop, plen, 3);
2751 -
2752 -      if (n_bytes >= 4)
2753 -        avr_asm_len ("%4lpm"      CR_TAB
2754 -                     "mov %D0,%3" CR_TAB
2755 -                     "adiw %2,1", xop, plen, 3);
2756 -
2757 -      break; /* POST_INC */
2758 -      
2759 -    } /* switch CODE (addr) */
2760 -      
2761 -  return "";
2762 -}
2763 -
2764 -
2765  /* If PLEN == NULL: Ouput instructions to load a value from a memory location
2766     OP[1] in AS1 to register OP[0].
2767     If PLEN != 0 set *PLEN to the length in words of the instruction sequence.
2768 @@ -2607,13 +2509,11 @@
2769  static const char*
2770  avr_out_lpm (rtx insn, rtx *op, int *plen)
2771  {
2772 -  rtx xop[6];
2773 +  rtx xop[3];
2774    rtx dest = op[0];
2775    rtx src = SET_SRC (single_set (insn));
2776    rtx addr;
2777    int n_bytes = GET_MODE_SIZE (GET_MODE (dest));
2778 -  int regno_dest;
2779 -  int segment;
2780    RTX_CODE code;
2781    addr_space_t as = MEM_ADDR_SPACE (src);
2782  
2783 @@ -2634,135 +2534,126 @@
2784    gcc_assert (REG_P (dest));
2785    gcc_assert (REG == code || POST_INC == code);
2786  
2787 +  /* Only 1-byte moves from __flash are representes as open coded
2788 +     mov insns.  All other loads from flash are not handled here but
2789 +     by some UNSPEC instead, see respective FIXME in machine description.  */
2790 +  
2791 +  gcc_assert (as == ADDR_SPACE_FLASH);
2792 +  gcc_assert (n_bytes == 1);
2793 +
2794    xop[0] = dest;
2795 -  xop[1] = addr;
2796 -  xop[2] = lpm_addr_reg_rtx;
2797 -  xop[4] = xstring_empty;
2798 -  xop[5] = tmp_reg_rtx;
2799 +  xop[1] = lpm_addr_reg_rtx;
2800 +  xop[2] = lpm_reg_rtx;
2801  
2802 -  regno_dest = REGNO (dest);
2803 -
2804 -  segment = avr_addrspace[as].segment;
2805 -
2806 -  /* Set RAMPZ as needed.  */
2807 -
2808 -  if (segment)
2809 +  switch (code)
2810      {
2811 -      xop[4] = GEN_INT (segment);
2812 -      
2813 -      if (xop[3] = avr_find_unused_d_reg (insn, lpm_addr_reg_rtx),
2814 -          xop[3])
2815 -        {
2816 -          avr_asm_len ("ldi %3,%4" CR_TAB
2817 -                       "out __RAMPZ__,%3", xop, plen, 2);
2818 -        }
2819 -      else if (segment == 1)
2820 -        {
2821 -          avr_asm_len ("clr %5" CR_TAB
2822 -                       "inc %5" CR_TAB
2823 -                       "out __RAMPZ__,%5", xop, plen, 3);
2824 -        }
2825 -      else
2826 -        {
2827 -          avr_asm_len ("mov %5,%2"         CR_TAB
2828 -                       "ldi %2,%4"         CR_TAB
2829 -                       "out __RAMPZ__,%2"  CR_TAB
2830 -                       "mov %2,%5", xop, plen, 4);
2831 -        }
2832 -      
2833 -      xop[4] = xstring_e;
2834 -
2835 -      if (!AVR_HAVE_ELPMX)
2836 -        return avr_out_lpm_no_lpmx (insn, xop, plen);
2837 -    }
2838 -  else if (!AVR_HAVE_LPMX)
2839 -    {
2840 -      return avr_out_lpm_no_lpmx (insn, xop, plen);
2841 -    }
2842 -
2843 -  /* We have [E]LPMX: Output reading from Flash the comfortable way.  */
2844 -
2845 -  switch (GET_CODE (addr))
2846 -    {
2847      default:
2848        gcc_unreachable();
2849  
2850      case REG:
2851  
2852        gcc_assert (REG_Z == REGNO (addr));
2853 +      
2854 +      return AVR_HAVE_LPMX
2855 +        ? avr_asm_len ("lpm %0,%a1", xop, plen, 1)
2856 +        : avr_asm_len ("lpm" CR_TAB
2857 +                       "mov %0,%2", xop, plen, 2);
2858 +      
2859 +    case POST_INC:
2860 +      
2861 +      gcc_assert (REG_Z == REGNO (XEXP (addr, 0)));
2862  
2863 -      switch (n_bytes)
2864 -        {
2865 -        default:
2866 -          gcc_unreachable();
2867 +      return AVR_HAVE_LPMX
2868 +        ? avr_asm_len ("lpm %0,%a1+", xop, plen, 1)
2869 +        : avr_asm_len ("lpm"        CR_TAB
2870 +                       "adiw %1, 1" CR_TAB
2871 +                       "mov %0,%2", xop, plen, 3);
2872 +    }
2873  
2874 -        case 1:
2875 -          return avr_asm_len ("%4lpm %0,%a2", xop, plen, 1);
2876 +  return "";
2877 +}
2878  
2879 -        case 2:
2880 -          if (REGNO (dest) == REG_Z)
2881 -            return avr_asm_len ("%4lpm %5,%a2+" CR_TAB
2882 -                                "%4lpm %B0,%a2" CR_TAB
2883 -                                "mov %A0,%5", xop, plen, 3);
2884 -          else
2885 -            {
2886 -              avr_asm_len ("%4lpm %A0,%a2+" CR_TAB
2887 -                           "%4lpm %B0,%a2", xop, plen, 2);
2888 -                
2889 -              if (!reg_unused_after (insn, addr))
2890 -                avr_asm_len ("sbiw %2,1", xop, plen, 1);
2891 -            }
2892 -          
2893 -          break; /* 2 */
2894  
2895 -        case 3:
2896 +/* If PLEN == NULL: Ouput instructions to load $0 with a value from
2897 +   flash address $1:Z.  If $1 = 0 we can use LPM to read, otherwise
2898 +   use ELPM.
2899 +   If PLEN != 0 set *PLEN to the length in words of the instruction sequence.
2900 +   Return "".  */
2901  
2902 -          avr_asm_len ("%4lpm %A0,%a2+" CR_TAB
2903 -                       "%4lpm %B0,%a2+" CR_TAB
2904 -                       "%4lpm %C0,%a2", xop, plen, 3);
2905 -                
2906 -          if (!reg_unused_after (insn, addr))
2907 -            avr_asm_len ("sbiw %2,2", xop, plen, 1);
2908 -
2909 -          break; /* 3 */
2910 +const char*
2911 +avr_load_lpm (rtx insn, rtx *op, int *plen)
2912 +{
2913 +  rtx xop[4];
2914 +  int n, n_bytes = GET_MODE_SIZE (GET_MODE (op[0]));
2915 +  rtx xsegment = op[1];
2916 +  bool clobber_z = PARALLEL == GET_CODE (PATTERN (insn));
2917 +  bool r30_in_tmp = false;
2918 +  
2919 +  if (plen)
2920 +    *plen = 0;
2921 +  
2922 +  xop[1] = lpm_addr_reg_rtx;
2923 +  xop[2] = lpm_reg_rtx;
2924 +  xop[3] = xstring_empty;
2925 +  
2926 +  /* Set RAMPZ as needed.  */
2927 +  
2928 +  if (REG_P (xsegment))
2929 +    {
2930 +      avr_asm_len ("out __RAMPZ__,%0", &xsegment, plen, 1);
2931 +      xop[3] = xstring_e;
2932 +    }
2933 +  
2934 +  /* Load the individual bytes from LSB to MSB.  */
2935 +  
2936 +  for (n = 0; n < n_bytes; n++)
2937 +    {
2938 +      xop[0] = all_regs_rtx[REGNO (op[0]) + n];
2939        
2940 -        case 4:
2941 -
2942 -          avr_asm_len ("%4lpm %A0,%a2+" CR_TAB
2943 -                       "%4lpm %B0,%a2+", xop, plen, 2);
2944 -          
2945 -          if (REGNO (dest) == REG_Z - 2)
2946 -            return avr_asm_len ("%4lpm %5,%a2+" CR_TAB
2947 -                                "%4lpm %C0,%a2"          CR_TAB
2948 -                                "mov %D0,%5", xop, plen, 3);
2949 -          else
2950 +      if ((CONST_INT_P (xsegment) && AVR_HAVE_LPMX)
2951 +          || (REG_P (xsegment) && AVR_HAVE_ELPMX))
2952 +        {
2953 +          if (n == n_bytes-1)
2954 +            avr_asm_len ("%3lpm %0,%a1", xop, plen, 1);
2955 +          else if (REGNO (xop[0]) == REG_Z)
2956              {
2957 -              avr_asm_len ("%4lpm %C0,%a2+" CR_TAB
2958 -                           "%4lpm %D0,%a2", xop, plen, 2);
2959 -                
2960 -              if (!reg_unused_after (insn, addr))
2961 -                avr_asm_len ("sbiw %2,3", xop, plen, 1);
2962 +              avr_asm_len ("%3lpm %2,%a1+", xop, plen, 1);
2963 +              r30_in_tmp = true;
2964              }
2965 +          else
2966 +            avr_asm_len ("%3lpm %0,%a1+", xop, plen, 1);
2967 +        }
2968 +      else
2969 +        {
2970 +          gcc_assert (clobber_z);
2971 +          
2972 +          avr_asm_len ("%3lpm" CR_TAB
2973 +                       "mov %0,%2", xop, plen, 2);
2974  
2975 -          break; /* 4 */
2976 -        } /* n_bytes */
2977 +          if (n != n_bytes-1)
2978 +            avr_asm_len ("adiw %1,1", xop, plen, 1);
2979 +        }
2980 +    }
2981 +  
2982 +  if (r30_in_tmp)
2983 +    avr_asm_len ("mov %1,%2", xop, plen, 1);
2984 +  
2985 +  if (!clobber_z
2986 +      && n_bytes > 1
2987 +      && !reg_unused_after (insn, lpm_addr_reg_rtx)
2988 +      && !reg_overlap_mentioned_p (op[0], lpm_addr_reg_rtx))
2989 +    {
2990 +      xop[2] = GEN_INT (n_bytes-1);
2991 +      avr_asm_len ("sbiw %1,%2", xop, plen, 1);
2992 +    }
2993 +  
2994 +  if (REG_P (xsegment) && AVR_HAVE_RAMPD)
2995 +    {
2996 +      /* Reset RAMPZ to 0 so that EBI devices don't read garbage from RAM */
2997        
2998 -      break; /* REG */
2999 +      avr_asm_len ("out __RAMPZ__,__zero_reg__", xop, plen, 1);
3000 +    }
3001  
3002 -    case POST_INC:
3003 -
3004 -      gcc_assert (REG_Z == REGNO (XEXP (addr, 0))
3005 -                  && n_bytes <= 4);
3006 -
3007 -      avr_asm_len                    ("%4lpm %A0,%a2+", xop, plen, 1);
3008 -      if (n_bytes >= 2)  avr_asm_len ("%4lpm %B0,%a2+", xop, plen, 1);
3009 -      if (n_bytes >= 3)  avr_asm_len ("%4lpm %C0,%a2+", xop, plen, 1);
3010 -      if (n_bytes >= 4)  avr_asm_len ("%4lpm %D0,%a2+", xop, plen, 1);
3011 -
3012 -      break; /* POST_INC */
3013 -
3014 -    } /* switch CODE (addr) */
3015 -      
3016    return "";
3017  }
3018  
3019 @@ -2782,8 +2673,9 @@
3020    if (plen)
3021      *plen = 0;
3022  
3023 -  avr_asm_len ("ld %3,%a2" CR_TAB
3024 -               "sbrs %1,7", xop, plen, 2);
3025 +  avr_asm_len ("sbrc %1,7" CR_TAB
3026 +               "ld %3,%a2" CR_TAB
3027 +               "sbrs %1,7", xop, plen, 3);
3028  
3029    avr_asm_len (AVR_HAVE_LPMX ? "lpm %3,%a2" : "lpm", xop, plen, 1);
3030  
3031 @@ -2794,13 +2686,11 @@
3032  }
3033  
3034  
3035 -const char *
3036 -output_movqi (rtx insn, rtx operands[], int *l)
3037 +const char*
3038 +output_movqi (rtx insn, rtx operands[], int *real_l)
3039  {
3040 -  int dummy;
3041    rtx dest = operands[0];
3042    rtx src = operands[1];
3043 -  int *real_l = l;
3044    
3045    if (avr_mem_flash_p (src)
3046        || avr_mem_flash_p (dest))
3047 @@ -2808,10 +2698,8 @@
3048        return avr_out_lpm (insn, operands, real_l);
3049      }
3050  
3051 -  if (!l)
3052 -    l = &dummy;
3053 -
3054 -  *l = 1;
3055 +  if (real_l)
3056 +    *real_l = 1;
3057    
3058    if (register_operand (dest, QImode))
3059      {
3060 @@ -2829,10 +2717,10 @@
3061            output_reload_in_const (operands, NULL_RTX, real_l, false);
3062            return "";
3063          }
3064 -      else if (GET_CODE (src) == MEM)
3065 +      else if (MEM_P (src))
3066         return out_movqi_r_mr (insn, operands, real_l); /* mov r,m */
3067      }
3068 -  else if (GET_CODE (dest) == MEM)
3069 +  else if (MEM_P (dest))
3070      {
3071        rtx xop[2];
3072  
3073 @@ -6533,6 +6421,7 @@
3074      case ADJUST_LEN_MOV32: output_movsisf (insn, op, &len); break;
3075      case ADJUST_LEN_MOVMEM: avr_out_movmem (insn, op, &len); break;
3076      case ADJUST_LEN_XLOAD: avr_out_xload (insn, op, &len); break;
3077 +    case ADJUST_LEN_LOAD_LPM: avr_load_lpm (insn, op, &len); break;
3078  
3079      case ADJUST_LEN_TSTHI: avr_out_tsthi (insn, op, &len); break;
3080      case ADJUST_LEN_TSTPSI: avr_out_tstpsi (insn, op, &len); break;
3081 @@ -8975,7 +8864,7 @@
3082  
3083  /* Implement `MODE_CODE_BASE_REG_CLASS'.  */
3084  
3085 -reg_class_t
3086 +enum reg_class
3087  avr_mode_code_base_reg_class (enum machine_mode mode ATTRIBUTE_UNUSED,
3088                                addr_space_t as, RTX_CODE outer_code,
3089                                RTX_CODE index_code ATTRIBUTE_UNUSED)
3090 @@ -9568,7 +9457,8 @@
3091  static bool
3092  avr_reg_ok_for_pgm_addr (rtx reg, bool strict)
3093  {
3094 -  gcc_assert (REG_P (reg));
3095 +  if (!REG_P (reg))
3096 +    return false;
3097  
3098    if (strict)
3099      {
3100 @@ -9916,7 +9806,7 @@
3101      case ADDR_SPACE_FLASH:
3102  
3103        if (AVR_HAVE_LPMX)
3104 -        avr_asm_len ("lpm %2,%Z+", xop, plen, 1);
3105 +        avr_asm_len ("lpm %2,Z+", xop, plen, 1);
3106        else
3107          avr_asm_len ("lpm" CR_TAB
3108                       "adiw r30,1", xop, plen, 2);
3109 @@ -9965,6 +9855,14 @@
3110  \f
3111  /* Helper for __builtin_avr_delay_cycles */
3112  
3113 +static rtx
3114 +avr_mem_clobber (void)
3115 +{
3116 +  rtx mem = gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (Pmode));
3117 +  MEM_VOLATILE_P (mem) = 1;
3118 +  return mem;
3119 +}
3120 +
3121  static void
3122  avr_expand_delay_cycles (rtx operands0)
3123  {
3124 @@ -9976,7 +9874,8 @@
3125      {
3126        loop_count = ((cycles - 9) / 6) + 1;
3127        cycles_used = ((loop_count - 1) * 6) + 9;
3128 -      emit_insn (gen_delay_cycles_4 (gen_int_mode (loop_count, SImode)));
3129 +      emit_insn (gen_delay_cycles_4 (gen_int_mode (loop_count, SImode),
3130 +                                     avr_mem_clobber()));
3131        cycles -= cycles_used;
3132      }
3133    
3134 @@ -9986,7 +9885,8 @@
3135        if (loop_count > 0xFFFFFF)
3136          loop_count = 0xFFFFFF;
3137        cycles_used = ((loop_count - 1) * 5) + 7;
3138 -      emit_insn (gen_delay_cycles_3 (gen_int_mode (loop_count, SImode)));
3139 +      emit_insn (gen_delay_cycles_3 (gen_int_mode (loop_count, SImode),
3140 +                                     avr_mem_clobber()));
3141        cycles -= cycles_used;
3142      }
3143    
3144 @@ -9996,7 +9896,8 @@
3145        if (loop_count > 0xFFFF)
3146          loop_count = 0xFFFF;
3147        cycles_used = ((loop_count - 1) * 4) + 5;
3148 -      emit_insn (gen_delay_cycles_2 (gen_int_mode (loop_count, HImode)));
3149 +      emit_insn (gen_delay_cycles_2 (gen_int_mode (loop_count, HImode),
3150 +                                     avr_mem_clobber()));
3151        cycles -= cycles_used;
3152      }
3153    
3154 @@ -10006,7 +9907,8 @@
3155        if (loop_count > 255) 
3156          loop_count = 255;
3157        cycles_used = loop_count * 3;
3158 -      emit_insn (gen_delay_cycles_1 (gen_int_mode (loop_count, QImode)));
3159 +      emit_insn (gen_delay_cycles_1 (gen_int_mode (loop_count, QImode),
3160 +                                     avr_mem_clobber()));
3161        cycles -= cycles_used;
3162        }
3163    
3164 @@ -11007,6 +10909,9 @@
3165  #undef  TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS
3166  #define TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS avr_addr_space_legitimize_address
3167  
3168 +#undef  TARGET_MODE_DEPENDENT_ADDRESS_P
3169 +#define TARGET_MODE_DEPENDENT_ADDRESS_P avr_mode_dependent_address_p
3170 +
3171  #undef  TARGET_PRINT_OPERAND
3172  #define TARGET_PRINT_OPERAND avr_print_operand
3173  #undef  TARGET_PRINT_OPERAND_ADDRESS
3174 Index: gcc/config/epiphany/epiphany.c
3175 ===================================================================
3176 --- gcc/config/epiphany/epiphany.c      (.../tags/gcc_4_7_0_release)    (wersja 185750)
3177 +++ gcc/config/epiphany/epiphany.c      (.../branches/gcc-4_7-branch)   (wersja 185750)
3178 @@ -1417,7 +1417,7 @@
3179    return gen_rtx_REG (mode, 0);
3180  }
3181  
3182 -bool
3183 +static bool
3184  epiphany_function_value_regno_p (const unsigned int regno ATTRIBUTE_UNUSED)
3185  {
3186    return regno == 0;
3187 Index: gcc/config/rs6000/vector.md
3188 ===================================================================
3189 --- gcc/config/rs6000/vector.md (.../tags/gcc_4_7_0_release)    (wersja 185750)
3190 +++ gcc/config/rs6000/vector.md (.../branches/gcc-4_7-branch)   (wersja 185750)
3191 @@ -516,6 +516,94 @@
3192    "VECTOR_UNIT_ALTIVEC_P (<MODE>mode)"
3193    "")
3194  
3195 +(define_insn_and_split "*vector_uneq<mode>"
3196 +  [(set (match_operand:VEC_F 0 "vfloat_operand" "")
3197 +       (uneq:VEC_F (match_operand:VEC_F 1 "vfloat_operand" "")
3198 +                   (match_operand:VEC_F 2 "vfloat_operand" "")))]
3199 +  "VECTOR_UNIT_ALTIVEC_OR_VSX_P (<MODE>mode)"
3200 +  "#"
3201 +  ""
3202 +  [(set (match_dup 3)
3203 +       (gt:VEC_F (match_dup 1)
3204 +                 (match_dup 2)))
3205 +   (set (match_dup 4)
3206 +       (gt:VEC_F (match_dup 2)
3207 +                 (match_dup 1)))
3208 +   (set (match_dup 0)
3209 +       (not:VEC_F (ior:VEC_F (match_dup 3)
3210 +                             (match_dup 4))))]
3211 +  "
3212 +{
3213 +  operands[3] = gen_reg_rtx (<MODE>mode);
3214 +  operands[4] = gen_reg_rtx (<MODE>mode);
3215 +}")
3216 +
3217 +(define_insn_and_split "*vector_ltgt<mode>"
3218 +  [(set (match_operand:VEC_F 0 "vfloat_operand" "")
3219 +       (ltgt:VEC_F (match_operand:VEC_F 1 "vfloat_operand" "")
3220 +                   (match_operand:VEC_F 2 "vfloat_operand" "")))]
3221 +  "VECTOR_UNIT_ALTIVEC_OR_VSX_P (<MODE>mode)"
3222 +  "#"
3223 +  ""
3224 +  [(set (match_dup 3)
3225 +       (gt:VEC_F (match_dup 1)
3226 +                 (match_dup 2)))
3227 +   (set (match_dup 4)
3228 +       (gt:VEC_F (match_dup 2)
3229 +                 (match_dup 1)))
3230 +   (set (match_dup 0)
3231 +       (ior:VEC_F (match_dup 3)
3232 +                  (match_dup 4)))]
3233 +  "
3234 +{
3235 +  operands[3] = gen_reg_rtx (<MODE>mode);
3236 +  operands[4] = gen_reg_rtx (<MODE>mode);
3237 +}")
3238 +
3239 +(define_insn_and_split "*vector_ordered<mode>"
3240 +  [(set (match_operand:VEC_F 0 "vfloat_operand" "")
3241 +       (ordered:VEC_F (match_operand:VEC_F 1 "vfloat_operand" "")
3242 +                      (match_operand:VEC_F 2 "vfloat_operand" "")))]
3243 +  "VECTOR_UNIT_ALTIVEC_OR_VSX_P (<MODE>mode)"
3244 +  "#"
3245 +  ""
3246 +  [(set (match_dup 3)
3247 +       (ge:VEC_F (match_dup 1)
3248 +                 (match_dup 2)))
3249 +   (set (match_dup 4)
3250 +       (ge:VEC_F (match_dup 2)
3251 +                 (match_dup 1)))
3252 +   (set (match_dup 0)
3253 +       (ior:VEC_F (match_dup 3)
3254 +                  (match_dup 4)))]
3255 +  "
3256 +{
3257 +  operands[3] = gen_reg_rtx (<MODE>mode);
3258 +  operands[4] = gen_reg_rtx (<MODE>mode);
3259 +}")
3260 +
3261 +(define_insn_and_split "*vector_unordered<mode>"
3262 +  [(set (match_operand:VEC_F 0 "vfloat_operand" "")
3263 +       (unordered:VEC_F (match_operand:VEC_F 1 "vfloat_operand" "")
3264 +                        (match_operand:VEC_F 2 "vfloat_operand" "")))]
3265 +  "VECTOR_UNIT_ALTIVEC_OR_VSX_P (<MODE>mode)"
3266 +  "#"
3267 +  ""
3268 +  [(set (match_dup 3)
3269 +       (ge:VEC_F (match_dup 1)
3270 +                 (match_dup 2)))
3271 +   (set (match_dup 4)
3272 +       (ge:VEC_F (match_dup 2)
3273 +                 (match_dup 1)))
3274 +   (set (match_dup 0)
3275 +       (not:VEC_F (ior:VEC_F (match_dup 3)
3276 +                             (match_dup 4))))]
3277 +  "
3278 +{
3279 +  operands[3] = gen_reg_rtx (<MODE>mode);
3280 +  operands[4] = gen_reg_rtx (<MODE>mode);
3281 +}")
3282 +
3283  ;; Note the arguments for __builtin_altivec_vsel are op2, op1, mask
3284  ;; which is in the reverse order that we want
3285  (define_expand "vector_select_<mode>"
3286 Index: gcc/config/rs6000/rs6000.c
3287 ===================================================================
3288 --- gcc/config/rs6000/rs6000.c  (.../tags/gcc_4_7_0_release)    (wersja 185750)
3289 +++ gcc/config/rs6000/rs6000.c  (.../branches/gcc-4_7-branch)   (wersja 185750)
3290 @@ -16137,6 +16137,10 @@
3291      case EQ:
3292      case GT:
3293      case GTU:
3294 +    case ORDERED:
3295 +    case UNORDERED:
3296 +    case UNEQ:
3297 +    case LTGT:
3298        mask = gen_reg_rtx (mode);
3299        emit_insn (gen_rtx_SET (VOIDmode,
3300                               mask,
3301 Index: libgo/go/syscall/syscall_unix.go
3302 ===================================================================
3303 --- libgo/go/syscall/syscall_unix.go    (.../tags/gcc_4_7_0_release)    (wersja 185750)
3304 +++ libgo/go/syscall/syscall_unix.go    (.../branches/gcc-4_7-branch)   (wersja 185750)
3305 @@ -31,6 +31,7 @@
3306  // expects a 32-bit one.
3307  func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) {
3308         Entersyscall()
3309 +       SetErrno(0)
3310         var r uintptr
3311         if unsafe.Sizeof(r) == 4 {
3312                 r1 := c_syscall32(int32(trap), int32(a1), int32(a2), int32(a3), 0, 0, 0)
3313 @@ -46,6 +47,7 @@
3314  
3315  func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) {
3316         Entersyscall()
3317 +       SetErrno(0)
3318         var r uintptr
3319         if unsafe.Sizeof(r) == 4 {
3320                 r1 := c_syscall32(int32(trap), int32(a1), int32(a2), int32(a3),
3321 @@ -63,6 +65,7 @@
3322  
3323  func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) {
3324         var r uintptr
3325 +       SetErrno(0)
3326         if unsafe.Sizeof(r) == 4 {
3327                 r1 := c_syscall32(int32(trap), int32(a1), int32(a2), int32(a3), 0, 0, 0)
3328                 r = uintptr(r1)
3329 @@ -76,6 +79,7 @@
3330  
3331  func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) {
3332         var r uintptr
3333 +       SetErrno(0)
3334         if unsafe.Sizeof(r) == 4 {
3335                 r1 := c_syscall32(int32(trap), int32(a1), int32(a2), int32(a3),
3336                         int32(a4), int32(a5), int32(a6))
3337 Index: libffi/src/powerpc/aix.S
3338 ===================================================================
3339 --- libffi/src/powerpc/aix.S    (.../tags/gcc_4_7_0_release)    (wersja 185750)
3340 +++ libffi/src/powerpc/aix.S    (.../branches/gcc-4_7-branch)   (wersja 185750)
3341 @@ -1,5 +1,5 @@
3342  /* -----------------------------------------------------------------------
3343 -   aix.S - Copyright (c) 2002,2009 Free Software Foundation, Inc.
3344 +   aix.S - Copyright (c) 2002, 2009 Free Software Foundation, Inc.
3345     based on darwin.S by John Hornkvist
3346  
3347     PowerPC Assembly glue.
3348 @@ -79,6 +79,8 @@
3349         .set f20,20
3350         .set f21,21
3351  
3352 +       .extern .ffi_prep_args
3353 +
3354  #define LIBFFI_ASM
3355  #include <fficonfig.h>
3356  #include <ffi.h>
3357 @@ -125,6 +127,7 @@
3358         /* Call ffi_prep_args.  */
3359         mr      r4, r1
3360         bl      .ffi_prep_args
3361 +       nop
3362  
3363         /* Now do the call.  */
3364         ld      r0, 0(r29)
3365 @@ -226,6 +229,7 @@
3366         /* Call ffi_prep_args.  */
3367         mr      r4, r1
3368         bl      .ffi_prep_args
3369 +       nop
3370  
3371         /* Now do the call.  */
3372         lwz     r0, 0(r29)
3373 Index: libffi/src/powerpc/aix_closure.S
3374 ===================================================================
3375 --- libffi/src/powerpc/aix_closure.S    (.../tags/gcc_4_7_0_release)    (wersja 185750)
3376 +++ libffi/src/powerpc/aix_closure.S    (.../branches/gcc-4_7-branch)   (wersja 185750)
3377 @@ -79,6 +79,8 @@
3378         .set f20,20
3379         .set f21,21
3380  
3381 +       .extern .ffi_closure_helper_DARWIN
3382 +
3383  #define LIBFFI_ASM
3384  #define JUMPTARGET(name) name
3385  #define L(x) x
3386 @@ -165,6 +167,7 @@
3387  
3388         /* look up the proper starting point in table  */
3389         /* by using return type as offset */
3390 +       lhz     r3, 10(r3)      /* load type from return type */
3391         ld      r4, LC..60(2)   /* get address of jump table */
3392         sldi    r3, r3, 4       /* now multiply return type by 16 */
3393         ld      r0, 240+16(r1)  /* load return address */
3394 @@ -337,8 +340,9 @@
3395  
3396         /* look up the proper starting point in table  */
3397         /* by using return type as offset */
3398 +       lhz     r3, 6(r3)       /* load type from return type */
3399         lwz     r4, LC..60(2)   /* get address of jump table */
3400 -       slwi    r3, r3, 4       /* now multiply return type by 4 */
3401 +       slwi    r3, r3, 4       /* now multiply return type by 16 */
3402         lwz     r0, 176+8(r1)   /* load return address */
3403         add     r3, r3, r4      /* add contents of table to table address */
3404         mtctr   r3
3405 Index: libffi/ChangeLog
3406 ===================================================================
3407 --- libffi/ChangeLog    (.../tags/gcc_4_7_0_release)    (wersja 185750)
3408 +++ libffi/ChangeLog    (.../branches/gcc-4_7-branch)   (wersja 185750)
3409 @@ -1,3 +1,17 @@
3410 +2012-03-22  David Edelsohn  <dje.gcc@gmail.com>
3411 +
3412 +       Backport from mainline:
3413 +       2012-03-09  David Edelsohn  <dje.gcc@gmail.com>
3414 +
3415 +       * src/powerpc/aix_closure.S (ffi_closure_ASM): Adjust for Darwin64
3416 +       change to return value of ffi_closure_helper_DARWIN and load type
3417 +       from return type.
3418 +
3419 +       From Tom Honermann <tom.honermann@oracle.com>:
3420 +       * src/powerpc/aix.S: Declare .ffi_prep_args.  Insert nops after
3421 +       branch instructions.
3422 +       * src/powerpc/aix_closure.S: Declare .ffi_closure_helper_DARWIN.
3423 +
3424  2012-03-22  Release Manager
3425  
3426         * GCC 4.7.0 released.
This page took 0.271819 seconds and 3 git commands to generate.