This patch merges recent changes from google/integration into branches/annotalysis.
Bootstrapped and passed GCC regression testsuite on x86_64-unknown-linux-gnu. Okay for branches/annotalysis? -- DeLesley Hutchins | Software Engineer | deles...@google.com | 505-206-0315
Property changes on: . ___________________________________________________________________ Modified: svnmerge-integrated - /branches/google/integration:1-171014 /trunk:1-170776,170779-170934 + /branches/google/integration:1-175319 /trunk:1-170776,170779-170934 Modified: svn:mergeinfo Merged /trunk:r171161 Merged /branches/google/integration:r171167-175149 Index: libstdc++-v3/scripts/extract_symvers.in =================================================================== --- libstdc++-v3/scripts/extract_symvers.in (revision 175318) +++ libstdc++-v3/scripts/extract_symvers.in (working copy) @@ -52,6 +52,9 @@ ${readelf} ${lib} |\ sed -e 's/ \[<other>: [A-Fa-f0-9]*\] //' -e '/\.dynsym/,/^$/p;d' |\ egrep -v ' (LOCAL|UND) ' |\ + sed -e 's/ <processor specific>: / <processor_specific>:_/g' |\ + sed -e 's/ <OS specific>: / <OS_specific>:_/g' |\ + sed -e 's/ <unknown>: / <unknown>:_/g' |\ awk '{ if ($4 == "FUNC" || $4 == "NOTYPE") printf "%s:%s\n", $4, $8; else if ($4 == "OBJECT" || $4 == "TLS") Index: libstdc++-v3/src/Makefile.in =================================================================== --- libstdc++-v3/src/Makefile.in (revision 175318) +++ libstdc++-v3/src/Makefile.in (working copy) @@ -484,7 +484,8 @@ $(XTEMPLATE_FLAGS) \ $(WARN_CXXFLAGS) \ $(OPTIMIZE_CXXFLAGS) \ - $(CONFIG_CXXFLAGS) + $(CONFIG_CXXFLAGS) \ + $($(@)_no_omit_frame_pointer) # libstdc++ libtool notes @@ -522,6 +523,9 @@ $(CXX) $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@ debugdir = debug + +# Google-specific pessimization +functexcept.lo_no_omit_frame_pointer = -fno-omit-frame-pointer all: all-am .SUFFIXES: Index: libstdc++-v3/src/Makefile.am =================================================================== --- libstdc++-v3/src/Makefile.am (revision 175318) +++ libstdc++-v3/src/Makefile.am (working copy) @@ -395,7 +395,8 @@ $(XTEMPLATE_FLAGS) \ $(WARN_CXXFLAGS) \ $(OPTIMIZE_CXXFLAGS) \ - $(CONFIG_CXXFLAGS) + $(CONFIG_CXXFLAGS) \ + $($(@)_no_omit_frame_pointer) # libstdc++ libtool notes @@ -469,3 +470,6 @@ install_debug: (cd ${debugdir} && $(MAKE) \ toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install) + +# Google-specific pessimization +functexcept.lo_no_omit_frame_pointer = -fno-omit-frame-pointer Index: libstdc++-v3/include/ext/vstring.h =================================================================== --- libstdc++-v3/include/ext/vstring.h (revision 175318) +++ libstdc++-v3/include/ext/vstring.h (working copy) @@ -37,6 +37,21 @@ #include <ext/rc_string_base.h> #include <ext/sso_string_base.h> +#if __google_stl_debug_string && !defined(_GLIBCXX_DEBUG) +# undef _GLIBCXX_DEBUG_ASSERT +# undef _GLIBCXX_DEBUG_PEDASSERT +// Perform additional checks (but only in this file). +# define _GLIBCXX_DEBUG_ASSERT(_Condition) \ + if (! (_Condition)) { \ + char buf[512]; \ + __builtin_snprintf(buf, sizeof(buf), \ + "%s:%d: %s: Assertion '%s' failed.\n", \ + __FILE__, __LINE__, __func__, # _Condition); \ + std::__throw_runtime_error(buf); \ + } +# define _GLIBCXX_DEBUG_PEDASSERT(_Condition) _GLIBCXX_DEBUG_ASSERT(_Condition) +#endif + namespace __gnu_cxx _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION @@ -2793,4 +2808,12 @@ #include "vstring.tcc" +#if __google_stl_debug_string && !defined(_GLIBCXX_DEBUG) +// Undo our defines, so they don't affect anything else. +# undef _GLIBCXX_DEBUG_ASSERT +# undef _GLIBCXX_DEBUG_PEDASSERT +# define _GLIBCXX_DEBUG_ASSERT(_Condition) +# define _GLIBCXX_DEBUG_PEDASSERT(_Condition) +#endif + #endif /* _VSTRING_H */ Index: libstdc++-v3/include/ext/sso_string_base.h =================================================================== --- libstdc++-v3/include/ext/sso_string_base.h (revision 175318) +++ libstdc++-v3/include/ext/sso_string_base.h (working copy) @@ -86,6 +86,13 @@ { if (!_M_is_local()) _M_destroy(_M_allocated_capacity); +#if __google_stl_debug_string_dangling + else { + // Wipe local storage for destructed string with 0xCD. + // This mimics what DebugAllocation does to free()d memory. + __builtin_memset(_M_local_data, 0xcd, sizeof(_M_local_data)); + } +#endif } void @@ -169,15 +176,29 @@ _M_leak() { } void - _M_set_length(size_type __n) + _M_set_length_no_wipe(size_type __n) { _M_length(__n); traits_type::assign(_M_data()[__n], _CharT()); } + void + _M_set_length(size_type __n) + { +#if __google_stl_debug_string_dangling + if (__n + 1 < _M_length()) + { + // Wipe the storage with 0xCD. + // Also wipes the old NUL terminator. + __builtin_memset(_M_data() + __n + 1, 0xcd, _M_length() - __n); + } +#endif + _M_set_length_no_wipe(__n); + } + __sso_string_base() : _M_dataplus(_M_local_data) - { _M_set_length(0); } + { _M_set_length_no_wipe(0); } __sso_string_base(const _Alloc& __a); @@ -336,7 +357,7 @@ __sso_string_base<_CharT, _Traits, _Alloc>:: __sso_string_base(const _Alloc& __a) : _M_dataplus(__a, _M_local_data) - { _M_set_length(0); } + { _M_set_length_no_wipe(0); } template<typename _CharT, typename _Traits, typename _Alloc> __sso_string_base<_CharT, _Traits, _Alloc>:: @@ -426,7 +447,7 @@ __throw_exception_again; } - _M_set_length(__len); + _M_set_length_no_wipe(__len); } template<typename _CharT, typename _Traits, typename _Alloc> @@ -458,7 +479,7 @@ __throw_exception_again; } - _M_set_length(__dnew); + _M_set_length_no_wipe(__dnew); } template<typename _CharT, typename _Traits, typename _Alloc> @@ -475,7 +496,7 @@ if (__n) _S_assign(_M_data(), __n, __c); - _M_set_length(__n); + _M_set_length_no_wipe(__n); } template<typename _CharT, typename _Traits, typename _Alloc> Index: libstdc++-v3/include/bits/stl_vector.h =================================================================== --- libstdc++-v3/include/bits/stl_vector.h (revision 175318) +++ libstdc++-v3/include/bits/stl_vector.h (working copy) @@ -690,10 +690,18 @@ * Note that data access with this operator is unchecked and * out_of_range lookups are not defined. (For checked lookups * see at().) + * + * Local modification: range checks are performed if + * __google_stl_debug_vector is defined to non-zero. */ reference operator[](size_type __n) - { return *(this->_M_impl._M_start + __n); } + { +#if __google_stl_debug_vector + _M_range_check(__n); +#endif + return *(this->_M_impl._M_start + __n); + } /** * @brief Subscript access to the data contained in the %vector. @@ -705,10 +713,18 @@ * Note that data access with this operator is unchecked and * out_of_range lookups are not defined. (For checked lookups * see at().) + * + * Local modification: range checks are performed if + * __google_stl_debug_vector is defined to non-zero. */ const_reference operator[](size_type __n) const - { return *(this->_M_impl._M_start + __n); } + { +#if __google_stl_debug_vector + _M_range_check(__n); +#endif + return *(this->_M_impl._M_start + __n); + } protected: /// Safety check used only from at(). Index: libstdc++-v3/include/bits/stl_algo.h =================================================================== --- libstdc++-v3/include/bits/stl_algo.h (revision 175318) +++ libstdc++-v3/include/bits/stl_algo.h (working copy) @@ -318,6 +318,39 @@ // count_if // search +// Local modification: if __google_stl_debug_compare is defined to +// non-zero value, check sort predicate for strict weak ordering. +// Google ref b/1731200. +#if __google_stl_debug_compare + template<typename _Compare> + struct _CheckedCompare { + _Compare _M_compare; + + _CheckedCompare(const _Compare & __comp): _M_compare(__comp) { } + + template <typename _Tp> + bool operator()(const _Tp& __x, const _Tp& __y) { + if (_M_compare(__x, __x)) + __throw_runtime_error("strict weak ordering: (__x LT __x) != false"); + if (_M_compare(__y, __y)) + __throw_runtime_error("strict weak ordering: (__y LT __y) != false"); + bool lt = _M_compare(__x, __y); + if (lt && _M_compare(__y, __x)) + __throw_runtime_error("strict weak ordering: ((__x LT __y) && (__y LT __x)) != false"); + return lt; + } + + // Different types; can't perform any checks. + template <typename _Tp1, typename _Tp2> + bool operator()(const _Tp1& __x, const _Tp2& __y) { + return _M_compare(__x, __y); + } + }; +# define __CheckedCompare(__comp) _CheckedCompare<__typeof__(__comp)>(__comp) +#else +# define __CheckedCompare(__comp) __comp +#endif + /** * This is an uglified * search_n(_ForwardIterator, _ForwardIterator, _Integer, const _Tp&) @@ -2041,18 +2074,20 @@ ++__result_real_last; ++__first; } - std::make_heap(__result_first, __result_real_last, __comp); + std::make_heap(__result_first, __result_real_last, + __CheckedCompare(__comp)); while (__first != __last) { - if (__comp(*__first, *__result_first)) + if (__CheckedCompare(__comp)(*__first, *__result_first)) std::__adjust_heap(__result_first, _DistanceType(0), _DistanceType(__result_real_last - __result_first), _InputValueType(*__first), - __comp); + __CheckedCompare(__comp)); ++__first; } - std::sort_heap(__result_first, __result_real_last, __comp); + std::sort_heap(__result_first, __result_real_last, + __CheckedCompare(__comp)); return __result_real_last; } @@ -2413,7 +2448,7 @@ _DistanceType __half = __len >> 1; _ForwardIterator __middle = __first; std::advance(__middle, __half); - if (__comp(*__middle, __val)) + if (__CheckedCompare(__comp)(*__middle, __val)) { __first = __middle; ++__first; @@ -2509,7 +2544,7 @@ _DistanceType __half = __len >> 1; _ForwardIterator __middle = __first; std::advance(__middle, __half); - if (__comp(__val, *__middle)) + if (__CheckedCompare(__comp)(__val, *__middle)) __len = __half; else { @@ -2628,13 +2663,13 @@ _DistanceType __half = __len >> 1; _ForwardIterator __middle = __first; std::advance(__middle, __half); - if (__comp(*__middle, __val)) + if (__CheckedCompare(__comp)(*__middle, __val)) { __first = __middle; ++__first; __len = __len - __half - 1; } - else if (__comp(__val, *__middle)) + else if (__CheckedCompare(__comp)(__val, *__middle)) __len = __half; else { @@ -2711,7 +2746,7 @@ __val, __comp); _ForwardIterator __i = std::lower_bound(__first, __last, __val, __comp); - return __i != __last && !bool(__comp(__val, *__i)); + return __i != __last && !bool(__CheckedCompare(__comp)(__val, *__i)); } // merge @@ -3180,11 +3215,11 @@ __last); if (__buf.begin() == 0) std::__merge_without_buffer(__first, __middle, __last, __len1, - __len2, __comp); + __len2, __CheckedCompare(__comp)); else std::__merge_adaptive(__first, __middle, __last, __len1, __len2, __buf.begin(), _DistanceType(__buf.size()), - __comp); + __CheckedCompare(__comp)); } template<typename _RandomAccessIterator1, typename _RandomAccessIterator2, @@ -3505,9 +3540,9 @@ __glibcxx_requires_sorted_set_pred(__first2, __last2, __first1, __comp); while (__first1 != __last1 && __first2 != __last2) - if (__comp(*__first2, *__first1)) + if (__CheckedCompare(__comp)(*__first2, *__first1)) return false; - else if(__comp(*__first1, *__first2)) + else if(__CheckedCompare(__comp)(*__first1, *__first2)) ++__first1; else ++__first1, ++__first2; @@ -3620,10 +3655,10 @@ { _BidirectionalIterator __ii = __i; --__i; - if (__comp(*__i, *__ii)) + if (__CheckedCompare(__comp)(*__i, *__ii)) { _BidirectionalIterator __j = __last; - while (!bool(__comp(*__i, *--__j))) + while (!bool(__CheckedCompare(__comp)(*__i, *--__j))) {} std::iter_swap(__i, __j); std::reverse(__ii, __last); @@ -3733,10 +3768,10 @@ { _BidirectionalIterator __ii = __i; --__i; - if (__comp(*__ii, *__i)) + if (__CheckedCompare(__comp)(*__ii, *__i)) { _BidirectionalIterator __j = __last; - while (!bool(__comp(*--__j, *__i))) + while (!bool(__CheckedCompare(__comp)(*--__j, *__i))) {} std::iter_swap(__i, __j); std::reverse(__ii, __last); @@ -3909,7 +3944,7 @@ _ForwardIterator __next = __first; for (++__next; __next != __last; __first = __next, ++__next) - if (__comp(*__next, *__first)) + if (__CheckedCompare(__comp)(*__next, *__first)) return __next; return __next; } @@ -3944,8 +3979,9 @@ inline pair<const _Tp&, const _Tp&> minmax(const _Tp& __a, const _Tp& __b, _Compare __comp) { - return __comp(__b, __a) ? pair<const _Tp&, const _Tp&>(__b, __a) - : pair<const _Tp&, const _Tp&>(__a, __b); + return __CheckedCompare(__comp)(__b, __a) + ? pair<const _Tp&, const _Tp&>(__b, __a) + : pair<const _Tp&, const _Tp&>(__a, __b); } /** @@ -4053,7 +4089,7 @@ return std::make_pair(__first, __first); _ForwardIterator __min, __max; - if (__comp(*__next, *__first)) + if (__CheckedCompare(__comp)(*__next, *__first)) { __min = __next; __max = __first; @@ -4072,25 +4108,25 @@ __next = __first; if (++__next == __last) { - if (__comp(*__first, *__min)) + if (__CheckedCompare(__comp)(*__first, *__min)) __min = __first; - else if (!__comp(*__first, *__max)) + else if (!__CheckedCompare(__comp)(*__first, *__max)) __max = __first; break; } - if (__comp(*__next, *__first)) + if (__CheckedCompare(__comp)(*__next, *__first)) { - if (__comp(*__next, *__min)) + if (__CheckedCompare(__comp)(*__next, *__min)) __min = __next; - if (!__comp(*__first, *__max)) + if (!__CheckedCompare(__comp)(*__first, *__max)) __max = __first; } else { - if (__comp(*__first, *__min)) + if (__CheckedCompare(__comp)(*__first, *__min)) __min = __first; - if (!__comp(*__next, *__max)) + if (!__CheckedCompare(__comp)(*__next, *__max)) __max = __next; } @@ -5215,8 +5251,8 @@ __glibcxx_requires_valid_range(__first, __middle); __glibcxx_requires_valid_range(__middle, __last); - std::__heap_select(__first, __middle, __last, __comp); - std::sort_heap(__first, __middle, __comp); + std::__heap_select(__first, __middle, __last, __CheckedCompare(__comp)); + std::sort_heap(__first, __middle, __CheckedCompare(__comp)); } /** @@ -5294,7 +5330,8 @@ return; std::__introselect(__first, __nth, __last, - std::__lg(__last - __first) * 2, __comp); + std::__lg(__last - __first) * 2, + __CheckedCompare(__comp)); } @@ -5366,8 +5403,10 @@ if (__first != __last) { std::__introsort_loop(__first, __last, - std::__lg(__last - __first) * 2, __comp); - std::__final_insertion_sort(__first, __last, __comp); + std::__lg(__last - __first) * 2, + __CheckedCompare(__comp)); + std::__final_insertion_sort(__first, __last, + __CheckedCompare(__comp)); } } @@ -5478,7 +5517,7 @@ while (__first1 != __last1 && __first2 != __last2) { - if (__comp(*__first2, *__first1)) + if (__CheckedCompare(__comp)(*__first2, *__first1)) { *__result = *__first2; ++__first2; @@ -5575,10 +5614,11 @@ _Temporary_buffer<_RandomAccessIterator, _ValueType> __buf(__first, __last); if (__buf.begin() == 0) - std::__inplace_stable_sort(__first, __last, __comp); + std::__inplace_stable_sort(__first, __last, __CheckedCompare(__comp)); else std::__stable_sort_adaptive(__first, __last, __buf.begin(), - _DistanceType(__buf.size()), __comp); + _DistanceType(__buf.size()), + __CheckedCompare(__comp)); } @@ -5695,12 +5735,12 @@ while (__first1 != __last1 && __first2 != __last2) { - if (__comp(*__first1, *__first2)) + if (__CheckedCompare(__comp)(*__first1, *__first2)) { *__result = *__first1; ++__first1; } - else if (__comp(*__first2, *__first1)) + else if (__CheckedCompare(__comp)(*__first2, *__first1)) { *__result = *__first2; ++__first2; @@ -5816,9 +5856,9 @@ __glibcxx_requires_sorted_set_pred(__first2, __last2, __first1, __comp); while (__first1 != __last1 && __first2 != __last2) - if (__comp(*__first1, *__first2)) + if (__CheckedCompare(__comp)(*__first1, *__first2)) ++__first1; - else if (__comp(*__first2, *__first1)) + else if (__CheckedCompare(__comp)(*__first2, *__first1)) ++__first2; else { @@ -5935,13 +5975,13 @@ __glibcxx_requires_sorted_set_pred(__first2, __last2, __first1, __comp); while (__first1 != __last1 && __first2 != __last2) - if (__comp(*__first1, *__first2)) + if (__CheckedCompare(__comp)(*__first1, *__first2)) { *__result = *__first1; ++__first1; ++__result; } - else if (__comp(*__first2, *__first1)) + else if (__CheckedCompare(__comp)(*__first2, *__first1)) ++__first2; else { @@ -6062,13 +6102,13 @@ __glibcxx_requires_sorted_set_pred(__first2, __last2, __first1, __comp); while (__first1 != __last1 && __first2 != __last2) - if (__comp(*__first1, *__first2)) + if (__CheckedCompare(__comp)(*__first1, *__first2)) { *__result = *__first1; ++__first1; ++__result; } - else if (__comp(*__first2, *__first1)) + else if (__CheckedCompare(__comp)(*__first2, *__first1)) { *__result = *__first2; ++__first2; @@ -6135,7 +6175,7 @@ return __first; _ForwardIterator __result = __first; while (++__first != __last) - if (__comp(*__first, *__result)) + if (__CheckedCompare(__comp)(*__first, *__result)) __result = __first; return __result; } @@ -6190,11 +6230,13 @@ if (__first == __last) return __first; _ForwardIterator __result = __first; while (++__first != __last) - if (__comp(*__result, *__first)) + if (__CheckedCompare(__comp)(*__result, *__first)) __result = __first; return __result; } +#undef __CheckedCompare + _GLIBCXX_END_NAMESPACE_ALGO } // namespace std Index: libstdc++-v3/include/bits/stl_tree.h =================================================================== --- libstdc++-v3/include/bits/stl_tree.h (revision 175318) +++ libstdc++-v3/include/bits/stl_tree.h (working copy) @@ -461,7 +461,47 @@ } }; + // Local modification: if __google_stl_debug_rbtree is defined to + // non-zero value, check sort predicate for strict weak ordering. + // Google ref b/1731200. +#if __google_stl_debug_rbtree + template<typename _KeyCompare> + struct _CheckedCompare { + _KeyCompare _M_key_compare; + + _CheckedCompare(): _M_key_compare() { } + _CheckedCompare(const _KeyCompare & __comp): _M_key_compare(__comp) { } + + // Template arg required to avoid duplicating code in the two op() + // operators below. User-provided _M_key_compare may not be const, + // but needs to be callable from our const op(). + // Google ref. b/1731200. + template <typename _KeyCompareT> + static bool _M_compare_with(_KeyCompareT& __comp, const _Key& __x, const _Key& __y) { + if (__comp(__x, __x)) + __throw_runtime_error("strict weak ordering: (__x LT __x) != false"); + if (__comp(__y, __y)) + __throw_runtime_error("strict weak ordering: (__y LT __y) != false"); + bool lt = __comp(__x, __y); + if (lt && __comp(__y, __x)) + __throw_runtime_error("strict weak ordering: ((__x LT __y) && (__y LT __x)) != false"); + return lt; + } + bool operator()(const _Key& __x, const _Key& __y) const { + return _M_compare_with(_M_key_compare, __x, __y); + } + + bool operator()(const _Key& __x, const _Key& __y) { + return _M_compare_with(_M_key_compare, __x, __y); + } + + operator _KeyCompare() const { return _M_key_compare; } + }; + + _Rb_tree_impl<_CheckedCompare<_Compare> > _M_impl; +#else _Rb_tree_impl<_Compare> _M_impl; +#endif protected: _Base_ptr& Index: libstdc++-v3/libsupc++/Makefile.in =================================================================== --- libstdc++-v3/libsupc++/Makefile.in (revision 175318) +++ libstdc++-v3/libsupc++/Makefile.in (working copy) @@ -412,7 +412,8 @@ $(LIBSUPCXX_PICFLAGS) \ $(WARN_CXXFLAGS) \ $(OPTIMIZE_CXXFLAGS) \ - $(CONFIG_CXXFLAGS) + $(CONFIG_CXXFLAGS) \ + $($(@)_no_omit_frame_pointer) AM_MAKEFLAGS = \ "gxx_include_dir=$(gxx_include_dir)" @@ -476,6 +477,11 @@ # prepending each of $(*_HEADERS) with VPATH below. stddir = $(gxx_include_dir) bitsdir = $(gxx_include_dir)/bits + +# Google-specific pessimization +eh_terminate.lo_no_omit_frame_pointer = -fno-omit-frame-pointer +eh_throw.lo_no_omit_frame_pointer = -fno-omit-frame-pointer +vterminate.lo_no_omit_frame_pointer = -fno-omit-frame-pointer all: all-am .SUFFIXES: Index: libstdc++-v3/libsupc++/Makefile.am =================================================================== --- libstdc++-v3/libsupc++/Makefile.am (revision 175318) +++ libstdc++-v3/libsupc++/Makefile.am (working copy) @@ -106,7 +106,8 @@ $(LIBSUPCXX_PICFLAGS) \ $(WARN_CXXFLAGS) \ $(OPTIMIZE_CXXFLAGS) \ - $(CONFIG_CXXFLAGS) + $(CONFIG_CXXFLAGS) \ + $($(@)_no_omit_frame_pointer) AM_MAKEFLAGS = \ "gxx_include_dir=$(gxx_include_dir)" @@ -211,3 +212,8 @@ q=`echo $$p | sed -e 's,.*/,,'`; \ rm -f $(DESTDIR)$(bitsdir)/$$q; \ done + +# Google-specific pessimization +eh_terminate.lo_no_omit_frame_pointer = -fno-omit-frame-pointer +eh_throw.lo_no_omit_frame_pointer = -fno-omit-frame-pointer +vterminate.lo_no_omit_frame_pointer = -fno-omit-frame-pointer Index: libstdc++-v3/testsuite/decimal/mixed-mode_neg.cc =================================================================== --- libstdc++-v3/testsuite/decimal/mixed-mode_neg.cc (revision 175319) +++ libstdc++-v3/testsuite/decimal/mixed-mode_neg.cc (working copy) @@ -1,206 +0,0 @@ -// Copyright (C) 2009 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 -// <http://www.gnu.org/licenses/>. - -// { dg-do compile } -// { dg-require-effective-target dfp } - -// Test that binary operators do not accept mixed decimal and generic -// floating-point operands. This isn't explicity prohibited in -// ISO/IEC TR 24733 but it is prohibited in C, and in C++ there should -// not be an implicit conversion from a decimal floating-point type to -// a generic floating-point type. - -#include <decimal/decimal> -#include <testsuite_hooks.h> - -using namespace std::decimal; - -decimal32 a32, b32, c32; -decimal64 a64, b64, c64; -decimal128 a128, b128, c128; -float f; -double d; -long double ld; -bool b1, b2, b3, b4, b5, b6; - -void -bad_add (void) -{ - a32 = b32 + f; // { dg-error "error" } - a32 = ld + b32; // { dg-error "error" } - a64 = b64 + d; // { dg-error "error" } - a64 = ld + b64; // { dg-error "error" } - a128 = b128 + ld; // { dg-error "error" } - a128 = d + b128; // { dg-error "error" } -} - -void -bad_subtract (void) -{ - a32 = b32 - f; // { dg-error "error" } - a32 = ld - b32; // { dg-error "error" } - a64 = b64 - d; // { dg-error "error" } - a64 = ld - b64; // { dg-error "error" } - a128 = b128 - ld; // { dg-error "error" } - a128 = d - b128; // { dg-error "error" } -} - -void -bad_multiply (void) -{ - a32 = b32 * f; // { dg-error "error" } - a32 = ld * b32; // { dg-error "error" } - a64 = b64 * d; // { dg-error "error" } - a64 = ld * b64; // { dg-error "error" } - a128 = b128 * ld; // { dg-error "error" } - a128 = d * b128; // { dg-error "error" } -} - -void -bad_divide (void) -{ - a32 = b32 / f; // { dg-error "error" } - a32 = ld / b32; // { dg-error "error" } - a64 = b64 / d; // { dg-error "error" } - a64 = ld / b64; // { dg-error "error" } - a128 = b128 / ld; // { dg-error "error" } - a128 = d / b128; // { dg-error "error" } -} - -void -bad_eq (void) -{ - b1 = b32 == f; // { dg-error "error" } - b2 = ld == b32; // { dg-error "error" } - b3 = b64 == d; // { dg-error "error" } - b4 = ld == b64; // { dg-error "error" } - b5 = b128 == ld; // { dg-error "error" } - b6 = d == b128; // { dg-error "error" } -} - -void -bad_ne (void) -{ - b1 = b32 != f; // { dg-error "error" } - b2 = ld != b32; // { dg-error "error" } - b3 = b64 != d; // { dg-error "error" } - b4 = ld != b64; // { dg-error "error" } - b5 = b128 != ld; // { dg-error "error" } - b6 = d != b128; // { dg-error "error" } -} - -void -bad_lt (void) -{ - b1 = b32 < f; // { dg-error "error" } - b2 = ld < b32; // { dg-error "error" } - b3 = b64 < d; // { dg-error "error" } - b4 = ld < b64; // { dg-error "error" } - b5 = b128 < ld; // { dg-error "error" } - b6 = d < b128; // { dg-error "error" } -} - -void -bad_le (void) -{ - b1 = b32 <= f; // { dg-error "error" } - b2 = ld <= b32; // { dg-error "error" } - b3 = b64 <= d; // { dg-error "error" } - b4 = ld <= b64; // { dg-error "error" } - b5 = b128 <= ld; // { dg-error "error" } - b6 = d <= b128; // { dg-error "error" } -} - -void -bad_gt (void) -{ - b1 = b32 > f; // { dg-error "error" } - b2 = ld > b32; // { dg-error "error" } - b3 = b64 > d; // { dg-error "error" } - b4 = ld > b64; // { dg-error "error" } - b5 = b128 > ld; // { dg-error "error" } - b6 = d > b128; // { dg-error "error" } -} - -void -bad_ge (void) -{ - b1 = b32 >= f; // { dg-error "error" } - b2 = ld >= b32; // { dg-error "error" } - b3 = b64 >= d; // { dg-error "error" } - b4 = ld >= b64; // { dg-error "error" } - b5 = b128 >= ld; // { dg-error "error" } - b6 = d >= b128; // { dg-error "error" } -} - -void -bad_pluseq (void) -{ - a32 += f; // { dg-error "error" } - a32 += d; // { dg-error "error" } - a32 += ld; // { dg-error "error" } - a64 += f; // { dg-error "error" } - a64 += d; // { dg-error "error" } - a64 += ld; // { dg-error "error" } - a128 += f; // { dg-error "error" } - a128 += d; // { dg-error "error" } - a128 += ld; // { dg-error "error" } -} - -void -bad_minuseq (void) -{ - a32 -= f; // { dg-error "error" } - a32 -= d; // { dg-error "error" } - a32 -= ld; // { dg-error "error" } - a64 -= f; // { dg-error "error" } - a64 -= d; // { dg-error "error" } - a64 -= ld; // { dg-error "error" } - a128 -= f; // { dg-error "error" } - a128 -= d; // { dg-error "error" } - a128 -= ld; // { dg-error "error" } -} - -void -bad_timeseq (void) -{ - a32 *= f; // { dg-error "error" } - a32 *= d; // { dg-error "error" } - a32 *= ld; // { dg-error "error" } - a64 *= f; // { dg-error "error" } - a64 *= d; // { dg-error "error" } - a64 *= ld; // { dg-error "error" } - a128 *= f; // { dg-error "error" } - a128 *= d; // { dg-error "error" } - a128 *= ld; // { dg-error "error" } -} - -void -bad_divideeq (void) -{ - a32 /= f; // { dg-error "error" } - a32 /= d; // { dg-error "error" } - a32 /= ld; // { dg-error "error" } - a64 /= f; // { dg-error "error" } - a64 /= d; // { dg-error "error" } - a64 /= ld; // { dg-error "error" } - a128 /= f; // { dg-error "error" } - a128 /= d; // { dg-error "error" } - a128 /= ld; // { dg-error "error" } -} - -// { dg-excess-errors "notes about candidates" } Index: libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/assign_neg.cc =================================================================== --- libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/assign_neg.cc (revision 175318) +++ libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/assign_neg.cc (working copy) @@ -18,7 +18,7 @@ // <http://www.gnu.org/licenses/>. // { dg-do compile } -// { dg-error "no matching" "" { target *-*-* } 1150 } +// { dg-error "no matching" "" { target *-*-* } 1166 } // { dg-excess-errors "" } #include <vector> Index: libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/insert_neg.cc =================================================================== --- libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/insert_neg.cc (revision 175318) +++ libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/insert_neg.cc (working copy) @@ -18,7 +18,7 @@ // <http://www.gnu.org/licenses/>. // { dg-do compile } -// { dg-error "no matching" "" { target *-*-* } 1191 } +// { dg-error "no matching" "" { target *-*-* } 1207 } // { dg-excess-errors "" } #include <vector> Index: libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_1_neg.cc =================================================================== --- libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_1_neg.cc (revision 175318) +++ libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_1_neg.cc (working copy) @@ -18,7 +18,7 @@ // <http://www.gnu.org/licenses/>. // { dg-do compile } -// { dg-error "no matching" "" { target *-*-* } 1080 } +// { dg-error "no matching" "" { target *-*-* } 1096 } // { dg-excess-errors "" } #include <vector> Index: libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_2_neg.cc =================================================================== --- libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_2_neg.cc (revision 175318) +++ libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_2_neg.cc (working copy) @@ -18,7 +18,7 @@ // <http://www.gnu.org/licenses/>. // { dg-do compile } -// { dg-error "no matching" "" { target *-*-* } 1080 } +// { dg-error "no matching" "" { target *-*-* } 1096 } // { dg-excess-errors "" } #include <vector> Property changes on: gcc/testsuite/gcc.target/powerpc/ppc-round.c ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk/gcc/testsuite/gcc.target/powerpc/ppc-round.c:r171161 Merged /branches/google/integration/gcc/testsuite/gcc.target/powerpc/ppc-round.c:r171167-175149 Index: gcc/testsuite/ChangeLog.google-integration =================================================================== --- gcc/testsuite/ChangeLog.google-integration (revision 175318) +++ gcc/testsuite/ChangeLog.google-integration (working copy) @@ -1,3 +1,18 @@ +2011-05-27 Simon Baldwin <sim...@google.com> + + * testsuite/gcc.dg/plugin/selfassign.c (check_self_assign): Renamed + from warn_self_assign. + (execute_warn_self_assign): Call a function by its new name. + * testsuite/g++.dg/plugin/selfassign.c (check_self_assign): Renamed + from warn_self_assign. + (execute_warn_self_assign): Call a function by its new name. + +2011-03-30 Diego Novillo <dnovi...@google.com> + + * g++.dg/guality/guality.exp: Disable. + * gcc.dg/guality/guality.exp: Disable. + * gfortran.dg/guality/guality.exp: Disable. + 2011-03-14 Diego Novillo <dnovi...@google.com> * gcc.dg/guality/vla-1.c: XFAIL. Index: gcc/testsuite/gfortran.dg/guality/guality.exp =================================================================== --- gcc/testsuite/gfortran.dg/guality/guality.exp (revision 175318) +++ gcc/testsuite/gfortran.dg/guality/guality.exp (working copy) @@ -1,5 +1,8 @@ # This harness is for tests that should be run at all optimisation levels. +# Disable everywhere. These tests are very flaky. +return + load_lib gfortran-dg.exp load_lib gcc-gdb-test.exp Index: gcc/testsuite/gcc.dg/guality/guality.exp =================================================================== --- gcc/testsuite/gcc.dg/guality/guality.exp (revision 175318) +++ gcc/testsuite/gcc.dg/guality/guality.exp (working copy) @@ -1,5 +1,8 @@ # This harness is for tests that should be run at all optimisation levels. +# Disable everywhere. These tests are very flaky. +return + load_lib gcc-dg.exp load_lib gcc-gdb-test.exp Index: gcc/testsuite/gcc.dg/plugin/selfassign.c =================================================================== --- gcc/testsuite/gcc.dg/plugin/selfassign.c (revision 175318) +++ gcc/testsuite/gcc.dg/plugin/selfassign.c (working copy) @@ -194,7 +194,7 @@ /* Check and warn if STMT is a self-assign statement. */ static void -warn_self_assign (gimple stmt) +check_self_assign (gimple stmt) { tree rhs, lhs; @@ -247,7 +247,7 @@ FOR_EACH_BB (bb) { for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi)) - warn_self_assign (gsi_stmt (gsi)); + check_self_assign (gsi_stmt (gsi)); } return 0; Index: gcc/testsuite/g++.dg/guality/guality.exp =================================================================== --- gcc/testsuite/g++.dg/guality/guality.exp (revision 175318) +++ gcc/testsuite/g++.dg/guality/guality.exp (working copy) @@ -1,5 +1,8 @@ # This harness is for tests that should be run at all optimisation levels. +# Disable everywhere. These tests are very flaky. +return + load_lib g++-dg.exp load_lib gcc-gdb-test.exp Index: gcc/testsuite/g++.dg/plugin/selfassign.c =================================================================== --- gcc/testsuite/g++.dg/plugin/selfassign.c (revision 175318) +++ gcc/testsuite/g++.dg/plugin/selfassign.c (working copy) @@ -194,7 +194,7 @@ /* Check and warn if STMT is a self-assign statement. */ static void -warn_self_assign (gimple stmt) +check_self_assign (gimple stmt) { tree rhs, lhs; @@ -247,7 +247,7 @@ FOR_EACH_BB (bb) { for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi)) - warn_self_assign (gsi_stmt (gsi)); + check_self_assign (gsi_stmt (gsi)); } return 0; Index: gcc/ChangeLog.google-integration =================================================================== --- gcc/ChangeLog.google-integration (revision 175318) +++ gcc/ChangeLog.google-integration (working copy) @@ -1,3 +1,26 @@ +2011-06-17 Chris Demetriou <c...@google.com> + + * config/arm/linux-grtev2.h: New file. + * config/arm/linux-elf.h (GLIBC_DYNAMIC_LINKER): Prefix with + RUNTIME_ROOT_PREFIX. + * config/arm/linux-eabi.h (GLIBC_DYNAMIC_LINKER): Likewise. + * config/linux-grtev2.h (LIB_SPEC): Update comment about what + this definition overrides. + * config.gcc: Use linux-grtev2.h for arm-grtev2-linux-*eabi targets. + +2011-05-24 Simon Baldwin <sim...@google.com> + + * common.opt (-Wself-assign): New placeholder flag. + +2011-04-27 Ollie Wild <a...@google.com> + + * config.gcc: Add GRTE detection. + * config/i386/linux.h (LINUX_GRTE_EXTRA_SPECS): New macro. + (SUBTARGET_EXTRA_SPECS): Add LINUX_GRTE_EXTRA_SPECS. + * config/i386/linux64.h (LINUX_GRTE_EXTRA_SPECS): New macro. + (SUBTARGET_EXTRA_SPECS): New macro with LINUX_GRTE_EXTRA_SPECS. + * config/linux-grtev2.h: New file. + 2011-03-14 Diego Novillo <dnovi...@google.com> Mainline merge rev 170934 (gcc-4_6-branch). Index: gcc/common.opt =================================================================== --- gcc/common.opt (revision 175318) +++ gcc/common.opt (working copy) @@ -561,6 +561,13 @@ Common Var(warn_padded) Warning Warn when padding is required to align structure members +; FIXME. The following -Wself-assign flag is a placeholder to prevent +; confusing the compiler when applications are built with these flags. +; Actual support for this flag is found in the google/main branch. +Wself-assign +Common Var(warn_self_assign) Init(0) Warning +Warn when a variable is assigned to itself + Wshadow Common Var(warn_shadow) Warning Warn when one local variable shadows another Index: gcc/config.gcc =================================================================== --- gcc/config.gcc (revision 175318) +++ gcc/config.gcc (working copy) @@ -832,6 +832,12 @@ tmake_file="$tmake_file arm/t-linux-androideabi" ;; esac + # Pull in spec changes for GRTEv2 configurations. + case ${target} in + *-grtev2-*) + tm_file="${tm_file} linux-grtev2.h arm/linux-grtev2.h" + ;; + esac # The BPABI long long divmod functions return a 128-bit value in # registers r0-r3. Correctly modeling that requires the use of # TImode. @@ -1286,6 +1292,9 @@ i[34567]86-*-gnu*) tm_file="$tm_file i386/linux.h gnu.h i386/gnu.h";; esac tmake_file="${tmake_file} i386/t-crtstuff i386/t-crtpc i386/t-crtfm t-dfprules" + if [ "$with_sysroot" = "/usr/grte/v2" ]; then + tm_file="${tm_file} linux-grtev2.h" + fi ;; x86_64-*-linux* | x86_64-*-kfreebsd*-gnu | x86_64-*-knetbsd*-gnu) tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h \ @@ -1297,6 +1306,9 @@ x86_64-*-knetbsd*-gnu) tm_file="${tm_file} knetbsd-gnu.h" ;; esac tmake_file="${tmake_file} i386/t-linux64 i386/t-crtstuff i386/t-crtpc i386/t-crtfm t-dfprules" + if [ "$with_sysroot" = "/usr/grte/v2" ]; then + tm_file="${tm_file} linux-grtev2.h" + fi ;; i[34567]86-pc-msdosdjgpp*) xm_file=i386/xm-djgpp.h Index: gcc/config/i386/linux.h =================================================================== --- gcc/config/i386/linux.h (revision 175318) +++ gcc/config/i386/linux.h (working copy) @@ -101,8 +101,14 @@ #define ASM_SPEC \ "--32 %{!mno-sse2avx:%{mavx:-msse2avx}} %{msse2avx:%{!mavx:-msse2avx}}" +/* These may be provided by config/linux-grtev2.h. */ +#ifndef LINUX_GRTE_EXTRA_SPECS +#define LINUX_GRTE_EXTRA_SPECS +#endif + #undef SUBTARGET_EXTRA_SPECS #define SUBTARGET_EXTRA_SPECS \ + LINUX_GRTE_EXTRA_SPECS \ { "link_emulation", LINK_EMULATION },\ { "dynamic_linker", LINUX_DYNAMIC_LINKER } Index: gcc/config/i386/linux64.h =================================================================== --- gcc/config/i386/linux64.h (revision 175318) +++ gcc/config/i386/linux64.h (working copy) @@ -90,6 +90,15 @@ %{" SPEC_64 ":-dynamic-linker " LINUX_DYNAMIC_LINKER64 "}} \ %{static:-static}}" +/* These may be provided by config/linux-grtev2.h. */ +#ifndef LINUX_GRTE_EXTRA_SPECS +#define LINUX_GRTE_EXTRA_SPECS +#endif + +#undef SUBTARGET_EXTRA_SPECS +#define SUBTARGET_EXTRA_SPECS \ + LINUX_GRTE_EXTRA_SPECS + /* Similar to standard Linux, but adding -ffast-math support. */ #undef ENDFILE_SPEC #define ENDFILE_SPEC \ Index: gcc/config/arm/linux-elf.h =================================================================== --- gcc/config/arm/linux-elf.h (revision 175318) +++ gcc/config/arm/linux-elf.h (working copy) @@ -62,7 +62,7 @@ #define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc" -#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" +#define GLIBC_DYNAMIC_LINKER RUNTIME_ROOT_PREFIX "/lib/ld-linux.so.2" #define LINUX_TARGET_LINK_SPEC "%{h*} \ %{static:-Bstatic} \ Index: gcc/config/arm/linux-eabi.h =================================================================== --- gcc/config/arm/linux-eabi.h (revision 175318) +++ gcc/config/arm/linux-eabi.h (working copy) @@ -62,7 +62,7 @@ /* Use ld-linux.so.3 so that it will be possible to run "classic" GNU/Linux binaries on an EABI system. */ #undef GLIBC_DYNAMIC_LINKER -#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.3" +#define GLIBC_DYNAMIC_LINKER RUNTIME_ROOT_PREFIX "/lib/ld-linux.so.3" /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to use the GNU/Linux version, not the generic BPABI version. */