Index: libgomp/ChangeLog =================================================================== --- libgomp/ChangeLog (.../tags/gcc_4_7_1_release) (wersja 189237) +++ libgomp/ChangeLog (.../branches/gcc-4_7-branch) (wersja 189237) @@ -1,3 +1,23 @@ +2012-06-14 Jakub Jelinek + + Backported from mainline + 2012-06-07 Jakub Jelinek + + PR middle-end/53580 + * testsuite/libgomp.c/pr26943-2.c: Remove #pragma omp barrier, + use GOMP_barrier () call instead. + * testsuite/libgomp.c/pr26943-3.c: Likewise. + * testsuite/libgomp.c/pr26943-4.c: Likewise. + * testsuite/libgomp.fortran/vla4.f90: Remove !$omp barrier, + call GOMP_barrier instead. + * testsuite/libgomp.fortran/vla5.f90: Likewise. + + 2012-06-06 Jakub Jelinek + + PR libgomp/52993 + * config/linux/lock.c (gomp_init_nest_lock_25): Fix up last + argument to memset call. + 2012-06-14 Release Manager * GCC 4.7.1 released. Index: libgomp/testsuite/libgomp.fortran/vla4.f90 =================================================================== --- libgomp/testsuite/libgomp.fortran/vla4.f90 (.../tags/gcc_4_7_1_release) (wersja 189237) +++ libgomp/testsuite/libgomp.fortran/vla4.f90 (.../branches/gcc-4_7-branch) (wersja 189237) @@ -10,6 +10,10 @@ subroutine foo (c, d, e, f, g, h, i, j, k, n) use omp_lib + interface + subroutine GOMP_barrier () bind(c, name="GOMP_barrier") + end subroutine + end interface integer :: n character (len = *) :: c character (len = n) :: d @@ -94,7 +98,7 @@ forall (p = 1:2, q = 3:7, r = 1:7) u(p, q, r) = 30 - x - p + q - 2 * r forall (p = 1:5, q = 3:7, p + q .le. 8) v(p, q) = w(1:7) forall (p = 1:5, q = 3:7, p + q .gt. 8) v(p, q) = w(20:26) -!$omp barrier ! { dg-warning "may not be closely nested" } + call GOMP_barrier y = '' if (x .eq. 0) y = '0' if (x .eq. 1) y = '1' Index: libgomp/testsuite/libgomp.fortran/vla5.f90 =================================================================== --- libgomp/testsuite/libgomp.fortran/vla5.f90 (.../tags/gcc_4_7_1_release) (wersja 189237) +++ libgomp/testsuite/libgomp.fortran/vla5.f90 (.../branches/gcc-4_7-branch) (wersja 189237) @@ -10,6 +10,10 @@ subroutine foo (c, d, e, f, g, h, i, j, k, n) use omp_lib + interface + subroutine GOMP_barrier () bind(c, name="GOMP_barrier") + end subroutine + end interface integer :: n character (len = *) :: c character (len = n) :: d @@ -66,7 +70,7 @@ forall (p = 1:2, q = 3:7, r = 1:7) u(p, q, r) = 30 - x - p + q - 2 * r forall (p = 1:5, q = 3:7, p + q .le. 8) v(p, q) = w(1:7) forall (p = 1:5, q = 3:7, p + q .gt. 8) v(p, q) = w(20:26) -!$omp barrier ! { dg-warning "may not be closely nested" } + call GOMP_barrier y = '' if (x .eq. 0) y = '0' if (x .eq. 1) y = '1' Index: libgomp/testsuite/libgomp.c/pr26943-2.c =================================================================== --- libgomp/testsuite/libgomp.c/pr26943-2.c (.../tags/gcc_4_7_1_release) (wersja 189237) +++ libgomp/testsuite/libgomp.c/pr26943-2.c (.../branches/gcc-4_7-branch) (wersja 189237) @@ -3,6 +3,7 @@ extern int omp_set_dynamic (int); extern void abort (void); +extern void GOMP_barrier (void); int a = 8, b = 12, c = 16, d = 20, j = 0; char e[10] = "a", f[10] = "b", g[10] = "c", h[10] = "d"; @@ -20,7 +21,7 @@ { if (a != 8 || b != 12 || e[0] != 'a' || f[0] != 'b') j++; -#pragma omp barrier /* { dg-warning "may not be closely nested" } */ + GOMP_barrier (); #pragma omp atomic a += i; b += i; @@ -31,7 +32,7 @@ f[0] += i; g[0] = 'g' + i; h[0] = 'h' + i; -#pragma omp barrier /* { dg-warning "may not be closely nested" } */ + GOMP_barrier (); if (a != 8 + 6 || b != 12 + i || c != i || d != i) j += 8; if (e[0] != 'a' + 6 || f[0] != 'b' + i || g[0] != 'g' + i) Index: libgomp/testsuite/libgomp.c/pr26943-3.c =================================================================== --- libgomp/testsuite/libgomp.c/pr26943-3.c (.../tags/gcc_4_7_1_release) (wersja 189237) +++ libgomp/testsuite/libgomp.c/pr26943-3.c (.../branches/gcc-4_7-branch) (wersja 189237) @@ -4,6 +4,7 @@ extern int omp_set_dynamic (int); extern int omp_get_thread_num (void); extern void abort (void); +extern void GOMP_barrier (void); int a = 8, b = 12, c = 16, d = 20, j = 0, l = 0; char e[10] = "a", f[10] = "b", g[10] = "c", h[10] = "d"; @@ -26,7 +27,7 @@ { if (a != 8 || b != 12 || e[0] != 'a' || f[0] != 'b') j++; -#pragma omp barrier /* { dg-warning "may not be closely nested" } */ + GOMP_barrier (); #pragma omp atomic a += i; b += i; @@ -37,7 +38,7 @@ f[0] += i; g[0] = 'g' + i; h[0] = 'h' + i; -#pragma omp barrier /* { dg-warning "may not be closely nested" } */ + GOMP_barrier (); if (a != 8 + 6 || b != 12 + i || c != i || d != i) j += 8; if (e[0] != 'a' + 6 || f[0] != 'b' + i || g[0] != 'g' + i) Index: libgomp/testsuite/libgomp.c/pr26943-4.c =================================================================== --- libgomp/testsuite/libgomp.c/pr26943-4.c (.../tags/gcc_4_7_1_release) (wersja 189237) +++ libgomp/testsuite/libgomp.c/pr26943-4.c (.../branches/gcc-4_7-branch) (wersja 189237) @@ -4,6 +4,7 @@ extern int omp_set_dynamic (int); extern int omp_get_thread_num (void); extern void abort (void); +extern void GOMP_barrier (void); int a = 8, b = 12, c = 16, d = 20, j = 0, l = 0; char e[10] = "a", f[10] = "b", g[10] = "c", h[10] = "d"; @@ -27,7 +28,7 @@ { if (a != 8 || b != 12 || e[0] != 'a' || f[0] != 'b') j++; -#pragma omp barrier /* { dg-warning "may not be closely nested" } */ + GOMP_barrier (); #pragma omp atomic a += i; b += i; @@ -38,7 +39,7 @@ f[0] += i; g[0] = 'g' + i; h[0] = 'h' + i; -#pragma omp barrier /* { dg-warning "may not be closely nested" } */ + GOMP_barrier (); if (a != 8 + 6 || b != 12 + i || c != i || d != i) j += 8; if (e[0] != 'a' + 6 || f[0] != 'b' + i || g[0] != 'g' + i) Index: libgomp/config/linux/lock.c =================================================================== --- libgomp/config/linux/lock.c (.../tags/gcc_4_7_1_release) (wersja 189237) +++ libgomp/config/linux/lock.c (.../branches/gcc-4_7-branch) (wersja 189237) @@ -1,4 +1,4 @@ -/* Copyright (C) 2005, 2008, 2009, 2011 Free Software Foundation, Inc. +/* Copyright (C) 2005, 2008, 2009, 2011, 2012 Free Software Foundation, Inc. Contributed by Richard Henderson . This file is part of the GNU OpenMP Library (libgomp). @@ -175,7 +175,7 @@ void gomp_init_nest_lock_25 (omp_nest_lock_25_t *lock) { - memset (lock, 0, sizeof (lock)); + memset (lock, 0, sizeof (*lock)); } void Index: libstdc++-v3/include/bits/stl_list.h =================================================================== --- libstdc++-v3/include/bits/stl_list.h (.../tags/gcc_4_7_1_release) (wersja 189237) +++ libstdc++-v3/include/bits/stl_list.h (.../branches/gcc-4_7-branch) (wersja 189237) @@ -1,7 +1,7 @@ // List implementation -*- C++ -*- // Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -// 2011 Free Software Foundation, Inc. +// 2011, 2012 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -313,27 +313,17 @@ { __detail::_List_node_base _M_node; -#ifdef __GXX_EXPERIMENTAL_CXX0X__ - size_t _M_size; -#endif - _List_impl() : _Node_alloc_type(), _M_node() -#ifdef __GXX_EXPERIMENTAL_CXX0X__ - , _M_size(0) -#endif { } _List_impl(const _Node_alloc_type& __a) : _Node_alloc_type(__a), _M_node() -#ifdef __GXX_EXPERIMENTAL_CXX0X__ - , _M_size(0) -#endif { } #ifdef __GXX_EXPERIMENTAL_CXX0X__ _List_impl(_Node_alloc_type&& __a) - : _Node_alloc_type(std::move(__a)), _M_node(), _M_size(0) + : _Node_alloc_type(std::move(__a)), _M_node() { } #endif }; @@ -342,23 +332,12 @@ _List_node<_Tp>* _M_get_node() - { - _List_node<_Tp>* __tmp = _M_impl._Node_alloc_type::allocate(1); -#ifdef __GXX_EXPERIMENTAL_CXX0X__ - ++_M_impl._M_size; -#endif - return __tmp; - } + { return _M_impl._Node_alloc_type::allocate(1); } void _M_put_node(_List_node<_Tp>* __p) - { - _M_impl._Node_alloc_type::deallocate(__p, 1); -#ifdef __GXX_EXPERIMENTAL_CXX0X__ - --_M_impl._M_size; -#endif - } - + { _M_impl._Node_alloc_type::deallocate(__p, 1); } + public: typedef _Alloc allocator_type; @@ -392,7 +371,6 @@ { _M_init(); __detail::_List_node_base::swap(_M_impl._M_node, __x._M_impl._M_node); - std::swap(_M_impl._M_size, __x._M_impl._M_size); } #endif @@ -874,13 +852,7 @@ /** Returns the number of elements in the %list. */ size_type size() const _GLIBCXX_NOEXCEPT - { -#ifdef __GXX_EXPERIMENTAL_CXX0X__ - return this->_M_impl._M_size; -#else - return std::distance(begin(), end()); -#endif - } + { return std::distance(begin(), end()); } /** Returns the size() of the largest possible %list. */ size_type @@ -1215,9 +1187,6 @@ { __detail::_List_node_base::swap(this->_M_impl._M_node, __x._M_impl._M_node); -#ifdef __GXX_EXPERIMENTAL_CXX0X__ - std::swap(this->_M_impl._M_size, __x._M_impl._M_size); -#endif // _GLIBCXX_RESOLVE_LIB_DEFECTS // 431. Swapping containers with unequal allocators. @@ -1262,11 +1231,6 @@ _M_check_equal_allocators(__x); this->_M_transfer(__position, __x.begin(), __x.end()); - -#ifdef __GXX_EXPERIMENTAL_CXX0X__ - this->_M_impl._M_size += __x.size(); - __x._M_impl._M_size = 0; -#endif } } @@ -1298,15 +1262,8 @@ return; if (this != &__x) - { - _M_check_equal_allocators(__x); + _M_check_equal_allocators(__x); -#ifdef __GXX_EXPERIMENTAL_CXX0X__ - ++this->_M_impl._M_size; - --__x._M_impl._M_size; -#endif - } - this->_M_transfer(__position, __i, __j); } @@ -1340,16 +1297,8 @@ if (__first != __last) { if (this != &__x) - { - _M_check_equal_allocators(__x); + _M_check_equal_allocators(__x); -#ifdef __GXX_EXPERIMENTAL_CXX0X__ - const size_type __size = std::distance(__first, __last); - this->_M_impl._M_size += __size; - __x._M_impl._M_size -= __size; -#endif - } - this->_M_transfer(__position, __first, __last); } } @@ -1624,10 +1573,6 @@ inline bool operator==(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y) { -#ifdef __GXX_EXPERIMENTAL_CXX0X__ - return (__x.size() == __y.size() - && std::equal(__x.begin(), __x.end(), __y.begin())); -#else typedef typename list<_Tp, _Alloc>::const_iterator const_iterator; const_iterator __end1 = __x.end(); const_iterator __end2 = __y.end(); @@ -1640,7 +1585,6 @@ ++__i2; } return __i1 == __end1 && __i2 == __end2; -#endif } /** Index: libstdc++-v3/include/bits/list.tcc =================================================================== --- libstdc++-v3/include/bits/list.tcc (.../tags/gcc_4_7_1_release) (wersja 189237) +++ libstdc++-v3/include/bits/list.tcc (.../branches/gcc-4_7-branch) (wersja 189237) @@ -1,7 +1,7 @@ // List implementation (out of line) -*- C++ -*- // Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -// 2011 Free Software Foundation, Inc. +// 2011, 2012 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -139,14 +139,14 @@ list<_Tp, _Alloc>:: resize(size_type __new_size) { - if (__new_size > size()) - _M_default_append(__new_size - size()); - else if (__new_size < size()) - { - iterator __i = begin(); - std::advance(__i, __new_size); - erase(__i, end()); - } + iterator __i = begin(); + size_type __len = 0; + for (; __i != end() && __len < __new_size; ++__i, ++__len) + ; + if (__len == __new_size) + erase(__i, end()); + else // __i == end() + _M_default_append(__new_size - __len); } template @@ -154,14 +154,14 @@ list<_Tp, _Alloc>:: resize(size_type __new_size, const value_type& __x) { - if (__new_size > size()) - insert(end(), __new_size - size(), __x); - else if (__new_size < size()) - { - iterator __i = begin(); - std::advance(__i, __new_size); - erase(__i, end()); - } + iterator __i = begin(); + size_type __len = 0; + for (; __i != end() && __len < __new_size; ++__i, ++__len) + ; + if (__len == __new_size) + erase(__i, end()); + else // __i == end() + insert(end(), __new_size - __len, __x); } #else template @@ -312,11 +312,6 @@ ++__first1; if (__first2 != __last2) _M_transfer(__last1, __first2, __last2); - -#ifdef __GXX_EXPERIMENTAL_CXX0X__ - this->_M_impl._M_size += __x.size(); - __x._M_impl._M_size = 0; -#endif } } @@ -351,11 +346,6 @@ ++__first1; if (__first2 != __last2) _M_transfer(__last1, __first2, __last2); - -#ifdef __GXX_EXPERIMENTAL_CXX0X__ - this->_M_impl._M_size += __x.size(); - __x._M_impl._M_size = 0; -#endif } } Index: libstdc++-v3/ChangeLog =================================================================== --- libstdc++-v3/ChangeLog (.../tags/gcc_4_7_1_release) (wersja 189237) +++ libstdc++-v3/ChangeLog (.../branches/gcc-4_7-branch) (wersja 189237) @@ -1,3 +1,39 @@ +2012-07-02 Paolo Carlini + + Revert: + 2011-10-04 Paolo Carlini + + PR libstdc++/49561 + * include/bits/stl_list.h (_List_base<>::_List_impl::_M_size): + Add in C++0x mode. + (_List_base<>::_List_impl, _List_base<>::_M_get_node, + _List_base<>::_M_put_node, _List_base<>::_List_base(_List_base&&), + list<>::size, list<>::swap, list<>::splice): Use it. + (operator==(const list<>&, const list<>&)): Rewrite in C++0x mode. + * include/bits/list.tcc (list<>::erase): Likewise. + (list<>::merge): Adjust in C++0x mode. + * testsuite/23_containers/list/requirements/dr438/assign_neg.cc: + Adjust dg-error line number. + * testsuite/23_containers/list/requirements/dr438/insert_neg.cc: + Likewise. + * testsuite/23_containers/list/requirements/dr438/ + constructor_1_neg.cc: Likewise. + * testsuite/23_containers/list/requirements/dr438/ + constructor_2_neg.cc: Likewise. + +2012-06-19 Jonathan Wakely + + PR libstdc++/53270 + * config/os/gnu-linux/os_defines.h: Disable static initializer macros + for gthreads types in C++11 mode. + +2012-06-19 Jörg Sonnenberger + Jonathan Wakely + + PR libstdc++/53678 + * config/os/bsd/netbsd/ctype_base.h: Check for _CTYPE_U. + * testsuite/22_locale/ctype_base/53678.cc: New. + 2012-06-14 Release Manager * GCC 4.7.1 released. Index: libstdc++-v3/testsuite/22_locale/ctype_base/53678.cc =================================================================== --- libstdc++-v3/testsuite/22_locale/ctype_base/53678.cc (.../tags/gcc_4_7_1_release) (wersja 0) +++ libstdc++-v3/testsuite/22_locale/ctype_base/53678.cc (.../branches/gcc-4_7-branch) (wersja 189237) @@ -0,0 +1,28 @@ +// Copyright (C) 2012 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// { dg-do compile } + +// 22.2.1 The ctype category + +#include + +// libstdc++/53678 +void test01() +{ + bool NetBSD __attribute__((unused)) = true; +} Index: libstdc++-v3/testsuite/23_containers/list/requirements/dr438/assign_neg.cc =================================================================== --- libstdc++-v3/testsuite/23_containers/list/requirements/dr438/assign_neg.cc (.../tags/gcc_4_7_1_release) (wersja 189237) +++ libstdc++-v3/testsuite/23_containers/list/requirements/dr438/assign_neg.cc (.../branches/gcc-4_7-branch) (wersja 189237) @@ -1,6 +1,6 @@ // 2007-04-27 Paolo Carlini -// Copyright (C) 2007, 2008, 2009, 2010, 2011 Free Software Foundation +// Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -18,7 +18,7 @@ // . // { dg-do compile } -// { dg-error "no matching" "" { target *-*-* } 1552 } +// { dg-error "no matching" "" { target *-*-* } 1501 } #include Index: libstdc++-v3/testsuite/23_containers/list/requirements/dr438/insert_neg.cc =================================================================== --- libstdc++-v3/testsuite/23_containers/list/requirements/dr438/insert_neg.cc (.../tags/gcc_4_7_1_release) (wersja 189237) +++ libstdc++-v3/testsuite/23_containers/list/requirements/dr438/insert_neg.cc (.../branches/gcc-4_7-branch) (wersja 189237) @@ -1,6 +1,6 @@ // 2007-04-27 Paolo Carlini -// Copyright (C) 2007, 2008, 2009, 2010, 2011 Free Software Foundation +// Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -18,7 +18,7 @@ // . // { dg-do compile } -// { dg-error "no matching" "" { target *-*-* } 1508 } +// { dg-error "no matching" "" { target *-*-* } 1457 } #include Index: libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc =================================================================== --- libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc (.../tags/gcc_4_7_1_release) (wersja 189237) +++ libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc (.../branches/gcc-4_7-branch) (wersja 189237) @@ -1,6 +1,6 @@ // 2007-04-27 Paolo Carlini -// Copyright (C) 2007, 2008, 2009, 2010, 2011 Free Software Foundation +// Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -18,7 +18,7 @@ // . // { dg-do compile } -// { dg-error "no matching" "" { target *-*-* } 1508 } +// { dg-error "no matching" "" { target *-*-* } 1457 } #include Index: libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc =================================================================== --- libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc (.../tags/gcc_4_7_1_release) (wersja 189237) +++ libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc (.../branches/gcc-4_7-branch) (wersja 189237) @@ -1,6 +1,6 @@ // 2007-04-27 Paolo Carlini -// Copyright (C) 2007, 2008, 2009, 2010, 2011 Free Software Foundation +// Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -18,7 +18,7 @@ // . // { dg-do compile } -// { dg-error "no matching" "" { target *-*-* } 1508 } +// { dg-error "no matching" "" { target *-*-* } 1457 } #include #include Index: libstdc++-v3/config/os/gnu-linux/os_defines.h =================================================================== --- libstdc++-v3/config/os/gnu-linux/os_defines.h (.../tags/gcc_4_7_1_release) (wersja 189237) +++ libstdc++-v3/config/os/gnu-linux/os_defines.h (.../branches/gcc-4_7-branch) (wersja 189237) @@ -46,4 +46,10 @@ # undef _GLIBCXX_HAVE_GETS #endif +#if defined(__hppa__) && defined(__GXX_EXPERIMENTAL_CXX0X__) +# define _GTHREAD_USE_MUTEX_INIT_FUNC +# define _GTHREAD_USE_RECURSIVE_MUTEX_INIT_FUNC +# define _GTHREAD_USE_COND_INIT_FUNC #endif + +#endif Index: libstdc++-v3/config/os/bsd/netbsd/ctype_base.h =================================================================== --- libstdc++-v3/config/os/bsd/netbsd/ctype_base.h (.../tags/gcc_4_7_1_release) (wersja 189237) +++ libstdc++-v3/config/os/bsd/netbsd/ctype_base.h (.../branches/gcc-4_7-branch) (wersja 189237) @@ -1,6 +1,6 @@ // Locale support -*- C++ -*- -// Copyright (C) 2000, 2009 Free Software Foundation, Inc. +// Copyright (C) 2000, 2009, 2011, 2012 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -31,8 +31,6 @@ // anoncvs@anoncvs.netbsd.org:/cvsroot/basesrc/include/ctype.h // See www.netbsd.org for details of access. -#include - namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION @@ -47,7 +45,7 @@ // on the mask type. Because of this, we don't use an enum. typedef unsigned char mask; -#if __NetBSD_Version__ < 599004100 +#ifndef _CTYPE_U static const mask upper = _U; static const mask lower = _L; static const mask alpha = _U | _L; Index: gcc/tree-ssa-loop-im.c =================================================================== --- gcc/tree-ssa-loop-im.c (.../tags/gcc_4_7_1_release) (wersja 189237) +++ gcc/tree-ssa-loop-im.c (.../branches/gcc-4_7-branch) (wersja 189237) @@ -52,7 +52,7 @@ } } - Where COND and INV are is invariants, but evaluating INV may trap or be + Where COND and INV are invariants, but evaluating INV may trap or be invalid from some other reason if !COND. This may be transformed to if (cond) @@ -1626,6 +1626,7 @@ fprintf (dump_file, "\n"); } } + if (is_stored) mark_ref_stored (ref, loop); @@ -1956,6 +1957,173 @@ return lsm_tmp_name; } +struct prev_flag_edges { + /* Edge to insert new flag comparison code. */ + edge append_cond_position; + + /* Edge for fall through from previous flag comparison. */ + edge last_cond_fallthru; +}; + +/* Helper function for execute_sm. Emit code to store TMP_VAR into + MEM along edge EX. + + The store is only done if MEM has changed. We do this so no + changes to MEM occur on code paths that did not originally store + into it. + + The common case for execute_sm will transform: + + for (...) { + if (foo) + stuff; + else + MEM = TMP_VAR; + } + + into: + + lsm = MEM; + for (...) { + if (foo) + stuff; + else + lsm = TMP_VAR; + } + MEM = lsm; + + This function will generate: + + lsm = MEM; + + lsm_flag = false; + ... + for (...) { + if (foo) + stuff; + else { + lsm = TMP_VAR; + lsm_flag = true; + } + } + if (lsm_flag) <-- + MEM = lsm; <-- +*/ + +static void +execute_sm_if_changed (edge ex, tree mem, tree tmp_var, tree flag) +{ + basic_block new_bb, then_bb, old_dest; + bool loop_has_only_one_exit; + edge then_old_edge, orig_ex = ex; + gimple_stmt_iterator gsi; + gimple stmt; + struct prev_flag_edges *prev_edges = (struct prev_flag_edges *) ex->aux; + + /* ?? Insert store after previous store if applicable. See note + below. */ + if (prev_edges) + ex = prev_edges->append_cond_position; + + loop_has_only_one_exit = single_pred_p (ex->dest); + + if (loop_has_only_one_exit) + ex = split_block_after_labels (ex->dest); + + old_dest = ex->dest; + new_bb = split_edge (ex); + then_bb = create_empty_bb (new_bb); + if (current_loops && new_bb->loop_father) + add_bb_to_loop (then_bb, new_bb->loop_father); + + gsi = gsi_start_bb (new_bb); + stmt = gimple_build_cond (NE_EXPR, flag, boolean_false_node, + NULL_TREE, NULL_TREE); + gsi_insert_after (&gsi, stmt, GSI_CONTINUE_LINKING); + + gsi = gsi_start_bb (then_bb); + /* Insert actual store. */ + stmt = gimple_build_assign (unshare_expr (mem), tmp_var); + gsi_insert_after (&gsi, stmt, GSI_CONTINUE_LINKING); + + make_edge (new_bb, then_bb, EDGE_TRUE_VALUE); + make_edge (new_bb, old_dest, EDGE_FALSE_VALUE); + then_old_edge = make_edge (then_bb, old_dest, EDGE_FALLTHRU); + + set_immediate_dominator (CDI_DOMINATORS, then_bb, new_bb); + + if (prev_edges) + { + basic_block prevbb = prev_edges->last_cond_fallthru->src; + redirect_edge_succ (prev_edges->last_cond_fallthru, new_bb); + set_immediate_dominator (CDI_DOMINATORS, new_bb, prevbb); + set_immediate_dominator (CDI_DOMINATORS, old_dest, + recompute_dominator (CDI_DOMINATORS, old_dest)); + } + + /* ?? Because stores may alias, they must happen in the exact + sequence they originally happened. Save the position right after + the (_lsm) store we just created so we can continue appending after + it and maintain the original order. */ + { + struct prev_flag_edges *p; + + if (orig_ex->aux) + orig_ex->aux = NULL; + alloc_aux_for_edge (orig_ex, sizeof (struct prev_flag_edges)); + p = (struct prev_flag_edges *) orig_ex->aux; + p->append_cond_position = then_old_edge; + p->last_cond_fallthru = find_edge (new_bb, old_dest); + orig_ex->aux = (void *) p; + } + + if (!loop_has_only_one_exit) + for (gsi = gsi_start_phis (old_dest); !gsi_end_p (gsi); gsi_next (&gsi)) + { + gimple phi = gsi_stmt (gsi); + unsigned i; + + for (i = 0; i < gimple_phi_num_args (phi); i++) + if (gimple_phi_arg_edge (phi, i)->src == new_bb) + { + tree arg = gimple_phi_arg_def (phi, i); + add_phi_arg (phi, arg, then_old_edge, UNKNOWN_LOCATION); + update_stmt (phi); + } + } + /* Remove the original fall through edge. This was the + single_succ_edge (new_bb). */ + EDGE_SUCC (new_bb, 0)->flags &= ~EDGE_FALLTHRU; +} + +/* Helper function for execute_sm. On every location where REF is + set, set an appropriate flag indicating the store. */ + +static tree +execute_sm_if_changed_flag_set (struct loop *loop, mem_ref_p ref) +{ + unsigned i; + mem_ref_loc_p loc; + tree flag; + VEC (mem_ref_loc_p, heap) *locs = NULL; + char *str = get_lsm_tmp_name (ref->mem, ~0); + + lsm_tmp_name_add ("_flag"); + flag = make_rename_temp (boolean_type_node, str); + get_all_locs_in_loop (loop, ref, &locs); + FOR_EACH_VEC_ELT (mem_ref_loc_p, locs, i, loc) + { + gimple_stmt_iterator gsi; + gimple stmt; + + gsi = gsi_for_stmt (loc->stmt); + stmt = gimple_build_assign (flag, boolean_true_node); + gsi_insert_after (&gsi, stmt, GSI_CONTINUE_LINKING); + } + VEC_free (mem_ref_loc_p, heap, locs); + return flag; +} + /* Executes store motion of memory reference REF from LOOP. Exits from the LOOP are stored in EXITS. The initialization of the temporary variable is put to the preheader of the loop, and assignments @@ -1964,12 +2132,13 @@ static void execute_sm (struct loop *loop, VEC (edge, heap) *exits, mem_ref_p ref) { - tree tmp_var; + tree tmp_var, store_flag; unsigned i; - gimple load, store; + gimple load; struct fmt_data fmt_data; - edge ex; + edge ex, latch_edge; struct lim_aux_data *lim_data; + bool multi_threaded_model_p = false; if (dump_file && (dump_flags & TDF_DETAILS)) { @@ -1985,23 +2154,47 @@ fmt_data.orig_loop = loop; for_each_index (&ref->mem, force_move_till, &fmt_data); + if (block_in_transaction (loop_preheader_edge (loop)->src) + || !PARAM_VALUE (PARAM_ALLOW_STORE_DATA_RACES)) + multi_threaded_model_p = true; + + if (multi_threaded_model_p) + store_flag = execute_sm_if_changed_flag_set (loop, ref); + rewrite_mem_refs (loop, ref, tmp_var); - /* Emit the load & stores. */ + /* Emit the load code into the latch, so that we are sure it will + be processed after all dependencies. */ + latch_edge = loop_latch_edge (loop); + + /* FIXME/TODO: For the multi-threaded variant, we could avoid this + load altogether, since the store is predicated by a flag. We + could, do the load only if it was originally in the loop. */ load = gimple_build_assign (tmp_var, unshare_expr (ref->mem)); lim_data = init_lim_data (load); lim_data->max_loop = loop; lim_data->tgt_loop = loop; + gsi_insert_on_edge (latch_edge, load); - /* Put this into the latch, so that we are sure it will be processed after - all dependencies. */ - gsi_insert_on_edge (loop_latch_edge (loop), load); + if (multi_threaded_model_p) + { + load = gimple_build_assign (store_flag, boolean_false_node); + lim_data = init_lim_data (load); + lim_data->max_loop = loop; + lim_data->tgt_loop = loop; + gsi_insert_on_edge (latch_edge, load); + } + /* Sink the store to every exit from the loop. */ FOR_EACH_VEC_ELT (edge, exits, i, ex) - { - store = gimple_build_assign (unshare_expr (ref->mem), tmp_var); - gsi_insert_on_edge (ex, store); - } + if (!multi_threaded_model_p) + { + gimple store; + store = gimple_build_assign (unshare_expr (ref->mem), tmp_var); + gsi_insert_on_edge (ex, store); + } + else + execute_sm_if_changed (ex, ref->mem, tmp_var, store_flag); } /* Hoists memory references MEM_REFS out of LOOP. EXITS is the list of exit @@ -2410,6 +2603,8 @@ if (flag_tm) compute_transaction_bits (); + + alloc_aux_for_edges (0); } /* Cleans up after the invariant motion pass. */ @@ -2421,6 +2616,8 @@ unsigned i; bitmap b; + free_aux_for_edges (); + FOR_EACH_BB (bb) SET_ALWAYS_EXECUTED_IN (bb, NULL); Index: gcc/c-family/ChangeLog =================================================================== --- gcc/c-family/ChangeLog (.../tags/gcc_4_7_1_release) (wersja 189237) +++ gcc/c-family/ChangeLog (.../branches/gcc-4_7-branch) (wersja 189237) @@ -1,3 +1,9 @@ +2012-06-27 Kai Tietz + + Merged from trunk + PR preprocessor/37215 + * c-ppoutput.c (preprocess_file): Check for nonempty buffer. + 2012-06-14 Release Manager * GCC 4.7.1 released. Index: gcc/c-family/c-ppoutput.c =================================================================== --- gcc/c-family/c-ppoutput.c (.../tags/gcc_4_7_1_release) (wersja 189237) +++ gcc/c-family/c-ppoutput.c (.../branches/gcc-4_7-branch) (wersja 189237) @@ -86,7 +86,7 @@ { /* A successful cpp_read_main_file guarantees that we can call cpp_scan_nooutput or cpp_get_token next. */ - if (flag_no_output) + if (flag_no_output && pfile->buffer) { /* Scan -included buffers, then the main file. */ while (pfile->buffer->prev) Index: gcc/DATESTAMP =================================================================== --- gcc/DATESTAMP (.../tags/gcc_4_7_1_release) (wersja 189237) +++ gcc/DATESTAMP (.../branches/gcc-4_7-branch) (wersja 189237) @@ -1 +1 @@ -20120614 +20120703 Index: gcc/tree.c =================================================================== --- gcc/tree.c (.../tags/gcc_4_7_1_release) (wersja 189237) +++ gcc/tree.c (.../branches/gcc-4_7-branch) (wersja 189237) @@ -4517,11 +4517,17 @@ free_lang_data_in_one_sizepos (&TYPE_SIZE (type)); free_lang_data_in_one_sizepos (&TYPE_SIZE_UNIT (type)); - if (debug_info_level < DINFO_LEVEL_TERSE - || (TYPE_CONTEXT (type) - && TREE_CODE (TYPE_CONTEXT (type)) != FUNCTION_DECL - && TREE_CODE (TYPE_CONTEXT (type)) != NAMESPACE_DECL)) - TYPE_CONTEXT (type) = NULL_TREE; + if (TYPE_CONTEXT (type) + && TREE_CODE (TYPE_CONTEXT (type)) == BLOCK) + { + tree ctx = TYPE_CONTEXT (type); + do + { + ctx = BLOCK_SUPERCONTEXT (ctx); + } + while (ctx && TREE_CODE (ctx) == BLOCK); + TYPE_CONTEXT (type) = ctx; + } } Index: gcc/configure =================================================================== --- gcc/configure (.../tags/gcc_4_7_1_release) (wersja 189237) +++ gcc/configure (.../branches/gcc-4_7-branch) (wersja 189237) @@ -26179,7 +26179,7 @@ then gcc_cv_as_gnu_unique_object=yes fi elif test x$gcc_cv_as != x; then - $as_echo '.type foo, @gnu_unique_object' > conftest.s + $as_echo '.type foo, '$target_type_format_char'gnu_unique_object' > conftest.s if { ac_try='$gcc_cv_as $gcc_cv_as_flags -o conftest.o conftest.s >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 (eval $ac_try) 2>&5 @@ -26198,7 +26198,8 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_gnu_unique_object" >&5 $as_echo "$gcc_cv_as_gnu_unique_object" >&6; } if test $gcc_cv_as_gnu_unique_object = yes; then - # Also check for ld.so support, i.e. glibc 2.11 or higher. + # We need to unquote above to to use the definition from config.gcc. +# Also check for ld.so support, i.e. glibc 2.11 or higher. if test x$host = x$build -a x$host = x$target && ldd --version 2>/dev/null && glibcver=`ldd --version 2>/dev/null | sed 's/.* //;q'`; then Index: gcc/omp-low.c =================================================================== --- gcc/omp-low.c (.../tags/gcc_4_7_1_release) (wersja 189237) +++ gcc/omp-low.c (.../branches/gcc-4_7-branch) (wersja 189237) @@ -1823,8 +1823,8 @@ /* Check OpenMP nesting restrictions. */ -static void -check_omp_nesting_restrictions (gimple stmt, omp_context *ctx) +static bool +check_omp_nesting_restrictions (gimple stmt, omp_context *ctx) { switch (gimple_code (stmt)) { @@ -1843,17 +1843,19 @@ case GIMPLE_OMP_TASK: if (is_gimple_call (stmt)) { - warning (0, "barrier region may not be closely nested inside " - "of work-sharing, critical, ordered, master or " - "explicit task region"); - return; + error_at (gimple_location (stmt), + "barrier region may not be closely nested inside " + "of work-sharing, critical, ordered, master or " + "explicit task region"); + return false; } - warning (0, "work-sharing region may not be closely nested inside " - "of work-sharing, critical, ordered, master or explicit " - "task region"); - return; + error_at (gimple_location (stmt), + "work-sharing region may not be closely nested inside " + "of work-sharing, critical, ordered, master or explicit " + "task region"); + return false; case GIMPLE_OMP_PARALLEL: - return; + return true; default: break; } @@ -1866,11 +1868,12 @@ case GIMPLE_OMP_SECTIONS: case GIMPLE_OMP_SINGLE: case GIMPLE_OMP_TASK: - warning (0, "master region may not be closely nested inside " - "of work-sharing or explicit task region"); - return; + error_at (gimple_location (stmt), + "master region may not be closely nested inside " + "of work-sharing or explicit task region"); + return false; case GIMPLE_OMP_PARALLEL: - return; + return true; default: break; } @@ -1881,17 +1884,22 @@ { case GIMPLE_OMP_CRITICAL: case GIMPLE_OMP_TASK: - warning (0, "ordered region may not be closely nested inside " - "of critical or explicit task region"); - return; + error_at (gimple_location (stmt), + "ordered region may not be closely nested inside " + "of critical or explicit task region"); + return false; case GIMPLE_OMP_FOR: if (find_omp_clause (gimple_omp_for_clauses (ctx->stmt), OMP_CLAUSE_ORDERED) == NULL) - warning (0, "ordered region must be closely nested inside " + { + error_at (gimple_location (stmt), + "ordered region must be closely nested inside " "a loop region with an ordered clause"); - return; + return false; + } + return true; case GIMPLE_OMP_PARALLEL: - return; + return true; default: break; } @@ -1902,14 +1910,16 @@ && (gimple_omp_critical_name (stmt) == gimple_omp_critical_name (ctx->stmt))) { - warning (0, "critical region may not be nested inside a critical " - "region with the same name"); - return; + error_at (gimple_location (stmt), + "critical region may not be nested inside a critical " + "region with the same name"); + return false; } break; default: break; } + return true; } @@ -1980,15 +1990,21 @@ /* Check the OpenMP nesting restrictions. */ if (ctx != NULL) { + bool remove = false; if (is_gimple_omp (stmt)) - check_omp_nesting_restrictions (stmt, ctx); + remove = !check_omp_nesting_restrictions (stmt, ctx); else if (is_gimple_call (stmt)) { tree fndecl = gimple_call_fndecl (stmt); if (fndecl && DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL && DECL_FUNCTION_CODE (fndecl) == BUILT_IN_GOMP_BARRIER) - check_omp_nesting_restrictions (stmt, ctx); + remove = !check_omp_nesting_restrictions (stmt, ctx); } + if (remove) + { + stmt = gimple_build_nop (); + gsi_replace (gsi, stmt, false); + } } *handled_ops_p = true; Index: gcc/cfg.c =================================================================== --- gcc/cfg.c (.../tags/gcc_4_7_1_release) (wersja 189237) +++ gcc/cfg.c (.../branches/gcc-4_7-branch) (wersja 189237) @@ -814,10 +814,10 @@ clear_aux_for_blocks (); } -/* Allocate a memory edge of SIZE as BB->aux. The obstack must +/* Allocate a memory edge of SIZE as E->aux. The obstack must be first initialized by alloc_aux_for_edges. */ -static void +void alloc_aux_for_edge (edge e, int size) { /* Verify that aux field is clear. */ Index: gcc/DEV-PHASE =================================================================== --- gcc/DEV-PHASE (.../tags/gcc_4_7_1_release) (wersja 189237) +++ gcc/DEV-PHASE (.../branches/gcc-4_7-branch) (wersja 189237) @@ -0,0 +1 @@ +prerelease Index: gcc/ChangeLog =================================================================== --- gcc/ChangeLog (.../tags/gcc_4_7_1_release) (wersja 189237) +++ gcc/ChangeLog (.../branches/gcc-4_7-branch) (wersja 189237) @@ -1,3 +1,218 @@ +2012-07-02 Martin Jambor + + Backport from mainline. + 2012-07-02 Martin Jambor + + PR middle-end/38474 + * ipa-prop.c (compute_known_type_jump_func): Put BINFO check before a + dynamic type change check. + +2012-06-29 Eric Botcazou + + * tree-eh.c (lower_try_finally_switch): Really put the location of the + last statement of the finally block onto the switch. + +2012-06-29 Ramana Radhakrishnan + + * configure: Regenerate. + Backport from mainline. + 2012-03-15 Ramana Radhakrishnan + * config.gcc (target_type_format_char): New. Document it. Set it for + arm*-*-* . + * configure.ac (gnu_unique_option): Use target_type_format_char + in test. Comment rationale. + +2012-06-29 Ramana Radhakrishnan + + Backport from mainline. + 2012-05-30 Ramana Radhakrishnan + * config/arm/arm.c (arm_evpc_neon_vrev): Adjust off by one error. + +2012-06-28 Georg-Johann Lay + + Backport from 2012-06-28 mainline r189049 + + PR 53595 + * config/avr/avr.c (avr_hard_regno_call_part_clobbered): New. + * config/avr/avr-protos.h (avr_hard_regno_call_part_clobbered): New. + * config/avr/avr.h (HARD_REGNO_CALL_PART_CLOBBERED): Forward to + avr_hard_regno_call_part_clobbered. + +2012-06-28 Richard Guenther + + PR middle-end/53790 + * expr.c (expand_expr_real_1): Verify if the type is complete + before inspecting its size. + +2012-06-27 Nick Clifton + + * config/rx/rx.md (comparesi3_extend): Remove = modifier from + input operand. + +2012-06-26 Alexandre Oliva + + PR debug/53682 + * cselib.c (promote_debug_loc): Don't crash on NULL argument. + +2012-06-26 Nick Clifton + + * config/rx/rx.md (simple_return): Use the simple_return rtx. + +2012-06-25 Jakub Jelinek + + PR target/53759 + * config/i386/sse.md (sse_loadlps): Use x m x constraints instead + of x x x in the vmovlps load alternative. + +2012-06-22 Richard Guenther + + * gcov-iov.c: Include bconfig.h and system.h. + +2012-06-22 Richard Guenther + + PR gcov-profile/53744 + * gcov-iov.c (main): Treat "" and "prerelease" the same. + +2012-06-22 Eric Botcazou + + * tree-ssa-live.c (remove_unused_scope_block_p): Remove again + DECL_IGNORED_P non-reg vars even if they are used. + +2012-06-19 Jason Merrill + + PR c++/52637 + * dwarf2out.c (modified_type_die): Use scope_die_for. + (gen_type_die_with_usage, dwarf2out_finish): Likewise. + (uses_local_type_r, uses_local_type): New. + (scope_die_for): Keep a type that uses a local type in local scope. + Use get_context_die for namespace and type scope. + +2012-06-19 Richard Guenther + + PR middle-end/53470 + * tree.c (free_lang_data_in_type): Do not clear TYPE_CONTEXT but + replace it with the first non-BLOCK context. + +2012-06-18 Vladimir Makarov + + PR rtl-optimization/53700 + + Backport from mainline + 2012-03-29 Vladimir Makarov + + * ira-color.c (setup_left_conflict_sizes_p): Process all + conflicting objects. + +2012-06-18 Venkataramanan Kumar + + Backport from mainline + 2012-05-09 Uros Bizjak + + PR target/52908 + * config/i386/sse.md (vec_widen_smult_hi_v4si): Expand using + xop_pmacsdqh insn pattern instead of xop_mulv2div2di3_high. + (vec_widen_smult_lo_v4si): Expand using xop_pmacsdql insn pattern + instead of xop_mulv2div2di3_low. + (xop_pdql): Fix vec_select selector. + (xop_pdqh): Ditto. + (xop_mulv2div2di3_low): Remove insn_and_split pattern. + (xop_mulv2div2di3_high): Ditto. + +2012-06-17 Uros Bizjak + + Backport from mainline: + 2012-06-17 Uros Bizjak + + * config/i386/sse.md (vcvtph2ps): Fix vec_select selector. + +2012-06-16 John David Anglin + + Backport from mainline: + 2012-06-03 John David Anglin + + * config/pa/pa.h (MAX_PCREL17F_OFFSET): Define. + * config/pa/pa.c (pa_attr_length_millicode_call): Use + MAX_PCREL17F_OFFSET instead of fixed offset. + (pa_attr_length_call): Likewise. + (pa_attr_length_indirect_call): Likewise. + +2012-06-15 Walter Lee + + Backport from mainline: + 2012-06-15 Walter Lee + + * config/tilegx/sync.md (atomic_fetch_): Fix typo. + + 2012-06-14 Maxim Kuvyrkov + + * config/tilegx/sync.md (atomic_fetch_sub): Fix typo. + +2012-06-15 Aldy Hernandez + + Backport from mainline: + + 2012-05-31 Aldy Hernandez + * tree-ssa-loop-im.c (execute_sm): Do not check flag_tm. + * gimple.h (block_in_transaction): Check for flag_tm. + +2012-06-14 Aldy Hernandez + + PR tree-optimization/52558 + + Backport from mainline: + 2012-05-21 Aldy Hernandez + * gimple.h (gimple_set_in_transaction): Remove. + (gimple_in_transaction): Look in BB instead. + (gimple_statement_base): Remove in_transaction field. + * basic-block.h (enum bb_flags): Add BB_IN_TRANSACTION. + * trans-mem.c (compute_transaction_bits): Place transaction bit + information into basic blocks. + + 2012-05-31 Aldy Hernandez + + PR tree-optimization/52558 + * cfg.c (alloc_aux_for_edge): Fix comment. + (alloc_aux_for_edge): Remove static. + * basic-block.h (alloc_aux_for_edge): Protoize. + * tree-ssa-loop-im.c (execute_sm_if_changed): New. + (execute_sm_if_changed_flag): New. + (execute_sm_if_changed_flag_set): New. + (execute_sm): Do not generate data races unless requested. + (tree_ssa_lim_initialize): Call alloc_aux_for_edges. + (tree_ssa_lim_finalize): Call free_aux_for_edges. + * gimple.h (block_in_transaction): New. + (gimple_in_transaction): Use block_in_transaction. + +2012-06-14 Jakub Jelinek + + Backported from mainline + 2012-06-12 Jakub Jelinek + + PR rtl-optimization/53589 + * cfgrtl.c (force_nonfallthru_and_redirect): Do asm_goto_edge + discovery even when e->dest != target. If any LABEL_REF points + to e->dest label, redirect it to target's label. + + 2012-06-07 Jakub Jelinek + + PR middle-end/53580 + * omp-low.c (scan_omp_1_stmt): If check_omp_nesting_restrictions + returns false, replace stmt with GIMPLE_NOP. + (check_omp_nesting_restrictions): Instead of issuing warnings, + issue errors and return false if any errors were reported. + +2012-06-14 Richard Guenther + + * BASE-VER: Set to 4.7.2. + * DEV-PHASE: Set to prerelease. + +2012-06-12 Christian Bruel + + PR target/53621 + * config/sh/sh.c (sh_option_override): Don't force + flag_omit_frame_pointer and maccumulate_outgoing_args. + * config/sh/sh.opt (maccumulate-outgoing-args): Init as Var. + 2012-06-14 Release Manager * GCC 4.7.1 released. Index: gcc/testsuite/gcc.target/arm/neon-vrev.c =================================================================== --- gcc/testsuite/gcc.target/arm/neon-vrev.c (.../tags/gcc_4_7_1_release) (wersja 0) +++ gcc/testsuite/gcc.target/arm/neon-vrev.c (.../branches/gcc-4_7-branch) (wersja 189237) @@ -0,0 +1,105 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target arm_neon_ok } */ +/* { dg-options "-O2" } */ +/* { dg-add-options arm_neon } */ + +#include + +uint16x4_t +tst_vrev642_u16 (uint16x4_t __a) +{ + uint16x4_t __rv; + uint16x4_t __mask1 = { 3, 2, 1, 0}; + return __builtin_shuffle ( __a, __mask1) ; +} + +uint16x8_t +tst_vrev64q2_u16 (uint16x8_t __a) +{ + uint16x8_t __rv; + uint16x8_t __mask1 = {3, 2, 1, 0, 7, 6, 5, 4 }; + return __builtin_shuffle ( __a, __mask1) ; +} + +uint8x8_t +tst_vrev642_u8 (uint8x8_t __a) +{ + uint8x8_t __rv; + uint8x8_t __mask1 = { 7, 6, 5, 4, 3, 2, 1, 0}; + return __builtin_shuffle ( __a, __mask1) ; +} + +uint8x16_t +tst_vrev64q2_u8 (uint8x16_t __a) +{ + uint8x16_t __rv; + uint8x16_t __mask1 = {7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8}; + return __builtin_shuffle ( __a, __mask1) ; + +} + +uint32x2_t +tst_vrev642_u32 (uint32x2_t __a) +{ + uint32x2_t __rv; + uint32x2_t __mask1 = {1, 0}; + return __builtin_shuffle ( __a, __mask1) ; + +} + +uint32x4_t +tst_vrev64q2_u32 (uint32x4_t __a) +{ + uint32x4_t __rv; + uint32x4_t __mask1 = {1, 0, 3, 2}; + return __builtin_shuffle ( __a, __mask1) ; +} + +uint16x4_t +tst_vrev322_u16 (uint16x4_t __a) +{ + uint16x4_t __mask1 = { 1, 0, 3, 2 }; + return __builtin_shuffle (__a, __mask1); +} + +uint16x8_t +tst_vrev32q2_u16 (uint16x8_t __a) +{ + uint16x8_t __mask1 = { 1, 0, 3, 2, 5, 4, 7, 6 }; + return __builtin_shuffle (__a, __mask1); +} + +uint8x8_t +tst_vrev322_u8 (uint8x8_t __a) +{ + uint8x8_t __mask1 = { 3, 2, 1, 0, 7, 6, 5, 4}; + return __builtin_shuffle (__a, __mask1); +} + +uint8x16_t +tst_vrev32q2_u8 (uint8x16_t __a) +{ + uint8x16_t __mask1 = { 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12}; + return __builtin_shuffle (__a, __mask1); +} + +uint8x8_t +tst_vrev162_u8 (uint8x8_t __a) +{ + uint8x8_t __mask = { 1, 0, 3, 2, 5, 4, 7, 6}; + return __builtin_shuffle (__a, __mask); +} + +uint8x16_t +tst_vrev16q2_u8 (uint8x16_t __a) +{ + uint8x16_t __mask = { 1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10, 13, 12, 15, 14}; + return __builtin_shuffle (__a, __mask); +} + +/* { dg-final {scan-assembler-times "vrev32\.16\\t" 2} } */ +/* { dg-final {scan-assembler-times "vrev32\.8\\t" 2} } */ +/* { dg-final {scan-assembler-times "vrev16\.8\\t" 2} } */ +/* { dg-final {scan-assembler-times "vrev64\.8\\t" 2} } */ +/* { dg-final {scan-assembler-times "vrev64\.32\\t" 2} } */ +/* { dg-final {scan-assembler-times "vrev64\.16\\t" 2} } */ Index: gcc/testsuite/gcc.target/i386/xop-imul32widen-vector.c =================================================================== --- gcc/testsuite/gcc.target/i386/xop-imul32widen-vector.c (.../tags/gcc_4_7_1_release) (wersja 189237) +++ gcc/testsuite/gcc.target/i386/xop-imul32widen-vector.c (.../branches/gcc-4_7-branch) (wersja 189237) @@ -32,5 +32,5 @@ exit (0); } -/* { dg-final { scan-assembler "vpmacsdql" } } */ +/* { dg-final { scan-assembler "vpmuldq" } } */ /* { dg-final { scan-assembler "vpmacsdqh" } } */ Index: gcc/testsuite/gcc.target/i386/pr53759.c =================================================================== --- gcc/testsuite/gcc.target/i386/pr53759.c (.../tags/gcc_4_7_1_release) (wersja 0) +++ gcc/testsuite/gcc.target/i386/pr53759.c (.../branches/gcc-4_7-branch) (wersja 189237) @@ -0,0 +1,17 @@ +/* PR target/53759 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -mavx" } */ +/* { dg-require-effective-target avx } */ + +#include + +void +foo (__m128 *x, __m64 *y) +{ + __m128 a = _mm_setzero_ps (); + __m128 b = _mm_loadl_pi (a, y); + *x = _mm_add_ps (b, b); +} + +/* { dg-final { scan-assembler "vmovlps\[ \\t\]" } } */ +/* { dg-final { scan-assembler-not "vshufps\[ \\t\]" } } */ Index: gcc/testsuite/gfortran.dg/gomp/appendix-a/a.35.1.f90 =================================================================== --- gcc/testsuite/gfortran.dg/gomp/appendix-a/a.35.1.f90 (.../tags/gcc_4_7_1_release) (wersja 189237) +++ gcc/testsuite/gfortran.dg/gomp/appendix-a/a.35.1.f90 (.../branches/gcc-4_7-branch) (wersja 189237) @@ -10,7 +10,7 @@ !$OMP DO DO I = 1, N ! incorrect nesting of loop regions -!$OMP DO ! { dg-warning "may not be closely nested" } +!$OMP DO ! { dg-error "may not be closely nested" } DO J = 1, N CALL WORK(I,J) END DO Index: gcc/testsuite/gfortran.dg/gomp/appendix-a/a.35.3.f90 =================================================================== --- gcc/testsuite/gfortran.dg/gomp/appendix-a/a.35.3.f90 (.../tags/gcc_4_7_1_release) (wersja 189237) +++ gcc/testsuite/gfortran.dg/gomp/appendix-a/a.35.3.f90 (.../branches/gcc-4_7-branch) (wersja 189237) @@ -7,7 +7,7 @@ !$OMP DO DO I = 1, N ! incorrect nesting of regions -!$OMP SINGLE ! { dg-warning "may not be closely nested" } +!$OMP SINGLE ! { dg-error "may not be closely nested" } CALL WORK(I, 1) !$OMP END SINGLE END DO Index: gcc/testsuite/gfortran.dg/gomp/appendix-a/a.35.4.f90 =================================================================== --- gcc/testsuite/gfortran.dg/gomp/appendix-a/a.35.4.f90 (.../tags/gcc_4_7_1_release) (wersja 189237) +++ gcc/testsuite/gfortran.dg/gomp/appendix-a/a.35.4.f90 (.../branches/gcc-4_7-branch) (wersja 189237) @@ -8,7 +8,7 @@ DO I = 1, N CALL WORK(I, 1) ! incorrect nesting of barrier region in a loop region -!$OMP BARRIER ! { dg-warning "may not be closely nested" } +!$OMP BARRIER ! { dg-error "may not be closely nested" } CALL WORK(I, 2) END DO !$OMP END PARALLEL Index: gcc/testsuite/gfortran.dg/gomp/appendix-a/a.35.6.f90 =================================================================== --- gcc/testsuite/gfortran.dg/gomp/appendix-a/a.35.6.f90 (.../tags/gcc_4_7_1_release) (wersja 189237) +++ gcc/testsuite/gfortran.dg/gomp/appendix-a/a.35.6.f90 (.../branches/gcc-4_7-branch) (wersja 189237) @@ -6,7 +6,7 @@ !$OMP SINGLE CALL WORK(N,1) ! incorrect nesting of barrier region in a single region -!$OMP BARRIER ! { dg-warning "may not be closely nested" } +!$OMP BARRIER ! { dg-error "may not be closely nested" } CALL WORK(N,2) !$OMP END SINGLE !$OMP END PARALLEL Index: gcc/testsuite/gfortran.dg/init_flag_10.f90 =================================================================== --- gcc/testsuite/gfortran.dg/init_flag_10.f90 (.../tags/gcc_4_7_1_release) (wersja 0) +++ gcc/testsuite/gfortran.dg/init_flag_10.f90 (.../branches/gcc-4_7-branch) (wersja 189237) @@ -0,0 +1,43 @@ +! { dg-do run } +! { dg-options "-finit-real=NAN" } +! { dg-add-options ieee } +! { dg-skip-if "NaN not supported" { spu-*-* } { "*" } { "" } } +! +! PR fortran/50619 +! +! Contributed by Fred Krogh +! +! The NaN initialization used to set the associate name to NaN! +! + +module testa2 +type, public :: test_ty + real :: rmult = 1.0e0 +end type test_ty + +contains + subroutine test(e, var1) + type(test_ty) :: e + real :: var1, var2 ! Should get NaN initialized + + ! Should be the default value + if (e%rmult /= 1.0) call abort () + + ! Check that NaN initialization is really turned on + if (var1 == var1) call abort () + if (var2 == var2) call abort () + + ! The following was failing: + associate (rmult=>e%rmult) + if (e%rmult /= 1.0) call abort () + end associate + end subroutine test +end module testa2 + +program testa1 + use testa2 + type(test_ty) :: e + real :: var1 ! Should get NaN initialized + call test(e, var1) + stop +end program testa1 Index: gcc/testsuite/gfortran.dg/transfer_check_3.f90 =================================================================== --- gcc/testsuite/gfortran.dg/transfer_check_3.f90 (.../tags/gcc_4_7_1_release) (wersja 0) +++ gcc/testsuite/gfortran.dg/transfer_check_3.f90 (.../branches/gcc-4_7-branch) (wersja 189237) @@ -0,0 +1,33 @@ +! { dg-do compile } +! { dg-options "-Wsurprising" } +! +! PR fortran/53691 +! PR fortran/53685 +! +! TRANSFER checks + + +! (a) PR 53691 +! Failed for -Wsurprising with an ICE as SIZE was assumed to be constant + + SUBROUTINE CGBRFSX(N, RWORK) + INTEGER N + REAL RWORK(*) + REAL ZERO + PARAMETER (ZERO = 0.0E+0) + call foo(TRANSFER (RWORK(1:2*N), (/ (ZERO, ZERO) /), N)) + end + +! (b) PR 53685 +! Failed with a bogus size warning if the source's size is not known at compile +! time (for substrings, the length wasn't set) + + subroutine test(j) + implicit none + character(len=4) :: record_type + integer :: i, j + + i = transfer (record_type, i) ! no warning + i = transfer (record_type(1:4), i) ! gave a warning + i = transfer (record_type(1:j), i) ! gave a warning + end Index: gcc/testsuite/gfortran.dg/save_4.f90 =================================================================== --- gcc/testsuite/gfortran.dg/save_4.f90 (.../tags/gcc_4_7_1_release) (wersja 0) +++ gcc/testsuite/gfortran.dg/save_4.f90 (.../branches/gcc-4_7-branch) (wersja 189237) @@ -0,0 +1,13 @@ +! { dg-do compile } +! { dg-options "-std=f2003" } +! +! PR fortran/53597 +! +MODULE somemodule + IMPLICIT NONE + TYPE sometype + INTEGER :: i + DOUBLE PRECISION, POINTER, DIMENSION(:,:) :: coef => NULL() + END TYPE sometype + TYPE(sometype) :: somevariable ! { dg-error "Fortran 2008: Implied SAVE for module variable 'somevariable' at .1., needed due to the default initialization" } +END MODULE somemodule Index: gcc/testsuite/gnat.dg/vect8.adb =================================================================== --- gcc/testsuite/gnat.dg/vect8.adb (.../tags/gcc_4_7_1_release) (wersja 0) +++ gcc/testsuite/gnat.dg/vect8.adb (.../branches/gcc-4_7-branch) (wersja 189237) @@ -0,0 +1,11 @@ +package body Vect8 is + + function Foo (V : Vec) return Vec is + Ret : Vec; + begin + Ret (1) := V (1) + V (2); + Ret (2) := V (1) - V (2); + return Ret; + end; + +end Vect8; Index: gcc/testsuite/gnat.dg/vect8.ads =================================================================== --- gcc/testsuite/gnat.dg/vect8.ads (.../tags/gcc_4_7_1_release) (wersja 0) +++ gcc/testsuite/gnat.dg/vect8.ads (.../branches/gcc-4_7-branch) (wersja 189237) @@ -0,0 +1,10 @@ +-- { dg-do compile } + +package Vect8 is + + type Vec is array (1 .. 2) of Long_Float; + pragma Machine_Attribute (Vec, "vector_type"); + + function Foo (V : Vec) return Vec; + +end Vect8; Index: gcc/testsuite/gnat.dg/recursive_call.adb =================================================================== --- gcc/testsuite/gnat.dg/recursive_call.adb (.../tags/gcc_4_7_1_release) (wersja 0) +++ gcc/testsuite/gnat.dg/recursive_call.adb (.../branches/gcc-4_7-branch) (wersja 189237) @@ -0,0 +1,10 @@ +-- { dg-do compile } +-- { dg-options "-gnat2012" } + +function Recursive_Call (File : String; Status : out Boolean) return Boolean is +begin + if File /= "/dev/null" then + return Recursive_Call ("/dev/null", Status); + end if; + return False; +end; Index: gcc/testsuite/gnat.dg/lto15.adb =================================================================== --- gcc/testsuite/gnat.dg/lto15.adb (.../tags/gcc_4_7_1_release) (wersja 0) +++ gcc/testsuite/gnat.dg/lto15.adb (.../branches/gcc-4_7-branch) (wersja 189237) @@ -0,0 +1,11 @@ +-- { dg-do compile } +-- { dg-options "-O -flto -g" } + +package body Lto15 is + + function Proc (Data : Arr) return R is + begin + return (Data'Length, Data); + end; + +end Lto15; Index: gcc/testsuite/gnat.dg/lto15.ads =================================================================== --- gcc/testsuite/gnat.dg/lto15.ads (.../tags/gcc_4_7_1_release) (wersja 0) +++ gcc/testsuite/gnat.dg/lto15.ads (.../branches/gcc-4_7-branch) (wersja 189237) @@ -0,0 +1,11 @@ +package Lto15 is + + type Arr is array (Positive range <>) of Integer; + + type R(Size : Positive) is record + Data : Arr (1 .. Size); + end record; + + function Proc (Data : Arr) return R; + +end Lto15; Index: gcc/testsuite/gnat.dg/discr37.adb =================================================================== --- gcc/testsuite/gnat.dg/discr37.adb (.../tags/gcc_4_7_1_release) (wersja 0) +++ gcc/testsuite/gnat.dg/discr37.adb (.../branches/gcc-4_7-branch) (wersja 189237) @@ -0,0 +1,12 @@ +-- { dg-do compile } + +package body Discr37 is + + procedure Proc (A : access Child) is + B : Derived renames Derived (A.F(1).all); + C : Derived renames Derived (B.S(1).all); + begin + null; + end; + +end Discr37; Index: gcc/testsuite/gnat.dg/discr37.ads =================================================================== --- gcc/testsuite/gnat.dg/discr37.ads (.../tags/gcc_4_7_1_release) (wersja 0) +++ gcc/testsuite/gnat.dg/discr37.ads (.../branches/gcc-4_7-branch) (wersja 189237) @@ -0,0 +1,22 @@ +package Discr37 is + + subtype Index is Integer range 0 .. 100; + + type Root; + type Frame_Ptr is access all Root'Class; + + type Arr is array (Index range <>) of Frame_Ptr; + + type Root (Level : Index) is tagged record + S : Arr (0 .. Level); + end record; + + type Derived (Level : Index) is new Root (Level) with null record; + + type Child is new Derived (0) with record + F : Arr (0 .. 100); + end record; + + procedure Proc (A : access Child); + +end Discr37; Index: gcc/testsuite/gcc.dg/gomp/critical-4.c =================================================================== --- gcc/testsuite/gcc.dg/gomp/critical-4.c (.../tags/gcc_4_7_1_release) (wersja 189237) +++ gcc/testsuite/gcc.dg/gomp/critical-4.c (.../branches/gcc-4_7-branch) (wersja 189237) @@ -15,7 +15,7 @@ foo2 (void) { #pragma omp critical - #pragma omp critical /* { dg-warning "with the same name" } */ + #pragma omp critical /* { dg-error "with the same name" } */ bar (0); } @@ -23,6 +23,6 @@ foo3 (void) { #pragma omp critical(foo) - #pragma omp critical(foo) /* { dg-warning "with the same name" } */ + #pragma omp critical(foo) /* { dg-error "with the same name" } */ bar (0); } Index: gcc/testsuite/gcc.dg/gomp/nesting-1.c =================================================================== --- gcc/testsuite/gcc.dg/gomp/nesting-1.c (.../tags/gcc_4_7_1_release) (wersja 189237) +++ gcc/testsuite/gcc.dg/gomp/nesting-1.c (.../branches/gcc-4_7-branch) (wersja 189237) @@ -8,89 +8,89 @@ #pragma omp for for (i = 0; i < 3; i++) { - #pragma omp for /* { dg-warning "may not be closely nested" } */ + #pragma omp for /* { dg-error "may not be closely nested" } */ for (j = 0; j < 3; j++) ; - #pragma omp sections /* { dg-warning "may not be closely nested" } */ + #pragma omp sections /* { dg-error "may not be closely nested" } */ { ; #pragma omp section ; } - #pragma omp single /* { dg-warning "may not be closely nested" } */ + #pragma omp single /* { dg-error "may not be closely nested" } */ ; - #pragma omp master /* { dg-warning "may not be closely nested" } */ + #pragma omp master /* { dg-error "may not be closely nested" } */ ; - #pragma omp barrier /* { dg-warning "may not be closely nested" } */ + #pragma omp barrier /* { dg-error "may not be closely nested" } */ } #pragma omp sections { - #pragma omp for /* { dg-warning "may not be closely nested" } */ + #pragma omp for /* { dg-error "may not be closely nested" } */ for (j = 0; j < 3; j++) ; - #pragma omp sections /* { dg-warning "may not be closely nested" } */ + #pragma omp sections /* { dg-error "may not be closely nested" } */ { ; #pragma omp section ; } - #pragma omp single /* { dg-warning "may not be closely nested" } */ + #pragma omp single /* { dg-error "may not be closely nested" } */ ; - #pragma omp master /* { dg-warning "may not be closely nested" } */ + #pragma omp master /* { dg-error "may not be closely nested" } */ ; #pragma omp section ; } #pragma omp single { - #pragma omp for /* { dg-warning "may not be closely nested" } */ + #pragma omp for /* { dg-error "may not be closely nested" } */ for (j = 0; j < 3; j++) ; - #pragma omp sections /* { dg-warning "may not be closely nested" } */ + #pragma omp sections /* { dg-error "may not be closely nested" } */ { ; #pragma omp section ; } - #pragma omp single /* { dg-warning "may not be closely nested" } */ + #pragma omp single /* { dg-error "may not be closely nested" } */ ; - #pragma omp master /* { dg-warning "may not be closely nested" } */ + #pragma omp master /* { dg-error "may not be closely nested" } */ ; - #pragma omp barrier /* { dg-warning "may not be closely nested" } */ + #pragma omp barrier /* { dg-error "may not be closely nested" } */ } #pragma omp master { - #pragma omp for /* { dg-warning "may not be closely nested" } */ + #pragma omp for /* { dg-error "may not be closely nested" } */ for (j = 0; j < 3; j++) ; - #pragma omp sections /* { dg-warning "may not be closely nested" } */ + #pragma omp sections /* { dg-error "may not be closely nested" } */ { ; #pragma omp section ; } - #pragma omp single /* { dg-warning "may not be closely nested" } */ + #pragma omp single /* { dg-error "may not be closely nested" } */ ; #pragma omp master ; - #pragma omp barrier /* { dg-warning "may not be closely nested" } */ + #pragma omp barrier /* { dg-error "may not be closely nested" } */ } #pragma omp task { - #pragma omp for /* { dg-warning "may not be closely nested" } */ + #pragma omp for /* { dg-error "may not be closely nested" } */ for (j = 0; j < 3; j++) ; - #pragma omp sections /* { dg-warning "may not be closely nested" } */ + #pragma omp sections /* { dg-error "may not be closely nested" } */ { ; #pragma omp section ; } - #pragma omp single /* { dg-warning "may not be closely nested" } */ + #pragma omp single /* { dg-error "may not be closely nested" } */ ; - #pragma omp master /* { dg-warning "may not be closely nested" } */ + #pragma omp master /* { dg-error "may not be closely nested" } */ ; - #pragma omp barrier /* { dg-warning "may not be closely nested" } */ + #pragma omp barrier /* { dg-error "may not be closely nested" } */ } #pragma omp parallel { @@ -117,20 +117,20 @@ int i, j; #pragma omp ordered { - #pragma omp for /* { dg-warning "may not be closely nested" } */ + #pragma omp for /* { dg-error "may not be closely nested" } */ for (j = 0; j < 3; j++) ; - #pragma omp sections /* { dg-warning "may not be closely nested" } */ + #pragma omp sections /* { dg-error "may not be closely nested" } */ { ; #pragma omp section ; } - #pragma omp single /* { dg-warning "may not be closely nested" } */ + #pragma omp single /* { dg-error "may not be closely nested" } */ ; #pragma omp master ; - #pragma omp barrier /* { dg-warning "may not be closely nested" } */ + #pragma omp barrier /* { dg-error "may not be closely nested" } */ } } @@ -139,7 +139,7 @@ { #pragma omp critical { - #pragma omp ordered /* { dg-warning "may not be closely nested" } */ + #pragma omp ordered /* { dg-error "may not be closely nested" } */ ; } } @@ -149,7 +149,7 @@ { #pragma omp task { - #pragma omp ordered /* { dg-warning "may not be closely nested" } */ + #pragma omp ordered /* { dg-error "may not be closely nested" } */ ; } } @@ -161,7 +161,7 @@ #pragma omp for for (i = 0; i < 10; i++) { - #pragma omp ordered /* { dg-warning "must be closely nested" } */ + #pragma omp ordered /* { dg-error "must be closely nested" } */ ; } #pragma omp for ordered @@ -190,9 +190,9 @@ #pragma omp critical ; #pragma omp critical (bar) - #pragma omp critical (bar) /* { dg-warning "may not be nested" } */ + #pragma omp critical (bar) /* { dg-error "may not be nested" } */ ; #pragma omp critical - #pragma omp critical /* { dg-warning "may not be nested" } */ + #pragma omp critical /* { dg-error "may not be nested" } */ ; } Index: gcc/testsuite/gcc.dg/pr52558-1.c =================================================================== --- gcc/testsuite/gcc.dg/pr52558-1.c (.../tags/gcc_4_7_1_release) (wersja 0) +++ gcc/testsuite/gcc.dg/pr52558-1.c (.../branches/gcc-4_7-branch) (wersja 189237) @@ -0,0 +1,22 @@ +/* { dg-do compile } */ +/* { dg-options "--param allow-store-data-races=0 -O2 -fdump-tree-lim1" } */ + +/* Test that `count' is not written to unless p->data > 0. */ + +int count; + +struct obj { + int data; + struct obj *next; +} *q; + +void func() +{ + struct obj *p; + for (p = q; p; p = p->next) + if (p->data > 0) + count++; +} + +/* { dg-final { scan-tree-dump-times "MEM count_lsm.. count_lsm_flag" 1 "lim1" } } */ +/* { dg-final { cleanup-tree-dump "lim1" } } */ Index: gcc/testsuite/gcc.dg/pr52558-2.c =================================================================== --- gcc/testsuite/gcc.dg/pr52558-2.c (.../tags/gcc_4_7_1_release) (wersja 0) +++ gcc/testsuite/gcc.dg/pr52558-2.c (.../branches/gcc-4_7-branch) (wersja 189237) @@ -0,0 +1,23 @@ +/* { dg-do compile } */ +/* { dg-options "--param allow-store-data-races=0 -O2 -fdump-tree-lim1" } */ + +/* Test that g_2 is not written to unless !g_1. */ + +int g_1 = 1; +int g_2 = 0; + +int func_1(void) +{ + int l; + for (l = 0; l < 1234; l++) + { + if (g_1) + return l; + else + g_2 = 0; + } + return 999; +} + +/* { dg-final { scan-tree-dump-times "MEM.*g_2_lsm_flag" 1 "lim1" } } */ +/* { dg-final { cleanup-tree-dump "lim1" } } */ Index: gcc/testsuite/gcc.dg/stack-usage-1.c =================================================================== --- gcc/testsuite/gcc.dg/stack-usage-1.c (.../tags/gcc_4_7_1_release) (wersja 189237) +++ gcc/testsuite/gcc.dg/stack-usage-1.c (.../branches/gcc-4_7-branch) (wersja 189237) @@ -58,6 +58,8 @@ # define SIZE 224 #elif defined (__epiphany__) # define SIZE (256 - __EPIPHANY_STACK_OFFSET__) +#elif defined (__sh__) +# define SIZE 252 #else # define SIZE 256 #endif Index: gcc/testsuite/gcc.dg/lto/pr53470_0.c =================================================================== --- gcc/testsuite/gcc.dg/lto/pr53470_0.c (.../tags/gcc_4_7_1_release) (wersja 0) +++ gcc/testsuite/gcc.dg/lto/pr53470_0.c (.../branches/gcc-4_7-branch) (wersja 189237) @@ -0,0 +1,9 @@ +/* { dg-lto-do link } */ +/* { dg-lto-options { { -flto } { -flto -g } } } */ + +int main () +{ + { + union A { } v; + } +} Index: gcc/testsuite/gcc.dg/torture/pr53790.c =================================================================== --- gcc/testsuite/gcc.dg/torture/pr53790.c (.../tags/gcc_4_7_1_release) (wersja 0) +++ gcc/testsuite/gcc.dg/torture/pr53790.c (.../branches/gcc-4_7-branch) (wersja 189237) @@ -0,0 +1,17 @@ +/* { dg-do compile } */ + +typedef struct s { + int value; +} s_t; + +static inline int +read(s_t const *var) +{ + return var->value; +} + +int main() +{ + extern union u extern_var; + return read((s_t *)&extern_var); +} Index: gcc/testsuite/gcc.dg/torture/pr53589.c =================================================================== --- gcc/testsuite/gcc.dg/torture/pr53589.c (.../tags/gcc_4_7_1_release) (wersja 0) +++ gcc/testsuite/gcc.dg/torture/pr53589.c (.../branches/gcc-4_7-branch) (wersja 189237) @@ -0,0 +1,15 @@ +/* PR rtl-optimization/53589 */ +/* { dg-do compile } */ + +extern void foo (void) __attribute__ ((__noreturn__)); + +void +bar (int x) +{ + if (x < 0) + foo (); + if (x == 0) + return; + __asm goto ("# %l[lab]" : : : : lab); +lab:; +} Index: gcc/testsuite/gcc.dg/tm/reg-promotion.c =================================================================== --- gcc/testsuite/gcc.dg/tm/reg-promotion.c (.../tags/gcc_4_7_1_release) (wersja 0) +++ gcc/testsuite/gcc.dg/tm/reg-promotion.c (.../branches/gcc-4_7-branch) (wersja 189237) @@ -0,0 +1,24 @@ +/* { dg-do compile } */ +/* { dg-options "-fgnu-tm -O2 -fdump-tree-lim1" } */ + +/* Test that `count' is not written to unless p->data>0. */ + +int count; + +struct obj { + int data; + struct obj *next; +} *q; + +void func() +{ + struct obj *p; + __transaction_atomic { + for (p = q; p; p = p->next) + if (p->data > 0) + count++; + } +} + +/* { dg-final { scan-tree-dump-times "MEM count_lsm.. count_lsm_flag" 1 "lim1" } } */ +/* { dg-final { cleanup-tree-dump "lim1" } } */ Index: gcc/testsuite/ChangeLog =================================================================== --- gcc/testsuite/ChangeLog (.../tags/gcc_4_7_1_release) (wersja 189237) +++ gcc/testsuite/ChangeLog (.../branches/gcc-4_7-branch) (wersja 189237) @@ -1,3 +1,171 @@ +2012-07-03 Eric Botcazou + + * gnat.dg/recursive_call.adb: New test. + +2012-07-03 Eric Botcazou + + * gnat.dg/discr37.ad[sb]: New test. + +2012-07-02 Jason Merrill + + PR c++/53816 + * g++.dg/template/ref6.C: New. + + PR c++/53821 + * g++.dg/cpp0x/lambda/lambda-template6.C: New. + +2012-06-29 Ramana Radhakrishnan + + Backport from mainline. + 2012-05-30 Ramana Radhakrishnan + * gcc.target/arm/neon-vrev.c: New. + +2012-06-28 Richard Guenther + + PR middle-end/53790 + * gcc.dg/torture/pr53790.c: New testcase. + +2012-06-27 Fabien Chêne + + PR c++/51214 + * g++.dg/cpp0x/forw_enum11.C: New. + +2012-06-26 Richard Guenther + + PR c++/53752 + * g++.dg/torture/pr53752.C: New testcase. + +2012-06-25 Jason Merrill + + PR c++/53498 + PR c++/53305 + * g++.dg/cpp0x/decltype38.C: New. + * g++.dg/cpp0x/variadic132.C: New. + + PR c++/52988 + * g++.dg/cpp0x/nullptr28.C: New. + + PR c++/53202 + * g++.dg/cpp0x/constexpr-tuple.C: New. + +2012-06-25 Jakub Jelinek + + PR target/53759 + * gcc.target/i386/pr53759.c: New test. + + PR c++/53594 + * g++.dg/cpp0x/nsdmi7.C: New test. + +2012-06-22 Tobias Burnus + + Backport from mainline + 2012-06-17 Tobias Burnus + + PR fortran/53691 + PR fortran/53685 + * gfortran.dg/transfer_check_3.f90: New. + +2012-06-22 Eric Botcazou + + * gnat.dg/lto15.ad[sb]: New test. + +2012-06-19 Kaz Kojima + + * gcc.dg/stack-usage-1.c: Remove dg-options line for sh targets + and add __sh__ case. + +2012-06-19 Jason Merrill + + PR c++/53651 + * g++.dg/cpp0x/decltype37.C: New. + + PR c++/52637 + * g++.dg/debug/localclass1.C: New. + + * g++.dg/debug/dwarf2/namespace-2.C: New. + * g++.dg/debug/dwarf2/localclass3.C: New. + +2012-06-19 Richard Guenther + + PR middle-end/53470 + * g++.dg/lto/pr53470_0.C: New testcase. + * gcc.dg/lto/pr53470_0.c: Likewise. + +2012-06-19 Jason Merrill + + Reapply: + PR c++/53137 + * g++.dg/cpp0x/lambda/lambda-template5.C: New. + + PR c++/53599 + * g++.dg/template/local7.C: New. + +2012-06-16 Venkataramanan Kumar + + Back port from mainline + 2012-05-09 Uros Bizjak + + PR target/52908 + * gcc.target/i386/xop-imul32widen-vector.c: Update scan-assembler + directive to Scan for vpmuldq, not vpmacsdql. + +2012-06-15 Eric Botcazou + + * gnat.dg/vect8.ad[sb]: New test. + +2012-06-14 Jakub Jelinek + + Backported from mainline + 2012-06-12 Jakub Jelinek + + PR rtl-optimization/53589 + * gcc.dg/torture/pr53589.c: New test. + + 2012-06-07 Jakub Jelinek + + PR middle-end/53580 + * gcc.dg/gomp/nesting-1.c: Expect errors rather than warnings. + * gcc.dg/gomp/critical-4.c: Likewise. + * gfortran.dg/gomp/appendix-a/a.35.1.f90: Likewise. + * gfortran.dg/gomp/appendix-a/a.35.3.f90: Likewise. + * gfortran.dg/gomp/appendix-a/a.35.4.f90: Likewise. + * gfortran.dg/gomp/appendix-a/a.35.6.f90: Likewise. + * c-c++-common/gomp/pr53580.c: New test. + +2012-06-14 Tobias Burnus + + Backport from mainline + 2012-06-04 Tobias Burnus + + PR fortran/50619 + * gfortran.dg/init_flag_10.f90: New. + +2012-06-14 Richard Guenther + + Backport from mainline + 2012-06-11 Richard Guenther + + PR c++/53616 + * g++.dg/ext/pr53605.C: New testcase. + +2012-06-14 Tobias Burnus + + PR fortran/53597 + * gfortran.dg/save_4.f90: New. + +2012-06-14 Richard Guenther + + Backport from mainline + 2012-06-06 Fabien Chêne + + PR c++/52841 + * g++.dg/cpp0x/pr52841.C: New testcase. + +2012-06-13 Christian Bruel + + PR target/53621 + * gcc.dg/stack-usage-1.c: Force -fomit-frame-pointer on SH. + 2012-06-14 Release Manager * GCC 4.7.1 released. Index: gcc/testsuite/g++.dg/debug/localclass1.C =================================================================== --- gcc/testsuite/g++.dg/debug/localclass1.C (.../tags/gcc_4_7_1_release) (wersja 0) +++ gcc/testsuite/g++.dg/debug/localclass1.C (.../branches/gcc-4_7-branch) (wersja 189237) @@ -0,0 +1,21 @@ +// PR c++/52637 +// { dg-options "-g -std=c++11" } + +template +struct C { }; + +template +void f(V v) { + struct B {}; + C c; +} + +template +void g(T t) { + struct A { } a; + f (a); +} + +struct D { + void h() { g(0); } +}; Index: gcc/testsuite/g++.dg/debug/dwarf2/localclass3.C =================================================================== --- gcc/testsuite/g++.dg/debug/dwarf2/localclass3.C (.../tags/gcc_4_7_1_release) (wersja 0) +++ gcc/testsuite/g++.dg/debug/dwarf2/localclass3.C (.../branches/gcc-4_7-branch) (wersja 189237) @@ -0,0 +1,11 @@ +// Test that the A* pointer_type is also within the debug info for f. +// Currently GCC emits it immediately before A, which is simple to test for. +// { dg-options "-g -dA" } + +void f() +{ + struct A { int i; } *ap; + ap->i = 42; +} + +// { dg-final { scan-assembler "DW_TAG_pointer_type.\[^)\]*. DW_TAG_structure_type" } } Index: gcc/testsuite/g++.dg/debug/dwarf2/namespace-2.C =================================================================== --- gcc/testsuite/g++.dg/debug/dwarf2/namespace-2.C (.../tags/gcc_4_7_1_release) (wersja 0) +++ gcc/testsuite/g++.dg/debug/dwarf2/namespace-2.C (.../branches/gcc-4_7-branch) (wersja 189237) @@ -0,0 +1,10 @@ +// Test that we define A inside the namespace rather than declaring it +// there and then defining it at CU scope. +// { dg-options "-g -dA" } +// { dg-final { scan-assembler-not "DW_AT_declaration" } } + +namespace N { + struct A; +} + +struct N::A { } a; Index: gcc/testsuite/g++.dg/ext/pr53605.C =================================================================== --- gcc/testsuite/g++.dg/ext/pr53605.C (.../tags/gcc_4_7_1_release) (wersja 0) +++ gcc/testsuite/g++.dg/ext/pr53605.C (.../branches/gcc-4_7-branch) (wersja 189237) @@ -0,0 +1,16 @@ +// { dg-do compile } + +// Avoid -pedantic-error default +// { dg-options "" } + +template +class EqHelper { +public: + template + static int Compare( const T1& expected, + const T2& actual); +}; +void foo(){ + static const int kData[] = {}; + ::EqHelper::Compare(kData, "abc"); +} Index: gcc/testsuite/g++.dg/lto/pr53470_0.C =================================================================== --- gcc/testsuite/g++.dg/lto/pr53470_0.C (.../tags/gcc_4_7_1_release) (wersja 0) +++ gcc/testsuite/g++.dg/lto/pr53470_0.C (.../branches/gcc-4_7-branch) (wersja 189237) @@ -0,0 +1,26 @@ +// { dg-lto-do link } +// { dg-lto-options { { -g -flto } } } + +class sp_counted_base; +class shared_count { + sp_counted_base *pi_; +public: + template shared_count(Y) : pi_() {} + ~shared_count() {} +}; +template struct shared_ptr { + T element_type; + template shared_ptr(Y) : pn(0) {} + shared_count pn; +}; +template class ECGetterBase; +template struct ExtensionCord { + struct Holder { + ECGetterBase *getter_; + }; + ExtensionCord() : holder_(new Holder) {} + + shared_ptr holder_; +}; +ExtensionCord a; +int main() {} Index: gcc/testsuite/g++.dg/cpp0x/lambda/lambda-template6.C =================================================================== --- gcc/testsuite/g++.dg/cpp0x/lambda/lambda-template6.C (.../tags/gcc_4_7_1_release) (wersja 0) +++ gcc/testsuite/g++.dg/cpp0x/lambda/lambda-template6.C (.../branches/gcc-4_7-branch) (wersja 189237) @@ -0,0 +1,14 @@ +// PR c++/53821 +// { dg-final { scan-assembler-not "_ZZ1fIvEvvENKUlvE_cvPFvvEEv" } } +// { dg-do compile { target c++11 } } + +template void f() +{ + auto g = []{}; + g(); +} + +int main() +{ + f(); +} Index: gcc/testsuite/g++.dg/cpp0x/lambda/lambda-template5.C =================================================================== --- gcc/testsuite/g++.dg/cpp0x/lambda/lambda-template5.C (.../tags/gcc_4_7_1_release) (wersja 0) +++ gcc/testsuite/g++.dg/cpp0x/lambda/lambda-template5.C (.../branches/gcc-4_7-branch) (wersja 189237) @@ -0,0 +1,17 @@ +// PR c++/53137 +// { dg-do compile { target c++11 } } + +struct A +{ + template void f(); + + template void g() + { + [this]{ f(); }(); + } + + void h() + { + g(); + } +}; Index: gcc/testsuite/g++.dg/cpp0x/forw_enum11.C =================================================================== --- gcc/testsuite/g++.dg/cpp0x/forw_enum11.C (.../tags/gcc_4_7_1_release) (wersja 0) +++ gcc/testsuite/g++.dg/cpp0x/forw_enum11.C (.../branches/gcc-4_7-branch) (wersja 189237) @@ -0,0 +1,24 @@ +// { dg-do compile } +// { dg-options "-std=c++0x -pedantic-errors" } + +enum { A = 1 }; +struct T +{ + int i1, i2, i3, i4, i5, i6, i7; + enum E2 : int; + + void f(); +}; + +enum T::E2 : int { A1 = A, A2 = 23 }; + +static_assert(int(T::A1) == 1, "error"); +static_assert(int(T::A2) == 23, "error"); + +void T::f() +{ + static_assert(int(T::A1) == 1, "error"); + static_assert(int(T::A2) == 23, "error"); + static_assert(int(A1) == 1, "error"); + static_assert(int(A2) == 23, "error"); +} Index: gcc/testsuite/g++.dg/cpp0x/nsdmi7.C =================================================================== --- gcc/testsuite/g++.dg/cpp0x/nsdmi7.C (.../tags/gcc_4_7_1_release) (wersja 0) +++ gcc/testsuite/g++.dg/cpp0x/nsdmi7.C (.../branches/gcc-4_7-branch) (wersja 189237) @@ -0,0 +1,17 @@ +// PR c++/53594 +// { dg-do compile } +// { dg-options "-std=c++11 -Wuninitialized" } + +struct A +{ + const int a = 6; // { dg-bogus "non-static const member" } + static int b; + int &c = b; // { dg-bogus "non-static reference" } +}; + +struct B +{ + const int d; // { dg-warning "non-static const member" } + int &e; // { dg-warning "non-static reference" } + int f = 7; +}; Index: gcc/testsuite/g++.dg/cpp0x/constexpr-tuple.C =================================================================== --- gcc/testsuite/g++.dg/cpp0x/constexpr-tuple.C (.../tags/gcc_4_7_1_release) (wersja 0) +++ gcc/testsuite/g++.dg/cpp0x/constexpr-tuple.C (.../branches/gcc-4_7-branch) (wersja 189237) @@ -0,0 +1,106 @@ +// PR c++/53202 +// { dg-do run { target c++11 } } + +#include + +template + struct Bind_simple + { + explicit + Bind_simple(const Callable& callable) + : _M_bound(callable) + { } + + Bind_simple(const Bind_simple&) = default; + Bind_simple(Bind_simple&&) = default; + + auto operator()() -> decltype((*(Callable*)0)()) + { + return std::get<0>(_M_bound)(); + } + + private: + + std::tuple _M_bound; + }; + +template + Bind_simple + bind_simple(Callable& callable) + { + return Bind_simple(callable); + } + +struct thread +{ + struct ImplBase { }; + + template + struct Impl : ImplBase { + T t; + Impl(T&& t) : t(std::move(t)) { } + }; + + template + thread(T& t) + { + auto p = make_routine(bind_simple(t)); + + p->t(); + + delete p; + } + + template + Impl* + make_routine(Callable&& f) + { + return new Impl(std::forward(f)); + } +}; + + +int c; +class background_hello +{ +public: + background_hello() + { + __builtin_printf("default ctor called, this=%p\n", this); + ++c; + } + + background_hello(const background_hello &) + { + __builtin_printf("copy ctor called\n"); + ++c; + } + + background_hello(background_hello &&) + { + __builtin_printf("move ctor called\n"); + ++c; + } + + void operator ()() const + { + __builtin_printf("void background_hello::operator()() called, this=%p\n", this); + } + + ~background_hello() + { + __builtin_printf("destructor called, this=%p\n", this); + --c; + } + +}; + +int main() +{ + { + background_hello bh; + thread t(bh); + } + if (c != 0) + __builtin_abort (); +} Index: gcc/testsuite/g++.dg/cpp0x/variadic132.C =================================================================== --- gcc/testsuite/g++.dg/cpp0x/variadic132.C (.../tags/gcc_4_7_1_release) (wersja 0) +++ gcc/testsuite/g++.dg/cpp0x/variadic132.C (.../branches/gcc-4_7-branch) (wersja 189237) @@ -0,0 +1,27 @@ +// PR c++/53305 +// { dg-do compile { target c++11 } } + +template struct tuple { }; + +struct funct +{ + template + int operator()(argTs...); +}; + +template struct test; + +template