Index: libgomp/ChangeLog =================================================================== --- libgomp/ChangeLog (.../tags/gcc_4_7_1_release) (wersja 190845) +++ libgomp/ChangeLog (.../branches/gcc-4_7-branch) (wersja 190845) @@ -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 190845) +++ libgomp/testsuite/libgomp.fortran/vla4.f90 (.../branches/gcc-4_7-branch) (wersja 190845) @@ -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 190845) +++ libgomp/testsuite/libgomp.fortran/vla5.f90 (.../branches/gcc-4_7-branch) (wersja 190845) @@ -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 190845) +++ libgomp/testsuite/libgomp.c/pr26943-2.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -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 190845) +++ libgomp/testsuite/libgomp.c/pr26943-3.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -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 190845) +++ libgomp/testsuite/libgomp.c/pr26943-4.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -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 190845) +++ libgomp/config/linux/lock.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -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/src/c++11/condition_variable.cc =================================================================== --- libstdc++-v3/src/c++11/condition_variable.cc (.../tags/gcc_4_7_1_release) (wersja 190845) +++ libstdc++-v3/src/c++11/condition_variable.cc (.../branches/gcc-4_7-branch) (wersja 190845) @@ -1,6 +1,6 @@ // condition_variable -*- C++ -*- -// Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc. +// Copyright (C) 2008, 2009, 2010, 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 @@ -32,12 +32,12 @@ #ifdef __GTHREAD_COND_INIT condition_variable::condition_variable() noexcept = default; - condition_variable::~condition_variable() noexcept = default; #else condition_variable::condition_variable() noexcept { __GTHREAD_COND_INIT_FUNCTION(&_M_cond); } +#endif condition_variable::~condition_variable() noexcept { @@ -45,7 +45,6 @@ /* int __e = */ __gthread_cond_destroy(&_M_cond); // if __e == EBUSY then blocked } -#endif void condition_variable::wait(unique_lock& __lock) Index: libstdc++-v3/src/c++11/compatibility-thread-c++0x.cc =================================================================== --- libstdc++-v3/src/c++11/compatibility-thread-c++0x.cc (.../tags/gcc_4_7_1_release) (wersja 190845) +++ libstdc++-v3/src/c++11/compatibility-thread-c++0x.cc (.../branches/gcc-4_7-branch) (wersja 190845) @@ -22,11 +22,16 @@ // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . +#include +#if defined(_GLIBCXX_HAVE_TLS) && defined(PIC) +#define _GLIBCXX_ASYNC_ABI_COMPAT +#endif + #include #include #ifndef __GXX_EXPERIMENTAL_CXX0X__ -# error "compatibility-c++0x.cc must be compiled with -std=gnu++0x" +# error "compatibility-thread-c++0x.cc must be compiled with -std=gnu++0x" #endif #define _GLIBCXX_ASM_SYMVER(cur, old, version) \ @@ -70,3 +75,23 @@ #endif #endif // _GLIBCXX_HAS_GTHREADS && _GLIBCXX_USE_C99_STDINT_TR1 + + +// XXX GLIBCXX_ABI Deprecated +// gcc-4.7.0 +// export changes +#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1) \ + && (ATOMIC_INT_LOCK_FREE > 1) +#if defined(_GLIBCXX_HAVE_TLS) && defined(PIC) +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION + __future_base::_Async_state_common::~_Async_state_common() { _M_join(); } + + // Explicit instantiation due to -fno-implicit-instantiation. + template void call_once(once_flag&, void (thread::*&&)(), reference_wrapper&&); + template _Bind_simple_helper>::__type __bind_simple(void (thread::*&&)(), reference_wrapper&&); +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace std +#endif +#endif // _GLIBCXX_HAS_GTHREADS && _GLIBCXX_USE_C99_STDINT_TR1 Index: libstdc++-v3/src/c++11/future.cc =================================================================== --- libstdc++-v3/src/c++11/future.cc (.../tags/gcc_4_7_1_release) (wersja 190845) +++ libstdc++-v3/src/c++11/future.cc (.../branches/gcc-4_7-branch) (wersja 190845) @@ -84,15 +84,7 @@ __future_base::_Result_base::~_Result_base() = default; __future_base::_State_base::~_State_base() = default; - -#ifdef _GLIBCXX_HAVE_TLS - __future_base::_Async_state_common::~_Async_state_common() { _M_join(); } - - // Explicit instantiation due to -fno-implicit-instantiation. - template void call_once(once_flag&, void (thread::*&&)(), reference_wrapper&&); - template _Bind_simple_helper>::__type __bind_simple(void (thread::*&&)(), reference_wrapper&&); #endif -#endif _GLIBCXX_END_NAMESPACE_VERSION } // namespace std Index: libstdc++-v3/include/debug/unordered_map =================================================================== --- libstdc++-v3/include/debug/unordered_map (.../tags/gcc_4_7_1_release) (wersja 190845) +++ libstdc++-v3/include/debug/unordered_map (.../branches/gcc-4_7-branch) (wersja 190845) @@ -247,8 +247,8 @@ } template::value>::type> + std::enable_if::value>::type> std::pair insert(_Pair&& __obj) { @@ -260,8 +260,8 @@ } template::value>::type> + std::enable_if::value>::type> iterator insert(const_iterator __hint, _Pair&& __obj) { @@ -661,8 +661,8 @@ } template::value>::type> + std::enable_if::value>::type> iterator insert(_Pair&& __obj) { @@ -673,8 +673,8 @@ } template::value>::type> + std::enable_if::value>::type> iterator insert(const_iterator __hint, _Pair&& __obj) { Index: libstdc++-v3/include/debug/map.h =================================================================== --- libstdc++-v3/include/debug/map.h (.../tags/gcc_4_7_1_release) (wersja 190845) +++ libstdc++-v3/include/debug/map.h (.../branches/gcc-4_7-branch) (wersja 190845) @@ -212,8 +212,8 @@ #ifdef __GXX_EXPERIMENTAL_CXX0X__ template::value>::type> + std::enable_if::value>::type> std::pair insert(_Pair&& __x) { @@ -243,8 +243,8 @@ #ifdef __GXX_EXPERIMENTAL_CXX0X__ template::value>::type> + std::enable_if::value>::type> iterator insert(const_iterator __position, _Pair&& __x) { Index: libstdc++-v3/include/debug/multimap.h =================================================================== --- libstdc++-v3/include/debug/multimap.h (.../tags/gcc_4_7_1_release) (wersja 190845) +++ libstdc++-v3/include/debug/multimap.h (.../branches/gcc-4_7-branch) (wersja 190845) @@ -200,8 +200,8 @@ #ifdef __GXX_EXPERIMENTAL_CXX0X__ template::value>::type> + std::enable_if::value>::type> iterator insert(_Pair&& __x) { return iterator(_Base::insert(std::forward<_Pair>(__x)), this); } @@ -226,8 +226,8 @@ #ifdef __GXX_EXPERIMENTAL_CXX0X__ template::value>::type> + std::enable_if::value>::type> iterator insert(const_iterator __position, _Pair&& __x) { Index: libstdc++-v3/include/std/thread =================================================================== --- libstdc++-v3/include/std/thread (.../tags/gcc_4_7_1_release) (wersja 190845) +++ libstdc++-v3/include/std/thread (.../branches/gcc-4_7-branch) (wersja 190845) @@ -1,6 +1,6 @@ // -*- C++ -*- -// Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc. +// Copyright (C) 2008, 2009, 2010, 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 @@ -188,7 +188,7 @@ _M_make_routine(_Callable&& __f) { // Create and allocate full data structure, not base. - return make_shared<_Impl<_Callable>>(std::forward<_Callable>(__f)); + return std::make_shared<_Impl<_Callable>>(std::forward<_Callable>(__f)); } }; Index: libstdc++-v3/include/std/future =================================================================== --- libstdc++-v3/include/std/future (.../tags/gcc_4_7_1_release) (wersja 190845) +++ libstdc++-v3/include/std/future (.../branches/gcc-4_7-branch) (wersja 190845) @@ -1425,10 +1425,10 @@ class __future_base::_Async_state_common : public __future_base::_State_base { protected: -#ifdef _GLIBCXX_HAVE_TLS +#ifdef _GLIBCXX_ASYNC_ABI_COMPAT ~_Async_state_common(); #else - ~_Async_state_common() { _M_join(); } + ~_Async_state_common() = default; #endif // Allow non-timed waiting functions to block until the thread completes, @@ -1455,6 +1455,8 @@ } }; } + ~_Async_state_impl() { _M_join(); } + private: typedef __future_base::_Ptr<_Result<_Res>> _Ptr_type; _Ptr_type _M_result; Index: libstdc++-v3/include/std/condition_variable =================================================================== --- libstdc++-v3/include/std/condition_variable (.../tags/gcc_4_7_1_release) (wersja 190845) +++ libstdc++-v3/include/std/condition_variable (.../branches/gcc-4_7-branch) (wersja 190845) @@ -1,6 +1,6 @@ // -*- C++ -*- -// Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc. +// Copyright (C) 2008, 2009, 2010, 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 @@ -176,6 +176,26 @@ condition_variable _M_cond; mutex _M_mutex; + // scoped unlock - unlocks in ctor, re-locks in dtor + template + struct _Unlock + { + explicit _Unlock(_Lock& __lk) : _M_lock(__lk) { __lk.unlock(); } + + ~_Unlock() noexcept(false) + { + if (uncaught_exception()) + __try { _M_lock.lock(); } __catch(...) { } + else + _M_lock.lock(); + } + + _Unlock(const _Unlock&) = delete; + _Unlock& operator=(const _Unlock&) = delete; + + _Lock& _M_lock; + }; + public: condition_variable_any() noexcept; @@ -202,21 +222,8 @@ void wait(_Lock& __lock) { - // scoped unlock - unlocks in ctor, re-locks in dtor - struct _Unlock { - explicit _Unlock(_Lock& __lk) : _M_lock(__lk) { __lk.unlock(); } - ~_Unlock() noexcept(false) - { - if (uncaught_exception()) - __try { _M_lock.lock(); } __catch(...) { } - else - _M_lock.lock(); - } - _Lock& _M_lock; - }; - unique_lock __my_lock(_M_mutex); - _Unlock __unlock(__lock); + _Unlock<_Lock> __unlock(__lock); // _M_mutex must be unlocked before re-locking __lock so move // ownership of _M_mutex lock to an object with shorter lifetime. unique_lock __my_lock2(std::move(__my_lock)); @@ -237,11 +244,12 @@ wait_until(_Lock& __lock, const chrono::time_point<_Clock, _Duration>& __atime) { - unique_lock __my_lock(_M_mutex); - __lock.unlock(); - cv_status __status = _M_cond.wait_until(__my_lock, __atime); - __lock.lock(); - return __status; + unique_lock __my_lock(_M_mutex); + _Unlock<_Lock> __unlock(__lock); + // _M_mutex must be unlocked before re-locking __lock so move + // ownership of _M_mutex lock to an object with shorter lifetime. + unique_lock __my_lock2(std::move(__my_lock)); + return _M_cond.wait_until(__my_lock2, __atime); } template - static typename enable_if::type + static typename enable_if<(bool)sizeof(&_Rm::actual), void>::type _S_destroy(_Rm* __mx) { __gthread_mutex_destroy(&__mx->actual); } // matches a gthr-win32.h recursive mutex template - static typename enable_if::type + static typename enable_if<(bool)sizeof(&_Rm::sema), void>::type _S_destroy(_Rm* __mx) { __gthread_mutex_t __tmp; Index: libstdc++-v3/include/decimal/decimal.h =================================================================== --- libstdc++-v3/include/decimal/decimal.h (.../tags/gcc_4_7_1_release) (wersja 190845) +++ libstdc++-v3/include/decimal/decimal.h (.../branches/gcc-4_7-branch) (wersja 190845) @@ -288,7 +288,7 @@ inline _Tp operator _Op(_Tp __rhs) \ { \ _Tp __tmp; \ - __tmp.__setval(0 _Op __rhs.__getval()); \ + __tmp.__setval(_Op __rhs.__getval()); \ return __tmp; \ } Index: libstdc++-v3/include/ext/concurrence.h =================================================================== --- libstdc++-v3/include/ext/concurrence.h (.../tags/gcc_4_7_1_release) (wersja 190845) +++ libstdc++-v3/include/ext/concurrence.h (.../branches/gcc-4_7-branch) (wersja 190845) @@ -1,6 +1,6 @@ // Support for concurrent programing -*- C++ -*- -// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 +// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -143,7 +143,11 @@ class __mutex { private: +#if __GTHREADS && defined __GTHREAD_MUTEX_INIT + __gthread_mutex_t _M_mutex = __GTHREAD_MUTEX_INIT; +#else __gthread_mutex_t _M_mutex; +#endif __mutex(const __mutex&); __mutex& operator=(const __mutex&); @@ -151,17 +155,10 @@ public: __mutex() { -#if __GTHREADS +#if __GTHREADS && ! defined __GTHREAD_MUTEX_INIT if (__gthread_active_p()) - { -#if defined __GTHREAD_MUTEX_INIT - __gthread_mutex_t __tmp = __GTHREAD_MUTEX_INIT; - _M_mutex = __tmp; -#else - __GTHREAD_MUTEX_INIT_FUNCTION(&_M_mutex); + __GTHREAD_MUTEX_INIT_FUNCTION(&_M_mutex); #endif - } -#endif } #if __GTHREADS && ! defined __GTHREAD_MUTEX_INIT @@ -201,7 +198,11 @@ class __recursive_mutex { private: +#if __GTHREADS && defined __GTHREAD_RECURSIVE_MUTEX_INIT + __gthread_recursive_mutex_t _M_mutex = __GTHREAD_RECURSIVE_MUTEX_INIT; +#else __gthread_recursive_mutex_t _M_mutex; +#endif __recursive_mutex(const __recursive_mutex&); __recursive_mutex& operator=(const __recursive_mutex&); @@ -209,17 +210,10 @@ public: __recursive_mutex() { -#if __GTHREADS +#if __GTHREADS && ! defined __GTHREAD_RECURSIVE_MUTEX_INIT if (__gthread_active_p()) - { -#if defined __GTHREAD_RECURSIVE_MUTEX_INIT - __gthread_recursive_mutex_t __tmp = __GTHREAD_RECURSIVE_MUTEX_INIT; - _M_mutex = __tmp; -#else - __GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION(&_M_mutex); + __GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION(&_M_mutex); #endif - } -#endif } #if __GTHREADS && ! defined __GTHREAD_RECURSIVE_MUTEX_INIT @@ -270,7 +264,7 @@ // matches a gthr-win32.h recursive mutex template - static typename __enable_if::__type + static typename __enable_if<(bool)sizeof(&_Rm::sema), void>::__type _S_destroy(_Rm* __mx) { __gthread_mutex_t __tmp; @@ -279,7 +273,7 @@ // matches a recursive mutex with a member 'actual' template - static typename __enable_if::__type + static typename __enable_if<(bool)sizeof(&_Rm::actual), void>::__type _S_destroy(_Rm* __mx) { __gthread_mutex_destroy(&__mx->actual); } @@ -319,7 +313,11 @@ class __cond { private: +#if __GTHREADS && defined __GTHREAD_COND_INIT + __gthread_cond_t _M_cond = __GTHREAD_COND_INIT; +#else __gthread_cond_t _M_cond; +#endif __cond(const __cond&); __cond& operator=(const __cond&); @@ -327,17 +325,10 @@ public: __cond() { -#if __GTHREADS +#if __GTHREADS && ! defined __GTHREAD_COND_INIT if (__gthread_active_p()) - { -#if defined __GTHREAD_COND_INIT - __gthread_cond_t __tmp = __GTHREAD_COND_INIT; - _M_cond = __tmp; -#else - __GTHREAD_COND_INIT_FUNCTION(&_M_cond); + __GTHREAD_COND_INIT_FUNCTION(&_M_cond); #endif - } -#endif } #if __GTHREADS && ! defined __GTHREAD_COND_INIT Index: libstdc++-v3/include/ext/rope =================================================================== --- libstdc++-v3/include/ext/rope (.../tags/gcc_4_7_1_release) (wersja 190845) +++ libstdc++-v3/include/ext/rope (.../branches/gcc-4_7-branch) (wersja 190845) @@ -1,7 +1,7 @@ // SGI's rope class -*- C++ -*- -// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 -// Free Software Foundation, Inc. +// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, +// 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 @@ -44,6 +44,8 @@ #ifndef _ROPE #define _ROPE 1 +#pragma GCC system_header + #include #include #include @@ -458,20 +460,28 @@ volatile _RC_t _M_ref_count; // Constructor +#ifdef __GTHREAD_MUTEX_INIT + __gthread_mutex_t _M_ref_count_lock = __GTHREAD_MUTEX_INIT; +#else __gthread_mutex_t _M_ref_count_lock; +#endif - _Refcount_Base(_RC_t __n) : _M_ref_count(__n), _M_ref_count_lock() + _Refcount_Base(_RC_t __n) : _M_ref_count(__n) { -#ifdef __GTHREAD_MUTEX_INIT - __gthread_mutex_t __tmp = __GTHREAD_MUTEX_INIT; - _M_ref_count_lock = __tmp; -#elif defined(__GTHREAD_MUTEX_INIT_FUNCTION) +#ifndef __GTHREAD_MUTEX_INIT +#ifdef __GTHREAD_MUTEX_INIT_FUNCTION __GTHREAD_MUTEX_INIT_FUNCTION (&_M_ref_count_lock); #else #error __GTHREAD_MUTEX_INIT or __GTHREAD_MUTEX_INIT_FUNCTION should be defined by gthr.h abstraction layer, report problem to libstdc++@gcc.gnu.org. #endif +#endif } +#ifndef __GTHREAD_MUTEX_INIT + ~_Refcount_Base() + { __gthread_mutex_destroy(&_M_ref_count_lock); } +#endif + void _M_incr() { @@ -581,7 +591,11 @@ bool _M_is_balanced:8; unsigned char _M_depth; __GC_CONST _CharT* _M_c_string; +#ifdef __GTHREAD_MUTEX_INIT + __gthread_mutex_t _M_c_string_lock = __GTHREAD_MUTEX_INIT; +#else __gthread_mutex_t _M_c_string_lock; +#endif /* Flattened version of string, if needed. */ /* typically 0. */ /* If it's not 0, then the memory is owned */ @@ -602,13 +616,11 @@ #endif _M_tag(__t), _M_is_balanced(__b), _M_depth(__d), _M_c_string(0) #ifdef __GTHREAD_MUTEX_INIT - { - // Do not copy a POSIX/gthr mutex once in use. However, bits are bits. - __gthread_mutex_t __tmp = __GTHREAD_MUTEX_INIT; - _M_c_string_lock = __tmp; - } + { } #else - { __GTHREAD_MUTEX_INIT_FUNCTION (&_M_c_string_lock); } + { __GTHREAD_MUTEX_INIT_FUNCTION (&_M_c_string_lock); } + ~_Rope_RopeRep() + { __gthread_mutex_destroy (&_M_c_string_lock); } #endif #ifdef __GC void Index: libstdc++-v3/include/ext/alloc_traits.h =================================================================== --- libstdc++-v3/include/ext/alloc_traits.h (.../tags/gcc_4_7_1_release) (wersja 190845) +++ libstdc++-v3/include/ext/alloc_traits.h (.../branches/gcc-4_7-branch) (wersja 190845) @@ -1,6 +1,6 @@ // Allocator traits -*- C++ -*- -// Copyright (C) 2011 Free Software Foundation, Inc. +// Copyright (C) 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 @@ -49,37 +49,56 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION #ifdef __GXX_EXPERIMENTAL_CXX0X__ -template - struct __allocator_always_compares_equal - { static const bool value = false; }; + template + struct __allocator_always_compares_equal + { static const bool value = false; }; + template + const bool __allocator_always_compares_equal<_Alloc>::value; + template struct __allocator_always_compares_equal> { static const bool value = true; }; + template + const bool __allocator_always_compares_equal>::value; + template struct array_allocator; template struct __allocator_always_compares_equal> { static const bool value = true; }; + template + const bool + __allocator_always_compares_equal>::value; + template struct mt_allocator; template struct __allocator_always_compares_equal> { static const bool value = true; }; + template + const bool __allocator_always_compares_equal>::value; + template struct new_allocator; template struct __allocator_always_compares_equal> { static const bool value = true; }; + template + const bool __allocator_always_compares_equal>::value; + template struct pool_allocator; template struct __allocator_always_compares_equal> { static const bool value = true; }; + + template + const bool __allocator_always_compares_equal>::value; #endif /** Index: libstdc++-v3/include/profile/unordered_map =================================================================== --- libstdc++-v3/include/profile/unordered_map (.../tags/gcc_4_7_1_release) (wersja 190845) +++ libstdc++-v3/include/profile/unordered_map (.../branches/gcc-4_7-branch) (wersja 190845) @@ -1,6 +1,6 @@ // Profiling unordered_map/unordered_multimap implementation -*- C++ -*- -// Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc. +// Copyright (C) 2009, 2010, 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 @@ -214,8 +214,8 @@ } template::value>::type> + std::enable_if::value>::type> std::pair insert(_Pair&& __obj) { @@ -227,8 +227,8 @@ } template::value>::type> + std::enable_if::value>::type> iterator insert(const_iterator __iter, _Pair&& __v) { @@ -503,8 +503,8 @@ } template::value>::type> + std::enable_if::value>::type> iterator insert(_Pair&& __obj) { @@ -515,8 +515,8 @@ } template::value>::type> + std::enable_if::value>::type> iterator insert(const_iterator __iter, _Pair&& __v) { Index: libstdc++-v3/include/profile/map.h =================================================================== --- libstdc++-v3/include/profile/map.h (.../tags/gcc_4_7_1_release) (wersja 190845) +++ libstdc++-v3/include/profile/map.h (.../branches/gcc-4_7-branch) (wersja 190845) @@ -1,6 +1,6 @@ // Profiling map implementation -*- C++ -*- -// Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc. +// Copyright (C) 2009, 2010, 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 @@ -248,8 +248,8 @@ #ifdef __GXX_EXPERIMENTAL_CXX0X__ template::value>::type> + std::enable_if::value>::type> std::pair insert(_Pair&& __x) { @@ -289,8 +289,8 @@ #ifdef __GXX_EXPERIMENTAL_CXX0X__ template::value>::type> + std::enable_if::value>::type> iterator insert(const_iterator __position, _Pair&& __x) { Index: libstdc++-v3/include/profile/multimap.h =================================================================== --- libstdc++-v3/include/profile/multimap.h (.../tags/gcc_4_7_1_release) (wersja 190845) +++ libstdc++-v3/include/profile/multimap.h (.../branches/gcc-4_7-branch) (wersja 190845) @@ -1,6 +1,6 @@ // Profiling multimap implementation -*- C++ -*- -// Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc. +// Copyright (C) 2009, 2010, 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 @@ -186,8 +186,8 @@ #ifdef __GXX_EXPERIMENTAL_CXX0X__ template::value>::type> + std::enable_if::value>::type> iterator insert(_Pair&& __x) { return iterator(_Base::insert(std::forward<_Pair>(__x))); } @@ -209,8 +209,8 @@ #ifdef __GXX_EXPERIMENTAL_CXX0X__ template::value>::type> + std::enable_if::value>::type> iterator insert(const_iterator __position, _Pair&& __x) { return iterator(_Base::insert(__position, Index: libstdc++-v3/include/bits/hashtable.h =================================================================== --- libstdc++-v3/include/bits/hashtable.h (.../tags/gcc_4_7_1_release) (wersja 190845) +++ libstdc++-v3/include/bits/hashtable.h (.../branches/gcc-4_7-branch) (wersja 190845) @@ -550,8 +550,8 @@ template, - std::is_convertible<_Pair, - value_type>>::value>::type> + std::is_constructible>::value>::type> _Insert_Return_Type insert(_Pair&& __v) { return _M_insert(std::forward<_Pair>(__v), @@ -559,8 +559,8 @@ template, - std::is_convertible<_Pair, - value_type>>::value>::type> + std::is_constructible>::value>::type> iterator insert(const_iterator, _Pair&& __v) { return _Insert_Conv_Type()(insert(std::forward<_Pair>(__v))); } @@ -760,11 +760,12 @@ _M_element_count(0), _M_rehash_policy() { - _M_bucket_count = std::max(_M_rehash_policy._M_next_bkt(__bucket_hint), - _M_rehash_policy. - _M_bkt_for_elements(__detail:: - __distance_fw(__f, - __l))); + _M_bucket_count = + _M_rehash_policy._M_bkt_for_elements(__detail::__distance_fw(__f, + __l)); + if (_M_bucket_count <= __bucket_hint) + _M_bucket_count = _M_rehash_policy._M_next_bkt(__bucket_hint); + // We don't want the rehash policy to ask for the hashtable to shrink // on the first insertion so we need to reset its previous resize // level. @@ -1582,10 +1583,20 @@ rehash(size_type __n) { const _RehashPolicyState& __saved_state = _M_rehash_policy._M_state(); - _M_rehash(std::max(_M_rehash_policy._M_next_bkt(__n), - _M_rehash_policy._M_bkt_for_elements(_M_element_count - + 1)), - __saved_state); + std::size_t __buckets + = _M_rehash_policy._M_bkt_for_elements(_M_element_count + 1); + if (__buckets <= __n) + __buckets = _M_rehash_policy._M_next_bkt(__n); + + if (__buckets != _M_bucket_count) + { + _M_rehash(__buckets, __saved_state); + + // We don't want the rehash policy to ask for the hashtable to shrink + // on the next insertion so we need to reset its previous resize + // level. + _M_rehash_policy._M_prev_resize = 0; + } } template* _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/stl_map.h =================================================================== --- libstdc++-v3/include/bits/stl_map.h (.../tags/gcc_4_7_1_release) (wersja 190845) +++ libstdc++-v3/include/bits/stl_map.h (.../branches/gcc-4_7-branch) (wersja 190845) @@ -1,7 +1,7 @@ // Map 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 @@ -524,8 +524,8 @@ #ifdef __GXX_EXPERIMENTAL_CXX0X__ template::value>::type> + std::enable_if::value>::type> std::pair insert(_Pair&& __x) { return _M_t._M_insert_unique(std::forward<_Pair>(__x)); } @@ -577,8 +577,8 @@ #ifdef __GXX_EXPERIMENTAL_CXX0X__ template::value>::type> + std::enable_if::value>::type> iterator insert(const_iterator __position, _Pair&& __x) { return _M_t._M_insert_unique_(__position, Index: libstdc++-v3/include/bits/hashtable_policy.h =================================================================== --- libstdc++-v3/include/bits/hashtable_policy.h (.../tags/gcc_4_7_1_release) (wersja 190845) +++ libstdc++-v3/include/bits/hashtable_policy.h (.../branches/gcc-4_7-branch) (wersja 190845) @@ -294,6 +294,8 @@ enum { _S_n_primes = sizeof(unsigned long) != 8 ? 256 : 256 + 48 }; + static const std::size_t _S_growth_factor = 2; + float _M_max_load_factor; mutable std::size_t _M_prev_resize; mutable std::size_t _M_next_resize; @@ -314,28 +316,27 @@ static const unsigned char __fast_bkt[12] = { 2, 2, 2, 3, 5, 5, 7, 7, 11, 11, 11, 11 }; - if (__n <= 11) + const std::size_t __grown_n = __n * _S_growth_factor; + if (__grown_n <= 11) { _M_prev_resize = 0; _M_next_resize - = __builtin_ceil(__fast_bkt[__n] * (long double)_M_max_load_factor); - return __fast_bkt[__n]; + = __builtin_ceil(__fast_bkt[__grown_n] + * (long double)_M_max_load_factor); + return __fast_bkt[__grown_n]; } - const unsigned long* __p - = std::lower_bound(__prime_list + 5, __prime_list + _S_n_primes, __n); + const unsigned long* __next_bkt + = std::lower_bound(__prime_list + 5, __prime_list + _S_n_primes, + __grown_n); + const unsigned long* __prev_bkt + = std::lower_bound(__prime_list + 1, __next_bkt, __n / _S_growth_factor); - // Shrink will take place only if the number of elements is small enough - // so that the prime number 2 steps before __p is large enough to still - // conform to the max load factor: _M_prev_resize - = __builtin_floor(*(__p - 2) * (long double)_M_max_load_factor); - - // Let's guaranty that a minimal grow step of 11 is used - if (*__p - __n < 11) - __p = std::lower_bound(__p, __prime_list + _S_n_primes, __n + 11); - _M_next_resize = __builtin_ceil(*__p * (long double)_M_max_load_factor); - return *__p; + = __builtin_floor(*(__prev_bkt - 1) * (long double)_M_max_load_factor); + _M_next_resize + = __builtin_ceil(*__next_bkt * (long double)_M_max_load_factor); + return *__next_bkt; } // Return the smallest prime p such that alpha p >= n, where alpha Index: libstdc++-v3/include/bits/unique_ptr.h =================================================================== --- libstdc++-v3/include/bits/unique_ptr.h (.../tags/gcc_4_7_1_release) (wersja 190845) +++ libstdc++-v3/include/bits/unique_ptr.h (.../branches/gcc-4_7-branch) (wersja 190845) @@ -166,7 +166,13 @@ #endif // Destructor. - ~unique_ptr() noexcept { reset(); } + ~unique_ptr() noexcept + { + auto& __ptr = std::get<0>(_M_t); + if (__ptr != nullptr) + get_deleter()(__ptr); + __ptr = pointer(); + } // Assignment. unique_ptr& @@ -310,7 +316,13 @@ { } // Destructor. - ~unique_ptr() { reset(); } + ~unique_ptr() + { + auto& __ptr = std::get<0>(_M_t); + if (__ptr != nullptr) + get_deleter()(__ptr); + __ptr = pointer(); + } // Assignment. unique_ptr& Index: libstdc++-v3/include/bits/stl_multimap.h =================================================================== --- libstdc++-v3/include/bits/stl_multimap.h (.../tags/gcc_4_7_1_release) (wersja 190845) +++ libstdc++-v3/include/bits/stl_multimap.h (.../branches/gcc-4_7-branch) (wersja 190845) @@ -1,7 +1,7 @@ // Multimap 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 @@ -445,8 +445,8 @@ #ifdef __GXX_EXPERIMENTAL_CXX0X__ template::value>::type> + std::enable_if::value>::type> iterator insert(_Pair&& __x) { return _M_t._M_insert_equal(std::forward<_Pair>(__x)); } @@ -482,8 +482,8 @@ #ifdef __GXX_EXPERIMENTAL_CXX0X__ template::value>::type> + std::enable_if::value>::type> iterator insert(const_iterator __position, _Pair&& __x) { return _M_t._M_insert_equal_(__position, Index: libstdc++-v3/include/bits/stl_pair.h =================================================================== --- libstdc++-v3/include/bits/stl_pair.h (.../tags/gcc_4_7_1_release) (wersja 190845) +++ libstdc++-v3/include/bits/stl_pair.h (.../branches/gcc-4_7-branch) (wersja 190845) @@ -1,7 +1,7 @@ // Pair implementation -*- C++ -*- // Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, -// 2010, 2011 +// 2010, 2011, 2012 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -117,14 +117,8 @@ : first(__p.first), second(__p.second) { } constexpr pair(const pair&) = default; + constexpr pair(pair&&) = default; - // XXX Defaulted?!? Breaks std::map!!! - pair(pair&& __p) - noexcept(__and_, - is_nothrow_move_constructible<_T2>>::value) - : first(std::forward(__p.first)), - second(std::forward(__p.second)) { } - // DR 811. template::value>::type> Index: libstdc++-v3/include/bits/ptr_traits.h =================================================================== --- libstdc++-v3/include/bits/ptr_traits.h (.../tags/gcc_4_7_1_release) (wersja 190845) +++ libstdc++-v3/include/bits/ptr_traits.h (.../branches/gcc-4_7-branch) (wersja 190845) @@ -1,6 +1,6 @@ // Pointer Traits -*- C++ -*- -// Copyright (C) 2011 Free Software Foundation, Inc. +// Copyright (C) 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 @@ -86,6 +86,9 @@ static const bool __value = _S_chk<_Ptr, _Up>(nullptr); }; + template + const bool __ptrtr_rebind_helper<_Ptr, _Up>::__value; + template::__value> struct __ptrtr_rebind; Index: libstdc++-v3/include/bits/list.tcc =================================================================== --- libstdc++-v3/include/bits/list.tcc (.../tags/gcc_4_7_1_release) (wersja 190845) +++ libstdc++-v3/include/bits/list.tcc (.../branches/gcc-4_7-branch) (wersja 190845) @@ -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/include/bits/alloc_traits.h =================================================================== --- libstdc++-v3/include/bits/alloc_traits.h (.../tags/gcc_4_7_1_release) (wersja 190845) +++ libstdc++-v3/include/bits/alloc_traits.h (.../branches/gcc-4_7-branch) (wersja 190845) @@ -1,6 +1,6 @@ // Allocator traits -*- C++ -*- -// Copyright (C) 2011 Free Software Foundation, Inc. +// Copyright (C) 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 @@ -56,6 +56,9 @@ static const bool __value = _S_chk<_Alloc, _Tp>(nullptr); }; + template + const bool __alloctr_rebind_helper<_Alloc, _Tp>::__value; + template::__value> struct __alloctr_rebind; @@ -423,6 +426,27 @@ }; template + template + const bool allocator_traits<_Alloc>::__allocate_helper<_Alloc2>::value; + + template + template + const bool + allocator_traits<_Alloc>::__construct_helper<_Tp, _Args...>::value; + + template + template + const bool allocator_traits<_Alloc>::__destroy_helper<_Tp>::value; + + template + template + const bool allocator_traits<_Alloc>::__maxsize_helper<_Alloc2>::value; + + template + template + const bool allocator_traits<_Alloc>::__select_helper<_Alloc2>::value; + + template inline void __do_alloc_on_copy(_Alloc& __one, const _Alloc& __two, true_type) { __one = __two; } Index: libstdc++-v3/ChangeLog =================================================================== --- libstdc++-v3/ChangeLog (.../tags/gcc_4_7_1_release) (wersja 190845) +++ libstdc++-v3/ChangeLog (.../branches/gcc-4_7-branch) (wersja 190845) @@ -1,3 +1,192 @@ +2012-08-26 Jonathan Wakely + + * testsuite/30_threads/async/54297.cc: Add dg-require-nanosleep. + +2012-08-26 Jonathan Wakely + + PR libstdc++/54297 + * src/c++11/future.cc (~_Async_state_common): Move to... + * src/c++11/compatibility-thread-c++0x.cc (~_Async_state_common): + Here. + (_GLIBCXX_ABI_COMPAT_ASYNC): Rename to _GLIBCXX_ASYNC_ABI_COMPAT. + * include/std/future (_GLIBCXX_ABI_COMPAT_ASYNC): Likewise. + +2012-08-26 Jonathan Wakely + Geoff Romer + + PR libstdc++/54351 + * include/bits/unique_ptr.h (unique_ptr::~unique_ptr): Do not use + reset(). + (unique_ptr::~unique_ptr()): Likewise. + * testsuite/20_util/unique_ptr/54351.cc: New. + * testsuite/20_util/unique_ptr/assign/48635_neg.cc: Adjust dg-error + line numbers. + +2012-08-25 Jonathan Wakely + + PR libstdc++/54297 + * include/std/future (~_Async_state_impl): Join thread before + derived class members are destroyed. + (~_Async_state_common): Only define non-trivial destructor when + included from future.cc for ABI compatibility reasons. + * src/c++11/future.cc (_GLIBCXX_ABI_COMPAT_ASYNC): Define. + * testsuite/30_threads/async/54297.cc: New. + +2012-08-13 David Adler + + PR libstdc++/54185 + * src/c++11/condition_variable.cc (condition_variable): Always + destroy native type in destructor. + * testsuite/30_threads/condition_variable/54185.cc: New. + +2012-08-06 Peter Bergner + + PR libstdc++/54036 + * include/decimal/decimal.h (_DEFINE_DECIMAL_UNARY_OP): Use _Op as + a unary operator. + * testsuite/decimal/pr54036-1.cc: New test. + * testsuite/decimal/pr54036-2.cc: Likewise. + * testsuite/decimal/pr54036-3.cc: Likewise. + +2012-08-02 Michael Hope + + Backport from mainline r186389: + 2012-04-12 Andreas Schwab + + * testsuite/Makefile.am (check_DEJAGNUnormal0): Run + prettyprinters.exp. + * testsuite/Makefile.in: Regenerated. + +2012-07-29 François Dumont + + PR libstdc++/54075 + * include/bits/hashtable_policy.h + (_Prime_rehash_policy::_M_next_bkt): Add a growth factor set to 2 + to boost growth in the number of buckets. + * testsuite/performance/23_containers/insert/unordered_set.cc: New. + +2012-07-26 François Dumont + + PR libstdc++/54075 + * include/bits/hashtable.h + (_Hashtable<>::_Hashtable(_InputIterator, _InputIterator, + size_type, ...): Remove std::max usage to guarantee that hashtable + state is consistent with hash policy state. + (_Hashtable<>::rehash): Likewise. Set _M_prev_resize to 0 to avoid + the hashtable shrinking on next insertion. + * testsuite/23_containers/unordered_set/modifiers/reserve.cc: New. + * testsuite/23_containers/unordered_multiset/modifiers/reserve.cc: New. + * testsuite/23_containers/unordered_map/modifiers/reserve.cc: New. + * testsuite/23_containers/unordered_multimap/modifiers/reserve.cc: New. + +2012-07-20 Paolo Carlini + + * testsuite/30_threads/thread/adl.cc: Add missing dg-requires. + +2012-07-16 Jonathan Wakely + + PR libstdc++/53270 + * include/ext/concurrence.h: Use NSDMI for gthreads types. + * include/ext/rope: Likewise. Destroy mutexes in destructors. Add + system_header pragma. + + Revert: + 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-07-16 Jonathan Wakely + + PR libstdc++/53978 + * include/bits/alloc_traits.h (allocator_traits): Define static + constants. + * include/bits/ptr_traits.h (pointer_traits): Likewise. + * include/ext/alloc_traits.h (__allocator_always_compares_equal): + Likewise. + +2012-07-13 Paolo Carlini + + PR libstdc++/53657 + * include/bits/stl_pair.h (pair<>::pair(pair&&)): Declare defaulted, + per C++11. + * include/bits/stl_map.h (map<>::insert(_Pair&&), map<>::insert + (const_iterator, _Pair&&)): Constrain with std::is_constructible, + per LWG2005. + * include/bits/stl_multimap.h (multimap<>::insert(_Pair&&), + multimap<>::insert(const_iterator, _Pair&&)): Likewise. + * include/bits/hashtable_policy.h (_Insert<>::insert(_Pair&&), + _Insert<>::insert(const_iterator, _Pair&&)): Likewise. + * include/debug/unordered_map: Adjust. + * include/debug/map.h: Likewise. + * include/debug/multimap.h: Likewise. + * include/profile/unordered_map: Likewise. + * include/profile/map.h: Likewise. + * include/profile/multimap.h: Likewise. + +2012-07-07 Jonathan Wakely + + PR libstdc++/53578 + * include/ext/concurrence.h (__recursive_mutex::_S_destroy): Fix + narrowing conversion. + * include/std/mutex (__recursive_mutex_base::_S_destroy): Likewise. + +2012-07-06 Paolo Carlini + + PR libstdc++/53872 + * include/std/thread (thread::_M_make_routine): Qualify make_shared + to prevent ADL. + * testsuite/30_threads/thread/adl.cc: New. + +2012-07-05 Jonathan Wakely + + * include/std/condition_variable: Update copyright years. + +2012-07-05 Jonathan Wakely + + PR libstdc++/53830 + * include/std/condition_variable (condition_variable_any::wait): + Move _Unlock type to class scope. + (condition_variable_any::wait_until): Reuse it. + * testsuite/30_threads/condition_variable_any/53830.cc: New. + +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/Makefile.in =================================================================== --- libstdc++-v3/testsuite/Makefile.in (.../tags/gcc_4_7_1_release) (wersja 190845) +++ libstdc++-v3/testsuite/Makefile.in (.../branches/gcc-4_7-branch) (wersja 190845) @@ -572,7 +572,7 @@ normal0) \ if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \ $$runtest $(AM_RUNTESTFLAGS) $(RUNTESTDEFAULTFLAGS) \ - $(RUNTESTFLAGS) abi.exp; \ + $(RUNTESTFLAGS) abi.exp prettyprinters.exp; \ else echo "WARNING: could not find \`runtest'" 1>&2; :;\ fi; \ dirs="`cd $$srcdir; echo [013-9][0-9]_*/*`";; \ Index: libstdc++-v3/testsuite/30_threads/condition_variable/54185.cc =================================================================== --- libstdc++-v3/testsuite/30_threads/condition_variable/54185.cc (.../tags/gcc_4_7_1_release) (wersja 0) +++ libstdc++-v3/testsuite/30_threads/condition_variable/54185.cc (.../branches/gcc-4_7-branch) (wersja 190845) @@ -0,0 +1,62 @@ +// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } } +// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } } +// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } +// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } +// { dg-require-cstdint "" } +// { dg-require-gthreads "" } + +// 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 +// . + +#include +#include +#include +#include + +// PR libstdc++/54185 + +std::condition_variable* cond = nullptr; +std::mutex mx; +int started = 0; +int constexpr NUM_THREADS = 10; + +void do_thread_a() +{ + std::unique_lock lock(mx); + if(++started >= NUM_THREADS) + { + cond->notify_all(); + delete cond; + cond = nullptr; + } + else + cond->wait(lock); +} + +int main(){ + std::vector vec; + for(int j = 0; j < 1000; ++j) + { + started = 0; + cond = new std::condition_variable; + for (int i = 0; i < NUM_THREADS; ++i) + vec.emplace_back(&do_thread_a); + for (int i = 0; i < NUM_THREADS; ++i) + vec[i].join(); + vec.clear(); + } +} Index: libstdc++-v3/testsuite/30_threads/condition_variable_any/53830.cc =================================================================== --- libstdc++-v3/testsuite/30_threads/condition_variable_any/53830.cc (.../tags/gcc_4_7_1_release) (wersja 0) +++ libstdc++-v3/testsuite/30_threads/condition_variable_any/53830.cc (.../branches/gcc-4_7-branch) (wersja 190845) @@ -0,0 +1,68 @@ +// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } } +// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } } +// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } +// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } +// { dg-require-cstdint "" } +// { dg-require-gthreads "" } +// { dg-require-sched-yield "" } +// { dg-require-nanosleep "" } + +// 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 +// . + +// PR libstdc++/53830 +// Test for deadlock in condition_variable_any::wait_for + +#include +#include +#include +#include +#include + +std::mutex mutex; +std::condition_variable_any cv; + +std::atomic barrier(0); + +// waits for data from another thread +void wait_for_data() +{ + std::unique_lock lock(mutex); + barrier = 1; + cv.wait_for(lock, std::chrono::milliseconds(100), []{ return false; }); + // read data +} + +// passes data to waiting thread +void provide_data() +{ + while (barrier == 0) + std::this_thread::yield(); + std::unique_lock lock(mutex); + // pass data + std::this_thread::sleep_for(std::chrono::seconds(1)); + cv.notify_one(); +} + +int main() +{ + std::thread thread1(wait_for_data); + provide_data(); + thread1.join(); + return 0; +} + Index: libstdc++-v3/testsuite/30_threads/thread/adl.cc =================================================================== --- libstdc++-v3/testsuite/30_threads/thread/adl.cc (.../tags/gcc_4_7_1_release) (wersja 0) +++ libstdc++-v3/testsuite/30_threads/thread/adl.cc (.../branches/gcc-4_7-branch) (wersja 190845) @@ -0,0 +1,39 @@ +// { dg-do compile } +// { dg-options "-std=gnu++11" } +// { dg-require-cstdint "" } +// { dg-require-gthreads "" } + +// 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 +// . + +#include +#include +#include + +template +void make_shared(P&&...) +{} + +struct C {}; + +void f(C){} + +// PR libstdc++/53872 +int main() +{ + std::thread t(std::bind(&::f, C())); +} Index: libstdc++-v3/testsuite/30_threads/async/54297.cc =================================================================== --- libstdc++-v3/testsuite/30_threads/async/54297.cc (.../tags/gcc_4_7_1_release) (wersja 0) +++ libstdc++-v3/testsuite/30_threads/async/54297.cc (.../branches/gcc-4_7-branch) (wersja 190845) @@ -0,0 +1,51 @@ +// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } } +// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } } +// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } +// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } +// { dg-require-cstdint "" } +// { dg-require-gthreads "" } +// { dg-require-atomic-builtins "" } +// { dg-require-nanosleep "" } + +// 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 +// . + +#include +#include +#include +#include +#include + +struct Task; + +std::set dead_tasks; + +struct Task +{ + ~Task() { dead_tasks.insert(this); } + + void operator()() const + { + std::this_thread::sleep_for(std::chrono::seconds(1)); + VERIFY( dead_tasks.count(this) == 0 ); + } +}; + +int main() +{ + std::async(std::launch::async, Task()); +} Index: libstdc++-v3/testsuite/decimal/pr54036-1.cc =================================================================== --- libstdc++-v3/testsuite/decimal/pr54036-1.cc (.../tags/gcc_4_7_1_release) (wersja 0) +++ libstdc++-v3/testsuite/decimal/pr54036-1.cc (.../branches/gcc-4_7-branch) (wersja 190845) @@ -0,0 +1,70 @@ +// 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-require-effective-target dfp } + +#include +#include + +using namespace std::decimal; + +decimal32 +__attribute__ ((noinline)) +my_nan32 (void) +{ + decimal32 z = 0; + decimal32 v = z/z; + return v; +} + +decimal32 +__attribute__ ((noinline)) +my_inf32 (void) +{ + decimal32 o = 1; + decimal32 z = 0; + decimal32 v = o/z; + return v; +} + +int +main () +{ + decimal32 v; + + v = my_nan32 (); + + VERIFY (__builtin_isnand32 (v.__getval ())); + VERIFY (!__builtin_signbitd32 (v.__getval ())); + + v = -v; + + VERIFY (__builtin_isnand32 (v.__getval ())); + VERIFY (__builtin_signbitd32 (v.__getval ())); + + v = my_inf32 (); + + VERIFY (__builtin_isinfd32 (v.__getval ())); + VERIFY (!__builtin_signbitd32 (v.__getval ())); + + v = -v; + + VERIFY (__builtin_isinfd32 (v.__getval ())); + VERIFY (__builtin_signbitd32 (v.__getval ())); + + return 0; +} Index: libstdc++-v3/testsuite/decimal/pr54036-2.cc =================================================================== --- libstdc++-v3/testsuite/decimal/pr54036-2.cc (.../tags/gcc_4_7_1_release) (wersja 0) +++ libstdc++-v3/testsuite/decimal/pr54036-2.cc (.../branches/gcc-4_7-branch) (wersja 190845) @@ -0,0 +1,70 @@ +// 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-require-effective-target dfp } + +#include +#include + +using namespace std::decimal; + +decimal64 +__attribute__ ((noinline)) +my_nan64 (void) +{ + decimal64 z = 0; + decimal64 v = z/z; + return v; +} + +decimal64 +__attribute__ ((noinline)) +my_inf64 (void) +{ + decimal64 o = 1; + decimal64 z = 0; + decimal64 v = o/z; + return v; +} + +int +main () +{ + decimal64 v; + + v = my_nan64 (); + + VERIFY (__builtin_isnand64 (v.__getval ())); + VERIFY (!__builtin_signbitd64 (v.__getval ())); + + v = -v; + + VERIFY (__builtin_isnand64 (v.__getval ())); + VERIFY (__builtin_signbitd64 (v.__getval ())); + + v = my_inf64 (); + + VERIFY (__builtin_isinfd64 (v.__getval ())); + VERIFY (!__builtin_signbitd64 (v.__getval ())); + + v = -v; + + VERIFY (__builtin_isinfd64 (v.__getval ())); + VERIFY (__builtin_signbitd64 (v.__getval ())); + + return 0; +} Index: libstdc++-v3/testsuite/decimal/pr54036-3.cc =================================================================== --- libstdc++-v3/testsuite/decimal/pr54036-3.cc (.../tags/gcc_4_7_1_release) (wersja 0) +++ libstdc++-v3/testsuite/decimal/pr54036-3.cc (.../branches/gcc-4_7-branch) (wersja 190845) @@ -0,0 +1,70 @@ +// 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-require-effective-target dfp } + +#include +#include + +using namespace std::decimal; + +decimal128 +__attribute__ ((noinline)) +my_nan128 (void) +{ + decimal128 z = 0; + decimal128 v = z/z; + return v; +} + +decimal128 +__attribute__ ((noinline)) +my_inf128 (void) +{ + decimal128 o = 1; + decimal128 z = 0; + decimal128 v = o/z; + return v; +} + +int +main () +{ + decimal128 v; + + v = my_nan128 (); + + VERIFY (__builtin_isnand128 (v.__getval ())); + VERIFY (!__builtin_signbitd128 (v.__getval ())); + + v = -v; + + VERIFY (__builtin_isnand128 (v.__getval ())); + VERIFY (__builtin_signbitd128 (v.__getval ())); + + v = my_inf128 (); + + VERIFY (__builtin_isinfd128 (v.__getval ())); + VERIFY (!__builtin_signbitd128 (v.__getval ())); + + v = -v; + + VERIFY (__builtin_isinfd128 (v.__getval ())); + VERIFY (__builtin_signbitd128 (v.__getval ())); + + return 0; +} Index: libstdc++-v3/testsuite/performance/23_containers/insert/unordered_set.cc =================================================================== --- libstdc++-v3/testsuite/performance/23_containers/insert/unordered_set.cc (.../tags/gcc_4_7_1_release) (wersja 0) +++ libstdc++-v3/testsuite/performance/23_containers/insert/unordered_set.cc (.../branches/gcc-4_7-branch) (wersja 190845) @@ -0,0 +1,42 @@ +// 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-options "-std=c++11" } + +#include +#include + +int main() +{ + using namespace __gnu_test; + + time_counter time; + resource_counter resource; + + const int sz = 10000000; + + std::unordered_set s; + start_counters(time, resource); + + for (int i = 0; i != sz ; ++i) + s.insert(i); + + stop_counters(time, resource); + report_performance(__FILE__, "unordered_set 10000000 insertions", + time, resource); + return 0; +} 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 190845) @@ -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/Makefile.am =================================================================== --- libstdc++-v3/testsuite/Makefile.am (.../tags/gcc_4_7_1_release) (wersja 190845) +++ libstdc++-v3/testsuite/Makefile.am (.../branches/gcc-4_7-branch) (wersja 190845) @@ -134,7 +134,7 @@ normal0) \ if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \ $$runtest $(AM_RUNTESTFLAGS) $(RUNTESTDEFAULTFLAGS) \ - $(RUNTESTFLAGS) abi.exp; \ + $(RUNTESTFLAGS) abi.exp prettyprinters.exp; \ else echo "WARNING: could not find \`runtest'" 1>&2; :;\ fi; \ dirs="`cd $$srcdir; echo [013-9][0-9]_*/*`";; \ Index: libstdc++-v3/testsuite/23_containers/unordered_map/modifiers/reserve.cc =================================================================== --- libstdc++-v3/testsuite/23_containers/unordered_map/modifiers/reserve.cc (.../tags/gcc_4_7_1_release) (wersja 0) +++ libstdc++-v3/testsuite/23_containers/unordered_map/modifiers/reserve.cc (.../branches/gcc-4_7-branch) (wersja 190845) @@ -0,0 +1,47 @@ +// { dg-options "-std=gnu++0x" } + +// 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 +// . + +#include +#include + +bool test __attribute__((unused)) = true; + +void test01() +{ + const int N = 1000; + + typedef std::unordered_map Map; + Map m; + m.reserve(N); + + std::size_t bkts = m.bucket_count(); + for (int i = 0; i != N; ++i) + { + m.insert(std::make_pair(i, i)); + // As long as we insert less than the reserved number of elements we + // shouldn't experiment any rehash. + VERIFY( m.bucket_count() == bkts ); + } +} + +int main() +{ + test01(); + return 0; +} Index: libstdc++-v3/testsuite/23_containers/unordered_multimap/modifiers/reserve.cc =================================================================== --- libstdc++-v3/testsuite/23_containers/unordered_multimap/modifiers/reserve.cc (.../tags/gcc_4_7_1_release) (wersja 0) +++ libstdc++-v3/testsuite/23_containers/unordered_multimap/modifiers/reserve.cc (.../branches/gcc-4_7-branch) (wersja 190845) @@ -0,0 +1,48 @@ +// { dg-options "-std=gnu++0x" } + +// 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 +// . + +#include +#include + +bool test __attribute__((unused)) = true; + +void test01() +{ + const int N = 1000; + + typedef std::unordered_multimap MMap; + MMap m; + m.reserve(N * 2); + + std::size_t bkts = m.bucket_count(); + for (int i = 0; i != N; ++i) + { + m.insert(std::make_pair(i, i)); + m.insert(std::make_pair(i, i)); + // As long as we insert less than the reserved number of elements we + // shouldn't experiment any rehash. + VERIFY( m.bucket_count() == bkts ); + } +} + +int main() +{ + test01(); + return 0; +} Index: libstdc++-v3/testsuite/23_containers/unordered_set/modifiers/reserve.cc =================================================================== --- libstdc++-v3/testsuite/23_containers/unordered_set/modifiers/reserve.cc (.../tags/gcc_4_7_1_release) (wersja 0) +++ libstdc++-v3/testsuite/23_containers/unordered_set/modifiers/reserve.cc (.../branches/gcc-4_7-branch) (wersja 190845) @@ -0,0 +1,47 @@ +// { dg-options "-std=gnu++0x" } + +// 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 +// . + +#include +#include + +bool test __attribute__((unused)) = true; + +void test01() +{ + const int N = 1000; + + typedef std::unordered_set Set; + Set s; + s.reserve(N); + + std::size_t bkts = s.bucket_count(); + for (int i = 0; i != N; ++i) + { + s.insert(i); + // As long as we insert less than the reserved number of elements we + // shouldn't experiment any rehash. + VERIFY( s.bucket_count() == bkts ); + } +} + +int main() +{ + test01(); + return 0; +} 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 190845) +++ libstdc++-v3/testsuite/23_containers/list/requirements/dr438/assign_neg.cc (.../branches/gcc-4_7-branch) (wersja 190845) @@ -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 190845) +++ libstdc++-v3/testsuite/23_containers/list/requirements/dr438/insert_neg.cc (.../branches/gcc-4_7-branch) (wersja 190845) @@ -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 190845) +++ libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc (.../branches/gcc-4_7-branch) (wersja 190845) @@ -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 190845) +++ libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc (.../branches/gcc-4_7-branch) (wersja 190845) @@ -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/testsuite/23_containers/unordered_multiset/modifiers/reserve.cc =================================================================== --- libstdc++-v3/testsuite/23_containers/unordered_multiset/modifiers/reserve.cc (.../tags/gcc_4_7_1_release) (wersja 0) +++ libstdc++-v3/testsuite/23_containers/unordered_multiset/modifiers/reserve.cc (.../branches/gcc-4_7-branch) (wersja 190845) @@ -0,0 +1,48 @@ +// { dg-options "-std=gnu++0x" } + +// 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 +// . + +#include +#include + +bool test __attribute__((unused)) = true; + +void test01() +{ + const int N = 1000; + + typedef std::unordered_multiset MSet; + MSet s; + s.reserve(N * 2); + + std::size_t bkts = s.bucket_count(); + for (int i = 0; i != N; ++i) + { + s.insert(i); + s.insert(i); + // As long as we insert less than the reserved number of elements we + // shouldn't experiment any rehash. + VERIFY( s.bucket_count() == bkts ); + } +} + +int main() +{ + test01(); + return 0; +} Index: libstdc++-v3/testsuite/20_util/unique_ptr/assign/48635_neg.cc =================================================================== --- libstdc++-v3/testsuite/20_util/unique_ptr/assign/48635_neg.cc (.../tags/gcc_4_7_1_release) (wersja 190845) +++ libstdc++-v3/testsuite/20_util/unique_ptr/assign/48635_neg.cc (.../branches/gcc-4_7-branch) (wersja 190845) @@ -41,10 +41,10 @@ std::unique_ptr ub(nullptr, b); std::unique_ptr ud(nullptr, d); ub = std::move(ud); -// { dg-error "use of deleted function" "" { target *-*-* } 189 } +// { dg-error "use of deleted function" "" { target *-*-* } 195 } std::unique_ptr uba(nullptr, b); std::unique_ptr uda(nullptr, d); uba = std::move(uda); -// { dg-error "use of deleted function" "" { target *-*-* } 329 } +// { dg-error "use of deleted function" "" { target *-*-* } 341 } } Index: libstdc++-v3/testsuite/20_util/unique_ptr/54351.cc =================================================================== --- libstdc++-v3/testsuite/20_util/unique_ptr/54351.cc (.../tags/gcc_4_7_1_release) (wersja 0) +++ libstdc++-v3/testsuite/20_util/unique_ptr/54351.cc (.../branches/gcc-4_7-branch) (wersja 190845) @@ -0,0 +1,70 @@ +// { dg-options "-std=gnu++0x" } +// { dg-do run } + +// Copyright (C) 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 +// 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 +// . + +// 20.7.1 Template class unique_ptr [unique.ptr] + +#include +#include + +struct A; + +struct B +{ + std::unique_ptr a; +}; + +struct A +{ + B* b; + ~A() { VERIFY(b->a != nullptr); } +}; + +void test01() +{ + B b; + b.a.reset(new A); + b.a->b = &b; +} + +struct C; + +struct D +{ + std::unique_ptr c; +}; + +struct C +{ + D* d; + ~C() { VERIFY(d->c != nullptr); } +}; + +void test02() +{ + D d; + d.c.reset(new C[1]); + d.c[0].d = &d; +} + +int main() +{ + test01(); + test02(); +} 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 190845) +++ libstdc++-v3/config/os/bsd/netbsd/ctype_base.h (.../branches/gcc-4_7-branch) (wersja 190845) @@ -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: libgcc/config.host =================================================================== --- libgcc/config.host (.../tags/gcc_4_7_1_release) (wersja 190845) +++ libgcc/config.host (.../branches/gcc-4_7-branch) (wersja 190845) @@ -916,15 +916,15 @@ ;; rs6000-ibm-aix4.[3456789]* | powerpc-ibm-aix4.[3456789]*) md_unwind_header=rs6000/aix-unwind.h - tmake_file="t-fdpbit rs6000/t-ppc64-fp rs6000/t-ibm-ldouble rs6000/t-slibgcc-aix" + tmake_file="t-fdpbit rs6000/t-ppc64-fp rs6000/t-slibgcc-aix rs6000/t-ibm-ldouble" ;; rs6000-ibm-aix5.1.* | powerpc-ibm-aix5.1.*) md_unwind_header=rs6000/aix-unwind.h - tmake_file="t-fdpbit rs6000/t-ppc64-fp rs6000/t-ibm-ldouble rs6000/t-slibgcc-aix" + tmake_file="t-fdpbit rs6000/t-ppc64-fp rs6000/t-slibgcc-aix rs6000/t-ibm-ldouble" ;; rs6000-ibm-aix[56789].* | powerpc-ibm-aix[56789].*) md_unwind_header=rs6000/aix-unwind.h - tmake_file="t-fdpbit rs6000/t-ppc64-fp rs6000/t-ibm-ldouble rs6000/t-slibgcc-aix" + tmake_file="t-fdpbit rs6000/t-ppc64-fp rs6000/t-slibgcc-aix rs6000/t-ibm-ldouble" ;; rl78-*-elf) tmake_file="$tm_file t-fdpbit rl78/t-rl78" Index: libgcc/ChangeLog =================================================================== --- libgcc/ChangeLog (.../tags/gcc_4_7_1_release) (wersja 190845) +++ libgcc/ChangeLog (.../branches/gcc-4_7-branch) (wersja 190845) @@ -1,3 +1,16 @@ +2012-08-21 Ian Lance Taylor + + * config/i386/morestack.S (__morestack_non_split): Increase amount + of space allocated for non-split code stack. + +2012-08-16 David Edelsohn + + Backported from mainline + 2012-08-16 David Edelsohn + + * config.host (*-*-aix*): Move rs6000/t-ibm-ldouble after + rs6000/t-slibgcc-aix. + 2012-06-14 Release Manager * GCC 4.7.1 released. Index: libgcc/config/i386/morestack.S =================================================================== --- libgcc/config/i386/morestack.S (.../tags/gcc_4_7_1_release) (wersja 190845) +++ libgcc/config/i386/morestack.S (.../branches/gcc-4_7-branch) (wersja 190845) @@ -83,6 +83,9 @@ #endif +# The amount of space we ask for when calling non-split-stack code. +#define NON_SPLIT_STACK 0x100000 + # This entry point is for split-stack code which calls non-split-stack # code. When the linker sees this case, it converts the call to # __morestack to call __morestack_non_split instead. We just bump the @@ -109,7 +112,7 @@ movl %esp,%eax # Current stack, subl 8(%esp),%eax # less required stack frame size, - subl $0x4000,%eax # less space for non-split code. + subl $NON_SPLIT_STACK,%eax # less space for non-split code. cmpl %gs:0x30,%eax # See if we have enough space. jb 2f # Get more space if we need it. @@ -171,7 +174,8 @@ .cfi_adjust_cfa_offset -4 # Account for popped register. - addl $0x5000+BACKOFF,4(%esp) # Increment space we request. + # Increment space we request. + addl $NON_SPLIT_STACK+0x1000+BACKOFF,4(%esp) # Fall through into morestack. @@ -186,7 +190,7 @@ movq %rsp,%rax # Current stack, subq %r10,%rax # less required stack frame size, - subq $0x4000,%rax # less space for non-split code. + subq $NON_SPLIT_STACK,%rax # less space for non-split code. #ifdef __LP64__ cmpq %fs:0x70,%rax # See if we have enough space. @@ -219,7 +223,8 @@ .cfi_adjust_cfa_offset -8 # Adjust for popped register. - addq $0x5000+BACKOFF,%r10 # Increment space we request. + # Increment space we request. + addq $NON_SPLIT_STACK+0x1000+BACKOFF,%r10 # Fall through into morestack. Index: gcc/doc/tm.texi =================================================================== --- gcc/doc/tm.texi (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/doc/tm.texi (.../branches/gcc-4_7-branch) (wersja 190845) @@ -1105,6 +1105,14 @@ If the value of this macro has a type, it should be an unsigned type. @end defmac +@deftypefn {Target Hook} HOST_WIDE_INT TARGET_VECTOR_ALIGNMENT (const_tree @var{type}) +This hook can be used to define the alignment for a vector of type +@var{type}, in order to comply with a platform ABI. The default is to +require natural alignment for vector types. The alignment returned by +this hook must be a power-of-two multiple of the default alignment of +the vector element type. +@end deftypefn + @defmac STACK_SLOT_ALIGNMENT (@var{type}, @var{mode}, @var{basic-align}) If defined, a C expression to compute the alignment for stack slot. @var{type} is the data type, @var{mode} is the widest mode available, Index: gcc/doc/tm.texi.in =================================================================== --- gcc/doc/tm.texi.in (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/doc/tm.texi.in (.../branches/gcc-4_7-branch) (wersja 190845) @@ -1093,6 +1093,8 @@ If the value of this macro has a type, it should be an unsigned type. @end defmac +@hook TARGET_VECTOR_ALIGNMENT + @defmac STACK_SLOT_ALIGNMENT (@var{type}, @var{mode}, @var{basic-align}) If defined, a C expression to compute the alignment for stack slot. @var{type} is the data type, @var{mode} is the widest mode available, Index: gcc/doc/invoke.texi =================================================================== --- gcc/doc/invoke.texi (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/doc/invoke.texi (.../branches/gcc-4_7-branch) (wersja 190845) @@ -493,7 +493,8 @@ -mcaller-super-interworking -mcallee-super-interworking @gol -mtp=@var{name} -mtls-dialect=@var{dialect} @gol -mword-relocations @gol --mfix-cortex-m3-ldrd} +-mfix-cortex-m3-ldrd @gol +-munaligned-access} @emph{AVR Options} @gccoptlist{-mmcu=@var{mcu} -maccumulate-args -mbranch-cost=@var{cost} @gol @@ -882,8 +883,8 @@ -m5-compact -m5-compact-nofpu @gol -mb -ml -mdalign -mrelax @gol -mbigtable -mfmovd -mhitachi -mrenesas -mno-renesas -mnomacsave @gol --mieee -mbitops -misize -minline-ic_invalidate -mpadstruct -mspace @gol --mprefergot -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol +-mieee -mno-ieee -mbitops -misize -minline-ic_invalidate -mpadstruct @gol +-mspace -mprefergot -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol -mdivsi3_libfunc=@var{name} -mfixed-range=@var{register-range} @gol -madjust-unroll -mindexed-addressing -mgettrcost=@var{number} -mpt-fixed @gol -maccumulate-outgoing-args -minvalid-symbols -msoft-atomic @gol @@ -10929,6 +10930,23 @@ generating these instructions. This option is enabled by default when @option{-mcpu=cortex-m3} is specified. +@item -munaligned-access +@itemx -mno-unaligned-access +@opindex munaligned-access +@opindex mno-unaligned-access +Enables (or disables) reading and writing of 16- and 32- bit values +from addresses that are not 16- or 32- bit aligned. By default +unaligned access is disabled for all pre-ARMv6 and all ARMv6-M +architectures, and enabled for all other architectures. If unaligned +access is not enabled then words in packed data structures will be +accessed a byte at a time. + +The ARM attribute @code{Tag_CPU_unaligned_access} will be set in the +generated object file to either true or false, depending upon the +setting of this option. If unaligned access is enabled then the +preprocessor symbol @code{__ARM_FEATURE_UNALIGNED} will also be +defined. + @end table @node AVR Options @@ -17952,13 +17970,15 @@ @option{-mhitachi} is given. @item -mieee +@item -mno-ieee @opindex mieee -Increase IEEE compliance of floating-point code. -At the moment, this is equivalent to @option{-fno-finite-math-only}. -When generating 16-bit SH opcodes, getting IEEE-conforming results for -comparisons of NANs / infinities incurs extra overhead in every -floating-point comparison, therefore the default is set to -@option{-ffinite-math-only}. +@opindex mnoieee +Control the IEEE compliance of floating-point comparisons, which affects the +handling of cases where the result of a comparison is unordered. By default +@option{-mieee} is implicitly enabled. If @option{-ffinite-math-only} is +enabled @option{-mno-ieee} is implicitly set, which results in faster +floating-point greater-equal and less-equal comparisons. The implcit settings +can be overridden by specifying either @option{-mieee} or @option{-mno-ieee}. @item -minline-ic_invalidate @opindex minline-ic_invalidate Index: gcc/doc/md.texi =================================================================== --- gcc/doc/md.texi (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/doc/md.texi (.../branches/gcc-4_7-branch) (wersja 190845) @@ -3588,7 +3588,7 @@ @itemx R07 @itemx R08 @itemx R09 -@itemx R010 +@itemx R10 Each of these represents a register constraint for an individual register, from r0 to r10. @@ -3666,7 +3666,7 @@ @itemx R07 @itemx R08 @itemx R09 -@itemx R010 +@itemx R10 Each of these represents a register constraint for an individual register, from r0 to r10. Index: gcc/tree-ssa-loop-im.c =================================================================== --- gcc/tree-ssa-loop-im.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/tree-ssa-loop-im.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -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) @@ -1480,9 +1480,8 @@ /* A function to free the mem_ref object OBJ. */ static void -memref_free (void *obj) +memref_free (struct mem_ref *mem) { - struct mem_ref *const mem = (struct mem_ref *) obj; unsigned i; mem_ref_locs_p accs; @@ -1626,6 +1625,7 @@ fprintf (dump_file, "\n"); } } + if (is_stored) mark_ref_stored (ref, loop); @@ -1721,8 +1721,7 @@ unsigned i; bitmap empty; - memory_accesses.refs - = htab_create (100, memref_hash, memref_eq, memref_free); + memory_accesses.refs = htab_create (100, memref_hash, memref_eq, NULL); memory_accesses.refs_list = NULL; memory_accesses.refs_in_loop = VEC_alloc (bitmap, heap, number_of_loops ()); @@ -1956,6 +1955,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 +2130,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 +2152,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 +2601,8 @@ if (flag_tm) compute_transaction_bits (); + + alloc_aux_for_edges (0); } /* Cleans up after the invariant motion pass. */ @@ -2420,15 +2613,21 @@ basic_block bb; unsigned i; bitmap b; + mem_ref_p ref; + free_aux_for_edges (); + FOR_EACH_BB (bb) SET_ALWAYS_EXECUTED_IN (bb, NULL); pointer_map_destroy (lim_aux_data_map); - VEC_free (mem_ref_p, heap, memory_accesses.refs_list); htab_delete (memory_accesses.refs); + FOR_EACH_VEC_ELT (mem_ref_p, memory_accesses.refs_list, i, ref) + memref_free (ref); + VEC_free (mem_ref_p, heap, memory_accesses.refs_list); + FOR_EACH_VEC_ELT (bitmap, memory_accesses.refs_in_loop, i, b) BITMAP_FREE (b); VEC_free (bitmap, heap, memory_accesses.refs_in_loop); @@ -2442,7 +2641,7 @@ VEC_free (bitmap, heap, memory_accesses.all_refs_stored_in_loop); if (memory_accesses.ttae_cache) - pointer_map_destroy (memory_accesses.ttae_cache); + free_affine_expand_cache (&memory_accesses.ttae_cache); } /* Moves invariants from loops. Only "expensive" invariants are moved out -- Index: gcc/targhooks.c =================================================================== --- gcc/targhooks.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/targhooks.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -939,6 +939,13 @@ return id; } +/* Default to natural alignment for vector types. */ +HOST_WIDE_INT +default_vector_alignment (const_tree type) +{ + return tree_low_cst (TYPE_SIZE (type), 0); +} + bool default_builtin_vector_alignment_reachable (const_tree type, bool is_packed) { Index: gcc/targhooks.h =================================================================== --- gcc/targhooks.h (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/targhooks.h (.../branches/gcc-4_7-branch) (wersja 190845) @@ -83,6 +83,8 @@ extern tree default_builtin_reciprocal (unsigned int, bool, bool); +extern HOST_WIDE_INT default_vector_alignment (const_tree); + extern bool default_builtin_vector_alignment_reachable (const_tree, bool); extern bool default_builtin_support_vector_misalignment (enum machine_mode mode, Index: gcc/tree-ssa-loop-niter.c =================================================================== --- gcc/tree-ssa-loop-niter.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/tree-ssa-loop-niter.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -2290,7 +2290,10 @@ /* Loops with multiple exits are expensive to handle and less important. */ if (!flag_expensive_optimizations && VEC_length (edge, exits) > 1) - return chrec_dont_know; + { + VEC_free (edge, heap, exits); + return chrec_dont_know; + } FOR_EACH_VEC_ELT (edge, exits, i, ex) { Index: gcc/c-family/ChangeLog =================================================================== --- gcc/c-family/ChangeLog (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/c-family/ChangeLog (.../branches/gcc-4_7-branch) (wersja 190845) @@ -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 190845) +++ gcc/c-family/c-ppoutput.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -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/target.def =================================================================== --- gcc/target.def (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/target.def (.../branches/gcc-4_7-branch) (wersja 190845) @@ -1615,6 +1615,16 @@ bool, (enum machine_mode mode), hook_bool_mode_false) +DEFHOOK +(vector_alignment, + "This hook can be used to define the alignment for a vector of type\n\ +@var{type}, in order to comply with a platform ABI. The default is to\n\ +require natural alignment for vector types. The alignment returned by\n\ +this hook must be a power-of-two multiple of the default alignment of\n\ +the vector element type.", + HOST_WIDE_INT, (const_tree type), + default_vector_alignment) + /* True if we should try to use a scalar mode to represent an array, overriding the usual MAX_FIXED_MODE limit. */ DEFHOOK Index: gcc/DATESTAMP =================================================================== --- gcc/DATESTAMP (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/DATESTAMP (.../branches/gcc-4_7-branch) (wersja 190845) @@ -1 +1 @@ -20120614 +20120901 Index: gcc/defaults.h =================================================================== --- gcc/defaults.h (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/defaults.h (.../branches/gcc-4_7-branch) (wersja 190845) @@ -1063,6 +1063,11 @@ #define TARGET_HAS_SINCOS 0 #endif +/* Determin whether the target runtime library is Bionic */ +#ifndef TARGET_HAS_BIONIC +#define TARGET_HAS_BIONIC 0 +#endif + /* Indicate that CLZ and CTZ are undefined at zero. */ #ifndef CLZ_DEFINED_VALUE_AT_ZERO #define CLZ_DEFINED_VALUE_AT_ZERO(MODE, VALUE) 0 Index: gcc/tree.c =================================================================== --- gcc/tree.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/tree.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -1617,7 +1617,7 @@ { case INTEGER_TYPE: case ENUMERAL_TYPE: case BOOLEAN_TYPE: case POINTER_TYPE: case REFERENCE_TYPE: - case OFFSET_TYPE: + case OFFSET_TYPE: case NULLPTR_TYPE: return build_int_cst (type, 0); case REAL_TYPE: @@ -2922,6 +2922,7 @@ case METHOD_TYPE: case FUNCTION_TYPE: case VECTOR_TYPE: + case NULLPTR_TYPE: return false; case INTEGER_TYPE: @@ -4517,11 +4518,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; + } } @@ -4846,7 +4853,15 @@ fld_worklist_push (TYPE_MAIN_VARIANT (t), fld); /* Do not walk TYPE_NEXT_VARIANT. We do not stream it and thus do not and want not to reach unused variants this way. */ - fld_worklist_push (TYPE_CONTEXT (t), fld); + if (TYPE_CONTEXT (t)) + { + tree ctx = TYPE_CONTEXT (t); + /* We adjust BLOCK TYPE_CONTEXTs to the innermost non-BLOCK one. + So push that instead. */ + while (ctx && TREE_CODE (ctx) == BLOCK) + ctx = BLOCK_SUPERCONTEXT (ctx); + fld_worklist_push (ctx, fld); + } /* Do not walk TYPE_CANONICAL. We do not stream it and thus do not and want not to reach unused types this way. */ @@ -6119,6 +6134,7 @@ case COMPLEX_TYPE: case POINTER_TYPE: case REFERENCE_TYPE: + case NULLPTR_TYPE: return 1; case VECTOR_TYPE: Index: gcc/configure =================================================================== --- gcc/configure (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/configure (.../branches/gcc-4_7-branch) (wersja 190845) @@ -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 @@ -26721,6 +26722,11 @@ $target_header_dir/bits/uClibc_config.h > /dev/null; then gcc_cv_libc_provides_ssp=yes fi + # all versions of Bionic support stack protector + elif test -f $target_header_dir/sys/cdefs.h \ + && $EGREP '^[ ]*#[ ]*define[ ]+__BIONIC__[ ]+1' \ + $target_header_dir/sys/cdefs.h > /dev/null; then + gcc_cv_libc_provides_ssp=yes fi ;; *-*-gnu*) Index: gcc/omp-low.c =================================================================== --- gcc/omp-low.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/omp-low.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -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; @@ -4742,45 +4758,40 @@ unsigned i, casei; bool exit_reachable = region->cont != NULL; - gcc_assert (exit_reachable == (region->exit != NULL)); + gcc_assert (region->exit != NULL); entry_bb = region->entry; l0_bb = single_succ (entry_bb); l1_bb = region->cont; l2_bb = region->exit; - if (exit_reachable) + if (single_pred_p (l2_bb) && single_pred (l2_bb) == l0_bb) + l2 = gimple_block_label (l2_bb); + else { - if (single_pred_p (l2_bb) && single_pred (l2_bb) == l0_bb) - l2 = gimple_block_label (l2_bb); + /* This can happen if there are reductions. */ + len = EDGE_COUNT (l0_bb->succs); + gcc_assert (len > 0); + e = EDGE_SUCC (l0_bb, len - 1); + si = gsi_last_bb (e->dest); + l2 = NULL_TREE; + if (gsi_end_p (si) + || gimple_code (gsi_stmt (si)) != GIMPLE_OMP_SECTION) + l2 = gimple_block_label (e->dest); else - { - /* This can happen if there are reductions. */ - len = EDGE_COUNT (l0_bb->succs); - gcc_assert (len > 0); - e = EDGE_SUCC (l0_bb, len - 1); - si = gsi_last_bb (e->dest); - l2 = NULL_TREE; - if (gsi_end_p (si) - || gimple_code (gsi_stmt (si)) != GIMPLE_OMP_SECTION) - l2 = gimple_block_label (e->dest); - else - FOR_EACH_EDGE (e, ei, l0_bb->succs) + FOR_EACH_EDGE (e, ei, l0_bb->succs) + { + si = gsi_last_bb (e->dest); + if (gsi_end_p (si) + || gimple_code (gsi_stmt (si)) != GIMPLE_OMP_SECTION) { - si = gsi_last_bb (e->dest); - if (gsi_end_p (si) - || gimple_code (gsi_stmt (si)) != GIMPLE_OMP_SECTION) - { - l2 = gimple_block_label (e->dest); - break; - } + l2 = gimple_block_label (e->dest); + break; } - } - default_bb = create_empty_bb (l1_bb->prev_bb); + } } + if (exit_reachable) + default_bb = create_empty_bb (l1_bb->prev_bb); else - { - default_bb = create_empty_bb (l0_bb); - l2 = gimple_block_label (default_bb); - } + default_bb = create_empty_bb (l0_bb); /* We will build a switch() with enough cases for all the GIMPLE_OMP_SECTION regions, a '0' case to handle the end of more work @@ -4833,13 +4844,9 @@ vnext = NULL_TREE; } - i = 0; - if (exit_reachable) - { - t = build_case_label (build_int_cst (unsigned_type_node, 0), NULL, l2); - VEC_quick_push (tree, label_vec, t); - i++; - } + t = build_case_label (build_int_cst (unsigned_type_node, 0), NULL, l2); + VEC_quick_push (tree, label_vec, t); + i = 1; /* Convert each GIMPLE_OMP_SECTION into a CASE_LABEL_EXPR. */ for (inner = region->inner, casei = 1; @@ -4909,18 +4916,18 @@ gsi_remove (&si, true); single_succ_edge (l1_bb)->flags = EDGE_FALLTHRU; - - /* Cleanup function replaces GIMPLE_OMP_RETURN in EXIT_BB. */ - si = gsi_last_bb (l2_bb); - if (gimple_omp_return_nowait_p (gsi_stmt (si))) - t = builtin_decl_explicit (BUILT_IN_GOMP_SECTIONS_END_NOWAIT); - else - t = builtin_decl_explicit (BUILT_IN_GOMP_SECTIONS_END); - stmt = gimple_build_call (t, 0); - gsi_insert_after (&si, stmt, GSI_SAME_STMT); - gsi_remove (&si, true); } + /* Cleanup function replaces GIMPLE_OMP_RETURN in EXIT_BB. */ + si = gsi_last_bb (l2_bb); + if (gimple_omp_return_nowait_p (gsi_stmt (si))) + t = builtin_decl_explicit (BUILT_IN_GOMP_SECTIONS_END_NOWAIT); + else + t = builtin_decl_explicit (BUILT_IN_GOMP_SECTIONS_END); + stmt = gimple_build_call (t, 0); + gsi_insert_after (&si, stmt, GSI_SAME_STMT); + gsi_remove (&si, true); + set_immediate_dominator (CDI_DOMINATORS, default_bb, l0_bb); } @@ -6852,6 +6859,9 @@ lower_omp (gimple_try_eval (stmt), ctx); lower_omp (gimple_try_cleanup (stmt), ctx); break; + case GIMPLE_TRANSACTION: + lower_omp (gimple_transaction_body (stmt), ctx); + break; case GIMPLE_BIND: lower_omp (gimple_bind_body (stmt), ctx); break; Index: gcc/cfg.c =================================================================== --- gcc/cfg.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/cfg.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -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/tree-chrec.c =================================================================== --- gcc/tree-chrec.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/tree-chrec.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -1011,6 +1011,8 @@ if (TREE_CODE (chrec) == POLYNOMIAL_CHREC) { if (CHREC_VARIABLE (chrec) == (unsigned) loopnum + || flow_loop_nested_p (get_loop (loopnum), + get_loop (CHREC_VARIABLE (chrec))) || !evolution_function_is_invariant_rec_p (CHREC_RIGHT (chrec), loopnum) || !evolution_function_is_invariant_rec_p (CHREC_LEFT (chrec), @@ -1114,6 +1116,8 @@ break; default: + if (tree_contains_chrecs (CHREC_LEFT (chrec), NULL)) + return false; break; } @@ -1127,6 +1131,8 @@ break; default: + if (tree_contains_chrecs (CHREC_RIGHT (chrec), NULL)) + return false; break; } Index: gcc/DEV-PHASE =================================================================== --- gcc/DEV-PHASE (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/DEV-PHASE (.../branches/gcc-4_7-branch) (wersja 190845) @@ -0,0 +1 @@ +prerelease Index: gcc/tree-ssa-sccvn.c =================================================================== --- gcc/tree-ssa-sccvn.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/tree-ssa-sccvn.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -3590,6 +3590,8 @@ fprintf (dump_file, "WARNING: Giving up with SCCVN due to " "SCC size %u exceeding %u\n", VEC_length (tree, scc), (unsigned)PARAM_VALUE (PARAM_SCCVN_MAX_SCC_SIZE)); + + VEC_free (tree, heap, scc); return false; } Index: gcc/ChangeLog =================================================================== --- gcc/ChangeLog (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/ChangeLog (.../branches/gcc-4_7-branch) (wersja 190845) @@ -1,3 +1,805 @@ +2012-08-31 Kirill Yukhin + + Backport from mainline + 2012-08-23 Yuri Rumyantsev + + * config/i386/i386.c (ia32_multipass_dfa_lookahead) : Add + case for Atom processor. + +2012-08-28 Uros Bizjak + + Backport from mainline + 2012-08-27 Uros Bizjak + + PR target/46254 + * config/i386/predicates.md (cmpxchg8b_pic_memory_operand): Return + true for TARGET_64BIT or !flag_pic. + * config/i386/sync.md (*atomic_compare_and_swap_doubledi_pic): Remove. + (atomic_compare_and_swap_double): Change operand 2 predicate + to cmpxchg8b_pic_memory_operand. Use DWIH mode iterator. + Add insn constraint. Conditionally emit xchg asm insns. + (atomic_compare_and_swap): Update calls. Check only + cmpxchg8b_pic_memory_operand in memory address fixup. + (DCASMODE): Remove. + (CASHMODE): Rename from DCASHMODE. + (doublemodesuffix): Update modes. + (regprefix): New mode attribute. + + (unspecv) : Remove. + : New constant. + (atomic_compare_and_swap_1): Rename from + atomic_compare_and_swap_single. Update calls and + unspec_volatile constants. + (atomic_compare_and_swap_doubleword): Rename from + atomic_compare_and_swap_double. Update calls and + unspec_volatile constants. + +2012-08-28 Walter Lee + + Backport from mainline + 2012-08-28 Walter Lee + + * confg/tilegx/tilegx.md: Fix code style. + (*zero_extendsidi_truncdisi): Fix typo. + * config/tilegx/tilegx.c: Fix code style. + (tilegx_function_profiler): Fix typo. + +2012-08-27 Walter Lee + + Backport from mainline + 2012-08-27 Walter Lee + + * doc/md.texi (TILE-Gx): Fix typo. + +2012-08-27 Walter Lee + + Backport from mainline + 2012-08-27 Walter Lee + + * config/tilegx/tilegx.c (tilegx_function_profiler): Fix typo. + * config/tilepro/tilepro.c (tilepro_function_profiler): Ditto. + +2012-08-27 Walter Lee + + Backport from mainline + 2012-08-27 Walter Lee + + * config/tilegx/tilegx.md (*bfins): Rename to insn_bfins. + (insn_bfins): Delete. + +2012-08-27 Walter Lee + + Backport from mainline + 2012-08-27 Walter Lee + + * config/tilegx/sync.md (atomic_compare_and_swap_bare, + atomic_exchange_bare, + atomic_fetch__bare): Set type to X1_remote. + * config/tilegx/tilegx-generic.md (X1_remote): New insn_reservation. + * config/tilegx/tilegx.md (type): Add X1_remove. + (insn_cmpexch, insn_exch, + insn_fetchadd, insn_fetchaddgez, + insn_fetchand, insn_fetchor): Set type to + X1_remote. + +2012-08-25 Eric Botcazou + + PR rtl-optimization/54088 + * jump.c (delete_related_insns): Robustify latest change. + +2012-08-21 Richard Guenther + + Backport from mainline + 2012-08-16 Richard Guenther + + PR middle-end/54146 + * tree-ssa-loop-niter.c (find_loop_niter_by_eval): Free the + exit vector. + * ipa-pure-const.c (analyze_function): Use FOR_EACH_LOOP_BREAK. + * cfgloop.h (FOR_EACH_LOOP_BREAK): Fix. + * tree-ssa-structalias.c (handle_lhs_call): Properly free rhsc. + * tree-ssa-loop-im.c (analyze_memory_references): Adjust. + (tree_ssa_lim_finalize): Free all mem_refs. + * tree-ssa-sccvn.c (extract_and_process_scc_for_name): Free + scc when bailing out. + * modulo-sched.c (sms_schedule): Use FOR_EACH_LOOP_BREAK. + * ira-build.c (loop_with_complex_edge_p): Free loop exit vector. + * graphite-sese-to-poly.c (scop_ivs_can_be_represented): Use + FOR_EACH_LOOP_BREAK. + + 2012-08-17 Richard Guenther + + * tree-sra.c (modify_function): Free redirect_callers vector. + * ipa-split.c (split_function): Free args_to_pass vector. + * tree-vect-stmts.c (vectorizable_operation): Do not pre-allocate + vec_oprnds. + (new_stmt_vec_info): Do not pre-allocate STMT_VINFO_SAME_ALIGN_REFS. + * tree-vect-slp.c (vect_free_slp_instance): Free the instance. + (vect_analyze_slp_instance): Free everything. + (destroy_bb_vec_info): Free the SLP instances. + + 2012-08-17 Richard Guenther + + * params.def (integer-share-limit): Decrease from 256 to 251, + add rationale. + + 2012-08-21 Richard Guenther + + * tree-ssa-loop-im.c (tree_ssa_lim_finalize): Properly free + the affine expansion cache. + +2012-08-20 Patrick Marlier + + Backported from trunk + 2012-08-20 Patrick Marlier + + PR middle-end/53992 + * omp-low.c (lower_omp_1): Handle GIMPLE_TRANSACTION. + +2012-08-20 Ramana Radhakrishnan + + Backport from mainline. + 2012-08-15 Ramana Radhakrishnan + + PR target/54212 + * config/arm/neon.md (vec_set_internal VD,VQ): Do not + mark as predicable. Adjust asm template. + (vec_setv2di_internal): Likewise. + (vec_extract VD, VQ): Likewise. + (vec_extractv2di): Likewise. + (neon_vget_lane_sext_internal VD, VQ): Likewise. + (neon_vset_lane_sext_internal VD, VQ): Likewise. + (neon_vdup_n VX, V32): Likewise. + (neon_vdup_nv2di): Likewise. + +2012-08-17 Walter Lee + + Backport from mainline + 2012-08-17 Walter Lee + + * config/tilegx/feedback.h (FEEDBACK_ENTER_EXPLICIT): Define. + (FEEDBACK_ENTER): Define. + (FEEDBACK_REENTER): Define. + (FEEDBACK_ENTRY): Define. + * config/tilepro/feedback.h: (FEEDBACK_ENTER_EXPLICIT): Define. + (FEEDBACK_ENTER): Define. + (FEEDBACK_REENTER): Define. + (FEEDBACK_ENTRY): Define. + +2012-08-16 Walter Lee + + Backport from mainline + 2012-08-16 Walter Lee + + * config.gcc (tilegx-*-linux*): Add feedback.h. + (tilepro-*-linux*): Likewise. + * config/tilegx/feedback.h: New file. + * config/tilepro/feedback.h: New file. + +2012-08-08 Pavel Chupin + + Backport from mainline r189840 and r187586: + 2012-07-25 Sergey Melnikov + + * config/i386/i386.md (stack_protect_set): Disable the pattern + for Android since Android libc (bionic) does not provide random + value for stack protection guard at gs:0x14. Guard value + will be provided from external symbol (default implementation). + (stack_protect_set_): Likewise. + (stack_protect_test): Likewise. + (stack_protect_test_): Likewise. + * gcc/defaults.h: Define macro TARGET_HAS_BIONIC to 0 - target does + not have Bionic by default + * config/linux.h: Redefine macro TARGET_HAS_BIONIC to (OPTION_BIONIC) + Macro OPTION_BIONIC is defined in this file and provides Bionic + accessibility status + + 2012-05-16 Igor Zamyatin + + * configure.ac: Stack protector enabling for Android targets. + * configure: Regenerate. + +2012-08-13 Jakub Jelinek + + Backported from trunk + 2012-07-19 Jakub Jelinek + + PR rtl-optimization/53942 + * function.c (assign_parm_setup_reg): Avoid zero/sign extension + directly from likely spilled non-fixed hard registers, move them + to pseudo first. + +2012-08-11 Uros Bizjak + + * config/i386/sse.md (xop_phaddbq): Fix vec_select selectors. + (xop_phaddubq): Ditto. + +2012-08-10 Ulrich Weigand + + Backport from mainline + 2012-07-30 Ulrich Weigand + Richard Earnshaw + + * target.def (vector_alignment): New target hook. + * doc/tm.texi.in (TARGET_VECTOR_ALIGNMENT): Document new hook. + * doc/tm.texi: Regenerate. + * targhooks.c (default_vector_alignment): New function. + * targhooks.h (default_vector_alignment): Add prototype. + * stor-layout.c (layout_type): Use targetm.vector_alignment. + * config/arm/arm.c (arm_vector_alignment): New function. + (TARGET_VECTOR_ALIGNMENT): Define. + + * tree-vect-data-refs.c (vect_update_misalignment_for_peel): Use + vector type alignment instead of size. + * tree-vect-loop-manip.c (vect_do_peeling_for_loop_bound): Use + element type size directly instead of computing it from alignment. + Fix variable naming and comment. + +2012-08-09 Uros Bizjak + + Backport from mainline + 2012-08-09 Uros Bizjak + + * config/alpha/alpha.c (alpha_pad_noreturn): Rename to ... + (alpha_pad_function_end): ... this. Also insert NOP between + sibling call and GP load. + (alpha_reorg): Update call to alpha_pad_function_end. Expand comment. + +2012-08-09 H.J. Lu + + Backport from mainline + 2012-08-08 Richard Sandiford + H.J. Lu + + PR rtl-optimization/54157 + * combine.c (gen_lowpart_for_combine): Don't return identity + for CONST or symbolic reference. + +2012-08-06 Uros Bizjak + + Backport from mainline + 2012-07-23 Uros Bizjak + + * config/i386/i386-protos.h (ix86_lea_outperforms): Remove prototype. + * config/i386/i386.c (ix86_lea_outperforms): Make static. Make + split_cost argument signed. + (ix86_use_lea_for_mov): Use INVALID_REGNUM instead of -1. + (ix86_avoid_lea_for_addr): Ditto. + + 2012-07-27 Uros Bizjak + + * config/i386/i386.c (ix86_avoid_lea_for_addr): Return false if + the address has less than two components. + +2012-08-02 Steve Ellcey + + Backport from mainline + 2012-07-19 Steve Ellcey + + * config/mips/mips.c (mips_set_mips16_mode): Clear SYNCI_MASK in + MIPS16 mode. + +2012-08-02 Uros Bizjak + + Backport from mainline + 2012-07-24 Uros Bizjak + + PR target/53961 + * config/i386/i386.c (ix86_legitimate_address_p): Move check for + negative constant address for TARGET_X32 ... + (ix86_decompose_address): ... here. Reject constant addresses + that don't satisfy x86_64_immediate_operand predicate. + + 2012-07-23 Uros Bizjak + + PR target/53961 + * config/i386/i386.md (*lea): Add asserts to detect invalid addresses. + * config/i386/i386.c (ix86_print_operand_address): Ditto. + (ix86_decompose_address): Allow (zero_extend:DI (subreg:SI (...))) + addresses. Prevent zero extensions of CONST_INT operands. + + 2012-07-22 Uros Bizjak + + PR target/53961 + * config/i386/i386.md (*lea): New insn pattern. + (*lea_1): Remove. + (*lea_2): Ditto. + (*lea_{3,4,5,6}_zext): Ditto. + * config/i386/predicates.md (lea_address_operand): Do not reject + zero-extended address operands. + * config/i386/constraints.md (j): Remove address constraint. + * config/i386/i386.c (ix86_decompose_address): Allow SImode subreg + of an address. + (ix86_print_operand_address): Handle SImode subreg of an address. + (ix86_avoid_lea_for_addr): Reject zero-extended addresses for now. + +2012-08-01 Uros Bizjak + + Backport from mainline + 2012-03-09 Uros Bizjak + + PR target/52530 + * config/i386/i386.c (ix86_print_operand): Handle 'E' operand modifier. + (ix86_print_operand_address): Handle UNSPEC_LEA_ADDR. Do not fallback + to set code to 'q'. + * config/i386/i386.md (UNSPEC_LEA_ADDR): New unspec. + (*movdi_internal_rex64): Use %E operand modifier for lea. + (*movsi_internal): Ditto. + (*lea_1): Ditto. + (*lea_2): Ditto. + (*lea_{3,4,5,6}_zext): Ditto. + (*tls_global_dynamic_32_gnu): Ditto. + (*tls_global_dynamic_64): Ditto. + (*tls_dynamic_gnu2_lea_32): Ditto. + (*tls_dynamic_gnu2_lea_64): Ditto. + (pro_epilogue_adjust_stack__add): Ditto. + +2012-08-01 Uros Bizjak + + Backport from mainline + 2012-08-01 Uros Bizjak + + * config/i386/i386.c (ix86_address_subreg_operand): Reject + stack pointer. + (ix86_print_operand_address): Assert that parts.base and parts.index + are non-NULL after call to simplify_subreg. + +2012-07-22 Oleg Endo + + PR target/33135 + * config/sh/sh.opt (mieee): Use Var instead of Mask. Correct + description. + * config/sh/sh.c (sh_option_override): Do not change + flag_finite_math_only. Set TARGET_IEEE to complement of + flag_finite_math_only. + * doc/invoke.texi (SH options): Add mno-ieee. Correct + description of mieee and mno-ieee behavior. + +2012-07-20 Kirill Yukhin + + PR target/53877 + * config/i386/lzcntintrin.h (_lzcnt_u32): New. + (_lzcnt_u64): Ditto. + +2012-07-20 Andrey Belevantsev + + Backport from mainline + 2012-03-06 Andrey Belevantsev + + PR rtl-optimization/52250 + * sel-sched-ir.c (maybe_tidy_empty_bb): Try harder to find a bb + to put note list into. Unconditionally call move_bb_info. + (move_bb_info): Do not assert the blocks being in the same region, + just drop the note list if they are not. + +2012-07-19 Eric Botcazou + + * config/sparc/sparc.md (adddi3_insn_sp32): Add earlyclobber. + +2012-07-19 Eric Botcazou + + * tree-ssa-forwprop.c (combine_conversions): Punt if the RHS of the + defining statement is a SSA name that occurs in abnormal PHIs. + +2012-07-19 Eric Botcazou + + * gimple-fold.c (canonicalize_constructor_val): Strip only useless type + conversions. + +2012-07-19 Richard Guenther + Eric Botcazou + + * tree-ssa-ccp.c (valid_lattice_transition): Clarify comment + about transition from invariant to known bits. + (likely_value): Addresses with UNDEFINED components are UNDEFINED. + +2012-07-19 Jakub Jelinek + + PR middle-end/54017 + * tree-cfgcleanup.c (cleanup_omp_return): Remove. + (cleanup_tree_cfg_bb): Don't call it. + * omp-low.c (expand_omp_sections): Fix up the !exit_reachable case + handling. + +2012-07-19 Christian Bruel + + PR target/54029 + * config/sh/sh.c (gen_far_branch): Set JUMP_LABEL for return jumps. + +2012-07-18 Ralf Corsépius + + * config.gcc (v850-*-rtems*): New target. + * config/v850/rtems.h: New. + * config/v850/t-rtems: New. + +2012-07-18 Nick Clifton + + * doc/invoke.texi (ARM Options): Document -munaligned-access. + +2012-07-15 Uros Bizjak + + PR target/53961 + + Backport from mainline + 2012-04-25 Jakub Jelinek + + PR target/53110 + * config/i386/i386.md (and3): For andq $0xffffffff, reg + instead expand it as zero extension. + +2012-07-14 Uros Bizjak + + * config/i386/i386.md (QImode and HImode cmove splitters): Merge + QImode and HImode splitters. Use ix86_comparison_operator. + Explicitly match FLAGS_REG. + (DFmode cmove splitter): Explicitly match FLAGS_REG. + +2012-07-13 Richard Sandiford + Steven Bosscher + Bernd Schmidt + + PR rtl-optimization/53908 + * df-problems.c (can_move_insns_across): When doing + memory-reference book-keeping, handle call insns. + +2012-07-10 Uros Bizjak + + Backport from mainline + 2012-07-03 Uros Bizjak + + PR target/53811 + * config/i386/i386.c (x86_output_mi_thunk): Check if fnaddr satisfies + sibcall_insn_operand. Move it to a temporary register if not. + + 2012-07-06 Uros Bizjak + + PR target/53853 + * config/i386/i386.c (x86_output_mi_thunk): For CM_LARGE_PIC model, + emit PIC sequence for fnaddr symbol reference in advance. + +2012-07-09 Jason Merrill + + PR c++/53882 + * tree.c (type_contains_placeholder_1): Handle NULLPTR_TYPE. + (type_hash_eq): Likewise. + + PR c++/53826 + * tree.c (build_zero_cst): Handle NULLPTR_TYPE. + +2012-07-07 Ulrich Weigand + + * combine.c (force_to_mode) [LSHIFTRT]: Avoid undefined behaviour + due to negative shift amount. + +2012-07-06 Kai Tietz + + Backport from mainline. + PR bootstrap/52947 + * config/i386/mingw32.h (NATIVE_SYSTEM_HEADER_DIR): Define it always + as "/mingw/include". + +2012-07-06 Nick Clifton + + * config/mn10300/mn10300.c (mn10300_encode_section_info): Call + default_encode_section_info. + +2012-07-06 Richard Guenther + + Backport from mainline + 2012-03-30 Richard Guenther + + PR middle-end/52786 + * double-int.c (rshift_double): Remove not needed cast. + + 2012-03-28 Richard Guenther + + PR middle-end/50708 + * double-int.h (rshift_double): Remove. + * double-int.c (lshift_double): Use absu_hwi to make count + positive. + (rshift_double): Make static, take unsigned count argument, + remove handling of negative count argument. + (double_int_rshift): Dispatch to lshift_double. + +2012-07-06 Richard Guenther + + Backport from mainline + 2012-06-18 Richard Guenther + + PR tree-optimization/53693 + * tree-vect-patterns.c (vect_operation_fits_smaller_type): + Reject operands with more than one use. + +2012-07-06 Richard Guenther + + Backport from mainline + 2012-04-11 Richard Guenther + + PR middle-end/52621 + * tree-chrec.c (evolution_function_is_invariant_rec_p): Properly + consider loop nesting. + (evolution_function_is_univariate_p): Properly check the remainder + for chrecs. + +2012-07-05 Pat Haugen + + Backport from mainline + 2012-05-24 Pat Haugen + + * config/rs6000/rs6000.c (rs6000_option_override_internal): Change + rs6000_sched_costly_dep default to true_store_to_load_dep_costly. + (adjacent_mem_locations): Move some code to and call... + (get_memref_parts): ...new function. + (mem_locations_overlap): New function. + (rs6000_adjust_priority): Adjust calls to is_load_insn/is_store_insn. + (is_mem_ref): Rename to... + (find_mem_ref): ...this. Return MEM rtx. + (get_store_dest): Remove function. + (is_load_insn1, is_load_insn, is_store_insn1, is_store_insn): Add + new parameter and adjust calls. + (rs6000_is_costly_dependence): Update calls for extra arg. Make sure + mem refs overlap for true_store_to_load_dep_costly. + (rs6000_sched_reorder2): Update calls for extra arg. Adjust args + passed to adjacent_mem_locations. + (is_costly_group): Walk resolved dependency list. + (force_new_group): Emit group ending nop for Power6/Power7. + * config/rs6000/rs6000.md (UNSPEC_GRP_END_NOP): New enum value. + (group_ending_nop): New define_insn. + +2012-07-04 Richard Guenther + + PR middle-end/53433 + * gimple-fold.c (get_base_constructor): Do not return an + error_mark_node DECL_INITIAL. + +2012-07-04 Uros Bizjak + + Backport from mainline + 2012-07-03 Uros Bizjak + + * config/i386/i386.c (ix86_option_override_internal): Fix wrong + code model string in the error message. + +2012-07-04 Tristan Gingold + + Backport from mainline. + 2012-06-25 Tristan Gingold + + * config/i386/winnt.c (i386_pe_seh_end_prologue): Move code to ... + (seh_cfa_adjust_cfa): ... that function. + (seh_emit_stackalloc): Do not emit out of range values. + * config/i386/i386.md: Delete unused UNSPEC_REG_SAVE, + UNSPEC_DEF_CFA constants. + * config/i386/i386.h (SEH_MAX_FRAME_SIZE): Define. + * config/i386/i386.c (ix86_frame_pointer_required): Required + for very large frames on SEH target. + (ix86_compute_frame_layout): Save area is before frame pointer + on SEH target. Handle very large frames. + (ix86_expand_prologue): Likewise. + +2012-07-04 Richard Guenther + + * tree.c (find_decls_types_r): Handle TYPE_CONTEXT the same + as in free_lang_data_in_type. + +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/tree-vect-loop-manip.c =================================================================== --- gcc/tree-vect-loop-manip.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/tree-vect-loop-manip.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -1993,7 +1993,7 @@ If the misalignment of DR is known at compile time: addr_mis = int mis = DR_MISALIGNMENT (dr); Else, compute address misalignment in bytes: - addr_mis = addr & (vectype_size - 1) + addr_mis = addr & (vectype_align - 1) prolog_niters = min (LOOP_NITERS, ((VF - addr_mis/elem_size)&(VF-1))/step) @@ -2049,9 +2049,10 @@ tree ptr_type = TREE_TYPE (start_addr); tree size = TYPE_SIZE (ptr_type); tree type = lang_hooks.types.type_for_size (tree_low_cst (size, 1), 1); - tree vectype_size_minus_1 = build_int_cst (type, vectype_align - 1); - tree elem_size_log = - build_int_cst (type, exact_log2 (vectype_align/nelements)); + tree vectype_align_minus_1 = build_int_cst (type, vectype_align - 1); + HOST_WIDE_INT elem_size = + int_cst_value (TYPE_SIZE_UNIT (TREE_TYPE (vectype))); + tree elem_size_log = build_int_cst (type, exact_log2 (elem_size)); tree nelements_minus_1 = build_int_cst (type, nelements - 1); tree nelements_tree = build_int_cst (type, nelements); tree byte_misalign; @@ -2060,10 +2061,10 @@ new_bb = gsi_insert_seq_on_edge_immediate (pe, new_stmts); gcc_assert (!new_bb); - /* Create: byte_misalign = addr & (vectype_size - 1) */ + /* Create: byte_misalign = addr & (vectype_align - 1) */ byte_misalign = fold_build2 (BIT_AND_EXPR, type, fold_convert (type, start_addr), - vectype_size_minus_1); + vectype_align_minus_1); /* Create: elem_misalign = byte_misalign / element_size */ elem_misalign = 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 190845) @@ -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/arm/di-longlong64-sync-withhelpers.c =================================================================== --- gcc/testsuite/gcc.target/arm/di-longlong64-sync-withhelpers.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.target/arm/di-longlong64-sync-withhelpers.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -2,8 +2,8 @@ /* { dg-require-effective-target arm_arch_v5_ok } */ /* { dg-options "-std=gnu99" } */ /* { dg-add-options arm_arch_v5 } */ -/* { dg-message "note: '__sync_fetch_and_nand' changed semantics in GCC 4.4" "" { target *-*-* } 0 } */ -/* { dg-message "note: '__sync_nand_and_fetch' changed semantics in GCC 4.4" "" { target *-*-* } 0 } */ +/* { dg-message "note: '__sync_fetch_and_nand' changed semantics in GCC 4.4" "fetch_and_nand" { target *-*-* } 0 } */ +/* { dg-message "note: '__sync_nand_and_fetch' changed semantics in GCC 4.4" "nand_and_fetch" { target *-*-* } 0 } */ /* { dg-message "file included" "In file included" { target *-*-* } 0 } */ #include "../../gcc.dg/di-longlong64-sync-1.c" Index: gcc/testsuite/gcc.target/arm/di-longlong64-sync-withldrexd.c =================================================================== --- gcc/testsuite/gcc.target/arm/di-longlong64-sync-withldrexd.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.target/arm/di-longlong64-sync-withldrexd.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -3,8 +3,8 @@ /* { dg-options "-marm -std=gnu99" } */ /* { dg-require-effective-target arm_arch_v6k_ok } */ /* { dg-add-options arm_arch_v6k } */ -/* { dg-message "note: '__sync_fetch_and_nand' changed semantics in GCC 4.4" "" { target *-*-* } 0 } */ -/* { dg-message "note: '__sync_nand_and_fetch' changed semantics in GCC 4.4" "" { target *-*-* } 0 } */ +/* { dg-message "note: '__sync_fetch_and_nand' changed semantics in GCC 4.4" "fetch_and_nand" { target *-*-* } 0 } */ +/* { dg-message "note: '__sync_nand_and_fetch' changed semantics in GCC 4.4" "nand_and_fetch" { target *-*-* } 0 } */ /* { dg-message "file included" "In file included" { target *-*-* } 0 } */ #include "../../gcc.dg/di-longlong64-sync-1.c" Index: gcc/testsuite/gcc.target/powerpc/lhs-1.c =================================================================== --- gcc/testsuite/gcc.target/powerpc/lhs-1.c (.../tags/gcc_4_7_1_release) (wersja 0) +++ gcc/testsuite/gcc.target/powerpc/lhs-1.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -0,0 +1,21 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */ +/* { dg-options "-O2 -mcpu=power5" } */ +/* { dg-final { scan-assembler-times "nop" 3 } } */ + +/* Test generation of nops in load hit store situation. */ + +typedef union { + double val; + struct { + unsigned int w1; + unsigned int w2; + }; +} words; + +unsigned int f (double d, words *u) +{ + u->val = d; + return u->w2; +} + Index: gcc/testsuite/gcc.target/powerpc/lhs-2.c =================================================================== --- gcc/testsuite/gcc.target/powerpc/lhs-2.c (.../tags/gcc_4_7_1_release) (wersja 0) +++ gcc/testsuite/gcc.target/powerpc/lhs-2.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -0,0 +1,21 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */ +/* { dg-options "-O2 -mcpu=power6 -msched-groups" } */ +/* { dg-final { scan-assembler "ori 1,1,0" } } */ + +/* Test generation of group ending nop in load hit store situation. */ +typedef union { + double val; + struct { + unsigned int w1; + unsigned int w2; + }; +} words; + +unsigned int f (double d) +{ + words u; + u.val = d; + return u.w2; +} + Index: gcc/testsuite/gcc.target/powerpc/lhs-3.c =================================================================== --- gcc/testsuite/gcc.target/powerpc/lhs-3.c (.../tags/gcc_4_7_1_release) (wersja 0) +++ gcc/testsuite/gcc.target/powerpc/lhs-3.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -0,0 +1,21 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */ +/* { dg-options "-O2 -mcpu=power7" } */ +/* { dg-final { scan-assembler "ori 2,2,0" } } */ + +/* Test generation of group ending nop in load hit store situation. */ +typedef union { + double val; + struct { + unsigned int w1; + unsigned int w2; + }; +} words; + +unsigned int f (double d) +{ + words u; + u.val = d; + return u.w2; +} + 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 190845) +++ gcc/testsuite/gcc.target/i386/xop-imul32widen-vector.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -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/pr54157.c =================================================================== --- gcc/testsuite/gcc.target/i386/pr54157.c (.../tags/gcc_4_7_1_release) (wersja 0) +++ gcc/testsuite/gcc.target/i386/pr54157.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -0,0 +1,21 @@ +/* { dg-do compile { target { ! { ia32 } } } } */ +/* { dg-options "-O2 -mx32 -ftree-vectorize" } */ + +struct s2{ + int n[24 -1][24 -1][24 -1]; +}; + +struct test2{ + struct s2 e; +}; + +struct test2 tmp2[4]; + +void main1 () +{ + int i,j; + + for (i = 0; i < 24 -4; i++) + for (j = 0; j < 24 -4; j++) + tmp2[2].e.n[1][i][j] = 8; +} Index: gcc/testsuite/gcc.target/i386/pr46254.c =================================================================== --- gcc/testsuite/gcc.target/i386/pr46254.c (.../tags/gcc_4_7_1_release) (wersja 0) +++ gcc/testsuite/gcc.target/i386/pr46254.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target lp64 } */ +/* { dg-require-effective-target fpic } */ +/* { dg-options "-O2 -mcx16 -fpic -mcmodel=large" } */ + +__int128 i; + +void test () +{ + __sync_val_compare_and_swap (&i, i, i); +} 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 190845) @@ -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/go.test/test/named1.go =================================================================== --- gcc/testsuite/go.test/test/named1.go (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/go.test/test/named1.go (.../branches/gcc-4_7-branch) (wersja 190845) @@ -37,8 +37,8 @@ asBool(true) asBool(*&b) asBool(Bool(true)) - asBool(1 != 2) // ERROR "cannot use.*type bool.*as type Bool" - asBool(i < j) // ERROR "cannot use.*type bool.*as type Bool" + asBool(1 != 2) // ok now + asBool(i < j) // ok now _, b = m[2] // ERROR "cannot .* bool.*type Bool" Index: gcc/testsuite/g++.old-deja/g++.other/typename1.C =================================================================== --- gcc/testsuite/g++.old-deja/g++.other/typename1.C (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/g++.old-deja/g++.other/typename1.C (.../branches/gcc-4_7-branch) (wersja 190845) @@ -13,5 +13,5 @@ template void f() { - Vector::iterator i = 0; // { dg-error "typename" } missing typename -} // { dg-error "expected" "" { target *-*-* } 16 } + Vector::iterator i = 0; // { dg-error "typename" "typename" } missing typename +} // { dg-error "expected" "expected" { target *-*-* } 16 } Index: gcc/testsuite/g++.old-deja/g++.pt/niklas01a.C =================================================================== --- gcc/testsuite/g++.old-deja/g++.pt/niklas01a.C (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/g++.old-deja/g++.pt/niklas01a.C (.../branches/gcc-4_7-branch) (wersja 190845) @@ -2,8 +2,8 @@ // { dg-options "-fshow-column" } struct A { // { dg-error "" } forward declaration - friend struct B : A { // { dg-error "invalid use of incomplete type 'struct A" } + friend struct B : A { // { dg-error "invalid use of incomplete type 'struct A" "invalid" } int x; - }; // { dg-error "class definition may not be declared a friend" "" { target *-*-* } { 5 } } + }; // { dg-error "class definition may not be declared a friend" "may not" { target *-*-* } { 5 } } int y; }; Index: gcc/testsuite/lib/profopt.exp =================================================================== --- gcc/testsuite/lib/profopt.exp (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/lib/profopt.exp (.../branches/gcc-4_7-branch) (wersja 190845) @@ -64,8 +64,6 @@ { -Os } ] } -set prof_option_list $PROFOPT_OPTIONS - # # profopt-cleanup -- remove profiling or performance results files. # @@ -215,10 +213,11 @@ # proc profopt-execute { src } { global srcdir tmpdir - global prof_option_list + global PROFOPT_OPTIONS global tool profile_option feedback_option prof_ext perf_ext perf_delta global generate_final_code use_final_code global verbose + global testname_with_flags if ![info exists profile_option] { error "No profile option specified for first compile." @@ -227,6 +226,12 @@ error "No feedback option specified for second compile." } + # Use the default option list or one defined for a set of tests. + if ![info exists PROFOPT_OPTIONS] { + error "PROFOPT_OPTIONS is not defined" + } + set prof_option_list $PROFOPT_OPTIONS + regsub "(?q)$srcdir/" $src "" testcase # If we couldn't rip $srcdir out of `src' then just do the best we can. # The point is to reduce the unnecessary noise in the logs. Don't strip @@ -236,6 +241,12 @@ set testcase "[file tail [file dirname $src]]/[file tail $src]" } + # Several procedures access the name of the test with torture flags, + # normally defined in dg-test. Profile optimization tests don't + # use dg-test, so define it here to make it accessible via + # testname-for-summary. + set testname_with_flags $testcase + set executable $tmpdir/[file tail [file rootname $src].x] set basename [file tail $testcase] set base [file rootname $basename] @@ -268,6 +279,7 @@ set extra_flags [profopt-get-options $src] if { [lindex ${dg-do-what} 1 ] == "N" } { unsupported "$src" + unset testname_with_flags verbose "$src not supported on this target, skipping it" 3 return } @@ -433,4 +445,5 @@ remote_file build delete $execname3 } } + unset testname_with_flags } Index: gcc/testsuite/lib/gcc-dg.exp =================================================================== --- gcc/testsuite/lib/gcc-dg.exp (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/lib/gcc-dg.exp (.../branches/gcc-4_7-branch) (wersja 190845) @@ -432,10 +432,7 @@ # Remove compiler-generated coverage files for the current test. proc cleanup-coverage-files { } { - # This assumes that we are two frames down from dg-test or some other proc - # that stores the filename of the testcase in a local variable "name". - # A cleaner solution would require a new DejaGnu release. - upvar 2 name testcase + set testcase [testname-for-summary] # The name might include a list of options; extract the file name. set testcase [lindex $testcase 0] remove-build-file "[file rootname [file tail $testcase]].gc??" @@ -450,10 +447,7 @@ # Remove compiler-generated files from -repo for the current test. proc cleanup-repo-files { } { - # This assumes that we are two frames down from dg-test or some other proc - # that stores the filename of the testcase in a local variable "name". - # A cleaner solution would require a new DejaGnu release. - upvar 2 name testcase + set testcase [testname-for-summary] # The name might include a list of options; extract the file name. set testcase [lindex $testcase 0] remove-build-file "[file rootname [file tail $testcase]].o" @@ -491,10 +485,7 @@ # Remove a stack usage file for the current test. proc cleanup-stack-usage { } { - # This assumes that we are two frames down from dg-test or some other proc - # that stores the filename of the testcase in a local variable "name". - # A cleaner solution would require a new DejaGnu release. - upvar 2 name testcase + set testcase [testname-for-summary] # The name might include a list of options; extract the file name. set testcase [lindex $testcase 0] remove-build-file "[file rootname [file tail $testcase]].su" @@ -509,10 +500,7 @@ # Remove all dump files with the provided suffix. proc cleanup-dump { suffix } { - # This assumes that we are three frames down from dg-test or some other - # proc that stores the filename of the testcase in a local variable - # "name". A cleaner solution would require a new DejaGnu release. - upvar 3 name testcase + set testcase [testname-for-summary] # The name might include a list of options; extract the file name. set src [file tail [lindex $testcase 0]] remove-build-file "[file tail $src].$suffix" @@ -549,10 +537,7 @@ } } - # This assumes that we are two frames down from dg-test or some other proc - # that stores the filename of the testcase in a local variable "name". - # A cleaner solution would require a new DejaGnu release. - upvar 2 name testcase + set testcase [testname-for-summary] # The name might include a list of options; extract the file name. set testcase [lindex $testcase 0] foreach suffix $suffixes { @@ -590,7 +575,7 @@ set text [read $fd] close $fd - upvar 2 name testcase + set testcase [testname-for-summary] if [regexp -- [lindex $args 1] $text] { pass "$testcase scan-module [lindex $args 1]" } else { @@ -608,7 +593,7 @@ set text [read $fd] close $fd - upvar 2 name testcase + set testcase [testname-for-summary] if [regexp -- [lindex $args 1] $text] { fail "$testcase scan-module [lindex $args 1]" } else { @@ -628,8 +613,8 @@ } } - # Access variables from gcc-dg-test-1. - upvar 2 name testcase + set testcase [testname-for-summary] + # Access variable from gcc-dg-test-1. upvar 2 output_file output_file if [file exists $output_file] { @@ -651,8 +636,8 @@ } } - # Access variables from gcc-dg-test-1. - upvar 2 name testcase + set testcase [testname-for-summary] + # Access variable from gcc-dg-test-1. upvar 2 output_file output_file if [file exists $output_file] { @@ -680,6 +665,7 @@ global errorInfo global compiler_conditional_xfail_data global shouldfail + global testname_with_flags if { [ catch { eval saved-dg-test $args } errmsg ] } { set saved_info $errorInfo @@ -690,6 +676,9 @@ if [info exists compiler_conditional_xfail_data] { unset compiler_conditional_xfail_data } + if [info exists testname_with_flags] { + unset testname_with_flags + } unset_timeout_vars error $errmsg $saved_info } @@ -701,6 +690,9 @@ if [info exists compiler_conditional_xfail_data] { unset compiler_conditional_xfail_data } + if [info exists testname_with_flags] { + unset testname_with_flags + } } } Index: gcc/testsuite/lib/scanasm.exp =================================================================== --- gcc/testsuite/lib/scanasm.exp (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/lib/scanasm.exp (.../branches/gcc-4_7-branch) (wersja 190845) @@ -78,10 +78,8 @@ # dg-scan for details. proc scan-assembler { args } { - upvar 2 name testcase - set testcase [lindex $testcase 0] + set testcase [testname-for-summary] set output_file "[file rootname [file tail $testcase]].s" - dg-scan "scan-assembler" 1 $testcase $output_file $args } @@ -94,8 +92,7 @@ # compiler. See dg-scan for details. proc scan-assembler-not { args } { - upvar 2 name testcase - set testcase [lindex $testcase 0] + set testcase [testname-for-summary] set output_file "[file rootname [file tail $testcase]].s" dg-scan "scan-assembler-not" 0 $testcase $output_file $args @@ -125,8 +122,7 @@ # produced by the compiler. proc scan-hidden { args } { - upvar 2 name testcase - set testcase [lindex $testcase 0] + set testcase [testname-for-summary] set output_file "[file rootname [file tail $testcase]].s" set symbol [lindex $args 0] @@ -142,8 +138,7 @@ # produced by the compiler. proc scan-not-hidden { args } { - upvar 2 name testcase - set testcase [lindex $testcase 0] + set testcase [testname-for-summary] set output_file "[file rootname [file tail $testcase]].s" set symbol [lindex $args 0] @@ -157,8 +152,7 @@ # Look for a pattern in OUTPUT_FILE. See dg-scan for details. proc scan-file { output_file args } { - upvar 2 name testcase - set testcase [lindex $testcase 0] + set testcase [testname-for-summary] dg-scan "scan-file" 1 $testcase $output_file $args } @@ -166,8 +160,7 @@ # for details. proc scan-file-not { output_file args } { - upvar 2 name testcase - set testcase [lindex $testcase 0] + set testcase [testname-for-summary] dg-scan "scan-file-not" 0 $testcase $output_file $args } @@ -175,8 +168,7 @@ # dg-scan for details. proc scan-stack-usage { args } { - upvar 2 name testcase - set testcase [lindex $testcase 0] + set testcase [testname-for-summary] set output_file "[file rootname [file tail $testcase]].su" dg-scan "scan-file" 1 $testcase $output_file $args @@ -186,8 +178,7 @@ # compiler. See dg-scan for details. proc scan-stack-usage-not { args } { - upvar 2 name testcase - set testcase [lindex $testcase 0] + set testcase [testname-for-summary] set output_file "[file rootname [file tail $testcase]].su" dg-scan "scan-file-not" 0 $testcase $output_file $args @@ -212,12 +203,7 @@ } } - # This assumes that we are two frames down from dg-test, and that - # it still stores the filename of the testcase in a local variable "name". - # A cleaner solution would require a new dejagnu release. - upvar 2 name testcase - set testcase [lindex $testcase 0] - + set testcase [testname-for-summary] set pattern [lindex $args 0] set pp_pattern [make_pattern_printable $pattern] @@ -275,8 +261,7 @@ verbose -log "c++filt is $cxxfilt" } - upvar 2 name testcase - set testcase [lindex $testcase 0] + set testcase [testname-for-summary] set pattern [lindex $args 0] set pp_pattern [make_pattern_printable $pattern] set output_file "[file rootname [file tail $testcase]].s" @@ -330,8 +315,7 @@ verbose -log "c++filt is $cxxfilt" } - upvar 2 name testcase - set testcase [lindex $testcase 0] + set testcase [testname-for-summary] set pattern [lindex $args 0] set pp_pattern [make_pattern_printable $pattern] set output_file "[file rootname [file tail $testcase]].s" @@ -386,9 +370,7 @@ verbose -log "size is $size" } - upvar 2 name testcase - set testcase [lindex $testcase 0] - + set testcase [testname-for-summary] set what [lindex $args 0] set where [lsearch { text data bss total } $what] if { $where == -1 } { Index: gcc/testsuite/lib/gcov.exp =================================================================== --- gcc/testsuite/lib/gcov.exp (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/lib/gcov.exp (.../branches/gcc-4_7-branch) (wersja 190845) @@ -34,12 +34,14 @@ # # verify-lines -- check that line counts are as expected # -# TESTCASE is the name of the test. +# TESTNAME is the name of the test, including unique flags. +# TESTCASE is the name of the test file. # FILE is the name of the gcov output file. # -proc verify-lines { testcase file } { +proc verify-lines { testname testcase file } { #send_user "verify-lines\n" global subdir + set failed 0 set fd [open $file r] while { [gets $fd line] >= 0 } { @@ -54,13 +56,13 @@ } } if { $is == "" } { - fail "$subdir/$testcase:$n:no data available for this line" + fail "$testname line $n: no data available" incr failed } elseif { $is != $shouldbe } { - fail "$subdir/$testcase:$n:is $is:should be $shouldbe" + fail "$testname line $n: is $is:should be $shouldbe" incr failed } else { - pass "$subdir/$testcase:$n line count" + pass "$testname count for line $n" } } } @@ -71,7 +73,8 @@ # # verify-branches -- check that branch percentages are as expected # -# TESTCASE is the name of the test. +# TESTNAME is the name of the test, including unique flags. +# TESTCASE is the name of the test file. # FILE is the name of the gcov output file. # # Checks are based on comments in the source file. This means to look for @@ -86,8 +89,9 @@ # branch instructions. Don't check for branches that might be # optimized away or replaced with predicated instructions. # -proc verify-branches { testcase file } { +proc verify-branches { testname testcase file } { #send_user "verify-branches\n" + set failed 0 set shouldbe "" set fd [open $file r] @@ -99,7 +103,7 @@ if [regexp "branch\\((\[0-9 \]+)\\)" "$line" all new_shouldbe] { # All percentages in the current list should have been seen. if {[llength $shouldbe] != 0} { - fail "$n: expected branch percentages not found: $shouldbe" + fail "$testname line $n: expected branch percentages not found: $shouldbe" incr failed set shouldbe "" } @@ -117,14 +121,14 @@ } elseif [regexp "branch +\[0-9\]+ taken (-\[0-9\]+)%" "$line" \ all taken] { # Percentages should never be negative. - fail "$n: negative percentage: $taken" + fail "$testname line $n: negative percentage: $taken" incr failed } elseif [regexp "branch +\[0-9\]+ taken (\[0-9\]+)%" "$line" \ all taken] { #send_user "$n: taken = $taken\n" # Percentages should never be greater than 100. if {$taken > 100} { - fail "$n: percentage greater than 100: $taken" + fail "$testname line $n: branch percentage greater than 100: $taken" incr failed } if {$taken > 50} { @@ -139,7 +143,7 @@ } elseif [regexp "branch\\(end\\)" "$line"] { # All percentages in the list should have been seen by now. if {[llength $shouldbe] != 0} { - fail "$n: expected branch percentages not found: $shouldbe" + fail "$testname line n: expected branch percentages not found: $shouldbe" incr failed } set shouldbe "" @@ -148,7 +152,7 @@ } # All percentages in the list should have been seen. if {[llength $shouldbe] != 0} { - fail "$n: expected branch percentages not found: $shouldbe" + fail "$testname line $n: expected branch percentages not found: $shouldbe" incr failed } close $fd @@ -158,7 +162,8 @@ # # verify-calls -- check that call return percentages are as expected # -# TESTCASE is the name of the test. +# TESTNAME is the name of the test, including unique flags. +# TESTCASE is the name of the test file. # FILE is the name of the gcov output file. # # Checks are based on comments in the source file. This means to look for @@ -173,8 +178,9 @@ # call instructions. Don't check for calls that are inserted by the # compiler or that might be inlined. # -proc verify-calls { testcase file } { +proc verify-calls { testname testcase file } { #send_user "verify-calls\n" + set failed 0 set shouldbe "" set fd [open $file r] @@ -186,7 +192,7 @@ if [regexp "returns\\((\[0-9 \]+)\\)" "$line" all new_shouldbe] { # All percentages in the current list should have been seen. if {[llength $shouldbe] != 0} { - fail "$n: expected return percentages not found: $shouldbe" + fail "$testname line $n: expected return percentages not found: $shouldbe" incr failed set shouldbe "" } @@ -195,7 +201,7 @@ } elseif [regexp "call +\[0-9\]+ returned (-\[0-9\]+)%" "$line" \ all returns] { # Percentages should never be negative. - fail "$n: negative percentage: $returns" + fail "$testname line $n: negative percentage: $returns" incr failed } elseif [regexp "call +\[0-9\]+ returned (\[0-9\]+)%" "$line" \ all returns] { @@ -212,7 +218,7 @@ } elseif [regexp "returns\\(end\\)" "$line"] { # All percentages in the list should have been seen by now. if {[llength $shouldbe] != 0} { - fail "$n: expected return percentages not found: $shouldbe" + fail "$testname line $n: expected return percentages not found: $shouldbe" incr failed } set shouldbe "" @@ -221,7 +227,7 @@ } # All percentages in the list should have been seen. if {[llength $shouldbe] != 0} { - fail "$n: expected return percentages not found: $shouldbe" + fail "$testname line $n: expected return percentages not found: $shouldbe" incr failed } close $fd @@ -259,7 +265,9 @@ } } - # Extract the test name from the arguments. + set testname [testname-for-summary] + + # Extract the test file name from the arguments. set testcase [lindex $gcov_args end] verbose "Running $GCOV $testcase" 2 @@ -269,7 +277,7 @@ if { $xfailed } { setup_xfail "*-*-*" } - fail "$subdir/$testcase gcov failed: [lindex $result 1]" + fail "$testname gcov failed: [lindex $result 1]" clean-gcov $testcase return } @@ -280,24 +288,24 @@ if { $xfailed } { setup_xfail "*-*-*" } - fail "$subdir/$testcase gcov failed: $testcase.gcov does not exist" + fail "$testname gcov failed: $testcase.gov does not exist" clean-gcov $testcase return } remote_upload host $testcase.gcov $testcase.gcov # Check that line execution counts are as expected. - set lfailed [verify-lines $testcase $testcase.gcov] + set lfailed [verify-lines $testname $testcase $testcase.gcov] # If requested via the .x file, check that branch and call information # is correct. if { $gcov_verify_branches } { - set bfailed [verify-branches $testcase $testcase.gcov] + set bfailed [verify-branches $testname $testcase $testcase.gcov] } else { set bfailed 0 } if { $gcov_verify_calls } { - set cfailed [verify-calls $testcase $testcase.gcov] + set cfailed [verify-calls $testname $testcase $testcase.gcov] } else { set cfailed 0 } @@ -309,9 +317,9 @@ setup_xfail "*-*-*" } if { $tfailed > 0 } { - fail "$subdir/$testcase gcov: $lfailed failures in line counts, $bfailed in branch percentages, $cfailed in return percentages" + fail "$testname gcov: $lfailed failures in line counts, $bfailed in branch percentages, $cfailed in return percentages" } else { - pass "$subdir/$testcase gcov" + pass "$testname gcov" clean-gcov $testcase } } Index: gcc/testsuite/lib/dg-pch.exp =================================================================== --- gcc/testsuite/lib/dg-pch.exp (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/lib/dg-pch.exp (.../branches/gcc-4_7-branch) (wersja 190845) @@ -50,14 +50,16 @@ # Ensure that the PCH file is used, not the original header. file_on_host delete "$bname$suffix" - dg-test -keep-output $test "$otherflags $flags -I." "" + # The flags "-Dwith_PCH" and "-Dwithout_PCH" are to distinguish the + # two compiles in test summary lines. + dg-test -keep-output $test "$otherflags $flags -I. -Dwith_PCH" "" file_on_host delete "$bname$suffix.gch" if { !$have_errs } { if { [ file_on_host exists "$bname.s" ] } { remote_upload host "$bname.s" "$bname.s-gch" remote_download host "$bname.s-gch" gcc_copy_files "[file rootname $test]${suffix}s" "$bname$suffix" - dg-test -keep-output $test "$otherflags $flags -I." "" + dg-test -keep-output $test "$otherflags $flags -I. -Dwithout_PCH" "" remote_upload host "$bname.s" set tmp [ diff "$bname.s" "$bname.s-gch" ] if { $tmp == 0 } { @@ -89,4 +91,4 @@ proc dg-pch { subdir test options suffix } { return [dg-flags-pch $subdir $test "" $options $suffix] -} \ Brak znaku nowej linii na końcu pliku +} Index: gcc/testsuite/lib/scandump.exp =================================================================== --- gcc/testsuite/lib/scandump.exp (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/lib/scandump.exp (.../branches/gcc-4_7-branch) (wersja 190845) @@ -45,13 +45,11 @@ } } - # This assumes that we are three frames down from dg-test, and that - # it still stores the filename of the testcase in a local variable "name". - # A cleaner solution would require a new DejaGnu release. - upvar 3 name testcase + set testcase [testname-for-summary] + set printable_pattern [make_pattern_printable [lindex $args 1]] set suf [dump-suffix [lindex $args 2]] - set testname "$testcase scan-[lindex $args 0]-dump $suf \"[lindex $args 1]\"" + set testname "$testcase scan-[lindex $args 0]-dump $suf \"$printable_pattern\"" set src [file tail [lindex $testcase 0]] set output_file "[glob -nocomplain $src.[lindex $args 2]]" if { $output_file == "" } { @@ -88,13 +86,10 @@ } } - # This assumes that we are three frames down from dg-test, and that - # it still stores the filename of the testcase in a local variable "name". - # A cleaner solution would require a new DejaGnu release. - upvar 3 name testcase - + set testcase [testname-for-summary] set suf [dump-suffix [lindex $args 3]] - set testname "$testcase scan-[lindex $args 0]-dump-times $suf \"[lindex $args 1]\" [lindex $args 2]" + set printable_pattern [make_pattern_printable [lindex $args 1]] + set testname "$testcase scan-[lindex $args 0]-dump-times $suf \"$printable_pattern\" [lindex $args 2]" set src [file tail [lindex $testcase 0]] set output_file "[glob -nocomplain $src.[lindex $args 3]]" if { $output_file == "" } { @@ -131,13 +126,10 @@ } } - # This assumes that we are three frames down from dg-test, and that - # it still stores the filename of the testcase in a local variable "name". - # A cleaner solution would require a new DejaGnu release. - upvar 3 name testcase - + set testcase [testname-for-summary] + set printable_pattern [make_pattern_printable [lindex $args 1]] set suf [dump-suffix [lindex $args 2]] - set testname "$testcase scan-[lindex $args 0]-dump-not $suf \"[lindex $args 1]\"" + set testname "$testcase scan-[lindex $args 0]-dump-not $suf \"$printable_pattern\"" set src [file tail [lindex $testcase 0]] set output_file "[glob -nocomplain $src.[lindex $args 2]]" if { $output_file == "" } { @@ -187,9 +179,10 @@ verbose -log "c++filt is $cxxfilt" } - upvar 3 name testcase + set testcase [testname-for-summary] + set printable_pattern [make_pattern_printable [lindex $args 1]] set suf [dump-suffix [lindex $args 2]] - set testname "$testcase scan-[lindex $args 0]-dump-dem $suf \"[lindex $args 1]\"" + set testname "$testcase scan-[lindex $args 0]-dump-dem $suf \"$printable_pattern\"" set src [file tail [lindex $testcase 0]] set output_file "[glob -nocomplain $src.[lindex $args 2]]" if { $output_file == "" } { @@ -238,10 +231,10 @@ verbose -log "c++filt is $cxxfilt" } - upvar 3 name testcase - + set testcase [testname-for-summary] + set printable_pattern [make_pattern_printable [lindex $args 1] set suf [dump-suffix [lindex $args 2]] - set testname "$testcase scan-[lindex $args 0]-dump-dem-not $suf \"[lindex $args 1]\"" + set testname "$testcase scan-[lindex $args 0]-dump-dem-not $suf \"$printable_pattern\"" set src [file tail [lindex $testcase 0]] set output_file "[glob -nocomplain $src.[lindex $args 2]]" if { $output_file == "" } { Index: gcc/testsuite/lib/target-supports-dg.exp =================================================================== --- gcc/testsuite/lib/target-supports-dg.exp (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/lib/target-supports-dg.exp (.../branches/gcc-4_7-branch) (wersja 190845) @@ -31,6 +31,34 @@ return "$flags1 $flags2" } +# DejaGnu's dg-test defines a test name that includes torture options +# which is used in most pass/fail messages. Grab a copy of it. + +proc testname-for-summary { } { + global testname_with_flags + + # A variable called "name" is too generic, so identify dg-test by + # the existence of dg-extra-tool-flags. + if ![info exists testname_with_flags] { + set frames 2 + while { ![info exists flags] } { + set frames [expr $frames + 1] + upvar $frames dg-extra-tool-flags flags + } + + # We've got the stack level for dg-test; get the variable we want. + upvar $frames name name + set testname_with_flags $name + + # If there are flags, add an extra space to improve readability of + # the test summary. + if { [llength $testname_with_flags] > 1 } { + set testname_with_flags "$testname_with_flags " + } + } + return "$testname_with_flags" +} + # If this target does not support weak symbols, skip this test. proc dg-require-weak { args } { Index: gcc/testsuite/lib/target-supports.exp =================================================================== --- gcc/testsuite/lib/target-supports.exp (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/lib/target-supports.exp (.../branches/gcc-4_7-branch) (wersja 190845) @@ -3370,6 +3370,26 @@ return $et_natural_alignment_64_saved } +# Return 1 if all vector types are naturally aligned (aligned to their +# type-size), 0 otherwise. +# +# This won't change for different subtargets so cache the result. + +proc check_effective_target_vect_natural_alignment { } { + global et_vect_natural_alignment + + if [info exists et_vect_natural_alignment_saved] { + verbose "check_effective_target_vect_natural_alignment: using cached result" 2 + } else { + set et_vect_natural_alignment_saved 1 + if { [check_effective_target_arm_eabi] } { + set et_vect_natural_alignment_saved 0 + } + } + verbose "check_effective_target_vect_natural_alignment: returning $et_vect_natural_alignment_saved" 2 + return $et_vect_natural_alignment_saved +} + # Return 1 if vector alignment (for types of size 32 bit or less) is reachable, 0 otherwise. # # This won't change for different subtargets so cache the result. 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 190845) +++ gcc/testsuite/gfortran.dg/gomp/appendix-a/a.35.1.f90 (.../branches/gcc-4_7-branch) (wersja 190845) @@ -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 190845) +++ gcc/testsuite/gfortran.dg/gomp/appendix-a/a.35.3.f90 (.../branches/gcc-4_7-branch) (wersja 190845) @@ -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 190845) +++ gcc/testsuite/gfortran.dg/gomp/appendix-a/a.35.4.f90 (.../branches/gcc-4_7-branch) (wersja 190845) @@ -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 190845) +++ gcc/testsuite/gfortran.dg/gomp/appendix-a/a.35.6.f90 (.../branches/gcc-4_7-branch) (wersja 190845) @@ -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 190845) @@ -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/inline_sum_4.f90 =================================================================== --- gcc/testsuite/gfortran.dg/inline_sum_4.f90 (.../tags/gcc_4_7_1_release) (wersja 0) +++ gcc/testsuite/gfortran.dg/inline_sum_4.f90 (.../branches/gcc-4_7-branch) (wersja 190845) @@ -0,0 +1,19 @@ +! { dg-do compile } +! +! PR fortran/53732 +! this was leading to an internal "mismatching comparison operand types" +! error. +! +! Original testcase by minzastro +! Fixed by Dominique Dhumieres + +program test +implicit none + +real(8) arr(4,4,4,4) + +arr(:,:,:,:) = 1d0 + +arr(1,:,:,:) = sum(arr, dim=1, mask=(arr(:,:,:,:) > 0d0)) + +end program test 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 190845) @@ -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/pr52621.f90 =================================================================== --- gcc/testsuite/gfortran.dg/pr52621.f90 (.../tags/gcc_4_7_1_release) (wersja 0) +++ gcc/testsuite/gfortran.dg/pr52621.f90 (.../branches/gcc-4_7-branch) (wersja 190845) @@ -0,0 +1,20 @@ +! { dg-do compile } +! { dg-options "-O2 -fprefetch-loop-arrays -w" } + + SUBROUTINE GHDSYM(IZ,IS,LMMAX,S,LMS,Y,L2M,DRL,NLAY2,K0,DCUT)!, +! + COMPLEX Y(L2M,L2M),H(33),S(LMS) + COMPLEX RU,CI,CZ,K0,FF,Z,Z1,Z2,Z3,ST +! + DO 140 KK=1,4 + DO 130 L=1,L2M + L1=L*L-L + DO 120 M=1,L + IPM=L1+M + IMM=L1-M+2 + S(IPM)=S(IPM)+Z3*Y(L,M) + IF (M.NE.1) S(IMM)=S(IMM)+Z3*Y(M-1,L)*CSGN +120 CONTINUE +130 CONTINUE +140 CONTINUE + 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 190845) @@ -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/gcc.c-torture/compile/sync-1.c =================================================================== --- gcc/testsuite/gcc.c-torture/compile/sync-1.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.c-torture/compile/sync-1.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -1,5 +1,5 @@ -/* { dg-message "note: '__sync_fetch_and_nand' changed semantics in GCC 4.4" "" { target *-*-* } 0 } */ -/* { dg-message "note: '__sync_nand_and_fetch' changed semantics in GCC 4.4" "" { target *-*-* } 0 } */ +/* { dg-message "note: '__sync_fetch_and_nand' changed semantics in GCC 4.4" "fetch_and_nand" { target *-*-* } 0 } */ +/* { dg-message "note: '__sync_nand_and_fetch' changed semantics in GCC 4.4" "nand_and_fetch" { target *-*-* } 0 } */ /* { dg-options "-ffat-lto-objects" } */ /* Validate that each of the __sync builtins compiles. This won't Index: gcc/testsuite/gnat.dg/aggr20.adb =================================================================== --- gcc/testsuite/gnat.dg/aggr20.adb (.../tags/gcc_4_7_1_release) (wersja 0) +++ gcc/testsuite/gnat.dg/aggr20.adb (.../branches/gcc-4_7-branch) (wersja 190845) @@ -0,0 +1,10 @@ +-- { dg-do compile } + +package body Aggr20 is + + procedure Proc (R : out Rec3) is + begin + R := (Callback => Nil_Rec2); + end; + +end Aggr20; Index: gcc/testsuite/gnat.dg/aggr20.ads =================================================================== --- gcc/testsuite/gnat.dg/aggr20.ads (.../tags/gcc_4_7_1_release) (wersja 0) +++ gcc/testsuite/gnat.dg/aggr20.ads (.../branches/gcc-4_7-branch) (wersja 190845) @@ -0,0 +1,24 @@ +with Aggr20_Pkg; use Aggr20_Pkg; +with System; + +package Aggr20 is + + type Rec1 is record + Address : System.Address; + end record; + + Nil_Rec1 : constant Rec1 := (Address => Default_Nil_Address); + + type Rec2 is record + Callback : Rec1; + end record; + + Nil_Rec2 : constant Rec2 := (Callback => Nil_Rec1); + + type Rec3 is record + Callback : Rec2; + end record; + + procedure Proc (R : out Rec3); + +end Aggr20; Index: gcc/testsuite/gnat.dg/derived_type3_pkg.adb =================================================================== --- gcc/testsuite/gnat.dg/derived_type3_pkg.adb (.../tags/gcc_4_7_1_release) (wersja 0) +++ gcc/testsuite/gnat.dg/derived_type3_pkg.adb (.../branches/gcc-4_7-branch) (wersja 190845) @@ -0,0 +1,42 @@ +with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; +with Ada.Text_IO; use Ada.Text_IO; + +package body Derived_Type3_Pkg is + + type Parent is tagged null record; + + type Child is new Parent with + record + Image : Ada.Strings.Unbounded.Unbounded_String; + end record; + + function Set_Image return Child'class is + Local_Data : Child; + begin + Local_Data.Image := To_Unbounded_String ("Hello"); + return Local_Data; + end Set_Image; + + procedure Proc1 is + The_Data : Parent'class := Set_Image; + begin + Put_Line ("Child'Alignment =" & Child'Alignment'Img); + Put_Line ("The_Data'Alignment =" & The_Data'Alignment'Img); + end; + + procedure Proc2 is + + procedure Nested (X : Parent'Class) is + The_Data : Parent'Class := X; + begin + Put_Line ("Child'Alignment =" & Child'Alignment'Img); + Put_Line ("The_Data'Alignment =" & The_Data'Alignment'Img); + end; + + The_Data : Parent'Class := Set_Image; + + begin + Nested (The_Data); + end; + +end Derived_Type3_Pkg; Index: gcc/testsuite/gnat.dg/derived_type3_pkg.ads =================================================================== --- gcc/testsuite/gnat.dg/derived_type3_pkg.ads (.../tags/gcc_4_7_1_release) (wersja 0) +++ gcc/testsuite/gnat.dg/derived_type3_pkg.ads (.../branches/gcc-4_7-branch) (wersja 190845) @@ -0,0 +1,6 @@ +package Derived_Type3_Pkg is + + procedure Proc1; + procedure Proc2; + +end Derived_Type3_Pkg; Index: gcc/testsuite/gnat.dg/aggr20_pkg.ads =================================================================== --- gcc/testsuite/gnat.dg/aggr20_pkg.ads (.../tags/gcc_4_7_1_release) (wersja 0) +++ gcc/testsuite/gnat.dg/aggr20_pkg.ads (.../branches/gcc-4_7-branch) (wersja 190845) @@ -0,0 +1,9 @@ +with System; + +package Aggr20_Pkg is + + procedure Proc; + + Default_Nil_Address : constant System.Address := Proc'Address; + +end Aggr20_Pkg; Index: gcc/testsuite/gnat.dg/derived_type3.adb =================================================================== --- gcc/testsuite/gnat.dg/derived_type3.adb (.../tags/gcc_4_7_1_release) (wersja 0) +++ gcc/testsuite/gnat.dg/derived_type3.adb (.../branches/gcc-4_7-branch) (wersja 190845) @@ -0,0 +1,9 @@ +-- { dg-do run } + +with Derived_Type3_Pkg; use Derived_Type3_Pkg; + +procedure Derived_Type3 is +begin + Proc1; + Proc2; +end; 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 190845) @@ -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 190845) @@ -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/opt25.adb =================================================================== --- gcc/testsuite/gnat.dg/opt25.adb (.../tags/gcc_4_7_1_release) (wersja 0) +++ gcc/testsuite/gnat.dg/opt25.adb (.../branches/gcc-4_7-branch) (wersja 190845) @@ -0,0 +1,17 @@ +-- { dg-do compile } +-- { dg-options "-O" } + +with Opt25_Pkg1; +with Opt25_Pkg2; + +procedure Opt25 (B1, B2 : in out Boolean) is + + package Local_Pack_Instance is new Opt25_Pkg1 (Boolean, True); + + package Local_Stack is new Opt25_Pkg2 (Integer, 0); + + S : Local_Stack.Stack := Local_Stack.Default_Stack; + +begin + Local_Pack_Instance.Swap (B1, B2); +end; 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 190845) @@ -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 190845) @@ -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 190845) @@ -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/opt25_pkg1.adb =================================================================== --- gcc/testsuite/gnat.dg/opt25_pkg1.adb (.../tags/gcc_4_7_1_release) (wersja 0) +++ gcc/testsuite/gnat.dg/opt25_pkg1.adb (.../branches/gcc-4_7-branch) (wersja 190845) @@ -0,0 +1,10 @@ +package body Opt25_Pkg1 is + + procedure Swap (A, B : in out T) is + Tmp : T := A; + begin + A := B; + B := Tmp; + end Swap; + +end Opt25_Pkg1; Index: gcc/testsuite/gnat.dg/opt25_pkg1.ads =================================================================== --- gcc/testsuite/gnat.dg/opt25_pkg1.ads (.../tags/gcc_4_7_1_release) (wersja 0) +++ gcc/testsuite/gnat.dg/opt25_pkg1.ads (.../branches/gcc-4_7-branch) (wersja 190845) @@ -0,0 +1,11 @@ +generic + + type T is private; + Init_Value : T; + +package Opt25_Pkg1 is + + Var : T := Init_Value; + procedure Swap (A, B : in out T); + +end Opt25_Pkg1; 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 190845) @@ -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/opt25_pkg2.adb =================================================================== --- gcc/testsuite/gnat.dg/opt25_pkg2.adb (.../tags/gcc_4_7_1_release) (wersja 0) +++ gcc/testsuite/gnat.dg/opt25_pkg2.adb (.../branches/gcc-4_7-branch) (wersja 190845) @@ -0,0 +1,8 @@ +package body Opt25_Pkg2 is + + function Default_Stack return Stack is + begin + return Default_Stack_Var; + end Default_Stack; + +end Opt25_Pkg2; 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 190845) @@ -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/gnat.dg/opt25_pkg2.ads =================================================================== --- gcc/testsuite/gnat.dg/opt25_pkg2.ads (.../tags/gcc_4_7_1_release) (wersja 0) +++ gcc/testsuite/gnat.dg/opt25_pkg2.ads (.../branches/gcc-4_7-branch) (wersja 190845) @@ -0,0 +1,20 @@ +generic + + type Value is private; + Init_Val : Value; + +package Opt25_Pkg2 is + + type Stack (Size : Natural) is private; + + function Default_Stack return Stack; + +private + type Value_Array is array (Natural range <>) of Value; + + type Stack (Size : Natural) is record + Store : Value_Array (1 .. Size); + end record; + + Default_Stack_Var : Stack (10); +end Opt25_Pkg2; Index: gcc/testsuite/gnat.dg/loop_optimization11.adb =================================================================== --- gcc/testsuite/gnat.dg/loop_optimization11.adb (.../tags/gcc_4_7_1_release) (wersja 0) +++ gcc/testsuite/gnat.dg/loop_optimization11.adb (.../branches/gcc-4_7-branch) (wersja 190845) @@ -0,0 +1,19 @@ +-- { dg-do compile } +-- { dg-options "-O" } + +with Loop_Optimization11_Pkg; use Loop_Optimization11_Pkg; + +procedure Loop_Optimization11 is + Arr : array (Prot, Mem) of Integer := (others => (others => 0)); +begin + Put_Line (Img (0) & " "); + for I in Arr'Range (1) loop + for J in Arr'Range (2) loop + declare + Elem : Integer renames Arr (I, J); + begin + Put_Line (Img (Elem)); + end; + end loop; + end loop; +end; Index: gcc/testsuite/gnat.dg/loop_optimization11_pkg.ads =================================================================== --- gcc/testsuite/gnat.dg/loop_optimization11_pkg.ads (.../tags/gcc_4_7_1_release) (wersja 0) +++ gcc/testsuite/gnat.dg/loop_optimization11_pkg.ads (.../branches/gcc-4_7-branch) (wersja 190845) @@ -0,0 +1,11 @@ +package Loop_Optimization11_Pkg is + + function Img (X : Integer) return String; + + procedure Put_Line (Data : String); + + type Prot is (Execute, Execute_Read, Execute_Read_Write); + + type Mem is (Mem_Image, Mem_Mapped, Mem_Private, Unknown); + +end Loop_Optimization11_Pkg; Index: gcc/testsuite/gnat.dg/discr38.adb =================================================================== --- gcc/testsuite/gnat.dg/discr38.adb (.../tags/gcc_4_7_1_release) (wersja 0) +++ gcc/testsuite/gnat.dg/discr38.adb (.../branches/gcc-4_7-branch) (wersja 190845) @@ -0,0 +1,40 @@ +-- { dg-do compile } + +procedure Discr38 is + + type Enum is (OK, + NOT_CONNECTED, + DISCONNECTED, + REQUEST_Q_EMPTY, + SERVER_UNAVAILABLE, + BUFFER_TOO_SMALL, + NO_FREE_SLOT, + RAISE_EXCEPTION, + REQUEST_CANCELLED, + REQUEST_IN_PROGRESS, + SERVER_BUSY, + BLOCK_ACKNOWLEDGE); + + type R (Status : Enum := OK) is record + Status_Block : Integer; + case Status is + when RAISE_EXCEPTION => + I : Integer; + when OK => + Length : Natural; + Data : Integer; + when others => + null; + end case; + end record; + for R use record + Status at 0 range 0 .. 7; + Status_Block at 4 range 0 .. 31; + Length at 8 range 0 .. 31; + end record; + + Nil : constant R := (OK, 1, 0, 1); + +begin + null; +end; Index: gcc/testsuite/gcc.dg/vla-init-1.c =================================================================== --- gcc/testsuite/gcc.dg/vla-init-1.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/vla-init-1.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -10,6 +10,6 @@ foo (void) { int x[a] = { 1 }; /* { dg-error "variable-sized object may not be initialized" "VLA init" } */ - /* { dg-warning "excess elements in array initializer" "" { target *-*-* } 12 } */ - /* { dg-warning "near initialization" "" { target *-*-* } 12 } */ + /* { dg-warning "excess elements in array initializer" "excess" { target *-*-* } 12 } */ + /* { dg-warning "near initialization" "near" { target *-*-* } 12 } */ } Index: gcc/testsuite/gcc.dg/pr30551-2.c =================================================================== --- gcc/testsuite/gcc.dg/pr30551-2.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/pr30551-2.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -2,7 +2,7 @@ /* { dg-do compile } */ /* { dg-options "" } */ -void main(char a) {} /* { dg-bogus "first argument of .main. should be .int." } */ -/* { dg-bogus ".main. takes only zero or two arguments" "" { target *-*-* } 5 } */ -/* { dg-bogus "return type of .main. is not .int." "" { target *-*-* } 5 } */ +void main(char a) {} /* { dg-bogus "first argument of .main. should be .int." "int" } */ +/* { dg-bogus ".main. takes only zero or two arguments" "zero or two" { target *-*-* } 5 } */ +/* { dg-bogus "return type of .main. is not .int." "return type" { target *-*-* } 5 } */ Index: gcc/testsuite/gcc.dg/pr48552-2.c =================================================================== --- gcc/testsuite/gcc.dg/pr48552-2.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/pr48552-2.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -7,15 +7,15 @@ void f1 (void *x) { - __asm ("" : : "r" (*x)); /* { dg-warning "dereferencing" } */ -} /* { dg-error "invalid use of void expression" "" { target *-*-* } 10 } */ + __asm ("" : : "r" (*x)); /* { dg-warning "dereferencing" "deref" } */ +} /* { dg-error "invalid use of void expression" "void expr" { target *-*-* } 10 } */ void f2 (void *x) { - __asm ("" : "=r" (*x)); /* { dg-warning "dereferencing" } */ -} /* { dg-error "invalid use of void expression" "" { target *-*-* } 16 } */ - /* { dg-error "invalid lvalue in asm output 0" "" { target *-*-* } 16 } */ + __asm ("" : "=r" (*x)); /* { dg-warning "dereferencing" "deref" } */ +} /* { dg-error "invalid use of void expression" "void expr" { target *-*-* } 16 } */ + /* { dg-error "invalid lvalue in asm output 0" "invalid lvalue" { target *-*-* } 16 } */ void f3 (void *x) { @@ -31,15 +31,15 @@ void f5 (void *x) { - __asm ("" : : "g" (*x)); /* { dg-warning "dereferencing" } */ -} /* { dg-error "invalid use of void expression" "" { target *-*-* } 34 } */ + __asm ("" : : "g" (*x)); /* { dg-warning "dereferencing" "deref" } */ +} /* { dg-error "invalid use of void expression" "void expr" { target *-*-* } 34 } */ void f6 (void *x) { - __asm ("" : "=g" (*x)); /* { dg-warning "dereferencing" } */ -} /* { dg-error "invalid use of void expression" "" { target *-*-* } 40 } */ - /* { dg-error "invalid lvalue in asm output 0" "" { target *-*-* } 40 } */ + __asm ("" : "=g" (*x)); /* { dg-warning "dereferencing" "deref" } */ +} /* { dg-error "invalid use of void expression" "void expr" { target *-*-* } 40 } */ + /* { dg-error "invalid lvalue in asm output 0" "invalid lvalue" { target *-*-* } 40 } */ void f7 (struct S *x) { @@ -49,5 +49,5 @@ void f8 (struct S *x) { - __asm ("" : "=r" (*x)); /* { dg-error "dereferencing pointer to incomplete type" } */ -} /* { dg-error "invalid lvalue in asm output 0" "" { target *-*-* } 52 } */ + __asm ("" : "=r" (*x)); /* { dg-error "dereferencing pointer to incomplete type" "incomplete" } */ +} /* { dg-error "invalid lvalue in asm output 0" "invalid lvalue" { target *-*-* } 52 } */ Index: gcc/testsuite/gcc.dg/parser-pr28152.c =================================================================== --- gcc/testsuite/gcc.dg/parser-pr28152.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/parser-pr28152.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -7,5 +7,5 @@ _Complex float z; z = _Complex (1.90000007326203904e+19, 0.0); /* { dg-error "_Complex" } */ - z = _Complex (1.0e+0, 0.0) / z; /* { dg-error "_Complex" } */ - /* { dg-error "at end of input" "" { target *-*-* } 10 } */ + z = _Complex (1.0e+0, 0.0) / z; /* { dg-error "_Complex" "_Complex" } */ + /* { dg-error "at end of input" "end of input" { target *-*-* } 10 } */ Index: gcc/testsuite/gcc.dg/pr30551-6.c =================================================================== --- gcc/testsuite/gcc.dg/pr30551-6.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/pr30551-6.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -2,6 +2,6 @@ /* { dg-do compile } */ /* { dg-options "-pedantic" } */ /* { dg-skip-if "-Wmain not enabled with -pedantic on SPU" { spu-*-* } } */ -void main(char a) {} /* { dg-warning "first argument of .main. should be .int." } */ -/* { dg-warning ".main. takes only zero or two arguments" "" { target *-*-* } 5 } */ -/* { dg-warning "return type of .main. is not .int." "" { target *-*-* } 5 } */ +void main(char a) {} /* { dg-warning "first argument of .main. should be .int." "int" } */ +/* { dg-warning ".main. takes only zero or two arguments" "zero or two" { target *-*-* } 5 } */ +/* { dg-warning "return type of .main. is not .int." "return type" { target *-*-* } 5 } */ Index: gcc/testsuite/gcc.dg/gomp/critical-4.c =================================================================== --- gcc/testsuite/gcc.dg/gomp/critical-4.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/gomp/critical-4.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -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 190845) +++ gcc/testsuite/gcc.dg/gomp/nesting-1.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -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/gomp/pr53992.c =================================================================== --- gcc/testsuite/gcc.dg/gomp/pr53992.c (.../tags/gcc_4_7_1_release) (wersja 0) +++ gcc/testsuite/gcc.dg/gomp/pr53992.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -0,0 +1,21 @@ +/* PR middle-end/53992 */ +/* { dg-do compile } */ +/* { dg-options "-fgnu-tm -fopenmp" } */ +/* { dg-require-effective-target fgnu_tm } */ + +int main() { + long data[10000]; + long i, min=10000; + for (i=0; i<10000; i++) data[i] = -i; + +#pragma omp parallel for + for (i=0; i<10000; i++) { + __transaction_atomic + { + if (data[i] < min) + min = data[i]; + } + } + + return !(min == -9999); +} Index: gcc/testsuite/gcc.dg/c99-vla-jump-4.c =================================================================== --- gcc/testsuite/gcc.dg/c99-vla-jump-4.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/c99-vla-jump-4.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -305,5 +305,5 @@ void fd288 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;a: goto a; P03B:goto P03B; } /* Match extra informative notes. */ -/* { dg-message "note: label '\[^\n'\]*' defined here" "note: expected" { target *-*-* } 0 } */ -/* { dg-message "note: '\[^\n'\]*' declared here" "note: expected" { target *-*-* } 0 } */ +/* { dg-message "note: label '\[^\n'\]*' defined here" "note: defined" { target *-*-* } 0 } */ +/* { dg-message "note: '\[^\n'\]*' declared here" "note: declared" { target *-*-* } 0 } */ Index: gcc/testsuite/gcc.dg/decl-9.c =================================================================== --- gcc/testsuite/gcc.dg/decl-9.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/decl-9.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -21,7 +21,7 @@ { b: a: ; /* { dg-bogus "a label can only be part of a statement" } */ c: d e; /* { dg-error "a label can only be part of a statement" } */ -/* { dg-error "unknown type name 'd'" "" { target *-*-* } 23 } */ +/* { dg-error "unknown type name 'd'" "unknown type name" { target *-*-* } 23 } */ ; } Index: gcc/testsuite/gcc.dg/Wstrict-aliasing-converted-assigned.c =================================================================== --- gcc/testsuite/gcc.dg/Wstrict-aliasing-converted-assigned.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/Wstrict-aliasing-converted-assigned.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -5,9 +5,12 @@ int foo() { int i; - *(long*)&i = 0; /* { dg-warning "type-punn" } */ + *(long*)&i = 0; /* { dg-warning "type-punn" "type-punn" } */ return i; } -/* { dg-message "does break strict-aliasing" "" { target { *-*-* && lp64 } xfail *-*-* } 8 } */ -/* { dg-message "initialized" "" { target { *-*-* && lp64 } xfail *-*-* } 8 } */ +/* These messages are only expected for lp64, but fail there. When they + pass for lp64, replace "xfail *-*-*" with "target lp64". */ + +/* { dg-message "does break strict-aliasing" "break" { xfail *-*-* } 8 } */ +/* { dg-message "initialized" "init" { xfail *-*-* } 8 } */ 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 190845) @@ -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/align-2.c =================================================================== --- gcc/testsuite/gcc.dg/align-2.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/align-2.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -1,5 +1,5 @@ /* PR 17962 */ -/* { dg-do compile } */ +/* { dg-do compile { target vect_natural_alignment } } */ /* { dg-options "" } */ typedef float v4 __attribute__((vector_size(sizeof(float)*4))); Index: gcc/testsuite/gcc.dg/declspec-10.c =================================================================== --- gcc/testsuite/gcc.dg/declspec-10.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/declspec-10.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -44,4 +44,4 @@ inline int main (void) { return 0; } /* { dg-warning "cannot inline function 'main'" } */ -/* { dg-message "error: register name not specified for 'y'" "" { target *-*-* } 19 } */ +/* { dg-message "error: register name not specified for 'y'" "not specified" { target *-*-* } 19 } */ Index: gcc/testsuite/gcc.dg/Wobjsize-1.c =================================================================== --- gcc/testsuite/gcc.dg/Wobjsize-1.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/Wobjsize-1.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -11,5 +11,5 @@ } /* { dg-warning "will always overflow destination buffer" "" { target *-*-* } 6 } */ -/* { dg-message "file included" "" { target *-*-* } 0 } */ -/* { dg-message "inlined from" "" { target *-*-* } 0 } */ +/* { dg-message "file included" "included" { target *-*-* } 0 } */ +/* { dg-message "inlined from" "inlined" { target *-*-* } 0 } */ Index: gcc/testsuite/gcc.dg/cpp/include2a.c =================================================================== --- gcc/testsuite/gcc.dg/cpp/include2a.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/cpp/include2a.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -11,6 +11,6 @@ /* These error is No such file or directory, just once. However, this message is locale-dependent, so don't test for it. */ -/* { dg-error "silly" "" { target *-*-* } 0 } */ -/* { dg-error "missing" "" { target *-*-* } 0 } */ -/* { dg-message "terminated" "" { target *-*-* } 0 } */ +/* { dg-error "silly" "silly" { target *-*-* } 0 } */ +/* { dg-error "missing" "missing" { target *-*-* } 0 } */ +/* { dg-message "terminated" "terminated" { target *-*-* } 0 } */ Index: gcc/testsuite/gcc.dg/cpp/pr30786.c =================================================================== --- gcc/testsuite/gcc.dg/cpp/pr30786.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/cpp/pr30786.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -1,8 +1,8 @@ /* PR preprocessor/30786 - _Pragma at end of file should not ICE */ /* { dg-do compile } */ -/* { dg-error "parenthesized" "" { target *-*-* } 9 } */ -/* { dg-error "expected" "" { target *-*-* } 9 } */ +/* { dg-error "parenthesized" "parenthesized" { target *-*-* } 9 } */ +/* { dg-error "expected" "expected" { target *-*-* } 9 } */ int x; Index: gcc/testsuite/gcc.dg/cpp/pr28709.c =================================================================== --- gcc/testsuite/gcc.dg/cpp/pr28709.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/cpp/pr28709.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -4,5 +4,5 @@ /* { dg-do compile } */ #define foo - ## >> foo; -/* { dg-error "expected identifier.*'-'" "" { target *-*-* } 6 } */ -/* { dg-error pasting "" { target *-*-* } 6 } */ +/* { dg-error "expected identifier.*'-'" "expected" { target *-*-* } 6 } */ +/* { dg-error pasting "pasting" { target *-*-* } 6 } */ Index: gcc/testsuite/gcc.dg/cpp/missing-header-MD.c =================================================================== --- gcc/testsuite/gcc.dg/cpp/missing-header-MD.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/cpp/missing-header-MD.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -3,8 +3,8 @@ /* { dg-options "-MD" } */ #include "nonexistent.h" -/* { dg-message "nonexistent.h" "" { target *-*-* } 0 } */ -/* { dg-message "terminated" "" { target *-*-* } 0 } */ +/* { dg-message "nonexistent.h" "nonexistent.h" { target *-*-* } 0 } */ +/* { dg-message "terminated" "terminated" { target *-*-* } 0 } */ /* This declaration should not receive any diagnostic. */ foo bar; Index: gcc/testsuite/gcc.dg/cpp/macspace2.c =================================================================== --- gcc/testsuite/gcc.dg/cpp/macspace2.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/cpp/macspace2.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -59,5 +59,5 @@ #define ag"abc" /* { dg-error "requires whitespace" } */ int dummy; -/* { dg-error "missing terminating" "" { target *-*-* } 6 } */ -/* { dg-error "missing terminating" "" { target *-*-* } 10 } */ +/* { dg-error "missing terminating" "missing-terminating" { target *-*-* } 6 } */ +/* { dg-error "missing terminating" "missing-terminating" { target *-*-* } 10 } */ Index: gcc/testsuite/gcc.dg/cpp/missing-header-1.c =================================================================== --- gcc/testsuite/gcc.dg/cpp/missing-header-1.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/cpp/missing-header-1.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -3,8 +3,8 @@ /* { dg-options "" } */ #include "nonexistent.h" -/* { dg-message "nonexistent.h" "" { target *-*-* } 0 } */ -/* { dg-message "terminated" "" { target *-*-* } 0 } */ +/* { dg-message "nonexistent.h" "nonexistent.h" { target *-*-* } 0 } */ +/* { dg-message "terminated" "terminated" { target *-*-* } 0 } */ /* This declaration should not receive any diagnostic. */ foo bar; Index: gcc/testsuite/gcc.dg/cpp/missing-header-MMD.c =================================================================== --- gcc/testsuite/gcc.dg/cpp/missing-header-MMD.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/cpp/missing-header-MMD.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -3,8 +3,8 @@ /* { dg-options "-MMD" } */ #include "nonexistent.h" -/* { dg-message "nonexistent.h" "" { target *-*-* } 0 } */ -/* { dg-message "terminated" "" { target *-*-* } 0 } */ +/* { dg-message "nonexistent.h" "nonexistent.h" { target *-*-* } 0 } */ +/* { dg-message "terminated" "terminated" { target *-*-* } 0 } */ /* This declaration should not receive any diagnostic. */ foo bar; Index: gcc/testsuite/gcc.dg/cpp/missing-sysheader-MD.c =================================================================== --- gcc/testsuite/gcc.dg/cpp/missing-sysheader-MD.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/cpp/missing-sysheader-MD.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -3,8 +3,8 @@ /* { dg-options "-MD" } */ #include -/* { dg-message "nonexistent.h" "" { target *-*-* } 0 } */ -/* { dg-message "terminated" "" { target *-*-* } 0 } */ +/* { dg-message "nonexistent.h" "nonexistent.h" { target *-*-* } 0 } */ +/* { dg-message "terminated" "terminated" { target *-*-* } 0 } */ /* This declaration should not receive any diagnostic. */ foo bar; Index: gcc/testsuite/gcc.dg/cpp/missing-sysheader-MMD.c =================================================================== --- gcc/testsuite/gcc.dg/cpp/missing-sysheader-MMD.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/cpp/missing-sysheader-MMD.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -3,8 +3,8 @@ /* { dg-options "-MMD" } */ #include -/* { dg-message "nonexistent.h" "" { target *-*-* } 0 } */ -/* { dg-message "terminated" "" { target *-*-* } 0 } */ +/* { dg-message "nonexistent.h" "nonexistent.h" { target *-*-* } 0 } */ +/* { dg-message "terminated" "terminated" { target *-*-* } 0 } */ /* This declaration should not receive any diagnostic. */ foo bar; Index: gcc/testsuite/gcc.dg/20031223-1.c =================================================================== --- gcc/testsuite/gcc.dg/20031223-1.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/20031223-1.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -7,7 +7,7 @@ void f () { - l: int; /* { dg-error "a label can only be part of a statement and a declaration is not a statement" } */ - /* { dg-warning "useless type name in empty declaration" "" { target *-*-* } 10 } */ - /* { dg-error "label at end of compound statement" "" { target *-*-* } 10 } */ + l: int; /* { dg-error "a label can only be part of a statement and a declaration is not a statement" "not stmt" } */ + /* { dg-warning "useless type name in empty declaration" "type name" { target *-*-* } 10 } */ + /* { dg-error "label at end of compound statement" "label" { target *-*-* } 10 } */ } Index: gcc/testsuite/gcc.dg/matrix/matrix.exp =================================================================== --- gcc/testsuite/gcc.dg/matrix/matrix.exp (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/matrix/matrix.exp (.../branches/gcc-4_7-branch) (wersja 190845) @@ -39,9 +39,6 @@ set tool gcc set prof_ext "gcda" -# Override the list defined in profopt.exp. -set PROFOPT_OPTIONS [list {}] - if $tracelevel then { strace $tracelevel } @@ -49,6 +46,10 @@ # Load support procs. load_lib profopt.exp +# Save and override the default list defined in profopt.exp. +set matrix_save_profopt_options $PROFOPT_OPTIONS +set PROFOPT_OPTIONS [list {}] + # These are globals used by profopt-execute. The first is options # needed to generate profile data, the second is options to use the # profile data. @@ -63,3 +64,4 @@ profopt-execute $src } +set PROFOPT_OPTIONS $matrix_save_profopt_options Index: gcc/testsuite/gcc.dg/utf-dflt2.c =================================================================== --- gcc/testsuite/gcc.dg/utf-dflt2.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/utf-dflt2.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -2,8 +2,8 @@ /* { dg-do compile } */ /* { dg-options "" } */ -const void *s0 = u8"a"; /* { dg-error "undeclared" } */ - /* { dg-error "expected ',' or ';'" "" { target *-*-* } 5 } */ +const void *s0 = u8"a"; /* { dg-error "undeclared" "undeclared" } */ + /* { dg-error "expected ',' or ';'" "expected" { target *-*-* } 5 } */ #define u8 "a" Index: gcc/testsuite/gcc.dg/pr30551-3.c =================================================================== --- gcc/testsuite/gcc.dg/pr30551-3.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/pr30551-3.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -2,6 +2,6 @@ /* { dg-do compile } */ /* { dg-options "-pedantic-errors" } */ /* { dg-skip-if "-Wmain not enabled with -pedantic on SPU" { spu-*-* } } */ -void main(char a) {} /* { dg-error "first argument of .main. should be .int." } */ -/* { dg-error ".main. takes only zero or two arguments" "" { target *-*-* } 5 } */ -/* { dg-error "return type of .main. is not .int." "" { target *-*-* } 5 } */ +void main(char a) {} /* { dg-error "first argument of .main. should be .int." "int" } */ +/* { dg-error ".main. takes only zero or two arguments" "zero or two" { target *-*-* } 5 } */ +/* { dg-error "return type of .main. is not .int." "return type" { target *-*-* } 5 } */ Index: gcc/testsuite/gcc.dg/Wconversion-integer.c =================================================================== --- gcc/testsuite/gcc.dg/Wconversion-integer.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/Wconversion-integer.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -40,10 +40,10 @@ fuc ('A'); uc = 'A'; - uc = x ? 1U : -1; /* { dg-warning " conversion" } */ - /* { dg-warning "negative integer implicitly converted to unsigned type" "" { target *-*-* } 43 } */ - uc = x ? SCHAR_MIN : 1U; /* { dg-warning " conversion" } */ - /* { dg-warning "negative integer implicitly converted to unsigned type" "" { target *-*-* } 45 } */ + uc = x ? 1U : -1; /* { dg-warning " conversion" "conversion" } */ + /* { dg-warning "negative integer implicitly converted to unsigned type" "implicit" { target *-*-* } 43 } */ + uc = x ? SCHAR_MIN : 1U; /* { dg-warning " conversion" "conversion" } */ + /* { dg-warning "negative integer implicitly converted to unsigned type" "implicit" { target *-*-* } 45 } */ uc = x ? 1 : -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */ uc = x ? SCHAR_MIN : 1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */ ui = x ? 1U : -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */ Index: gcc/testsuite/gcc.dg/c99-vla-jump-1.c =================================================================== --- gcc/testsuite/gcc.dg/c99-vla-jump-1.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/c99-vla-jump-1.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -305,5 +305,5 @@ void fa288 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0;a: goto a; } /* Match extra informative notes. */ -/* { dg-message "note: label '\[^\n'\]*' defined here" "note: expected" { target *-*-* } 0 } */ -/* { dg-message "note: '\[^\n'\]*' declared here" "note: expected" { target *-*-* } 0 } */ +/* { dg-message "note: label '\[^\n'\]*' defined here" "note: defined" { target *-*-* } 0 } */ +/* { dg-message "note: '\[^\n'\]*' declared here" "note: declared" { target *-*-* } 0 } */ Index: gcc/testsuite/gcc.dg/declspec-18.c =================================================================== --- gcc/testsuite/gcc.dg/declspec-18.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/declspec-18.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -5,7 +5,7 @@ int z; /* { dg-message "previous declaration of 'z'" } */ typedef t2 *z; /* { dg-error "unknown type name 't2'" } */ -/* { dg-error "'z' redeclared " "" { target *-*-* } 7 } */ +/* { dg-error "'z' redeclared " "redeclared" { target *-*-* } 7 } */ extern t3 p1(void); /* { dg-error "unknown type name 't3'" } */ int p2(const t4 x); /* { dg-error "unknown type name 't4'" } */ @@ -23,36 +23,36 @@ }; typeof (z) c1; -typeof (x1) c2; /* { dg-error "undeclared" } */ +typeof (x1) c2; /* { dg-error "undeclared" "undeclared" } */ typeof (const t11) c3; /* { dg-error "unknown type name 't11'" } */ -typeof (t12 *) c3; /* { dg-error "unknown type name 't12'" "" { xfail *-*-* } } */ -/* { dg-bogus "unknown type name 'x1'" "" { target *-*-* } 26 } */ -/* { dg-bogus "undeclared" "" { xfail *-*-* } 28 } */ -/* { dg-bogus "expected expression before" "" { xfail *-*-* } 28 } */ +typeof (t12 *) c3; /* { dg-error "unknown type name 't12'" "t12" { xfail *-*-* } } */ +/* { dg-bogus "unknown type name 'x1'" unknown"" { target *-*-* } 26 } */ +/* { dg-bogus "undeclared" "undeclared" { xfail *-*-* } 28 } */ +/* { dg-bogus "expected expression before" "expected" { xfail *-*-* } 28 } */ int recover1; int s0 = sizeof (z); -int s1 = sizeof (x2); /* { dg-error "undeclared" } */ +int s1 = sizeof (x2); /* { dg-error "undeclared" "undeclared" } */ int s2 = sizeof (const t13); /* { dg-error "unknown type name 't13'" } */ -int s3 = sizeof (t14 *); /* { dg-error "unknown type name 't14'" "" { xfail *-*-* } } */ +int s3 = sizeof (t14 *); /* { dg-error "unknown type name 't14'" "t14" { xfail *-*-* } } */ int recover2; -/* { dg-bogus "unknown type name 'x2'" "" { target *-*-* } 36 } */ -/* { dg-bogus "undeclared" "" { xfail *-*-* } 38 } */ -/* { dg-bogus "expected expression before" "" { xfail *-*-* } 38 } */ +/* { dg-bogus "unknown type name 'x2'" "unknown" { target *-*-* } 36 } */ +/* { dg-bogus "undeclared" "undeclared" { xfail *-*-* } 38 } */ +/* { dg-bogus "expected expression before" "expected" { xfail *-*-* } 38 } */ int a0 = __alignof__ (z); int a1 = __alignof__ (x3); /* { dg-error "undeclared" } */ int a2 = __alignof__ (const t15); /* { dg-error "unknown type name 't15'" } */ -int a3 = __alignof__ (t16 *); /* { dg-error "unknown type name 't16'" "" { xfail *-*-* } } */ +int a3 = __alignof__ (t16 *); /* { dg-error "unknown type name 't16'" "t16" { xfail *-*-* } } */ int recover3; /* { dg-bogus "unknown type name 'x3'" "" { target *-*-* } 47 } */ -/* { dg-bogus "undeclared" "" { xfail *-*-* } 49 } */ -/* { dg-bogus "expected expression before" "" { xfail *-*-* } 49 } */ +/* { dg-bogus "undeclared" "undeclared" { xfail *-*-* } 49 } */ +/* { dg-bogus "expected expression before" "expected" { xfail *-*-* } 49 } */ /* Cannot detect (undefd_type *) or (undefd_type (*) because it would @@ -60,14 +60,14 @@ const char *f1() { - return (const t17) "abc"; /* { dg-error "unknown type name 't17'" } */ -/* { dg-bogus "expected" "" { target *-*-* } 63 } */ + return (const t17) "abc"; /* { dg-error "unknown type name 't17'" "t17" } */ +/* { dg-bogus "expected" "expected" { target *-*-* } 63 } */ } const char *f2() { - return (const t18 *) "abc"; /* { dg-error "unknown type name 't18'" } */ -/* { dg-bogus "expected" "" { target *-*-* } 69 } */ + return (const t18 *) "abc"; /* { dg-error "unknown type name 't18'" "t18" } */ +/* { dg-bogus "expected" "expected" { target *-*-* } 69 } */ } @@ -76,15 +76,15 @@ void *f3(int x) { - return (void *) ((void *(*)(t19)) f3); /* { dg-error "unknown type name 't19'" } */ -/* { dg-bogus "expected" "" { xfail *-*-* } 79 } */ + return (void *) ((void *(*)(t19)) f3); /* { dg-error "unknown type name 't19'" "t19" } */ +/* { dg-bogus "expected" "expected" { xfail *-*-* } 79 } */ } const void *f4() { return &((const t20){1}); /* { dg-error "unknown type name 't20'" } */ -/* { dg-bogus "return discards 'const'" "" { target *-*-* } 85 } */ -/* { dg-bogus "expected" "" { target *-*-* } 85 } */ +/* { dg-bogus "return discards 'const'" "discards" { target *-*-* } 85 } */ +/* { dg-bogus "expected" "expected" { target *-*-* } 85 } */ } int f5(__builtin_va_list ap) @@ -95,6 +95,6 @@ int f6(void) { - return __builtin_offsetof (t23, field); /* { dg-error "unknown type name 't23'" } */ -/* { dg-bogus "request for member" "" { target *-*-* } 98 } */ + return __builtin_offsetof (t23, field); /* { dg-error "unknown type name 't23'" "t23" } */ +/* { dg-bogus "request for member" "request" { target *-*-* } 98 } */ } Index: gcc/testsuite/gcc.dg/c99-vla-jump-5.c =================================================================== --- gcc/testsuite/gcc.dg/c99-vla-jump-5.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/c99-vla-jump-5.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -30,5 +30,5 @@ } /* Match extra informative notes. */ -/* { dg-message "note: switch starts here" "note: expected" { target *-*-* } 0 } */ -/* { dg-message "note: '\[^\n'\]*' declared here" "note: expected" { target *-*-* } 0 } */ +/* { dg-message "note: switch starts here" "note: starts" { target *-*-* } 0 } */ +/* { dg-message "note: '\[^\n'\]*' declared here" "note: declared" { target *-*-* } 0 } */ Index: gcc/testsuite/gcc.dg/redecl-1.c =================================================================== --- gcc/testsuite/gcc.dg/redecl-1.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/redecl-1.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -52,21 +52,21 @@ void prime4(void) { - bar4(); /* { dg-warning "implicit declaration of function" } */ + bar4(); /* { dg-warning "implicit declaration of function" "implicit" } */ } void test4(void) { extern double bar4(double); /* { dg-error "conflict" } */ -/* { dg-message "note: previous implicit declaration" "" { target *-*-* } 55 } */ +/* { dg-message "note: previous implicit declaration" "previous" { target *-*-* } 55 } */ } /* Implicit decl, clashing with extern at previous function scope. */ void prime5(void) { - extern double bar5(double); /* { dg-message "note: previous declaration" "" } */ -} /* { dg-message "note: previous implicit declaration" "" { target *-*-* } 68 } */ + extern double bar5(double); /* { dg-message "note: previous declaration" "previous 1" } */ +} /* { dg-message "note: previous implicit declaration" "previous 2" { target *-*-* } 68 } */ void test5(void) { Index: gcc/testsuite/gcc.dg/di-longlong64-sync-1.c =================================================================== --- gcc/testsuite/gcc.dg/di-longlong64-sync-1.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/di-longlong64-sync-1.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -3,8 +3,8 @@ /* { dg-options "-std=gnu99" } */ /* { dg-additional-options "-march=pentium" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */ -/* { dg-message "note: '__sync_fetch_and_nand' changed semantics in GCC 4.4" "" { target *-*-* } 0 } */ -/* { dg-message "note: '__sync_nand_and_fetch' changed semantics in GCC 4.4" "" { target *-*-* } 0 } */ +/* { dg-message "note: '__sync_fetch_and_nand' changed semantics in GCC 4.4" "fetch_and_nand" { target *-*-* } 0 } */ +/* { dg-message "note: '__sync_nand_and_fetch' changed semantics in GCC 4.4" "nand_and_fetch" { target *-*-* } 0 } */ /* Test basic functionality of the intrinsics. The operations should Index: gcc/testsuite/gcc.dg/noncompile/pr44517.c =================================================================== --- gcc/testsuite/gcc.dg/noncompile/pr44517.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/noncompile/pr44517.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -1,7 +1,7 @@ /* PR c/44517: Improve diagnostic for misspelled typename in function declaration. */ int f1(int x, pid_t y, long z, in t) { -/* { dg-error "unknown type name 'pid_t'" "" { target *-*-* } 2 } */ -/* { dg-error "unknown type name 'in'" "" { target *-*-* } 2 } */ +/* { dg-error "unknown type name 'pid_t'" "pid_t" { target *-*-* } 2 } */ +/* { dg-error "unknown type name 'in'" "in" { target *-*-* } 2 } */ return x + y + z + t; } Index: gcc/testsuite/gcc.dg/noncompile/pr52290.c =================================================================== --- gcc/testsuite/gcc.dg/noncompile/pr52290.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/noncompile/pr52290.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -1,3 +1,3 @@ -/* { dg-error "undeclared here" "" { target *-*-* } 3 } */ -/* { dg-error "expected" "" { target *-*-* } 3 } */ +/* { dg-error "undeclared here" "undeclared" { target *-*-* } 3 } */ +/* { dg-error "expected" "expected" { target *-*-* } 3 } */ int f()[j] Index: gcc/testsuite/gcc.dg/utf-dflt.c =================================================================== --- gcc/testsuite/gcc.dg/utf-dflt.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/utf-dflt.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -3,10 +3,10 @@ /* { dg-do compile } */ /* { dg-options "" } */ -const unsigned short c0 = u'a'; /* { dg-error "undeclared" } */ - /* { dg-error "expected ',' or ';'" "" { target *-*-* } 6 } */ -const unsigned long c1 = U'a'; /* { dg-error "undeclared" } */ - /* { dg-error "expected ',' or ';'" "" { target *-*-* } 8 } */ +const unsigned short c0 = u'a'; /* { dg-error "undeclared" "undeclared" } */ + /* { dg-error "expected ',' or ';'" "expected" { target *-*-* } 6 } */ +const unsigned long c1 = U'a'; /* { dg-error "undeclared" "undeclared" } */ + /* { dg-error "expected ',' or ';'" "expected" { target *-*-* } 8 } */ #define u 1 + #define U 2 + 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 190845) @@ -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/pr27953.c =================================================================== --- gcc/testsuite/gcc.dg/pr27953.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/pr27953.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -1,8 +1,8 @@ /* PR c/27953 */ -void foo(struct A a) {} /* { dg-warning "declared inside parameter list" } */ -/* { dg-warning "its scope is only" "" { target *-*-* } 3 } */ -/* { dg-error "incomplete type" "" { target *-*-* } 3 } */ +void foo(struct A a) {} /* { dg-warning "declared inside parameter list" "inside" } */ +/* { dg-warning "its scope is only" "scope" { target *-*-* } 3 } */ +/* { dg-error "incomplete type" "incomplete" { target *-*-* } 3 } */ -void foo() {} /* { dg-error "redefinition" } */ -/* { dg-message "note: previous definition" "" { target *-*-* } 3 } */ +void foo() {} /* { dg-error "redefinition" "redef" } */ +/* { dg-message "note: previous definition" "previous" { target *-*-* } 3 } */ Index: gcc/testsuite/gcc.dg/pr30551-4.c =================================================================== --- gcc/testsuite/gcc.dg/pr30551-4.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/pr30551-4.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -2,7 +2,7 @@ /* { dg-do compile } */ /* { dg-options "-pedantic-errors -Wno-main" } */ -void main(char a) {} /* { dg-bogus "first argument of .main. should be .int." } */ -/* { dg-bogus ".main. takes only zero or two arguments" "" { target *-*-* } 5 } */ -/* { dg-bogus "return type of .main. is not .int." "" { target *-*-* } 5 } */ +void main(char a) {} /* { dg-bogus "first argument of .main. should be .int." "int" } */ +/* { dg-bogus ".main. takes only zero or two arguments" "zero or two" { target *-*-* } 5 } */ +/* { dg-bogus "return type of .main. is not .int." "return type" { target *-*-* } 5 } */ Index: gcc/testsuite/gcc.dg/pr14475.c =================================================================== --- gcc/testsuite/gcc.dg/pr14475.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/pr14475.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -3,8 +3,8 @@ struct tree_common { - enum tree_code code : 8; /* { dg-error "ISO C forbids forward references to" "" } */ - /* { dg-error "type of bit-field .code. is a GCC extension" "" { target *-*-* } 6 } */ - /* { dg-warning "narrower than values of its type" "" { target *-*-* } 6 } */ - /* { dg-error "incomplete type" "" { target *-*-* } 6 } */ + enum tree_code code : 8; /* { dg-error "ISO C forbids forward references to" "forward ref" } */ + /* { dg-error "type of bit-field .code. is a GCC extension" "extension" { target *-*-* } 6 } */ + /* { dg-warning "narrower than values of its type" "narrower" { target *-*-* } 6 } */ + /* { dg-error "incomplete type" "incomplete" { target *-*-* } 6 } */ }; Index: gcc/testsuite/gcc.dg/stack-usage-1.c =================================================================== --- gcc/testsuite/gcc.dg/stack-usage-1.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/stack-usage-1.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -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/c99-vla-jump-2.c =================================================================== --- gcc/testsuite/gcc.dg/c99-vla-jump-2.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/c99-vla-jump-2.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -305,5 +305,5 @@ void fb288 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;a: goto a; P03B:goto P03B; } /* Match extra informative notes. */ -/* { dg-message "note: label '\[^\n'\]*' defined here" "note: expected" { target *-*-* } 0 } */ -/* { dg-message "note: '\[^\n'\]*' declared here" "note: expected" { target *-*-* } 0 } */ +/* { dg-message "note: label '\[^\n'\]*' defined here" "note: defined" { target *-*-* } 0 } */ +/* { dg-message "note: '\[^\n'\]*' declared here" "note: declared" { target *-*-* } 0 } */ Index: gcc/testsuite/gcc.dg/transparent-union-3.c =================================================================== --- gcc/testsuite/gcc.dg/transparent-union-3.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/transparent-union-3.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -6,15 +6,15 @@ enum e { A }; -union __attribute__((__transparent_union__)) ue1 { enum e; }; /* { dg-warning "declaration does not declare anything" } */ -/* { dg-warning "union cannot be made transparent" "" { target *-*-* } 9 } */ -union ue2 { enum e; } __attribute__((__transparent_union__)); /* { dg-warning "declaration does not declare anything" } */ -/* { dg-warning "union cannot be made transparent" "" { target *-*-* } 11 } */ +union __attribute__((__transparent_union__)) ue1 { enum e; }; /* { dg-warning "declaration does not declare anything" "not anything" } */ +/* { dg-warning "union cannot be made transparent" "cannot" { target *-*-* } 9 } */ +union ue2 { enum e; } __attribute__((__transparent_union__)); /* { dg-warning "declaration does not declare anything" "not anything" } */ +/* { dg-warning "union cannot be made transparent" "cannot" { target *-*-* } 11 } */ -union __attribute__((__transparent_union__)) ui1 { int; }; /* { dg-warning "declaration does not declare anything" } */ -/* { dg-warning "union cannot be made transparent" "" { target *-*-* } 14 } */ -union ui2 { int; } __attribute__((__transparent_union__)); /* { dg-warning "declaration does not declare anything" } */ -/* { dg-warning "union cannot be made transparent" "" { target *-*-* } 16 } */ +union __attribute__((__transparent_union__)) ui1 { int; }; /* { dg-warning "declaration does not declare anything" "not anything" } */ +/* { dg-warning "union cannot be made transparent" "cannot" { target *-*-* } 14 } */ +union ui2 { int; } __attribute__((__transparent_union__)); /* { dg-warning "declaration does not declare anything" "no anything" } */ +/* { dg-warning "union cannot be made transparent" "cannot" { target *-*-* } 16 } */ union __attribute__((__transparent_union__)) u1 { }; /* { dg-warning "union cannot be made transparent" "" { target *-*-* } 19 } */ Index: gcc/testsuite/gcc.dg/pr45461.c =================================================================== --- gcc/testsuite/gcc.dg/pr45461.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/pr45461.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -9,10 +9,10 @@ short e; va_list ap; va_start (ap, i); - e = va_arg (ap, short); /* { dg-warning "is promoted" } */ + e = va_arg (ap, short); /* { dg-warning "is promoted" "promoted" } */ va_end (ap); return e; } -/* { dg-message "note: \\(so you should pass" "" {target *-*-* } 12 } */ -/* { dg-message "note: if this code" "" {target *-*-* } 12 } */ +/* { dg-message "note: \\(so you should pass" "should pass" {target *-*-* } 12 } */ +/* { dg-message "note: if this code" "if this code" {target *-*-* } 12 } */ Index: gcc/testsuite/gcc.dg/ia64-sync-2.c =================================================================== --- gcc/testsuite/gcc.dg/ia64-sync-2.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/ia64-sync-2.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -4,8 +4,8 @@ /* { dg-options "-march=i486" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */ /* { dg-options "-mcpu=v9" { target sparc*-*-* } } */ -/* { dg-message "note: '__sync_fetch_and_nand' changed semantics in GCC 4.4" "" { target *-*-* } 0 } */ -/* { dg-message "note: '__sync_nand_and_fetch' changed semantics in GCC 4.4" "" { target *-*-* } 0 } */ +/* { dg-message "note: '__sync_fetch_and_nand' changed semantics in GCC 4.4" "fetch_and_nand" { target *-*-* } 0 } */ +/* { dg-message "note: '__sync_nand_and_fetch' changed semantics in GCC 4.4" "nand_and_fetch" { target *-*-* } 0 } */ /* Test basic functionality of the intrinsics. */ Index: gcc/testsuite/gcc.dg/parser-pr28152-2.c =================================================================== --- gcc/testsuite/gcc.dg/parser-pr28152-2.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/parser-pr28152-2.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -7,5 +7,5 @@ __complex__ float z; z = __complex__ (1.90000007326203904e+19, 0.0); /* { dg-error "__complex__" } */ - z = __complex__ (1.0e+0, 0.0) / z; /* { dg-error "__complex__" } */ - /* { dg-error "at end of input" "" { target *-*-* } 10 } */ + z = __complex__ (1.0e+0, 0.0) / z; /* { dg-error "__complex__" "Complex" } */ + /* { dg-error "at end of input" "end of input" { target *-*-* } 10 } */ 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 190845) @@ -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/pr53908.c =================================================================== --- gcc/testsuite/gcc.dg/torture/pr53908.c (.../tags/gcc_4_7_1_release) (wersja 0) +++ gcc/testsuite/gcc.dg/torture/pr53908.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -0,0 +1,288 @@ +/* { dg-do run } */ +/* SEGV at comment below. */ +typedef unsigned int size_t; +typedef enum har { + he_fatal = (-199), + he_not_initialized, + he_bad_input, + he_memory_too_small, + he_bad_action, + he_duplicate, + he_bad_nonce, + he_stale_nonce, + he_bad_credentials, + he_bad_user, + he_no_such_user, + he_bad_passwd, + he_unknown_auth_scheme, + he_not_found, + he_failed_digest_file_check, + he_failed_digest_file_save, + he_process_not_privileged, + he_other, + he_end_of_range, + ha_no_error = 0, + ha_no_value = 1 +} har; +typedef enum realm_type +{ + axis_realm = 0, + ws_realm +} realm_type; + +__attribute__((__noclone__, __noinline__)) +har has_www_auth(char *, size_t, realm_type, har); + +__attribute__((__noclone__, __noinline__)) +har has_auth_user(const char *, const char *, realm_type, char *, size_t); + +__attribute__((__noclone__, __noinline__)) +char *ha_get_string_value(void); + +typedef struct +{ + unsigned int track_id; + char* user; + char* realm; + char* authent; + int internal_realm; +} request; +enum user_response { + file_not_found_user_response = -3, + access_denied_user_response = -2, + no_user_response = -1, + ok_user_response = 0 +}; +struct realm_group { + char *name; + int id; + struct realm_group *next; +}; +struct realm { + char *name; + char *space; + struct realm_group *groups; + struct realm *next; +}; +struct user_info { + char *name; + int no_groups; + int groups[128]; + struct user_info *next; +}; +static struct user_info *find_user(const char *user_name); +static int is_member_of_groups(const struct user_info *user_item, + const struct realm_group *groups); +int authent_author(request *req); +struct realm *realms = ((void *)0); +struct user_info *users = ((void *)0); +static struct user_info* +find_user(const char *user_name) +{ + struct user_info *user_item; + user_item = users; + while (user_item != ((void *)0)) { + /* SEGV due to NULL access here on user_name. See also comment below. */ + if ((__builtin_strcmp(user_item->name, user_name) == 0)) + break; + user_item = user_item->next; + } + return user_item; +} +static int +is_member_of_groups(const struct user_info *user_item, + const struct realm_group *groups) +{ + const struct realm_group *group_item; + int i; + group_item = groups; + while (group_item != ((void *)0)) { + for (i = 0; i < user_item->no_groups; i++) + if (user_item->groups[i] == group_item->id) + return 0; + group_item = group_item->next; + } + return -1; +} +char *foo (void) __attribute__((__noclone__, __noinline__)); +char* g_strdup (const char *str) __attribute__((__malloc__, __noclone__, __noinline__)); +int g_strcmp0 (const char *str1, const char *str2); +static int +is_basic(char **user) +{ + char *passwd_ptr; + char *authent = foo(); + passwd_ptr = __builtin_strchr(authent, ':'); + if (passwd_ptr != ((void *)0)) { + *user = g_strdup(authent); + return 0; + } + return -1; +} +static int +is_digest(char **user) +{ + int ret_val = -1; + char *authent; + authent = ha_get_string_value(); + if (authent) { + *user = g_strdup(authent); + ret_val = 0; + } + return ret_val; +} +__attribute__((__noclone__, __noinline__)) +void g_free (void * mem); +static enum user_response +get_user_info_from_header(const realm_type type, + char **user_name, + struct user_info **user_item) +{ + int ret_val = no_user_response; + if ((type == ws_realm)) { + if (is_basic(user_name) == 0) + ret_val = access_denied_user_response; + if (is_digest(user_name) == 0) + ret_val = ok_user_response; + } else { + if (is_basic(user_name) < 0 && + /* Load of *user_name here, but not after the is_digest call. */ + is_digest(user_name) < 0) + ; + else if ((*user_item = find_user(*user_name)) != ((void *)0)) + ret_val = ok_user_response; + else + ret_val = access_denied_user_response; + if (ret_val != ok_user_response) + g_free(*user_name); + } + return ret_val; +} +static enum user_response +authenticate_user(request *req, + char **user_name, + struct user_info **user_item) +{ + char *authent = ((void *)0); + har resp = ha_no_value; + enum user_response user_resp; + int ret_val = no_user_response; + if (req->authent && __builtin_strlen(req->authent)) { + authent = req->authent; + user_resp = get_user_info_from_header(req->internal_realm, + user_name, + user_item); + if (user_resp == ok_user_response) { + resp = has_auth_user(authent, 0, req->internal_realm, "", 1); + if (resp == ha_no_error) + ret_val = ok_user_response; + else if (resp != he_stale_nonce) + ret_val = access_denied_user_response; + } else if (user_resp == access_denied_user_response) + ret_val = access_denied_user_response; + } + if (resp != he_memory_too_small && resp != ha_no_error) + resp = has_www_auth("", 1, req->internal_realm, resp); + return ret_val; +} + +int __attribute__ ((__noinline__, __noclone__)) +authent_author(request *req) +{ + struct realm *realm; + char *user_name = ((void *)0); + struct user_info *user_item = ((void *)0); + int res = 0; + asm (""); + realm = realms; + if (__builtin_strcmp("Wsd", realm->name) == 0) { + req->internal_realm = ws_realm; + is_digest(&user_name); + } + if (authenticate_user(req, &user_name, &user_item) < 0) { + if (user_name != ((void *)0)) + req->user = user_name; + res = -2; + goto authent_author_return; + } + if (is_member_of_groups(user_item, realm->groups) < 0) + res = -1; +authent_author_return: + return res; +} + +int good0, good1, good2; + +__attribute__ ((__noinline__, __noclone__)) +char *foo(void) +{ + asm (""); + good0++; + return ""; +} + +__attribute__ ((__noinline__, __noclone__)) +char *ha_get_string_value(void) +{ + asm (""); + good1++; + return "f"; +} + +__attribute__ ((__noinline__, __noclone__)) +har has_auth_user(const char *a, const char *b, realm_type c, char *d, size_t e) +{ + asm (""); + if (*a != 'z' || a[1] != 0 || b != 0 || c != axis_realm || *d != 0 + || e != 1) + __builtin_abort (); + return ha_no_error; +} + +__attribute__ ((__noinline__, __noclone__)) +har has_www_auth(char *a, size_t b, realm_type c, har d) +{ + (void)(*a+b+c+d); + asm (""); + __builtin_abort (); +} + + +char *strdupped_user = "me"; +__attribute__((__malloc__, __noclone__, __noinline__)) +char* g_strdup (const char *str) +{ + asm (""); + if (*str != 'f') + __builtin_abort (); + good2++; + return strdupped_user; +} + +__attribute__((__noclone__, __noinline__)) +void g_free (void * mem) +{ + (void)mem; + asm (""); + __builtin_abort (); +} + +struct user_info me = { .name = "me", .no_groups = 1, .groups = {42}, .next = 0}; +struct user_info you = { .name = "you", .next = &me}; +struct realm_group xgroups = { .name = "*", .id = 42, .next = 0}; + +int main(void) +{ + char *orig_user = "?"; + struct realm r = { .name = "x", .space = "space?", .groups = &xgroups, .next = 0}; + request req = { .user = orig_user, .realm = "!", .authent = "z", + .internal_realm = axis_realm}; + realms = &r; + users = &you; + if (authent_author (&req) != 0 || good0 != 1 || good1 != 1 || good2 != 1 + || req.user != orig_user + || req.internal_realm != axis_realm) + __builtin_abort (); + __builtin_exit (0); +} + 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 190845) @@ -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 190845) @@ -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/torture/stackalign/alloca-6.c =================================================================== --- gcc/testsuite/gcc.dg/torture/stackalign/alloca-6.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/torture/stackalign/alloca-6.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -1,6 +1,6 @@ /* PR middle-end/45234 */ /* { dg-do run { target { { i?86-*-* x86_64-*-* } && ia32 } } } */ -/* { dg-options "-mincoming-stack-boundary=2 -mpreferred-stack-boundary=2" } */ +/* { dg-additional-options "-mincoming-stack-boundary=2 -mpreferred-stack-boundary=2" } */ #include "check.h" Index: gcc/testsuite/gcc.dg/torture/stackalign/vararg-3.c =================================================================== --- gcc/testsuite/gcc.dg/torture/stackalign/vararg-3.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/torture/stackalign/vararg-3.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -1,6 +1,6 @@ /* PR middle-end/37009 */ /* { dg-do run { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */ -/* { dg-options "-msse2" } */ +/* { dg-additional-options "-mmmx -msse2" } */ /* { dg-require-effective-target sse2_runtime } */ #include Index: gcc/testsuite/gcc.dg/torture/stackalign/stackalign.exp =================================================================== --- gcc/testsuite/gcc.dg/torture/stackalign/stackalign.exp (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/torture/stackalign/stackalign.exp (.../branches/gcc-4_7-branch) (wersja 190845) @@ -1,4 +1,4 @@ -# Copyright (C) 2008, 2010 +# Copyright (C) 2008, 2010, 2012 # Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify @@ -18,33 +18,53 @@ # This harness is for tests that should be run at all optimisation levels. load_lib gcc-dg.exp +load_lib torture-options.exp -set additional_flags "" +global DG_TORTURE_OPTIONS LTO_TORTURE_OPTIONS + +dg-init +torture-init + +# default_flags are replaced by a dg-options test directive, or appended +# to by using dg-additional-options. Use default_flags for options that +# are used in all of the torture sets to limit the amount of noise in +# test summaries. +set default_flags "" + +# torture_flags are combined with other torture options and do not +# affect options specified within a test. +set torture_flags "" + +set stackalign_options [list] if { [check_effective_target_automatic_stack_alignment] } then { - lappend additional_flags "-mstackrealign" - lappend additional_flags "-mpreferred-stack-boundary=5" + append default_flags " -mstackrealign" + append default_flags " -mpreferred-stack-boundary=5" } if { [istarget i?86*-*-*] || [istarget x86_64-*-*] } then { - lappend additional_flags "-mno-mmx" + append default_flags " -mno-mmx" } +lappend stackalign_options [join $torture_flags] -dg-init - -gcc-dg-runtest [lsort [glob $srcdir/$subdir/*.c]] $additional_flags if { [check_effective_target_fpic] } then { - set pic_additional_flags $additional_flags - lappend pic_additional_flags "-fpic" - gcc-dg-runtest [lsort [glob $srcdir/$subdir/*.c]] $pic_additional_flags + set pic_torture_flags $torture_flags + append pic_torture_flags " -fpic" + lappend stackalign_options [join $pic_torture_flags] } if { [check_effective_target_automatic_stack_alignment] } then { - lappend additional_flags "-mforce-drap" - gcc-dg-runtest [lsort [glob $srcdir/$subdir/*.c]] $additional_flags + append torture_flags " -mforce-drap" + lappend stackalign_options [join $torture_flags] if { [check_effective_target_fpic] } then { - set pic_additional_flags $additional_flags - lappend pic_additional_flags "-fpic" - gcc-dg-runtest [lsort [glob $srcdir/$subdir/*.c]] $pic_additional_flags + set pic_torture_flags $torture_flags + append pic_torture_flags " -fpic" + lappend stackalign_options [join $pic_torture_flags] } } +# Combine stackalign options with the usual torture optimization flags. +set-torture-options [concat $DG_TORTURE_OPTIONS $LTO_TORTURE_OPTIONS] $stackalign_options + +gcc-dg-runtest [lsort [glob $srcdir/$subdir/*.c]] "$default_flags" + +torture-finish dg-finish Index: gcc/testsuite/gcc.dg/torture/stackalign/push-1.c =================================================================== --- gcc/testsuite/gcc.dg/torture/stackalign/push-1.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/torture/stackalign/push-1.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -1,6 +1,6 @@ /* PR middle-end/37010 */ /* { dg-do run { target { { i?86-*-* x86_64-*-* } && ia32 } } } */ -/* { dg-options "-msse2 -mpreferred-stack-boundary=2" } */ +/* { dg-additional-options "-mmmx -msse2 -mpreferred-stack-boundary=2" } */ /* { dg-require-effective-target sse2_runtime } */ #include Index: gcc/testsuite/gcc.dg/torture/stackalign/alloca-2.c =================================================================== --- gcc/testsuite/gcc.dg/torture/stackalign/alloca-2.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/torture/stackalign/alloca-2.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -1,6 +1,6 @@ /* PR middle-end/37009 */ /* { dg-do run { target { { i?86-*-* x86_64-*-* } && ia32 } } } */ -/* { dg-options "-msse2" } */ +/* { dg-additional-options "-mmmx -msse2" } */ /* { dg-require-effective-target sse2_runtime } */ #include Index: gcc/testsuite/gcc.dg/torture/stackalign/alloca-3.c =================================================================== --- gcc/testsuite/gcc.dg/torture/stackalign/alloca-3.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/torture/stackalign/alloca-3.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -1,6 +1,6 @@ /* PR middle-end/37009 */ /* { dg-do run { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */ -/* { dg-options "-msse2" } */ +/* { dg-additional-options "-mmmx -msse2" } */ /* { dg-require-effective-target sse2_runtime } */ #include Index: gcc/testsuite/gcc.dg/torture/stackalign/alloca-4.c =================================================================== --- gcc/testsuite/gcc.dg/torture/stackalign/alloca-4.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/torture/stackalign/alloca-4.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -1,6 +1,6 @@ /* PR middle-end/37009 */ /* { dg-do run { target { { i?86-*-* x86_64-*-* } && ia32 } } } */ -/* { dg-options "-mincoming-stack-boundary=2 -mpreferred-stack-boundary=2" } */ +/* { dg-additional-options "-mincoming-stack-boundary=2 -mpreferred-stack-boundary=2" } */ #include "check.h" Index: gcc/testsuite/gcc.dg/torture/stackalign/alloca-5.c =================================================================== --- gcc/testsuite/gcc.dg/torture/stackalign/alloca-5.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/torture/stackalign/alloca-5.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -1,6 +1,6 @@ /* PR middle-end/45234 */ /* { dg-do run { target { { i?86-*-* x86_64-*-* } && ia32 } } } */ -/* { dg-options "-mincoming-stack-boundary=2 -mpreferred-stack-boundary=2" } */ +/* { dg-additional-options "-mincoming-stack-boundary=2 -mpreferred-stack-boundary=2" } */ #include "check.h" Index: gcc/testsuite/gcc.dg/20020201-1.c =================================================================== --- gcc/testsuite/gcc.dg/20020201-1.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/20020201-1.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -7,12 +7,8 @@ /* { dg-options "-fprofile-arcs" } */ /* { dg-do run { target native } } */ -extern void abort (void); -extern void exit (int); +#include -int rand (void); -void srand (unsigned int seed); - int globvar; void Index: gcc/testsuite/gcc.dg/pr53942.c =================================================================== --- gcc/testsuite/gcc.dg/pr53942.c (.../tags/gcc_4_7_1_release) (wersja 0) +++ gcc/testsuite/gcc.dg/pr53942.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -0,0 +1,34 @@ +/* PR rtl-optimization/53942 */ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ +/* { dg-additional-options "-mtune=pentium2" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */ + +struct S +{ + unsigned short w[3]; + unsigned int x, y; +}; + +struct S *baz (void); + +__attribute__ ((noinline)) +static unsigned char +foo (struct S *x, unsigned char y) +{ + unsigned char c = 0; + unsigned char v = x->w[0]; + c |= v; + v = ((x->w[1]) & (1 << y)) ? 1 : 0; + c |= v << 1; + v = ((x->w[2]) & 0xff) & (1 << y); + c |= v << 2; + return c; +} + +void +bar (void) +{ + struct S *s = baz (); + s->x = foo (s, 6); + s->y = foo (s, 7); +} Index: gcc/testsuite/gcc.dg/pr52530.c =================================================================== --- gcc/testsuite/gcc.dg/pr52530.c (.../tags/gcc_4_7_1_release) (wersja 0) +++ gcc/testsuite/gcc.dg/pr52530.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -0,0 +1,40 @@ +/* { dg-do run } */ + +extern void abort (void); + +#if __SIZEOF_INT__ > 2 +struct foo +{ + int *f; + int i; +}; + +int baz; +#else +struct foo +{ + long *f; + long i; +}; + +long baz; +#endif + +void __attribute__ ((noinline)) +bar (struct foo x) +{ + *(x.f) = x.i; +} + +int +main () +{ + struct foo x = { &baz, 0xdeadbeef }; + + bar (x); + + if (baz != 0xdeadbeef) + abort (); + + return 0; +} Index: gcc/testsuite/gcc.dg/Wfatal-2.c =================================================================== --- gcc/testsuite/gcc.dg/Wfatal-2.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/Wfatal-2.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -5,5 +5,5 @@ int i = INT_MAX + 1; /* { dg-error "integer overflow in expression" } */ int k = 1 / 0; int j = INT_MIN - 1; -/* { dg-message "being treated as errors" "" { target *-*-* } 0 } */ -/* { dg-message "terminated due to -Wfatal-errors" "" { target *-*-* } 0 } */ +/* { dg-message "being treated as errors" "treated as errors" { target *-*-* } 0 } */ +/* { dg-message "terminated due to -Wfatal-errors" "terminated" { target *-*-* } 0 } */ Index: gcc/testsuite/gcc.dg/pr48552-1.c =================================================================== --- gcc/testsuite/gcc.dg/pr48552-1.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/pr48552-1.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -7,15 +7,15 @@ void f1 (void *x) { - __asm volatile ("" : : "r" (*x)); /* { dg-warning "dereferencing" } */ -} /* { dg-error "invalid use of void expression" "" { target *-*-* } 10 } */ + __asm volatile ("" : : "r" (*x)); /* { dg-warning "dereferencing" "deref" } */ +} /* { dg-error "invalid use of void expression" "void expr" { target *-*-* } 10 } */ void f2 (void *x) { - __asm volatile ("" : "=r" (*x)); /* { dg-warning "dereferencing" } */ -} /* { dg-error "invalid use of void expression" "" { target *-*-* } 16 } */ - /* { dg-error "invalid lvalue in asm output 0" "" { target *-*-* } 16 } */ + __asm volatile ("" : "=r" (*x)); /* { dg-warning "dereferencing" "deref" } */ +} /* { dg-error "invalid use of void expression" "void expr" { target *-*-* } 16 } */ + /* { dg-error "invalid lvalue in asm output 0" "invalid lvalue" { target *-*-* } 16 } */ void f3 (void *x) { @@ -31,15 +31,15 @@ void f5 (void *x) { - __asm volatile ("" : : "g" (*x)); /* { dg-warning "dereferencing" } */ -} /* { dg-error "invalid use of void expression" "" { target *-*-* } 34 } */ + __asm volatile ("" : : "g" (*x)); /* { dg-warning "dereferencing" "deref" } */ +} /* { dg-error "invalid use of void expression" "void expr" { target *-*-* } 34 } */ void f6 (void *x) { - __asm volatile ("" : "=g" (*x)); /* { dg-warning "dereferencing" } */ -} /* { dg-error "invalid use of void expression" "" { target *-*-* } 40 } */ - /* { dg-error "invalid lvalue in asm output 0" "" { target *-*-* } 40 } */ + __asm volatile ("" : "=g" (*x)); /* { dg-warning "dereferencing" "deref" } */ +} /* { dg-error "invalid use of void expression" "void expr" { target *-*-* } 40 } */ + /* { dg-error "invalid lvalue in asm output 0" "invalid lvalue" { target *-*-* } 40 } */ void f7 (struct S *x) { @@ -49,5 +49,5 @@ void f8 (struct S *x) { - __asm volatile ("" : "=r" (*x)); /* { dg-error "dereferencing pointer to incomplete type" } */ -} /* { dg-error "invalid lvalue in asm output 0" "" { target *-*-* } 52 } */ + __asm volatile ("" : "=r" (*x)); /* { dg-error "dereferencing pointer to incomplete type" "incomplete" } */ +} /* { dg-error "invalid lvalue in asm output 0" "invalid lvalue" { target *-*-* } 52 } */ Index: gcc/testsuite/gcc.dg/tree-prof/tree-prof.exp =================================================================== --- gcc/testsuite/gcc.dg/tree-prof/tree-prof.exp (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/tree-prof/tree-prof.exp (.../branches/gcc-4_7-branch) (wersja 190845) @@ -29,9 +29,6 @@ set tool gcc set prof_ext "gcda" -# Override the list defined in profopt.exp. -set PROFOPT_OPTIONS [list {}] - if $tracelevel then { strace $tracelevel } @@ -39,6 +36,10 @@ # Load support procs. load_lib profopt.exp +# Save and override the default list defined in profopt.exp. +set treeprof_save_profopt_options $PROFOPT_OPTIONS +set PROFOPT_OPTIONS [list {}] + # These are globals used by profopt-execute. The first is options # needed to generate profile data, the second is options to use the # profile data. @@ -52,3 +53,5 @@ } profopt-execute $src } + +set PROFOPT_OPTIONS $treeprof_save_profopt_options Index: gcc/testsuite/gcc.dg/pr30551-5.c =================================================================== --- gcc/testsuite/gcc.dg/pr30551-5.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/pr30551-5.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -2,6 +2,6 @@ /* { dg-do compile } */ /* { dg-options "-pedantic -Wno-main" } */ -void main(char a) {} /* { dg-bogus "first argument of .main. should be .int." } */ -/* { dg-bogus ".main. takes only zero or two arguments" "" { target *-*-* } 5 } */ -/* { dg-bogus "return type of .main. is not .int." "" { target *-*-* } 5 } */ +void main(char a) {} /* { dg-bogus "first argument of .main. should be .int." "int" } */ +/* { dg-bogus ".main. takes only zero or two arguments" "zero or two" { target *-*-* } 5 } */ +/* { dg-bogus "return type of .main. is not .int." "return type" { target *-*-* } 5 } */ Index: gcc/testsuite/gcc.dg/wtr-int-type-1.c =================================================================== --- gcc/testsuite/gcc.dg/wtr-int-type-1.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/wtr-int-type-1.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -25,8 +25,8 @@ /* But this one should, since it doesn't fit in long (long), but does fit in unsigned long (long). */ - i = 18446744073709551615; /* { dg-warning "integer constant is so large that it is unsigned" "decimal constant" } */ - /* { dg-warning "this decimal constant would be unsigned in ISO C90" "decimal constant" { target *-*-* } 28 } */ + i = 18446744073709551615; /* { dg-warning "integer constant is so large that it is unsigned" "so large" } */ + /* { dg-warning "this decimal constant would be unsigned in ISO C90" "ISO C90" { target *-*-* } 28 } */ # 29 "sys-header.h" 3 } Index: gcc/testsuite/gcc.dg/c99-vla-jump-3.c =================================================================== --- gcc/testsuite/gcc.dg/c99-vla-jump-3.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/c99-vla-jump-3.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -305,5 +305,5 @@ void fc288 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0;a: goto a; } /* Match extra informative notes. */ -/* { dg-message "note: label '\[^\n'\]*' defined here" "note: expected" { target *-*-* } 0 } */ -/* { dg-message "note: '\[^\n'\]*' declared here" "note: expected" { target *-*-* } 0 } */ +/* { dg-message "note: label '\[^\n'\]*' defined here" "note: defined" { target *-*-* } 0 } */ +/* { dg-message "note: '\[^\n'\]*' declared here" "note: declared" { target *-*-* } 0 } */ Index: gcc/testsuite/gcc.dg/pr30551.c =================================================================== --- gcc/testsuite/gcc.dg/pr30551.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/pr30551.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -2,6 +2,6 @@ /* { dg-do compile } */ /* { dg-options "-Wall" } */ /* { dg-skip-if "-Wmain not enabled with -Wall on SPU" { spu-*-* } } */ -void main(char a) {} /* { dg-warning "first argument of .main. should be .int." } */ -/* { dg-warning ".main. takes only zero or two arguments" "" { target *-*-* } 5 } */ -/* { dg-warning "return type of .main. is not .int." "" { target *-*-* } 5 } */ +void main(char a) {} /* { dg-warning "first argument of .main. should be .int." "int" } */ +/* { dg-warning ".main. takes only zero or two arguments" "zero or two" { target *-*-* } 5 } */ +/* { dg-warning "return type of .main. is not .int." "return type" { target *-*-* } 5 } */ Index: gcc/testsuite/gcc.dg/Wfatal.c =================================================================== --- gcc/testsuite/gcc.dg/Wfatal.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/Wfatal.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -5,8 +5,8 @@ int i = INT_MAX + 1; /* { dg-warning "integer overflow in expression" } */ int k = 1 / 0; /* { dg-error "division by zero" } */ int j = INT_MIN - 1; -/* { dg-message "some warnings being treated as errors" "" {target "*-*-*"} 0 } */ -/* { dg-message "terminated due to -Wfatal-errors" "" { target *-*-* } 0 } */ +/* { dg-message "some warnings being treated as errors" "treated as errors" {target "*-*-*"} 0 } */ +/* { dg-message "terminated due to -Wfatal-errors" "terminated" { target *-*-* } 0 } */ Index: gcc/testsuite/gcc.dg/vla-8.c =================================================================== --- gcc/testsuite/gcc.dg/vla-8.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/vla-8.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -30,5 +30,5 @@ } /* Match extra informative notes. */ -/* { dg-message "note: label '\[^\n'\]*' defined here" "note: expected" { target *-*-* } 0 } */ -/* { dg-message "note: '\[^\n'\]*' declared here" "note: expected" { target *-*-* } 0 } */ +/* { dg-message "note: label '\[^\n'\]*' defined here" "defined" { target *-*-* } 0 } */ +/* { dg-message "note: '\[^\n'\]*' declared here" "declared" { target *-*-* } 0 } */ 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 190845) @@ -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/gcc.dg/sync-2.c =================================================================== --- gcc/testsuite/gcc.dg/sync-2.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/sync-2.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -4,8 +4,8 @@ /* { dg-options "-march=i486" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */ /* { dg-options "-mcpu=v9" { target sparc*-*-* } } */ -/* { dg-message "note: '__sync_fetch_and_nand' changed semantics in GCC 4.4" "" { target *-*-* } 0 } */ -/* { dg-message "note: '__sync_nand_and_fetch' changed semantics in GCC 4.4" "" { target *-*-* } 0 } */ +/* { dg-message "note: '__sync_fetch_and_nand' changed semantics in GCC 4.4" "fetch_and_nand" { target *-*-* } 0 } */ +/* { dg-message "note: '__sync_nand_and_fetch' changed semantics in GCC 4.4" "nand_and_fetch" { target *-*-* } 0 } */ /* Test functionality of the intrinsics for 'short' and 'char'. */ Index: gcc/testsuite/gcc.dg/vect/slp-25.c =================================================================== --- gcc/testsuite/gcc.dg/vect/slp-25.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/vect/slp-25.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -56,5 +56,5 @@ /* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */ /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */ -/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail { vect_no_align } } } } */ +/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail { vect_no_align || { ! vect_natural_alignment } } } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ Index: gcc/testsuite/gcc.dg/mtune.c =================================================================== --- gcc/testsuite/gcc.dg/mtune.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/mtune.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -1,8 +1,8 @@ /* { dg-do compile } */ /* { dg-skip-if "" { *-*-* } { "-mtune=*" } { "" } } */ /* { dg-options "-mtune=foo" } */ -/* { dg-error "mtune" "" { target *-*-* } 0 } */ -/* { dg-bogus "march" "" { target *-*-* } 0 } */ -/* { dg-bogus "mcpu" "" { target *-*-* } 0 } */ +/* { dg-error "mtune" "mtune" { target *-*-* } 0 } */ +/* { dg-bogus "march" "march" { target *-*-* } 0 } */ +/* { dg-bogus "mcpu" "mcpu" { target *-*-* } 0 } */ /* { dg-prune-output "note: valid arguments.*" } */ int i; Index: gcc/testsuite/gcc.dg/pr30457.c =================================================================== --- gcc/testsuite/gcc.dg/pr30457.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/pr30457.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -17,9 +17,9 @@ va_start(ap, paramN); /* { dg-warning "undefined behaviour when second parameter of 'va_start' is declared with 'register' storage" } */ /* Undefined by C99 7.15.1.1p2: */ - (void) va_arg(ap, char); /* { dg-warning "'char' is promoted to 'int' when passed through '...'" } */ - /* { dg-message "note: .so you should pass .int. not .char. to .va_arg.." "" { target *-*-* } 20 } */ - /* { dg-message "note: if this code is reached, the program will abort" "" { target *-*-* } 20 } */ + (void) va_arg(ap, char); /* { dg-warning "'char' is promoted to 'int' when passed through '...'" "promoted" } */ + /* { dg-message "note: .so you should pass .int. not .char. to .va_arg.." "int not char" { target *-*-* } 20 } */ + /* { dg-message "note: if this code is reached, the program will abort" "will abort" { target *-*-* } 20 } */ va_end(ap); } Index: gcc/testsuite/gcc.dg/format/few-1.c =================================================================== --- gcc/testsuite/gcc.dg/format/few-1.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/format/few-1.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -4,15 +4,15 @@ int f(int *ip, char *cp) { __builtin_printf ("%*.*s"); -/* { dg-warning "field width specifier '\\*' expects a matching 'int' argument" "" { target *-*-* } 6 } */ -/* { dg-warning "field precision specifier '\\.\\*' expects a matching 'int' argument" "" { target *-*-* } 6 } */ -/* { dg-warning "format '%s' expects a matching 'char \\*' argument" "" { target *-*-* } 6 } */ +/* { dg-warning "field width specifier '\\*' expects a matching 'int' argument" "width" { target *-*-* } 6 } */ +/* { dg-warning "field precision specifier '\\.\\*' expects a matching 'int' argument" "precision" { target *-*-* } 6 } */ +/* { dg-warning "format '%s' expects a matching 'char \\*' argument" "format" { target *-*-* } 6 } */ __builtin_printf ("%*.*s", ip, *cp); -/* { dg-warning "field width specifier '\\*' expects argument of type 'int'" "" { target *-*-* } 10 } */ -/* { dg-warning "format '%s' expects a matching 'char \\*' argument" "" { target *-*-* } 10 } */ +/* { dg-warning "field width specifier '\\*' expects argument of type 'int'" "width" { target *-*-* } 10 } */ +/* { dg-warning "format '%s' expects a matching 'char \\*' argument" "format" { target *-*-* } 10 } */ __builtin_printf ("%s %i", ip, ip); -/* { dg-warning "format '%s' expects argument of type 'char \\*'" "" { target *-*-* } 13 } */ -/* { dg-warning "format '%i' expects argument of type 'int'" "" { target *-*-* } 13 } */ +/* { dg-warning "format '%s' expects argument of type 'char \\*'" "char" { target *-*-* } 13 } */ +/* { dg-warning "format '%i' expects argument of type 'int'" "int" { target *-*-* } 13 } */ __builtin_printf ("%s %i", cp); /* { dg-warning "format '%i' expects a matching 'int' argument" "" { target *-*-* } 16 } */ __builtin_printf ("%lc"); Index: gcc/testsuite/gcc.dg/pr28322-3.c =================================================================== --- gcc/testsuite/gcc.dg/pr28322-3.c (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.dg/pr28322-3.c (.../branches/gcc-4_7-branch) (wersja 190845) @@ -6,5 +6,5 @@ { int i = 1; } -/* { dg-message "unrecognized command line option .-fno-foobar." "" { target *-*-* } 0 } */ -/* { dg-message "unrecognized command line option .-mno-foobar." "" { target *-*-* } 0 } */ +/* { dg-message "unrecognized command line option .-fno-foobar." "f" { target *-*-* } 0 } */ +/* { dg-message "unrecognized command line option .-mno-foobar." "m" { target *-*-* } 0 } */ Index: gcc/testsuite/gcc.misc-tests/bprob.exp =================================================================== --- gcc/testsuite/gcc.misc-tests/bprob.exp (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/gcc.misc-tests/bprob.exp (.../branches/gcc-4_7-branch) (wersja 190845) @@ -30,16 +30,6 @@ set prof_ext "gcda" set perf_ext tim -# Override the list defined in profopt.exp. -set PROFOPT_OPTIONS [list \ - { -g } \ - { -O0 } \ - { -O1 } \ - { -O2 -DPERFTIME } \ - { -O3 -DPERFTIME } \ - { -O3 -g -DPERFTIME } \ - { -Os } ] - if $tracelevel then { strace $tracelevel } @@ -47,6 +37,10 @@ # Load support procs. load_lib profopt.exp +# Save and override the default list defined in profopt.exp. +set bprob_save_profopt_options $PROFOPT_OPTIONS +set PROFOPT_OPTIONS [list { -O2 } { -O3 }] + set profile_options "-fprofile-arcs" set feedback_options "-fbranch-probabilities" @@ -59,3 +53,5 @@ profopt-execute $src } } + +set PROFOPT_OPTIONS $bprob_save_profopt_options Index: gcc/testsuite/ChangeLog =================================================================== --- gcc/testsuite/ChangeLog (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/ChangeLog (.../branches/gcc-4_7-branch) (wersja 190845) @@ -1,3 +1,549 @@ +2012-08-31 Ollie Wild + + PR c++/54197 + * g++.dg/init/lifetime3.C: New test. + +2012-08-28 Uros Bizjak + + Backport from mainline + 2012-08-27 Uros Bizjak + + PR target/46254 + * gcc.target/i386/pr46254.c: New test. + +2012-08-20 Patrick Marlier + + Backported from trunk + 2012-08-20 Patrick Marlier + + PR middle-end/53992 + * gcc.dg/gomp/pr53992.c: New test. + +2012-08-13 Jakub Jelinek + + Backported from trunk + 2012-07-19 Jakub Jelinek + + PR rtl-optimization/53942 + * gcc.dg/pr53942.c: New test. + +2012-08-10 Ulrich Weigand + + Backport from mainline + 2012-07-30 Ulrich Weigand + + * lib/target-supports.exp + (check_effective_target_vect_natural_alignment): New function. + * gcc.dg/align-2.c: Only run on targets with natural alignment + of vector types. + * gcc.dg/vect/slp-25.c: Adjust tests for targets without natural + alignment of vector types. + +2012-08-09 H.J. Lu + + Backport from mainline + 2012-08-08 H.J. Lu + + PR rtl-optimization/54157 + * gcc.target/i386/pr54157.c: New file. + +2012-08-01 Uros Bizjak + + Backport from mainline + 2012-03-11 Uros Bizjak + + PR target/52530 + * gcc.dg/torture/pr52530.c: New test. + +2012-07-27 Anna Tikhonova + + * gcc.dg/20020201-1.c: Remove declarations for exit, abort, + rand, srand. Include . + +2012-07-20 Jason Merrill + + PR c++/54038 + * g++.dg/other/array7.C: New. + +2012-07-19 Jason Merrill + + PR c++/54026 + * g++.dg/init/mutable1.C: New. + +2012-07-19 Eric Botcazou + + * gnat.dg/opt25.adb: New test. + * gnat.dg/opt25_pkg1.ad[sb]: New helper. + * gnat.dg/opt25_pkg2.ad[sb]: Likewise. + +2012-07-19 Eric Botcazou + + * gnat.dg/aggr20.ad[sb]: New test. + * gnat.dg/aggr20_pkg.ads: New helper. + +2012-07-19 Eric Botcazou + + * gnat.dg/derived_type3.adb: New test. + * gnat.dg/derived_type3_pkg.ad[sb]: New helper. + +2012-07-19 Richard Guenther + Eric Botcazou + + * gnat.dg/loop_optimization11.adb: New testcase. + * gnat.dg/loop_optimization11_pkg.ads: Likewise. + +2012-07-19 Eric Botcazou + + * gnat.dg/discr38.adb: New test. + +2012-07-19 Jakub Jelinek + + PR middle-end/54017 + * c-c++-common/gomp/pr54017.c: New test. + +2012-07-18 Richard Guenther + + Backport from mainline + 2012-05-03 Richard Guenther + + * gfortran.dg/pr52621.f90: Add -w to avoid diagnostic about + unsupported prefetching support. + +2012-07-17 Jason Merrill + + PR c++/53995 + * g++.dg/parse/enum9.C: New. + +2012-07-17 Jason Merrill + + PR c++/53989 + * g++.dg/template/array23.C: New. + +2012-07-17 Jason Merrill + + PR c++/53549 + * g++.dg/template/current-inst1.C: New. + * g++.dg/parse/crash35.C: Adjust. + +2012-07-13 Hans-Peter Nilsson + + PR rtl-optimization/53908 + * gcc.dg/torture/pr53908.c: New test. + +2012-07-10 Uros Bizjak + + Backport from mainline + 2012-07-03 Uros Bizjak + + PR target/53811 + * g++.dg/other/pr53811.C: New test. + +2012-07-10 Jason Merrill + + PR c++/53733 + * g++.dg/cpp0x/defaulted36.C: New. + * g++.dg/cpp0x/defaulted21.C: Adjust. + + * g++.dg/cpp0x/implicit13.C: New. + +2012-07-09 Janis Johnson + + Backport from mainline. + 2012-06-28 Janis Johnson + + * g++.dg/cpp0x/nullptr19.c: Remove exta directives on same line. + + * g++.dg/template/error46.C: Add missing comment to dg-message. + * g++.dg/template/crash107.C: Likewise. + * g++.dg/template/error47.C: Likewise. + * g++.dg/template/crash108.C: Likewise. + * g++.dg/overload/operator5.C: Likewise. + + * gcc.dg/Wstrict-aliasing-converted-assigned.c: Fix syntax + errors in dg-message directives, add comments. + + 2012-06-26 Janis Johnson + + * lib/scandump.exp (scan-dump, scan-dump-not, scan-dump-dem, + scan-dump-dem-not): Use printable pattern in test name. + + 2012-06-25 Janis Johnson + + * lib/target-supports-dg.exp (testname-for-summary): New. + * lib/profopt.exp (profopt_execute): Define testname_with_flags. + * lib/gcc-dg.exp (cleanup-coverage-files, cleanup-repo-notes, + cleanup-stack-usage, cleanup-dump, cleanup-saved-temps, scan-module, + scan-module-absence, output-exists, output-exists-not: Use + testname-for-summary. + (dg-test): Clean up testname_with_flags. + * lib/scanasm.exp (scan-assembler, scan-assembler-not, scan-hidden, + scan-not-hidden, scan-file, scan-file-not, scan-stack-usage, + scan-stack-usage-not, scan-assembler-times, scan-assembler-dem, + scan-assembler-dem-not, object-size: Use testname-for-summary. + * lib/gcov.exp (run-gcov): Likewise. + * lib/scandump.exp (scan-dump, scan-dump-times, scan-dump-not, + scan-dump-dem, scan-dump-dem-note): Likewise. + + * lib/profopt.exp: Make prof_option_list local to profopt-execute. + * g++.dg/tree-prof/tree-prof.exp (PROFOPT_OPTIONS): Define after + including profopt.opt; save and restore existing value. + * g++.dg/bprob/bprob.exp: Likewise. + * gcc.dg/matrix/matrix.exp: Likewise. + * gcc.dg/tree-prof/tree-prof.exp: Likewise. + * gcc.misc-tests/bprob.exp: Likewise; also replace formerly-ignored + PROFOPT_OPTIONS. + + 2012-06-15 Janis Johnson + + * lib/gcov.exp (verify-lines, verify-branches, verify-calls): Use + testname that includes flags, passed in as new argument, in + pass/fail messages. + (run_gcov): Get testname from dg-test, use it in pass/fail messages + and pass it to verify-* procedures. + + * g++.dg/torture/stackalign/stackalign.exp: Combine stack + alignment torture options with usual torture options. + + * g++.dg/cpp0x/auto27.C: Add comments to checks for multiple + messages reported for one line of source code. + * g++.dg/cpp0x/constexpr-decl.C: Likewise. + * g++.dg/cpp0x/decltype2.C: Likewise. + * g++.dg/cpp0x/decltype3.C: Likewise. + * g++.dg/cpp0x/lambda/lambda-syntax1.C: Likewise. + * g++.dg/cpp0x/regress/error-recovery1.C: Likewise. + * g++.dg/cpp0x/static_assert3.C: Likewise. + * g++.dg/cpp0x/udlit-cpp98-neg.C: Likewise. + * g++.dg/cpp0x/udlit-shadow-neg.C: Likewise. + * g++.dg/cpp0x/union1.C: Likewise. + * g++.dg/cpp0x/variadic-ex10.C: Likewise. + * g++.dg/cpp0x/variadic-ex14.C: Likewise. + * g++.dg/cpp0x/variadic2.C: Likewise. + * g++.dg/cpp0x/variadic20.C: Likewise. + * g++.dg/cpp0x/variadic74.C: Likewise. + * g++.dg/diagnostic/bitfld2.C: Likewise. + * g++.dg/ext/attrib44.C: Likewise. + * g++.dg/ext/no-asm-1.C: Likewise. + * g++.dg/other/error34.C: Likewise. + * g++.dg/parse/crash46.C: Likewise. + * g++.dg/parse/error10.C: Likewise. + * g++.dg/parse/error2.C: Likewise. + * g++.dg/parse/error3.C: Likewise. + * g++.dg/parse/error36.C: Likewise. + * g++.dg/parse/error8.C: Likewise. + * g++.dg/parse/error9.C: Likewise. + * g++.dg/parse/parser-pr28152-2.C: Likewise. + * g++.dg/parse/parser-pr28152.C: Likewise. + * g++.dg/parse/template25.C: Likewise. + * g++.dg/parse/typename11.C: Likewise. + * g++.dg/tc1/dr147.C: Likewise. + * g++.dg/template/deduce3.C: Likewise. + * g++.dg/template/koenig9.C: Likewise. + * g++.dg/template/pr23510.C: Likewise. + * g++.dg/warn/pr12242.C: Likewise. + * g++.dg/warn/pr30551-2.C: Likewise. + * g++.dg/warn/pr30551.C: Likewise. + * g++.old-deja/g++.other/typename1.C: Likewise. + * g++.old-deja/g++.pt/niklas01a.C: Likewise. + + 2012-06-13 Janis Johnson + + PR testsuite/20771 + * lib/dg-pch.exp (dg-flags-pch): Add flags to make compile lines in + test summary unique. + + * lib/scanasm.exp (scan-assembler, scan-assembler-not, scan-hidden, + scan-not-hiddent, scan-file, scan-file-not, scan-stack-usage, + scan-stack-usage-not): Don't strip torture options from test name. + + * lib/scandump.exp (scan-dump-times): Use printable version of + regexp in test summary line. + + * gcc.dg/di-longlong64-sync-1.c: Add comments to checks for multiple + messages reported for one line of source code. + * gcc.dg/format/few-1.c: Likewise. + * gcc.dg/ia64-sync-2.c: Likewise. + * gcc.dg/sync-2.c: Likewise. + * gcc.dg/noncompile/pr44517.c: Likewise. + + 2012-06-12 Janis Johnson + + * gcc.dg/torture/stackalign/stackalign.exp: Combine stack + alignment torture options with usual torture options. + * gcc.dg/torture/stackalign/alloca-2.c: Use dg-additional-options + instead of dg-options. + * gcc.dg/torture/stackalign/alloca-3.c: Likewise. + * gcc.dg/torture/stackalign/alloca-4.c: Likewise. + * gcc.dg/torture/stackalign/alloca-5.c: Likewise. + * gcc.dg/torture/stackalign/alloca-6.c: Likewise. + * gcc.dg/torture/stackalign/push-1.c: Likewise. + * gcc.dg/torture/stackalign/vararg-3.c: Likewise. + + * gcc.target/arm/di-longlong64-sync-withhelpers.c: Add comments + to checks for multiple messages reported for one line of source code. + * gcc.target/arm/di-longlong64-sync-withldrexd.c: Likewise. + + * gcc.c-torture/compile/sync-1.c: Add comments to checks for multiple + messages reported for one line of source code. + + * gcc.dg/20031223-1.c: Add comments to check for multiple + messages reported for one line of source code. + * gcc.dg/Wconversion-integer.c: Likewise. + * gcc.dg/Wfatal-2.c: Likewise. + * gcc.dg/Wfatal.c: Likewise. + * gcc.dg/Wobjsize-1.c: Likewise. + * gcc.dg/c99-vla-jump-1.c: Likewise. + * gcc.dg/c99-vla-jump-2.c: Likewise. + * gcc.dg/c99-vla-jump-3.c: Likewise. + * gcc.dg/c99-vla-jump-4.c: Likewise. + * gcc.dg/c99-vla-jump-5.c: Likewise. + * gcc.dg/decl-9.c: Likewise. + * gcc.dg/declspec-10.c: Likewise. + * gcc.dg/declspec-18.c: Likewise. + * gcc.dg/mtune.c: Likewise. + * gcc.dg/parser-pr28152-2.c: Likewise. + * gcc.dg/parser-pr28152.c: Likewise. + * gcc.dg/pr14475.c: Likewise. + * gcc.dg/pr27953.c: Likewise. + * gcc.dg/pr28322-3.c: Likewise. + * gcc.dg/pr30457.c: Likewise. + * gcc.dg/pr30551-2.c: Likewise. + * gcc.dg/pr30551-3.c: Likewise. + * gcc.dg/pr30551-4.c: Likewise. + * gcc.dg/pr30551-5.c: Likewise. + * gcc.dg/pr30551-6.c: Likewise. + * gcc.dg/pr30551.c: Likewise. + * gcc.dg/pr45461.c: Likewise. + * gcc.dg/pr48552-1.c: Likewise. + * gcc.dg/pr48552-2.c: Likewise. + * gcc.dg/redecl-1.c: Likewise. + * gcc.dg/transparent-union-3.c: Likewise. + * gcc.dg/utf-dflt.c: Likewise. + * gcc.dg/utf-dflt2.c: Likewise. + * gcc.dg/vla-8.c: Likewise. + * gcc.dg/vla-init-1.c: Likewise. + * gcc.dg/wtr-int-type-1.c: Likewise. + + * c-c++-common/raw-string-3.c: Add comments to checks for multiple + messages reported for for one line of source code. + * c-c++-common/raw-string-5.c: Likewise. + * c-c++-common/raw-string-4.c: Likewise. + * c-c++-common/raw-string-6.c: Likewise. + * c-c++-common/pr20000.c: Likewise. + + * gcc.dg/cpp/include2a.c: Add comments to checks for multiple + messages reported for one line of source code. + * gcc.dg/cpp/pr30786.c: Likewise. + * gcc.dg/cpp/pr28709.c: Likewise. + * gcc.dg/cpp/missing-header-MD.c: Likewise. + * gcc.dg/cpp/macspace2.c: Likewise. + * gcc.dg/cpp/missing-header-1.c: Likewise. + * gcc.dg/cpp/missing-header-MMD.c: Likewise. + * gcc.dg/cpp/missing-sysheader-MD.c: Likewise. + * gcc.dg/cpp/missing-sysheader-MMD.c: Likewise. + +2012-07-09 Jason Merrill + + PR c++/53882 + * g++.dg/cpp0x/nullptr29.C: New. + +2012-07-06 Mikael Morin + + PR fortran/53732 + * gfortran.dg/inline_sum_4.f90: New test. + +2012-07-06 Richard Guenther + + Backport from mainline + 2012-06-18 Richard Guenther + + PR tree-optimization/53693 + * g++.dg/torture/pr53693.C: New testcase. + +2012-07-06 Richard Guenther + + Backport from mainline + 2012-04-11 Richard Guenther + + PR middle-end/52621 + * gfortran.dg/pr52621.f90: New testcase. + +2012-07-05 Pat Haugen + + Backport from mainline + 2012-05-24 Pat Haugen + + * gcc.target/powerpc/lhs-1.c: New. + * gcc.target/powerpc/lhs-2.c: New. + * gcc.target/powerpc/lhs-3.c: New. + +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 190845) @@ -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 190845) @@ -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 190845) @@ -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/attrib44.C =================================================================== --- gcc/testsuite/g++.dg/ext/attrib44.C (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/g++.dg/ext/attrib44.C (.../branches/gcc-4_7-branch) (wersja 190845) @@ -1,4 +1,4 @@ // PR c++/52671 // { dg-do compile } -__attribute__ ((deprecated)) enum E { E0 }; // { dg-warning "attribute ignored in declaration of" } -// { dg-message "must follow the" "" { target *-*-* } 3 } +__attribute__ ((deprecated)) enum E { E0 }; // { dg-warning "attribute ignored in declaration of" "ignored" } +// { dg-message "must follow the" "must follow" { target *-*-* } 3 } Index: gcc/testsuite/g++.dg/ext/no-asm-1.C =================================================================== --- gcc/testsuite/g++.dg/ext/no-asm-1.C (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/g++.dg/ext/no-asm-1.C (.../branches/gcc-4_7-branch) (wersja 190845) @@ -5,6 +5,6 @@ // keywords. int asm; // { dg-error "before .asm." } -int typeof; // { dg-error "expected" } -// { dg-error "multiple types" "" { target *-*-* } 8 } -// { dg-error "declaration" "" { target *-*-* } 8 } +int typeof; // { dg-error "expected" "expected" } +// { dg-error "multiple types" "multiple" { target *-*-* } 8 } +// { dg-error "declaration" "declaration" { target *-*-* } 8 } 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 190845) @@ -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/tree-prof/tree-prof.exp =================================================================== --- gcc/testsuite/g++.dg/tree-prof/tree-prof.exp (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/g++.dg/tree-prof/tree-prof.exp (.../branches/gcc-4_7-branch) (wersja 190845) @@ -29,9 +29,6 @@ set tool g++ set prof_ext "gcda" -# Override the list defined in profopt.exp. -set PROFOPT_OPTIONS [list {}] - if $tracelevel then { strace $tracelevel } @@ -39,6 +36,10 @@ # Load support procs. load_lib profopt.exp +# Save and override the default list defined in profopt.exp. +set treeprof_save_profopt_options $PROFOPT_OPTIONS +set PROFOPT_OPTIONS [list {}] + # These are globals used by profopt-execute. The first is options # needed to generate profile data, the second is options to use the # profile data. @@ -52,3 +53,5 @@ } profopt-execute $src } + +set PROFOPT_OPTIONS $treeprof_save_profopt_options Index: gcc/testsuite/g++.dg/init/mutable1.C =================================================================== --- gcc/testsuite/g++.dg/init/mutable1.C (.../tags/gcc_4_7_1_release) (wersja 0) +++ gcc/testsuite/g++.dg/init/mutable1.C (.../branches/gcc-4_7-branch) (wersja 190845) @@ -0,0 +1,20 @@ +// PR c++/54026 +// { dg-final { scan-assembler-not "rodata" } } + +void non_const(int *); + +template +struct Foo { + T x; + mutable int y; + void func() const { non_const(&y); } +}; + +struct Bar { + int x; + mutable int y; + void func() const { non_const(&y); } +}; + +const Foo foo = { 1, 2 }; +const Bar bar = { 3, 4 }; Index: gcc/testsuite/g++.dg/init/lifetime3.C =================================================================== --- gcc/testsuite/g++.dg/init/lifetime3.C (.../tags/gcc_4_7_1_release) (wersja 0) +++ gcc/testsuite/g++.dg/init/lifetime3.C (.../branches/gcc-4_7-branch) (wersja 190845) @@ -0,0 +1,37 @@ +// PR c++/26714 +// { dg-do run } + +extern "C" void abort(); + +bool ok = false; +struct A { + A() { } + ~A() { if (!ok) abort(); } +}; + +struct B { + static A foo() { return A(); } +}; + +B b_g; + +struct scoped_ptr { + B* operator->() const { return &b_g; } + B* get() const { return &b_g; } +}; + +B *get() { return &b_g; } + +int main() +{ + scoped_ptr f; + const A& ref1 = f->foo(); + const A& ref2 = f.get()->foo(); + const A& ref3 = get()->foo(); + const A& ref4 = B::foo(); + B *pf = f.get(); + const A& ref5 = pf->foo(); + + + ok = true; +} Index: gcc/testsuite/g++.dg/other/pr53811.C =================================================================== --- gcc/testsuite/g++.dg/other/pr53811.C (.../tags/gcc_4_7_1_release) (wersja 0) +++ gcc/testsuite/g++.dg/other/pr53811.C (.../branches/gcc-4_7-branch) (wersja 190845) @@ -0,0 +1,29 @@ +// { dg-do compile } +// { dg-options "-mcmodel=large" { target { { i?86-*-* x86_64-*-* } && lp64 } } } + +struct ICCStringClass +{ + virtual void * + CreateString (const char *fromText) = 0; +}; + +struct AGSCCDynamicObject +{ + virtual void + Unserialize (int index, const char *serializedData, int dataSize) = 0; +}; + + +struct ScriptString:AGSCCDynamicObject, ICCStringClass +{ + virtual void *CreateString (const char *fromText); +}; + +const char * +CreateNewScriptString (const char *fromText, bool reAllocate = true); + +void * +ScriptString::CreateString (const char *fromText) +{ + return (void *) CreateNewScriptString (fromText); +} Index: gcc/testsuite/g++.dg/other/error34.C =================================================================== --- gcc/testsuite/g++.dg/other/error34.C (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/g++.dg/other/error34.C (.../branches/gcc-4_7-branch) (wersja 190845) @@ -2,5 +2,5 @@ // { dg-do compile } // { dg-options "" } -S () : str(__PRETTY_FUNCTION__) {} // { dg-error "forbids declaration" } -// { dg-error "only constructors" "" { target *-*-* } 5 } +S () : str(__PRETTY_FUNCTION__) {} // { dg-error "forbids declaration" "decl" } +// { dg-error "only constructors" "constructor" { target *-*-* } 5 } Index: gcc/testsuite/g++.dg/other/array7.C =================================================================== --- gcc/testsuite/g++.dg/other/array7.C (.../tags/gcc_4_7_1_release) (wersja 0) +++ gcc/testsuite/g++.dg/other/array7.C (.../branches/gcc-4_7-branch) (wersja 190845) @@ -0,0 +1,9 @@ +// PR c++/54038 + +extern const char *const v[]; +typedef char T; +void foo (const T *const[]); +struct A +{ + static const char *const a[]; +}; Index: gcc/testsuite/g++.dg/diagnostic/bitfld2.C =================================================================== --- gcc/testsuite/g++.dg/diagnostic/bitfld2.C (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/g++.dg/diagnostic/bitfld2.C (.../branches/gcc-4_7-branch) (wersja 190845) @@ -3,7 +3,7 @@ template struct A { - struct {} : 2; // { dg-error "expected ';' after struct" } + struct {} : 2; // { dg-error "expected ';' after struct" "expected" } }; -// { dg-error "ISO C.. forbids declaration" "" { target *-*-* } 6 } -// { dg-error "ISO C.. prohibits anonymous" "" { target *-*-* } 6 } +// { dg-error "ISO C.. forbids declaration" "declaration" { target *-*-* } 6 } +// { dg-error "ISO C.. prohibits anonymous" "anonymous" { target *-*-* } 6 } 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 190845) @@ -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/warn/pr30551-2.C =================================================================== --- gcc/testsuite/g++.dg/warn/pr30551-2.C (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/g++.dg/warn/pr30551-2.C (.../branches/gcc-4_7-branch) (wersja 190845) @@ -2,5 +2,5 @@ // { dg-do compile } // { dg-options "-pedantic-errors" } // { dg-skip-if "-Wmain not enabled with -pedantic on SPU" { spu-*-* } } -int main(char a) {} /* { dg-error "first argument of .*main.* should be .int." } */ -/* { dg-error "main.* takes only zero or two arguments" "" { target *-*-* } 5 } */ +int main(char a) {} /* { dg-error "first argument of .*main.* should be .int." "int" } */ +/* { dg-error "main.* takes only zero or two arguments" "zero or two" { target *-*-* } 5 } */ Index: gcc/testsuite/g++.dg/warn/pr30551.C =================================================================== --- gcc/testsuite/g++.dg/warn/pr30551.C (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/g++.dg/warn/pr30551.C (.../branches/gcc-4_7-branch) (wersja 190845) @@ -2,5 +2,5 @@ // { dg-do compile } // { dg-options "" } // { dg-skip-if "-Wmain not enabled on SPU" { spu-*-* } } -int main(char a) {} /* { dg-warning "first argument of .*main.* should be .int." } */ -/* { dg-warning "main.* takes only zero or two arguments" "" { target *-*-* } 5 } */ +int main(char a) {} /* { dg-warning "first argument of .*main.* should be .int." "int" } */ +/* { dg-warning "main.* takes only zero or two arguments" "zero or two" { target *-*-* } 5 } */ Index: gcc/testsuite/g++.dg/warn/pr12242.C =================================================================== --- gcc/testsuite/g++.dg/warn/pr12242.C (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/g++.dg/warn/pr12242.C (.../branches/gcc-4_7-branch) (wersja 190845) @@ -10,8 +10,8 @@ X x; Y y; - x = 10; // { dg-warning "invalid conversion from .int. to .X." } - // { dg-warning "unspecified" "" { target *-*-* } 13 } + x = 10; // { dg-warning "invalid conversion from .int. to .X." "invalid" } + // { dg-warning "unspecified" "unspecified" { target *-*-* } 13 } x = 1; // { dg-warning "invalid conversion from .int. to .X." } x = C; // { dg-error "cannot convert .Y. to .X. in assignment" } x = D; // { dg-error "cannot convert .Y. to .X. in assignment" } Index: gcc/testsuite/g++.dg/parse/error36.C =================================================================== --- gcc/testsuite/g++.dg/parse/error36.C (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/g++.dg/parse/error36.C (.../branches/gcc-4_7-branch) (wersja 190845) @@ -11,22 +11,22 @@ void f(T t) { typedef A::foo type; // { dg-error "typename" } - A::bar b; // { dg-error "typename" } -} // { dg-error "expected ';'" "" { target *-*-* } 14 } + A::bar b; // { dg-error "typename" "typename" } +} // { dg-error "expected ';'" "expected" { target *-*-* } 14 } // PR c++/36353 template struct B { void f() { - A::baz z; // { dg-error "typename" } - } // { dg-error "expected ';'" "" { target *-*-* } 22 } + A::baz z; // { dg-error "typename" "typename" } + } // { dg-error "expected ';'" "expected" { target *-*-* } 22 } }; // PR c++/40738 template -void g(const A::type &t); // { dg-error "typename" } -// { dg-error "no type" "" { target *-*-* } 28 } +void g(const A::type &t); // { dg-error "typename" "typename" } +// { dg-error "no type" "no type" { target *-*-* } 28 } // PR c++/18451 template A::B A::b; // { dg-error "typename" } Index: gcc/testsuite/g++.dg/parse/error9.C =================================================================== --- gcc/testsuite/g++.dg/parse/error9.C (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/g++.dg/parse/error9.C (.../branches/gcc-4_7-branch) (wersja 190845) @@ -5,5 +5,5 @@ int a[] = { FOO: 1, BAR: 2 }; // the following 2 column locations are still not accurate enough -// { dg-error "28:name 'FOO' used in a GNU-style designated initializer for an array" "" { target *-*-* } 5 } -// { dg-error "28:name 'BAR' used in a GNU-style designated initializer for an array" "" { target *-*-* } 5 } +// { dg-error "28:name 'FOO' used in a GNU-style designated initializer for an array" "FOO" { target *-*-* } 5 } +// { dg-error "28:name 'BAR' used in a GNU-style designated initializer for an array" "BAR" { target *-*-* } 5 } Index: gcc/testsuite/g++.dg/parse/enum9.C =================================================================== --- gcc/testsuite/g++.dg/parse/enum9.C (.../tags/gcc_4_7_1_release) (wersja 0) +++ gcc/testsuite/g++.dg/parse/enum9.C (.../branches/gcc-4_7-branch) (wersja 190845) @@ -0,0 +1,13 @@ +// PR c++/53995 + +enum E1 { e }; +void f(E1); + +struct A { + int i1,i2,i3,i4,i5,i6,i7,i8,i9,i10; + void g(); + void h(); +}; + +void A::g() { enum E2 { e }; } +void A::h() { f(e); } Index: gcc/testsuite/g++.dg/parse/crash35.C =================================================================== --- gcc/testsuite/g++.dg/parse/crash35.C (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/g++.dg/parse/crash35.C (.../branches/gcc-4_7-branch) (wersja 190845) @@ -3,5 +3,5 @@ struct a {}; -class foo : public a, a -{ /* { dg-error "duplicate base type|at end of input" } */ +class foo : public a, a // { dg-error "duplicate base" } +{ /* { dg-error "at end of input" } */ Index: gcc/testsuite/g++.dg/parse/error2.C =================================================================== --- gcc/testsuite/g++.dg/parse/error2.C (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/g++.dg/parse/error2.C (.../branches/gcc-4_7-branch) (wersja 190845) @@ -8,8 +8,8 @@ template struct Foo {}; -Foo f; // { dg-error "5:'int func.double.' cannot appear in a constant-expression" "" { target *-*-* } 11 } -// { dg-error "10:'g' cannot appear in a constant-expression" "" { target *-*-* } 11 } -// { dg-error "11:a function call cannot appear in a constant-expression" "" { target *-*-* } 11 } -// { dg-error "12:template argument 1 is invalid" "" { target *-*-* } 11 } -// { dg-error "15:invalid type in declaration before ';' token" "" { target *-*-* } 11 } +Foo f; // { dg-error "5:'int func.double.' cannot appear in a constant-expression" "func double" { target *-*-* } 11 } +// { dg-error "10:'g' cannot appear in a constant-expression" "g" { target *-*-* } 11 } +// { dg-error "11:a function call cannot appear in a constant-expression" "call" { target *-*-* } 11 } +// { dg-error "12:template argument 1 is invalid" "invalid template argument" { target *-*-* } 11 } +// { dg-error "15:invalid type in declaration before ';' token" "invalid type" { target *-*-* } 11 } Index: gcc/testsuite/g++.dg/parse/template25.C =================================================================== --- gcc/testsuite/g++.dg/parse/template25.C (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/g++.dg/parse/template25.C (.../branches/gcc-4_7-branch) (wersja 190845) @@ -9,6 +9,6 @@ void g(void) { - template f(); /* { dg-error "expected primary-expression" } */ - /* { dg-error "expected ';'" "" { target *-*-* } 12 } */ + template f(); /* { dg-error "expected primary-expression" "primary-expression" } */ + /* { dg-error "expected ';'" "semicolon" { target *-*-* } 12 } */ } Index: gcc/testsuite/g++.dg/parse/parser-pr28152-2.C =================================================================== --- gcc/testsuite/g++.dg/parse/parser-pr28152-2.C (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/g++.dg/parse/parser-pr28152-2.C (.../branches/gcc-4_7-branch) (wersja 190845) @@ -6,8 +6,8 @@ { __complex__ float z; - z = __complex__ (1.90000007326203904e+19, 0.0); // { dg-error "expected primary-expression before '__complex__'" } - // { dg-error "expected .;. before .__complex__." "" { target *-*-* } 9 } - z = __complex__ (1.0e+0, 0.0) / z; // { dg-error "expected primary-expression before '__complex__'" } - // { dg-error "expected .;. before '__complex__'" "" { target *-*-* } 11 } - // { dg-error "at end of input" "" { target *-*-* } 11 } + z = __complex__ (1.90000007326203904e+19, 0.0); // { dg-error "expected primary-expression before '__complex__'" "primary-expression" } + // { dg-error "expected .;. before .__complex__." "semicolon" { target *-*-* } 9 } + z = __complex__ (1.0e+0, 0.0) / z; // { dg-error "expected primary-expression before '__complex__'" "primaty-expression" } + // { dg-error "expected .;. before '__complex__'" "semicolon" { target *-*-* } 11 } + // { dg-error "at end of input" "end" { target *-*-* } 11 } Index: gcc/testsuite/g++.dg/parse/error3.C =================================================================== --- gcc/testsuite/g++.dg/parse/error3.C (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/g++.dg/parse/error3.C (.../branches/gcc-4_7-branch) (wersja 190845) @@ -5,5 +5,5 @@ void(*AddFunction)(const TYPE&,bool&, char*, char*, unsigned*)); -// { dg-error "64: ISO C\\+\\+ forbids declaration of 'parameter' with no type" "" { target *-*-* } { 5 } } -// { dg-error "60: 'TYPE' does not name a type" "" { target *-*-* } { 5 } } +// { dg-error "64: ISO C\\+\\+ forbids declaration of 'parameter' with no type" "forbids" { target *-*-* } { 5 } } +// { dg-error "60: 'TYPE' does not name a type" "does not" { target *-*-* } { 5 } } Index: gcc/testsuite/g++.dg/parse/crash46.C =================================================================== --- gcc/testsuite/g++.dg/parse/crash46.C (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/g++.dg/parse/crash46.C (.../branches/gcc-4_7-branch) (wersja 190845) @@ -2,17 +2,17 @@ // { dg-do compile } void -foo (_Decimal32) // { dg-error "declared void" } +foo (_Decimal32) // { dg-error "declared void" "declared" } { } - // { dg-error "was not declared" "" { target *-*-* } 5 } + // { dg-error "was not declared" "not" { target *-*-* } 5 } void -bar (_Bool) // { dg-error "declared void" } +bar (_Bool) // { dg-error "declared void" "declared" } { } - // { dg-error "was not declared" "" { target *-*-* } 10 } + // { dg-error "was not declared" "not" { target *-*-* } 10 } void -baz (_Fract) // { dg-error "declared void" } +baz (_Fract) // { dg-error "declared void" "declared" } { } - // { dg-error "was not declared" "" { target *-*-* } 15 } + // { dg-error "was not declared" "not" { target *-*-* } 15 } Index: gcc/testsuite/g++.dg/parse/parser-pr28152.C =================================================================== --- gcc/testsuite/g++.dg/parse/parser-pr28152.C (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/g++.dg/parse/parser-pr28152.C (.../branches/gcc-4_7-branch) (wersja 190845) @@ -6,8 +6,8 @@ { _Complex float z; - z = _Complex (1.90000007326203904e+19, 0.0); // { dg-error "expected primary-expression before '_Complex'" } - // { dg-error "expected .;. before ._Complex." "" { target *-*-* } 9 } - z = _Complex (1.0e+0, 0.0) / z; // { dg-error "expected primary-expression before '_Complex'" } - // { dg-error "expected .;. before '_Complex'" "" { target *-*-* } 11 } - // { dg-error "at end of input" "" { target *-*-* } 11 } + z = _Complex (1.90000007326203904e+19, 0.0); // { dg-error "expected primary-expression before '_Complex'" "primary-expression" } + // { dg-error "expected .;. before ._Complex." "semicolon" { target *-*-* } 9 } + z = _Complex (1.0e+0, 0.0) / z; // { dg-error "expected primary-expression before '_Complex'" "primary-expression" } + // { dg-error "expected .;. before '_Complex'" "semicolon" { target *-*-* } 11 } + // { dg-error "at end of input" "end" { target *-*-* } 11 } Index: gcc/testsuite/g++.dg/parse/error10.C =================================================================== --- gcc/testsuite/g++.dg/parse/error10.C (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/g++.dg/parse/error10.C (.../branches/gcc-4_7-branch) (wersja 190845) @@ -15,5 +15,5 @@ } // Here, columns nums are not very accurate either. Still acceptable though -// { dg-error "30:invalid type in declaration before ';' token" "" { target *-*-* } 14 } -// { dg-error "30:two or more data types in declaration of 'e4'" "" { target *-*-* } 14 } +// { dg-error "30:invalid type in declaration before ';' token" "invalid" { target *-*-* } 14 } +// { dg-error "30:two or more data types in declaration of 'e4'" "2 or more" { target *-*-* } 14 } Index: gcc/testsuite/g++.dg/parse/error8.C =================================================================== --- gcc/testsuite/g++.dg/parse/error8.C (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/g++.dg/parse/error8.C (.../branches/gcc-4_7-branch) (wersja 190845) @@ -4,6 +4,6 @@ struct A { friend typename struct B; }; -// { dg-error "28:expected nested-name-specifier before 'struct'" "" { target *-*-* } 4 } -// { dg-error "35:multiple types in one declaration" "" { target *-*-* } 4 } -// { dg-error "12:friend declaration does not name a class or function" "" { target *-*-* } 4 } +// { dg-error "28:expected nested-name-specifier before 'struct'" "expected" { target *-*-* } 4 } +// { dg-error "35:multiple types in one declaration" "multiple" { target *-*-* } 4 } +// { dg-error "12:friend declaration does not name a class or function" "friend decl" { target *-*-* } 4 } Index: gcc/testsuite/g++.dg/parse/typename11.C =================================================================== --- gcc/testsuite/g++.dg/parse/typename11.C (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/g++.dg/parse/typename11.C (.../branches/gcc-4_7-branch) (wersja 190845) @@ -10,7 +10,7 @@ // note: I is nested type in X, not Y! template -Y::I::I () {} // { dg-error "dependent typedef" } -// { dg-error "no type|dependent type" "" { target *-*-* } 13 } +Y::I::I () {} // { dg-error "dependent typedef" "typedef" } +// { dg-error "no type|dependent type" "no type" { target *-*-* } 13 } template struct Y<1>; Index: gcc/testsuite/g++.dg/tc1/dr147.C =================================================================== --- gcc/testsuite/g++.dg/tc1/dr147.C (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/g++.dg/tc1/dr147.C (.../branches/gcc-4_7-branch) (wersja 190845) @@ -20,8 +20,8 @@ void f() { - A::A a; // { dg-error "constructor" } -} // { dg-error "" "" { target *-*-* } 23 } error cascade + A::A a; // { dg-error "constructor" "constructor" } +} // { dg-error "" "error cascade" { target *-*-* } 23 } error cascade } namespace N2 { Index: gcc/testsuite/g++.dg/cpp0x/variadic-ex14.C =================================================================== --- gcc/testsuite/g++.dg/cpp0x/variadic-ex14.C (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/g++.dg/cpp0x/variadic-ex14.C (.../branches/gcc-4_7-branch) (wersja 190845) @@ -8,12 +8,12 @@ template class Q> class Y { /* ... */ }; X xA; // okay -X xB; // { dg-error "mismatch" } -// { dg-error "expected a template" "" { target *-*-* } 11 } -// { dg-error "invalid type" "" { target *-*-* } 11 } -X xC; // { dg-error "mismatch" } -// { dg-error "expected a template" "" { target *-*-* } 14 } -// { dg-error "invalid type" "" { target *-*-* } 14 } +X xB; // { dg-error "mismatch" "mismatch" } +// { dg-error "expected a template" "expected" { target *-*-* } 11 } +// { dg-error "invalid type" "invalid" { target *-*-* } 11 } +X xC; // { dg-error "mismatch" "mismatch" } +// { dg-error "expected a template" "expected" { target *-*-* } 14 } +// { dg-error "invalid type" "invalid" { target *-*-* } 14 } Y yA; Y yB; Y yC; // okay Index: gcc/testsuite/g++.dg/cpp0x/defaulted36.C =================================================================== --- gcc/testsuite/g++.dg/cpp0x/defaulted36.C (.../tags/gcc_4_7_1_release) (wersja 0) +++ gcc/testsuite/g++.dg/cpp0x/defaulted36.C (.../branches/gcc-4_7-branch) (wersja 190845) @@ -0,0 +1,24 @@ +// PR c++/53733 +// { dg-do compile { target c++11 } } + +template +struct wrap +{ + wrap() = default; + wrap(wrap&&) = default; // Line 5 + wrap(const wrap&) = default; + + T t; +}; + +struct S { + S() = default; + S(const S&){} + S(S&&) = default; +}; + +typedef wrap W; + +W get() { return W(); } // Line 19 + +int main() {} Index: gcc/testsuite/g++.dg/cpp0x/union1.C =================================================================== --- gcc/testsuite/g++.dg/cpp0x/union1.C (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/g++.dg/cpp0x/union1.C (.../branches/gcc-4_7-branch) (wersja 190845) @@ -14,8 +14,8 @@ A a; // { dg-error "union member" } }; -B b; // { dg-error "B::B\\(\\)" } -B b2(b); // { dg-error "B::B\\(const B&\\)" } +B b; // { dg-error "B::B\\(\\)" "B::B" } +B b2(b); // { dg-error "B::B\\(const B&\\)" "B::B" } struct C { @@ -25,10 +25,10 @@ }; }; -C c; // { dg-error "C::C\\(\\)" } -C c2(c); // { dg-error "C::C\\(const C&\\)" } +C c; // { dg-error "C::C\\(\\)" "C::C" } +C c2(c); // { dg-error "C::C\\(const C&\\)" "C::C" } -// { dg-error "B::~B" "" { target *-*-* } 17 } -// { dg-error "B::~B" "" { target *-*-* } 18 } -// { dg-error "C::~C" "" { target *-*-* } 28 } -// { dg-error "C::~C" "" { target *-*-* } 29 } +// { dg-error "B::~B" "B::~B" { target *-*-* } 17 } +// { dg-error "B::~B" "B::~B" { target *-*-* } 18 } +// { dg-error "C::~C" "C::~C" { target *-*-* } 28 } +// { dg-error "C::~C" "C::~C" { target *-*-* } 29 } 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 190845) @@ -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 190845) @@ -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/lambda/lambda-syntax1.C =================================================================== --- gcc/testsuite/g++.dg/cpp0x/lambda/lambda-syntax1.C (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/g++.dg/cpp0x/lambda/lambda-syntax1.C (.../branches/gcc-4_7-branch) (wersja 190845) @@ -1,5 +1,5 @@ // PR c++/46124 // { dg-options -std=c++0x } -void foo() { [] () -> void (); } // { dg-error "returning a function" } -// { dg-error "expected .\{" "" { target *-*-* } 4 } +void foo() { [] () -> void (); } // { dg-error "returning a function" "returning" } +// { dg-error "expected .\{" "expected" { target *-*-* } 4 } Index: gcc/testsuite/g++.dg/cpp0x/variadic20.C =================================================================== --- gcc/testsuite/g++.dg/cpp0x/variadic20.C (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/g++.dg/cpp0x/variadic20.C (.../branches/gcc-4_7-branch) (wersja 190845) @@ -37,11 +37,11 @@ int a0[metatuple<>::value == 0? 1 : -1]; int a1[metatuple::value == 1? 1 : -1]; -int a2a[metatuple::value == 2? 1 : -1]; // { dg-error "ambiguous|array bound" } +int a2a[metatuple::value == 2? 1 : -1]; // { dg-error "ambiguous|array bound" "bound" } int a2b[metatuple::value == 2? 1 : -1]; -int a3[metatuple::value == 3? 1 : -1]; // { dg-error "ambiguous|array bound" } +int a3[metatuple::value == 3? 1 : -1]; // { dg-error "ambiguous|array bound" "bound" } int a4[metatuple::value == 4? 1 : -1]; int a5[metatuple::value == 5? 1 : -1]; -// { dg-error "incomplete" "" { target *-*-* } 40 } -// { dg-error "incomplete" "" { target *-*-* } 42 } +// { dg-error "incomplete" "incomplete" { target *-*-* } 40 } +// { dg-error "incomplete" "incomplete" { target *-*-* } 42 } 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 190845) @@ -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/udlit-cpp98-neg.C =================================================================== --- gcc/testsuite/g++.dg/cpp0x/udlit-cpp98-neg.C (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/g++.dg/cpp0x/udlit-cpp98-neg.C (.../branches/gcc-4_7-branch) (wersja 190845) @@ -12,6 +12,6 @@ operator"" _Q(const char *, std::size_t) // { dg-warning "user-defined literals only available with" } { return 42; } -int x = "Hello"_Q; // { dg-error "invalid conversion from" } +int x = "Hello"_Q; // { dg-error "invalid conversion from" "invalid" } -// { dg-error "expected" "" { target *-*-* } 15 } +// { dg-error "expected" "expected" { target *-*-* } 15 } 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 190845) @@ -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/static_assert3.C =================================================================== --- gcc/testsuite/g++.dg/cpp0x/static_assert3.C (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/g++.dg/cpp0x/static_assert3.C (.../branches/gcc-4_7-branch) (wersja 190845) @@ -1,4 +1,4 @@ // { dg-options "-std=c++0x" } -static_assert(7 / 0, "X"); // { dg-error "non-constant condition" } -// { dg-warning "division by zero" "" { target *-*-* } 2 } -// { dg-error "7 / 0.. is not a constant expression" "" { target *-*-* } 2 } +static_assert(7 / 0, "X"); // { dg-error "non-constant condition" "non-constant" } +// { dg-warning "division by zero" "zero" { target *-*-* } 2 } +// { dg-error "7 / 0.. is not a constant expression" "not a constant" { target *-*-* } 2 } Index: gcc/testsuite/g++.dg/cpp0x/implicit13.C =================================================================== --- gcc/testsuite/g++.dg/cpp0x/implicit13.C (.../tags/gcc_4_7_1_release) (wersja 0) +++ gcc/testsuite/g++.dg/cpp0x/implicit13.C (.../branches/gcc-4_7-branch) (wersja 190845) @@ -0,0 +1,32 @@ +// Make sure that A's destructor doesn't affect constexpr +// or exception-spec on D's default constructor. +// { dg-do compile { target c++11 } } + +struct A { + constexpr A() noexcept: i(0) { } + int i; + ~A() noexcept(false); +}; + +struct B: A { }; + +// Should get static initialization, so no constructor call. +// { dg-final { scan-assembler-not "_ZN1BC1Ev" } } +B b; + +struct C { C() noexcept; ~C() noexcept(false); }; +struct D: C { }; +extern D d; + +void *operator new(__SIZE_TYPE__, void*) noexcept; + +#define SA(X) static_assert((X),#X) +SA(noexcept(new (&d) D)); + +struct E: virtual C { }; +extern E e; +SA(noexcept (new (&e) E)); + +struct F { C c; }; +extern F f; +SA(noexcept (new (&f) F)); Index: gcc/testsuite/g++.dg/cpp0x/auto27.C =================================================================== --- gcc/testsuite/g++.dg/cpp0x/auto27.C (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/g++.dg/cpp0x/auto27.C (.../branches/gcc-4_7-branch) (wersja 190845) @@ -1,6 +1,6 @@ // PR c++/51186 -auto main()->int // { dg-error "std=" "" { target c++98 } } - // { dg-error "auto" "" { target c++98 } 3 } - // { dg-error "no type" "" { target c++98 } 3 } +auto main()->int // { dg-error "std=" "std" { target c++98 } } + // { dg-error "auto" "auto" { target c++98 } 3 } + // { dg-error "no type" "no type" { target c++98 } 3 } { } Index: gcc/testsuite/g++.dg/cpp0x/regress/error-recovery1.C =================================================================== --- gcc/testsuite/g++.dg/cpp0x/regress/error-recovery1.C (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/g++.dg/cpp0x/regress/error-recovery1.C (.../branches/gcc-4_7-branch) (wersja 190845) @@ -5,7 +5,7 @@ foo () { const bool b =; // { dg-error "" } - foo < b > (); // { dg-error "constant expression" } + foo < b > (); // { dg-error "constant expression" "const expr" } }; -// { dg-error "no match" "" { target *-*-* } 8 } +// { dg-error "no match" "no match" { target *-*-* } 8 } Index: gcc/testsuite/g++.dg/cpp0x/variadic2.C =================================================================== --- gcc/testsuite/g++.dg/cpp0x/variadic2.C (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/g++.dg/cpp0x/variadic2.C (.../branches/gcc-4_7-branch) (wersja 190845) @@ -8,8 +8,8 @@ template struct two_or_more {}; // { dg-error "provided for" } -typedef two_or_more bad; // { dg-error "2 or more" } -// { dg-error "invalid type" "" { target *-*-* } 11 } +typedef two_or_more bad; // { dg-error "2 or more" "2 or more" } +// { dg-error "invalid type" "invalid type" { target *-*-* } 11 } void f() { Index: gcc/testsuite/g++.dg/cpp0x/udlit-shadow-neg.C =================================================================== --- gcc/testsuite/g++.dg/cpp0x/udlit-shadow-neg.C (.../tags/gcc_4_7_1_release) (wersja 190845) +++ gcc/testsuite/g++.dg/cpp0x/udlit-shadow-neg.C (.../branches/gcc-4_7-branch) (wersja 190845) @@ -39,11 +39,11 @@ } -// { dg-warning "literal operator suffixes not preceded by|are reserved for future standardization" "" { target *-*-* } 5 } -// { dg-warning "literal operator suffixes not preceded by|are reserved for future standardization" "" { target *-*-* } 9 } -// { dg-warning "literal operator suffixes not preceded by|are reserved for future standardization" "" { target *-*-* } 13 } -// { dg-warning "literal operator suffixes not preceded by|are reserved for future standardization" "" { target *-*-* } 17 } -// { dg-warning "literal operator suffixes not preceded by|are reserved for future standardization" "" { target *-*-* } 25 } -// { dg-warning "literal operator suffixes not preceded by|are reserved for future standardization" "" { target *-*-* } 29 } -// { dg-warning "literal operator suffixes not preceded by|are reserved for future standardization" "" { target *-*-* } 33 } -// { dg-warning "literal operator suffixes not preceded by|are reserved for future standardization" "" { target *-*-* } 37 } +// { dg-warning "literal operator suffixes not preceded by|are reserved for future standardization" "reserved" { target *-*-* } 5 } +// { dg-warning "literal operator suffixes not preceded by|are reserved for future standardization" "reserved" { target *-*-* } 9 } +// { dg-warning "literal operator suffixes not preceded by|are reserved for future standardization" "reserved" { target *-*-* } 13 } +// { dg-warning "literal operator suffixes not preceded by|are reserved for future standardization" "reserved" { target *-*-* } 17 } +// { dg-warning "literal operator suffixes not preceded by|are reserved for future standardization" "reserved" { target *-*-* } 25 } +// { dg-warning "literal operator suffixes not preceded by|are reserved for future standardization" "reserved" { target *-*-* } 29 } +// { dg-warning "literal operator suffixes not preceded by|are reserved for future standardization" "reserved" { target *-*-* } 33 } +// { dg-warning "literal operator suffixes not preceded by|are reserved for future standardization" "reserved" { target *-*-* } 37 } 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 190845) @@ -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 190845) @@ -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