Index: libitm/configure.tgt =================================================================== --- libitm/configure.tgt (.../tags/gcc_4_9_2_release) (wersja 218777) +++ libitm/configure.tgt (.../branches/gcc-4_9-branch) (wersja 218777) @@ -102,7 +102,7 @@ x86_64) case " ${CC} ${CFLAGS} " in *" -m32 "*) - XCFLAGS="${XCFLAGS} -march=i486 -mtune=i686" + XCFLAGS="${XCFLAGS} -march=i486 -mtune=generic" XCFLAGS="${XCFLAGS} -fomit-frame-pointer" ;; esac Index: libitm/ChangeLog =================================================================== --- libitm/ChangeLog (.../tags/gcc_4_9_2_release) (wersja 218777) +++ libitm/ChangeLog (.../branches/gcc-4_9-branch) (wersja 218777) @@ -1,3 +1,7 @@ +2014-12-03 Uros Bizjak + + * configure.tgt (x86_64): Tune -m32 multilib to generic. + 2014-10-30 Release Manager * GCC 4.9.2 released. Index: Makefile.in =================================================================== --- Makefile.in (.../tags/gcc_4_9_2_release) (wersja 218777) +++ Makefile.in (.../branches/gcc-4_9-branch) (wersja 218777) @@ -46988,6 +46988,38 @@ configure-stage4-gcc: maybe-all-stage4-gmp configure-stageprofile-gcc: maybe-all-stageprofile-gmp configure-stagefeedback-gcc: maybe-all-stagefeedback-gmp +configure-gcc: maybe-all-mpfr + +configure-stage1-gcc: maybe-all-stage1-mpfr +configure-stage2-gcc: maybe-all-stage2-mpfr +configure-stage3-gcc: maybe-all-stage3-mpfr +configure-stage4-gcc: maybe-all-stage4-mpfr +configure-stageprofile-gcc: maybe-all-stageprofile-mpfr +configure-stagefeedback-gcc: maybe-all-stagefeedback-mpfr +configure-gcc: maybe-all-mpc + +configure-stage1-gcc: maybe-all-stage1-mpc +configure-stage2-gcc: maybe-all-stage2-mpc +configure-stage3-gcc: maybe-all-stage3-mpc +configure-stage4-gcc: maybe-all-stage4-mpc +configure-stageprofile-gcc: maybe-all-stageprofile-mpc +configure-stagefeedback-gcc: maybe-all-stagefeedback-mpc +configure-gcc: maybe-all-isl + +configure-stage1-gcc: maybe-all-stage1-isl +configure-stage2-gcc: maybe-all-stage2-isl +configure-stage3-gcc: maybe-all-stage3-isl +configure-stage4-gcc: maybe-all-stage4-isl +configure-stageprofile-gcc: maybe-all-stageprofile-isl +configure-stagefeedback-gcc: maybe-all-stagefeedback-isl +configure-gcc: maybe-all-cloog + +configure-stage1-gcc: maybe-all-stage1-cloog +configure-stage2-gcc: maybe-all-stage2-cloog +configure-stage3-gcc: maybe-all-stage3-cloog +configure-stage4-gcc: maybe-all-stage4-cloog +configure-stageprofile-gcc: maybe-all-stageprofile-cloog +configure-stagefeedback-gcc: maybe-all-stagefeedback-cloog configure-gcc: maybe-all-lto-plugin configure-stage1-gcc: maybe-all-stage1-lto-plugin Index: libgomp/configure.tgt =================================================================== --- libgomp/configure.tgt (.../tags/gcc_4_9_2_release) (wersja 218777) +++ libgomp/configure.tgt (.../branches/gcc-4_9-branch) (wersja 218777) @@ -82,7 +82,7 @@ config_path="linux/x86 linux posix" case " ${CC} ${CFLAGS} " in *" -m32 "*) - XCFLAGS="${XCFLAGS} -march=i486 -mtune=i686" + XCFLAGS="${XCFLAGS} -march=i486 -mtune=generic" ;; esac ;; Index: libgomp/ChangeLog =================================================================== --- libgomp/ChangeLog (.../tags/gcc_4_9_2_release) (wersja 218777) +++ libgomp/ChangeLog (.../branches/gcc-4_9-branch) (wersja 218777) @@ -1,3 +1,16 @@ +2014-12-03 Uros Bizjak + + * configure.tgt (x86_64-*-linux*): Tune -m32 multilib to generic. + +2014-11-28 Jakub Jelinek + + Backported from mainline + 2014-11-24 Jakub Jelinek + + PR fortran/63938 + * libgomp.fortran/pr63938-1.f90: New test. + * libgomp.fortran/pr63938-2.f90: New test. + 2014-10-30 Release Manager * GCC 4.9.2 released. Index: libgomp/testsuite/libgomp.fortran/pr63938-1.f90 =================================================================== --- libgomp/testsuite/libgomp.fortran/pr63938-1.f90 (.../tags/gcc_4_9_2_release) (wersja 0) +++ libgomp/testsuite/libgomp.fortran/pr63938-1.f90 (.../branches/gcc-4_9-branch) (wersja 218777) @@ -0,0 +1,14 @@ +! PR fortran/63938 +! { dg-do run } + +program pr63938_1 + integer :: i, x(1) + x(1) = 0 +!$omp parallel do + do i = 1, 1000 + !$omp atomic + x(1) = x(1) + 1 + end do +!$omp end parallel do + if (x(1) .ne. 1000) call abort +end program pr63938_1 Index: libgomp/testsuite/libgomp.fortran/pr63938-2.f90 =================================================================== --- libgomp/testsuite/libgomp.fortran/pr63938-2.f90 (.../tags/gcc_4_9_2_release) (wersja 0) +++ libgomp/testsuite/libgomp.fortran/pr63938-2.f90 (.../branches/gcc-4_9-branch) (wersja 218777) @@ -0,0 +1,18 @@ +! PR fortran/63938 +! { dg-do run } + +program pr63938_2 + type t + integer :: x + end type + integer :: i + type(t) :: x + x%x = 0 +!$omp parallel do + do i = 1, 1000 + !$omp atomic + x%x = x%x + 1 + end do +!$omp end parallel do + if (x%x .ne. 1000) call abort +end program pr63938_2 Index: libstdc++-v3/configure.host =================================================================== --- libstdc++-v3/configure.host (.../tags/gcc_4_9_2_release) (wersja 218777) +++ libstdc++-v3/configure.host (.../branches/gcc-4_9-branch) (wersja 218777) @@ -219,7 +219,6 @@ os_include_dir="os/aix" atomicity_dir="os/aix" atomic_word_dir="os/aix" - OPT_LDFLAGS="-Wl,-G" ;; aix4.*) os_include_dir="os/generic" Index: libstdc++-v3/include/std/shared_mutex =================================================================== --- libstdc++-v3/include/std/shared_mutex (.../tags/gcc_4_9_2_release) (wersja 218777) +++ libstdc++-v3/include/std/shared_mutex (.../branches/gcc-4_9-branch) (wersja 218777) @@ -36,10 +36,8 @@ #else #include -#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1) -# include -# include -#endif +#include +#include #include namespace std _GLIBCXX_VISIBILITY(default) @@ -51,7 +49,8 @@ * @{ */ -#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1) +#ifdef _GLIBCXX_USE_C99_STDINT_TR1 +#ifdef _GLIBCXX_HAS_GTHREADS #define __cpp_lib_shared_timed_mutex 201402 @@ -254,7 +253,7 @@ } } }; -#endif // _GLIBCXX_HAS_GTHREADS && _GLIBCXX_USE_C99_STDINT_TR1 +#endif // _GLIBCXX_HAS_GTHREADS /// shared_lock template @@ -393,6 +392,8 @@ swap(shared_lock<_Mutex>& __x, shared_lock<_Mutex>& __y) noexcept { __x.swap(__y); } +#endif // _GLIBCXX_USE_C99_STDINT_TR1 + // @} group mutexes _GLIBCXX_END_NAMESPACE_VERSION } // namespace Index: libstdc++-v3/include/std/tuple =================================================================== --- libstdc++-v3/include/std/tuple (.../tags/gcc_4_9_2_release) (wersja 218777) +++ libstdc++-v3/include/std/tuple (.../branches/gcc-4_9-branch) (wersja 218777) @@ -88,21 +88,22 @@ constexpr _Head_base(const _Head& __h) : _Head(__h) { } - template::value>::type> + constexpr _Head_base(const _Head_base&) = default; + constexpr _Head_base(_Head_base&&) = default; + + template constexpr _Head_base(_UHead&& __h) : _Head(std::forward<_UHead>(__h)) { } - _Head_base(__uses_alloc0) + _Head_base(allocator_arg_t, __uses_alloc0) : _Head() { } template - _Head_base(__uses_alloc1<_Alloc> __a) + _Head_base(allocator_arg_t, __uses_alloc1<_Alloc> __a) : _Head(allocator_arg, *__a._M_a) { } template - _Head_base(__uses_alloc2<_Alloc> __a) + _Head_base(allocator_arg_t, __uses_alloc2<_Alloc> __a) : _Head(*__a._M_a) { } template @@ -133,21 +134,22 @@ constexpr _Head_base(const _Head& __h) : _M_head_impl(__h) { } - template::value>::type> + constexpr _Head_base(const _Head_base&) = default; + constexpr _Head_base(_Head_base&&) = default; + + template constexpr _Head_base(_UHead&& __h) : _M_head_impl(std::forward<_UHead>(__h)) { } - _Head_base(__uses_alloc0) + _Head_base(allocator_arg_t, __uses_alloc0) : _M_head_impl() { } template - _Head_base(__uses_alloc1<_Alloc> __a) + _Head_base(allocator_arg_t, __uses_alloc1<_Alloc> __a) : _M_head_impl(allocator_arg, *__a._M_a) { } template - _Head_base(__uses_alloc2<_Alloc> __a) + _Head_base(allocator_arg_t, __uses_alloc2<_Alloc> __a) : _M_head_impl(*__a._M_a) { } template @@ -285,7 +287,7 @@ template _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a) : _Inherited(__tag, __a), - _Base(__use_alloc<_Head>(__a)) { } + _Base(__tag, __use_alloc<_Head>(__a)) { } template _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a, Index: libstdc++-v3/include/std/functional =================================================================== --- libstdc++-v3/include/std/functional (.../tags/gcc_4_9_2_release) (wersja 218777) +++ libstdc++-v3/include/std/functional (.../branches/gcc-4_9-branch) (wersja 218777) @@ -2407,9 +2407,9 @@ { if (static_cast(__x)) { + __x._M_manager(_M_functor, __x._M_functor, __clone_functor); _M_invoker = __x._M_invoker; _M_manager = __x._M_manager; - __x._M_manager(_M_functor, __x._M_functor, __clone_functor); } } Index: libstdc++-v3/include/parallel/numeric =================================================================== --- libstdc++-v3/include/parallel/numeric (.../tags/gcc_4_9_2_release) (wersja 218777) +++ libstdc++-v3/include/parallel/numeric (.../branches/gcc-4_9-branch) (wersja 218777) @@ -85,8 +85,7 @@ __accumulate_switch(__RAIter __begin, __RAIter __end, _Tp __init, _BinaryOperation __binary_op, random_access_iterator_tag, - __gnu_parallel::_Parallelism __parallelism_tag - = __gnu_parallel::parallel_unbalanced) + __gnu_parallel::_Parallelism __parallelism_tag) { if (_GLIBCXX_PARALLEL_CONDITION( static_cast<__gnu_parallel::_SequenceIndex>(__end - __begin) @@ -193,8 +192,7 @@ _BinaryFunction2 __binary_op2, random_access_iterator_tag, random_access_iterator_tag, - __gnu_parallel::_Parallelism __parallelism_tag - = __gnu_parallel::parallel_unbalanced) + __gnu_parallel::_Parallelism __parallelism_tag) { if (_GLIBCXX_PARALLEL_CONDITION((__last1 - __first1) >= __gnu_parallel::_Settings::get(). @@ -419,8 +417,7 @@ random_access_iterator_tag, random_access_iterator_tag, __gnu_parallel::_Parallelism - __parallelism_tag - = __gnu_parallel::parallel_balanced) + __parallelism_tag) { if (_GLIBCXX_PARALLEL_CONDITION( static_cast<__gnu_parallel::_SequenceIndex>(__end - __begin) Index: libstdc++-v3/include/parallel/algo.h =================================================================== --- libstdc++-v3/include/parallel/algo.h (.../tags/gcc_4_9_2_release) (wersja 218777) +++ libstdc++-v3/include/parallel/algo.h (.../branches/gcc-4_9-branch) (wersja 218777) @@ -81,9 +81,8 @@ template _Function __for_each_switch(_RAIter __begin, _RAIter __end, - _Function __f, random_access_iterator_tag, - __gnu_parallel::_Parallelism __parallelism_tag - = __gnu_parallel::parallel_balanced) + _Function __f, random_access_iterator_tag, + __gnu_parallel::_Parallelism __parallelism_tag) { if (_GLIBCXX_PARALLEL_CONDITION( static_cast<__gnu_parallel::_SequenceIndex>(__end - __begin) @@ -896,8 +895,7 @@ typename iterator_traits<_RAIter>::difference_type __count_switch(_RAIter __begin, _RAIter __end, const _Tp& __value, random_access_iterator_tag, - __gnu_parallel::_Parallelism __parallelism_tag - = __gnu_parallel::parallel_unbalanced) + __gnu_parallel::_Parallelism __parallelism_tag) { typedef iterator_traits<_RAIter> _TraitsType; typedef typename _TraitsType::value_type _ValueType; @@ -966,8 +964,7 @@ typename iterator_traits<_RAIter>::difference_type __count_if_switch(_RAIter __begin, _RAIter __end, _Predicate __pred, random_access_iterator_tag, - __gnu_parallel::_Parallelism __parallelism_tag - = __gnu_parallel::parallel_unbalanced) + __gnu_parallel::_Parallelism __parallelism_tag) { typedef iterator_traits<_RAIter> _TraitsType; typedef typename _TraitsType::value_type _ValueType; @@ -1225,8 +1222,7 @@ __transform1_switch(_RAIter1 __begin, _RAIter1 __end, _RAIter2 __result, _UnaryOperation __unary_op, random_access_iterator_tag, random_access_iterator_tag, - __gnu_parallel::_Parallelism __parallelism_tag - = __gnu_parallel::parallel_balanced) + __gnu_parallel::_Parallelism __parallelism_tag) { if (_GLIBCXX_PARALLEL_CONDITION( static_cast<__gnu_parallel::_SequenceIndex>(__end - __begin) @@ -1315,8 +1311,7 @@ _RAIter3 __result, _BinaryOperation __binary_op, random_access_iterator_tag, random_access_iterator_tag, random_access_iterator_tag, - __gnu_parallel::_Parallelism __parallelism_tag - = __gnu_parallel::parallel_balanced) + __gnu_parallel::_Parallelism __parallelism_tag) { if (_GLIBCXX_PARALLEL_CONDITION( (__end1 - __begin1) >= @@ -1422,8 +1417,7 @@ __replace_switch(_RAIter __begin, _RAIter __end, const _Tp& __old_value, const _Tp& __new_value, random_access_iterator_tag, - __gnu_parallel::_Parallelism __parallelism_tag - = __gnu_parallel::parallel_balanced) + __gnu_parallel::_Parallelism __parallelism_tag) { // XXX parallel version is where? replace(__begin, __end, __old_value, __new_value, @@ -1478,8 +1472,7 @@ __replace_if_switch(_RAIter __begin, _RAIter __end, _Predicate __pred, const _Tp& __new_value, random_access_iterator_tag, - __gnu_parallel::_Parallelism __parallelism_tag - = __gnu_parallel::parallel_balanced) + __gnu_parallel::_Parallelism __parallelism_tag) { if (_GLIBCXX_PARALLEL_CONDITION( static_cast<__gnu_parallel::_SequenceIndex>(__end - __begin) @@ -1544,8 +1537,7 @@ void __generate_switch(_RAIter __begin, _RAIter __end, _Generator __gen, random_access_iterator_tag, - __gnu_parallel::_Parallelism __parallelism_tag - = __gnu_parallel::parallel_balanced) + __gnu_parallel::_Parallelism __parallelism_tag) { if (_GLIBCXX_PARALLEL_CONDITION( static_cast<__gnu_parallel::_SequenceIndex>(__end - __begin) @@ -1608,8 +1600,7 @@ inline _RAIter __generate_n_switch(_RAIter __begin, _Size __n, _Generator __gen, random_access_iterator_tag, - __gnu_parallel::_Parallelism __parallelism_tag - = __gnu_parallel::parallel_balanced) + __gnu_parallel::_Parallelism __parallelism_tag) { // XXX parallel version is where? return generate_n(__begin, __n, __gen, __gnu_parallel::sequential_tag()); @@ -2204,8 +2195,7 @@ _RAIter __max_element_switch(_RAIter __begin, _RAIter __end, _Compare __comp, random_access_iterator_tag, - __gnu_parallel::_Parallelism __parallelism_tag - = __gnu_parallel::parallel_balanced) + __gnu_parallel::_Parallelism __parallelism_tag) { if (_GLIBCXX_PARALLEL_CONDITION( static_cast<__gnu_parallel::_SequenceIndex>(__end - __begin) @@ -2296,8 +2286,7 @@ _RAIter __min_element_switch(_RAIter __begin, _RAIter __end, _Compare __comp, random_access_iterator_tag, - __gnu_parallel::_Parallelism __parallelism_tag - = __gnu_parallel::parallel_balanced) + __gnu_parallel::_Parallelism __parallelism_tag) { if (_GLIBCXX_PARALLEL_CONDITION( static_cast<__gnu_parallel::_SequenceIndex>(__end - __begin) Index: libstdc++-v3/include/bits/regex_executor.tcc =================================================================== --- libstdc++-v3/include/bits/regex_executor.tcc (.../tags/gcc_4_9_2_release) (wersja 218777) +++ libstdc++-v3/include/bits/regex_executor.tcc (.../branches/gcc-4_9-branch) (wersja 218777) @@ -267,9 +267,11 @@ _M_dfs<__match_mode>(__state._M_next); break; case _S_opcode_match: + if (_M_current == _M_end) + break; if (__dfs_mode) { - if (_M_current != _M_end && __state._M_matches(*_M_current)) + if (__state._M_matches(*_M_current)) { ++_M_current; _M_dfs<__match_mode>(__state._M_next); @@ -350,23 +352,24 @@ bool _Executor<_BiIter, _Alloc, _TraitsT, __dfs_mode>:: _M_word_boundary(_State<_TraitsT> __state) const { - // By definition. - bool __ans = false; - auto __pre = _M_current; - --__pre; - if (!(_M_at_begin() && _M_at_end())) + bool __left_is_word = false; + if (_M_current != _M_begin + || (_M_flags & regex_constants::match_prev_avail)) { - if (_M_at_begin()) - __ans = _M_is_word(*_M_current) - && !(_M_flags & regex_constants::match_not_bow); - else if (_M_at_end()) - __ans = _M_is_word(*__pre) - && !(_M_flags & regex_constants::match_not_eow); - else - __ans = _M_is_word(*_M_current) - != _M_is_word(*__pre); + auto __prev = _M_current; + if (_M_is_word(*std::prev(__prev))) + __left_is_word = true; } - return __ans; + bool __right_is_word = + _M_current != _M_end && _M_is_word(*_M_current); + + if (__left_is_word == __right_is_word) + return false; + if (__left_is_word && !(_M_flags & regex_constants::match_not_eow)) + return true; + if (__right_is_word && !(_M_flags & regex_constants::match_not_bow)) + return true; + return false; } _GLIBCXX_END_NAMESPACE_VERSION Index: libstdc++-v3/include/bits/regex.tcc =================================================================== --- libstdc++-v3/include/bits/regex.tcc (.../tags/gcc_4_9_2_release) (wersja 218777) +++ libstdc++-v3/include/bits/regex.tcc (.../branches/gcc-4_9-branch) (wersja 218777) @@ -62,6 +62,7 @@ return false; typename match_results<_BiIter, _Alloc>::_Base_type& __res = __m; + __m._M_begin = __s; __res.resize(__re._M_automaton->_M_sub_count() + 2); for (auto& __it : __res) __it.matched = false; @@ -581,8 +582,10 @@ | regex_constants::match_continuous)) { _GLIBCXX_DEBUG_ASSERT(_M_match[0].matched); - _M_match.at(_M_match.size()).first = __prefix_first; - _M_match._M_in_iterator = true; + auto& __prefix = _M_match.at(_M_match.size()); + __prefix.first = __prefix_first; + __prefix.matched = __prefix.first != __prefix.second; + // [28.12.1.4.5] _M_match._M_begin = _M_begin; return *this; } @@ -594,8 +597,10 @@ if (regex_search(__start, _M_end, _M_match, *_M_pregex, _M_flags)) { _GLIBCXX_DEBUG_ASSERT(_M_match[0].matched); - _M_match.at(_M_match.size()).first = __prefix_first; - _M_match._M_in_iterator = true; + auto& __prefix = _M_match.at(_M_match.size()); + __prefix.first = __prefix_first; + __prefix.matched = __prefix.first != __prefix.second; + // [28.12.1.4.5] _M_match._M_begin = _M_begin; } else Index: libstdc++-v3/include/bits/regex.h =================================================================== --- libstdc++-v3/include/bits/regex.h (.../tags/gcc_4_9_2_release) (wersja 218777) +++ libstdc++-v3/include/bits/regex.h (.../branches/gcc-4_9-branch) (wersja 218777) @@ -1568,42 +1568,30 @@ */ explicit match_results(const _Alloc& __a = _Alloc()) - : _Base_type(__a), _M_in_iterator(false) + : _Base_type(__a) { } /** * @brief Copy constructs a %match_results. */ - match_results(const match_results& __rhs) - : _Base_type(__rhs), _M_in_iterator(false) - { } + match_results(const match_results& __rhs) = default; /** * @brief Move constructs a %match_results. */ - match_results(match_results&& __rhs) noexcept - : _Base_type(std::move(__rhs)), _M_in_iterator(false) - { } + match_results(match_results&& __rhs) noexcept = default; /** * @brief Assigns rhs to *this. */ match_results& - operator=(const match_results& __rhs) - { - match_results(__rhs).swap(*this); - return *this; - } + operator=(const match_results& __rhs) = default; /** * @brief Move-assigns rhs to *this. */ match_results& - operator=(match_results&& __rhs) - { - match_results(std::move(__rhs)).swap(*this); - return *this; - } + operator=(match_results&& __rhs) = default; /** * @brief Destroys a %match_results object. @@ -1690,13 +1678,8 @@ difference_type position(size_type __sub = 0) const { - // [28.12.1.4.5] - if (_M_in_iterator) - return __sub < size() ? std::distance(_M_begin, - (*this)[__sub].first) : -1; - else - return __sub < size() ? std::distance(this->prefix().first, - (*this)[__sub].first) : -1; + return __sub < size() ? std::distance(_M_begin, + (*this)[__sub].first) : -1; } /** @@ -1881,7 +1864,10 @@ */ void swap(match_results& __that) - { _Base_type::swap(__that); } + { + _Base_type::swap(__that); + swap(_M_begin, __that._M_begin); + } //@} private: Index: libstdc++-v3/include/tr1/functional =================================================================== --- libstdc++-v3/include/tr1/functional (.../tags/gcc_4_9_2_release) (wersja 218777) +++ libstdc++-v3/include/tr1/functional (.../branches/gcc-4_9-branch) (wersja 218777) @@ -2112,9 +2112,9 @@ { if (static_cast(__x)) { + __x._M_manager(_M_functor, __x._M_functor, __clone_functor); _M_invoker = __x._M_invoker; _M_manager = __x._M_manager; - __x._M_manager(_M_functor, __x._M_functor, __clone_functor); } } @@ -2130,9 +2130,9 @@ if (_My_handler::_M_not_empty_function(__f)) { + _My_handler::_M_init_functor(_M_functor, __f); _M_invoker = &_My_handler::_M_invoke; _M_manager = &_My_handler::_M_manager; - _My_handler::_M_init_functor(_M_functor, __f); } } Index: libstdc++-v3/ChangeLog =================================================================== --- libstdc++-v3/ChangeLog (.../tags/gcc_4_9_2_release) (wersja 218777) +++ libstdc++-v3/ChangeLog (.../branches/gcc-4_9-branch) (wersja 218777) @@ -1,3 +1,87 @@ +2014-12-13 Tim Shen + + PR libstdc++/64239 + * include/bits/regex.h (match_results<>::match_results, + match_results<>::operator=, match_results<>::position, + match_results<>::swap): Fix ctor/assign/swap. + * include/bits/regex.tcc: (__regex_algo_impl<>, + regex_iterator<>::operator++): Set match_results::_M_begin as + "start position". + * testsuite/28_regex/iterators/regex_iterator/char/ + string_position_01.cc: Test cases. + +2014-12-09 Jonathan Wakely + + PR libstdc++/64203 + * include/std/shared_mutex: Fix preprocessor conditions. + * testsuite/experimental/feat-cxx14.cc: Check conditions. + +2014-12-06 Jonathan Wakely + + PR libstdc++/63840 + * include/std/functional (function::function(const function&)): Set + _M_manager after operations that might throw. + * include/tr1/functional (function::function(const function&), + function::function(_Functor, _Useless)): Likewise. + * testsuite/20_util/function/63840.cc: New. + * testsuite/tr1/3_function_objects/function/63840.cc: New. + + PR libstdc++/61947 + * include/std/tuple (_Head_base): Use allocator_arg_t parameters to + disambiguate unary constructors. + (_Tuple_impl): Pass allocator_arg_t arguments. + * testsuite/20_util/tuple/61947.cc: New. + * testsuite/20_util/uses_allocator/cons_neg.cc: Adjust dg-error line. + +2014-12-06 Tim Shen + + PR libstdc++/64140 + Backport form mainline + 2014-12-04 Tim Shen + + * include/bits/regex.tcc (regex_iterator<>::operator++): Update + prefix.matched after modifying prefix.first. + * testsuite/28_regex/iterators/regex_iterator/char/64140.cc: New + testcase. + +2014-12-02 Matthias Klose + + PR libstdc++/64103 + Backport from mainline + 2014-11-03 Paolo Carlini + + * include/parallel/algo.h: Do not use default arguments in function + template redeclarations (definitions). + + 2014-11-04 Jonathan Wakely + + * include/parallel/numeric.h: Do not use default arguments in function + template redeclarations (definitions). + +2014-11-28 Tim Shen + + PR libstdc++/63497 + * include/bits/regex_executor.tcc (_Executor::_M_dfs, + _Executor::_M_word_boundary): Avoid dereferecing _M_current at _M_end + or other invalid position. + +2014-11-13 Thomas Preud'homme + + Backport from mainline + 2014-09-10 Tony Wang + + PR target/56846 + * libsupc++/eh_personality.cc (PERSONALITY_FUNCTION): + Return with CONTINUE_UNWINDING when the state pattern + contains: _US_VIRTUAL_UNWIND_FRAME | _US_FORCE_UNWIND + +2014-10-30 David Edelsohn + + Backported from mainline. + 2014-10-30 David Edelsohn + + * configure.host (aix4.3+, 5+): Do not use -G in link command. + 2014-10-30 Release Manager * GCC 4.9.2 released. Index: libstdc++-v3/libsupc++/eh_personality.cc =================================================================== --- libstdc++-v3/libsupc++/eh_personality.cc (.../tags/gcc_4_9_2_release) (wersja 218777) +++ libstdc++-v3/libsupc++/eh_personality.cc (.../branches/gcc-4_9-branch) (wersja 218777) @@ -378,6 +378,12 @@ switch (state & _US_ACTION_MASK) { case _US_VIRTUAL_UNWIND_FRAME: + // If the unwind state pattern is + // _US_VIRTUAL_UNWIND_FRAME | _US_FORCE_UNWIND + // then we don't need to search for any handler as it is not a real + // exception. Just unwind the stack. + if (state & _US_FORCE_UNWIND) + CONTINUE_UNWINDING; actions = _UA_SEARCH_PHASE; break; Index: libstdc++-v3/testsuite/28_regex/iterators/regex_iterator/char/64140.cc =================================================================== --- libstdc++-v3/testsuite/28_regex/iterators/regex_iterator/char/64140.cc (.../tags/gcc_4_9_2_release) (wersja 0) +++ libstdc++-v3/testsuite/28_regex/iterators/regex_iterator/char/64140.cc (.../branches/gcc-4_9-branch) (wersja 218777) @@ -0,0 +1,53 @@ +// { dg-options "-std=gnu++11" } + +// +// Copyright (C) 2014 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 +// . + +// libstdc++/64140 + +#include +#include + +void +test01() +{ + bool test __attribute__((unused)) = true; + + const std::regex e("z*"); + const std::string s("ab"); + + auto it = std::sregex_iterator(s.begin(), s.end(), e); + auto end = std::sregex_iterator(); + VERIFY(it != end); + VERIFY(!it->prefix().matched); + ++it; + VERIFY(it != end); + VERIFY(it->prefix().matched); + ++it; + VERIFY(it != end); + VERIFY(it->prefix().matched); + ++it; + VERIFY(it == end); +} + +int +main() +{ + test01(); + return 0; +} Index: libstdc++-v3/testsuite/28_regex/iterators/regex_iterator/char/string_position_01.cc =================================================================== --- libstdc++-v3/testsuite/28_regex/iterators/regex_iterator/char/string_position_01.cc (.../tags/gcc_4_9_2_release) (wersja 218777) +++ libstdc++-v3/testsuite/28_regex/iterators/regex_iterator/char/string_position_01.cc (.../branches/gcc-4_9-branch) (wersja 218777) @@ -24,6 +24,7 @@ // Tests iter->position() behavior #include +#include #include void @@ -41,9 +42,53 @@ } } +// PR libstdc++/64239 +void +test02() +{ + bool test __attribute__((unused)) = true; + + std::regex re("\\w+"); + std::string s("-a-b-c-"); + + std::tuple expected[] = + { + std::make_tuple(1, 1, "a"), + std::make_tuple(3, 1, "b"), + std::make_tuple(5, 1, "c"), + }; + + int i = 0; + for (auto it1 = std::sregex_iterator(s.begin(), s.end(), re), + end = std::sregex_iterator(); it1 != end; ++it1, i++) + { + auto it2 = it1; + VERIFY(it1->position() == std::get<0>(expected[i])); + VERIFY(it1->length() == std::get<1>(expected[i])); + VERIFY(it1->str() == std::get<2>(expected[i])); + VERIFY(it2->position() == std::get<0>(expected[i])); + VERIFY(it2->length() == std::get<1>(expected[i])); + VERIFY(it2->str() == std::get<2>(expected[i])); + } +} + +void +test03() +{ + bool test __attribute__((unused)) = true; + + std::smatch m; + std::string s = "abcde"; + std::regex_search(s, m, std::regex("bcd")); + VERIFY(m.position() == 1); + VERIFY(m.position() == m.prefix().length()); +} + int main() { test01(); + test02(); + test03(); return 0; } Index: libstdc++-v3/testsuite/experimental/feat-cxx14.cc =================================================================== --- libstdc++-v3/testsuite/experimental/feat-cxx14.cc (.../tags/gcc_4_9_2_release) (wersja 218777) +++ libstdc++-v3/testsuite/experimental/feat-cxx14.cc (.../branches/gcc-4_9-branch) (wersja 218777) @@ -106,10 +106,12 @@ # error "" #endif -#ifndef __cpp_lib_shared_timed_mutex -# error "__cpp_lib_shared_timed_mutex" -#elif __cpp_lib_shared_timed_mutex != 201402 -# error "__cpp_lib_shared_timed_mutex != 201402" +#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1) +# ifndef __cpp_lib_shared_timed_mutex +# error "__cpp_lib_shared_timed_mutex" +# elif __cpp_lib_shared_timed_mutex != 201402 +# error "__cpp_lib_shared_timed_mutex != 201402" +# endif #endif #ifndef __cpp_lib_is_final Index: libstdc++-v3/testsuite/tr1/3_function_objects/function/63840.cc =================================================================== --- libstdc++-v3/testsuite/tr1/3_function_objects/function/63840.cc (.../tags/gcc_4_9_2_release) (wersja 0) +++ libstdc++-v3/testsuite/tr1/3_function_objects/function/63840.cc (.../branches/gcc-4_9-branch) (wersja 218777) @@ -0,0 +1,55 @@ +// Copyright (C) 2014 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 + +struct functor +{ + functor() : copies(0) { } + + functor(const functor& f) + : copies(f.copies + 1) + { + if (copies > 1) + throw std::runtime_error("functor"); + } + + void operator()() const { } + + int copies; +}; + + +void +test01() +{ + std::tr1::function f = functor(); + try { + std::tr1::function g = f; + } catch (const std::runtime_error& e) { + return; + } + VERIFY(false); +} + +int +main() +{ + test01(); +} Index: libstdc++-v3/testsuite/20_util/tuple/61947.cc =================================================================== --- libstdc++-v3/testsuite/20_util/tuple/61947.cc (.../tags/gcc_4_9_2_release) (wersja 0) +++ libstdc++-v3/testsuite/20_util/tuple/61947.cc (.../branches/gcc-4_9-branch) (wersja 218777) @@ -0,0 +1,29 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2014 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 + +struct ConvertibleToAny { + template operator T() const { return T(); } +}; + +int main() { + std::tuple t(ConvertibleToAny{}); +} Index: libstdc++-v3/testsuite/20_util/uses_allocator/cons_neg.cc =================================================================== --- libstdc++-v3/testsuite/20_util/uses_allocator/cons_neg.cc (.../tags/gcc_4_9_2_release) (wersja 218777) +++ libstdc++-v3/testsuite/20_util/uses_allocator/cons_neg.cc (.../branches/gcc-4_9-branch) (wersja 218777) @@ -44,4 +44,4 @@ tuple t(allocator_arg, a, 1); } -// { dg-error "no matching function" "" { target *-*-* } 118 } +// { dg-error "no matching function" "" { target *-*-* } 119 } Index: libstdc++-v3/testsuite/20_util/function/63840.cc =================================================================== --- libstdc++-v3/testsuite/20_util/function/63840.cc (.../tags/gcc_4_9_2_release) (wersja 0) +++ libstdc++-v3/testsuite/20_util/function/63840.cc (.../branches/gcc-4_9-branch) (wersja 218777) @@ -0,0 +1,55 @@ +// Copyright (C) 2014 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=gnu++11" } + +#include +#include +#include + +struct functor +{ + functor() = default; + + functor(const functor&) + { + throw std::runtime_error("test"); + } + + functor(functor&& f) = default; + + void operator()() const { } +}; + + +void +test01() +{ + std::function f = functor{}; + try { + auto g = f; + } catch (const std::runtime_error& e) { + return; + } + VERIFY(false); +} + +int +main() +{ + test01(); +} Index: configure.ac =================================================================== --- configure.ac (.../tags/gcc_4_9_2_release) (wersja 218777) +++ configure.ac (.../branches/gcc-4_9-branch) (wersja 218777) @@ -1658,6 +1658,9 @@ ISL_CHECK_VERSION(0,11) if test "${gcc_cv_isl}" = no ; then ISL_CHECK_VERSION(0,12) + if test "${gcc_cv_isl}" = no ; then + ISL_CHECK_VERSION(0,14) + fi fi fi dnl Only execute fail-action, if ISL has been requested. Index: ChangeLog =================================================================== --- ChangeLog (.../tags/gcc_4_9_2_release) (wersja 218777) +++ ChangeLog (.../branches/gcc-4_9-branch) (wersja 218777) @@ -1,3 +1,10 @@ +2014-12-04 Tobias Burnus + + * configure.ac: Permit also ISL 0.14 with CLooG. + * Makefile.def: Make more dependent on mpfr, mpc, isl, and cloog. + * Makefile.in: Regenerate. + * configure: Regenerate. + 2014-10-30 Release Manager * GCC 4.9.2 released. Index: configure =================================================================== --- configure (.../tags/gcc_4_9_2_release) (wersja 218777) +++ configure (.../branches/gcc-4_9-branch) (wersja 218777) @@ -6024,6 +6024,55 @@ fi + if test "${gcc_cv_isl}" = no ; then + + if test "${ENABLE_ISL_CHECK}" = yes ; then + _isl_saved_CFLAGS=$CFLAGS + _isl_saved_LDFLAGS=$LDFLAGS + _isl_saved_LIBS=$LIBS + + CFLAGS="${_isl_saved_CFLAGS} ${islinc} ${gmpinc}" + LDFLAGS="${_isl_saved_LDFLAGS} ${isllibs}" + LIBS="${_isl_saved_LIBS} -lisl" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for version 0.14 of ISL" >&5 +$as_echo_n "checking for version 0.14 of ISL... " >&6; } + if test "$cross_compiling" = yes; then : + gcc_cv_isl=yes +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include +int +main () +{ +if (strncmp (isl_version (), "isl-0.14", strlen ("isl-0.14")) != 0) + return 1; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gcc_cv_isl=yes +else + gcc_cv_isl=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_isl" >&5 +$as_echo "$gcc_cv_isl" >&6; } + + CFLAGS=$_isl_saved_CFLAGS + LDFLAGS=$_isl_saved_LDFLAGS + LIBS=$_isl_saved_LIBS + fi + + + fi fi fi Index: libgcc/ChangeLog =================================================================== --- libgcc/ChangeLog (.../tags/gcc_4_9_2_release) (wersja 218777) +++ libgcc/ChangeLog (.../branches/gcc-4_9-branch) (wersja 218777) @@ -1,3 +1,35 @@ +2014-12-09 John David Anglin + + Backport from mainline + 2014-11-24 John David Anglin + + * config/pa/linux-atomic.c (ABORT_INSTRUCTION): Use __builtin_trap() + instead. + + 2014-11-21 Guy Martin + John David Anglin + + * config/pa/linux-atomic.c (__kernel_cmpxchg2): New. + (FETCH_AND_OP_2): New. Use for subword and double word operations. + (OP_AND_FETCH_2): Likewise. + (COMPARE_AND_SWAP_2): Likewise. + (SYNC_LOCK_TEST_AND_SET_2): Likewise. + (SYNC_LOCK_RELEASE_2): Likewise. + (SUBWORD_SYNC_OP): Remove. + (SUBWORD_VAL_CAS): Likewise. + (SUBWORD_BOOL_CAS): Likewise. + (FETCH_AND_OP_WORD): Update. + Consistently use signed types. + +2014-12-09 Oleg Endo + + Backport from mainline + 2014-11-30 Oleg Endo + + PR target/55351 + * config/sh/lib1funcs.S: Check value of __SHMEDIA__ instead of checking + whether it's defined. + 2014-10-30 Release Manager * GCC 4.9.2 released. Index: libgcc/config/sh/lib1funcs.S =================================================================== --- libgcc/config/sh/lib1funcs.S (.../tags/gcc_4_9_2_release) (wersja 218777) +++ libgcc/config/sh/lib1funcs.S (.../branches/gcc-4_9-branch) (wersja 218777) @@ -1278,7 +1278,7 @@ #endif ENDFUNC(GLOBAL(sdivsi3_2)) #endif -#elif defined __SHMEDIA__ +#elif __SHMEDIA__ /* m5compact-nofpu */ // clobbered: r18,r19,r20,r21,r25,tr0,tr1,tr2 .mode SHmedia @@ -1683,7 +1683,7 @@ add.l r18,r25,r0 blink tr0,r63 #endif -#elif defined (__SHMEDIA__) +#elif __SHMEDIA__ /* m5compact-nofpu - more emphasis on code size than on speed, but don't ignore speed altogether - div1 needs 9 cycles, subc 7 and rotcl 4. So use a short shmedia loop. */ @@ -1707,7 +1707,7 @@ bnei r25,-32,tr1 add.l r20,r63,r0 blink tr2,r63 -#else /* ! defined (__SHMEDIA__) */ +#else /* ! __SHMEDIA__ */ LOCAL(div8): div1 r5,r4 LOCAL(div7): @@ -1773,7 +1773,7 @@ #endif /* L_udivsi3 */ #ifdef L_udivdi3 -#ifdef __SHMEDIA__ +#if __SHMEDIA__ .mode SHmedia .section .text..SHmedia32,"ax" .align 2 @@ -1901,7 +1901,7 @@ #endif /* L_udivdi3 */ #ifdef L_divdi3 -#ifdef __SHMEDIA__ +#if __SHMEDIA__ .mode SHmedia .section .text..SHmedia32,"ax" .align 2 @@ -1925,7 +1925,7 @@ #endif /* L_divdi3 */ #ifdef L_umoddi3 -#ifdef __SHMEDIA__ +#if __SHMEDIA__ .mode SHmedia .section .text..SHmedia32,"ax" .align 2 @@ -2054,7 +2054,7 @@ #endif /* L_umoddi3 */ #ifdef L_moddi3 -#ifdef __SHMEDIA__ +#if __SHMEDIA__ .mode SHmedia .section .text..SHmedia32,"ax" .align 2 @@ -3142,7 +3142,7 @@ #ifdef L_div_table #if __SH5__ -#if defined(__pic__) && defined(__SHMEDIA__) +#if defined(__pic__) && __SHMEDIA__ .global GLOBAL(sdivsi3) FUNC(GLOBAL(sdivsi3)) #if __SH5__ == 32 @@ -3215,7 +3215,7 @@ #else /* ! __pic__ || ! __SHMEDIA__ */ .section .rodata #endif /* __pic__ */ -#if defined(TEXT_DATA_BUG) && defined(__pic__) && defined(__SHMEDIA__) +#if defined(TEXT_DATA_BUG) && defined(__pic__) && __SHMEDIA__ .balign 2 .type Local_div_table,@object .size Local_div_table,128 Index: libgcc/config/pa/linux-atomic.c =================================================================== --- libgcc/config/pa/linux-atomic.c (.../tags/gcc_4_9_2_release) (wersja 218777) +++ libgcc/config/pa/linux-atomic.c (.../branches/gcc-4_9-branch) (wersja 218777) @@ -41,11 +41,8 @@ using the kernel helper defined below. There is no support for 64-bit operations yet. */ -/* A privileged instruction to crash a userspace program with SIGILL. */ -#define ABORT_INSTRUCTION asm ("iitlbp %r0,(%sr0, %r0)") - /* Determine kernel LWS function call (0=32-bit, 1=64-bit userspace). */ -#define LWS_CAS (sizeof(unsigned long) == 4 ? 0 : 1) +#define LWS_CAS (sizeof(long) == 4 ? 0 : 1) /* Kernel helper for compare-and-exchange a 32-bit value. */ static inline long @@ -64,7 +61,7 @@ : "r1", "r20", "r22", "r23", "r29", "r31", "memory" ); if (__builtin_expect (lws_errno == -EFAULT || lws_errno == -ENOSYS, 0)) - ABORT_INSTRUCTION; + __builtin_trap (); /* If the kernel LWS call succeeded (lws_errno == 0), lws_ret contains the old value from memory. If this value is equal to OLDVAL, the @@ -75,6 +72,30 @@ return lws_errno; } +static inline long +__kernel_cmpxchg2 (void * oldval, void * newval, void *mem, int val_size) +{ + register unsigned long lws_mem asm("r26") = (unsigned long) (mem); + register long lws_ret asm("r28"); + register long lws_errno asm("r21"); + register unsigned long lws_old asm("r25") = (unsigned long) oldval; + register unsigned long lws_new asm("r24") = (unsigned long) newval; + register int lws_size asm("r23") = val_size; + asm volatile ( "ble 0xb0(%%sr2, %%r0) \n\t" + "ldi %2, %%r20 \n\t" + : "=r" (lws_ret), "=r" (lws_errno) + : "i" (2), "r" (lws_mem), "r" (lws_old), "r" (lws_new), "r" (lws_size) + : "r1", "r20", "r22", "r29", "r31", "fr4", "memory" + ); + if (__builtin_expect (lws_errno == -EFAULT || lws_errno == -ENOSYS, 0)) + __builtin_trap (); + + /* If the kernel LWS call fails, retrun EBUSY */ + if (!lws_errno && lws_ret) + lws_errno = -EBUSY; + + return lws_errno; +} #define HIDDEN __attribute__ ((visibility ("hidden"))) /* Big endian masks */ @@ -84,69 +105,101 @@ #define MASK_1 0xffu #define MASK_2 0xffffu -#define FETCH_AND_OP_WORD(OP, PFX_OP, INF_OP) \ - int HIDDEN \ - __sync_fetch_and_##OP##_4 (int *ptr, int val) \ +#define FETCH_AND_OP_2(OP, PFX_OP, INF_OP, TYPE, WIDTH, INDEX) \ + TYPE HIDDEN \ + __sync_fetch_and_##OP##_##WIDTH (TYPE *ptr, TYPE val) \ { \ - int failure, tmp; \ + TYPE tmp, newval; \ + int failure; \ \ do { \ tmp = *ptr; \ - failure = __kernel_cmpxchg (tmp, PFX_OP (tmp INF_OP val), ptr); \ + newval = PFX_OP (tmp INF_OP val); \ + failure = __kernel_cmpxchg2 (&tmp, &newval, ptr, INDEX); \ } while (failure != 0); \ \ return tmp; \ } -FETCH_AND_OP_WORD (add, , +) -FETCH_AND_OP_WORD (sub, , -) -FETCH_AND_OP_WORD (or, , |) -FETCH_AND_OP_WORD (and, , &) -FETCH_AND_OP_WORD (xor, , ^) -FETCH_AND_OP_WORD (nand, ~, &) +FETCH_AND_OP_2 (add, , +, long long, 8, 3) +FETCH_AND_OP_2 (sub, , -, long long, 8, 3) +FETCH_AND_OP_2 (or, , |, long long, 8, 3) +FETCH_AND_OP_2 (and, , &, long long, 8, 3) +FETCH_AND_OP_2 (xor, , ^, long long, 8, 3) +FETCH_AND_OP_2 (nand, ~, &, long long, 8, 3) -#define NAME_oldval(OP, WIDTH) __sync_fetch_and_##OP##_##WIDTH -#define NAME_newval(OP, WIDTH) __sync_##OP##_and_fetch_##WIDTH +FETCH_AND_OP_2 (add, , +, short, 2, 1) +FETCH_AND_OP_2 (sub, , -, short, 2, 1) +FETCH_AND_OP_2 (or, , |, short, 2, 1) +FETCH_AND_OP_2 (and, , &, short, 2, 1) +FETCH_AND_OP_2 (xor, , ^, short, 2, 1) +FETCH_AND_OP_2 (nand, ~, &, short, 2, 1) -/* Implement both __sync__and_fetch and __sync_fetch_and_ for - subword-sized quantities. */ +FETCH_AND_OP_2 (add, , +, signed char, 1, 0) +FETCH_AND_OP_2 (sub, , -, signed char, 1, 0) +FETCH_AND_OP_2 (or, , |, signed char, 1, 0) +FETCH_AND_OP_2 (and, , &, signed char, 1, 0) +FETCH_AND_OP_2 (xor, , ^, signed char, 1, 0) +FETCH_AND_OP_2 (nand, ~, &, signed char, 1, 0) -#define SUBWORD_SYNC_OP(OP, PFX_OP, INF_OP, TYPE, WIDTH, RETURN) \ +#define OP_AND_FETCH_2(OP, PFX_OP, INF_OP, TYPE, WIDTH, INDEX) \ TYPE HIDDEN \ - NAME##_##RETURN (OP, WIDTH) (TYPE *ptr, TYPE val) \ + __sync_##OP##_and_fetch_##WIDTH (TYPE *ptr, TYPE val) \ { \ - int *wordptr = (int *) ((unsigned long) ptr & ~3); \ - unsigned int mask, shift, oldval, newval; \ + TYPE tmp, newval; \ int failure; \ \ - shift = (((unsigned long) ptr & 3) << 3) ^ INVERT_MASK_##WIDTH; \ - mask = MASK_##WIDTH << shift; \ + do { \ + tmp = *ptr; \ + newval = PFX_OP (tmp INF_OP val); \ + failure = __kernel_cmpxchg2 (&tmp, &newval, ptr, INDEX); \ + } while (failure != 0); \ \ + return PFX_OP (tmp INF_OP val); \ + } + +OP_AND_FETCH_2 (add, , +, long long, 8, 3) +OP_AND_FETCH_2 (sub, , -, long long, 8, 3) +OP_AND_FETCH_2 (or, , |, long long, 8, 3) +OP_AND_FETCH_2 (and, , &, long long, 8, 3) +OP_AND_FETCH_2 (xor, , ^, long long, 8, 3) +OP_AND_FETCH_2 (nand, ~, &, long long, 8, 3) + +OP_AND_FETCH_2 (add, , +, short, 2, 1) +OP_AND_FETCH_2 (sub, , -, short, 2, 1) +OP_AND_FETCH_2 (or, , |, short, 2, 1) +OP_AND_FETCH_2 (and, , &, short, 2, 1) +OP_AND_FETCH_2 (xor, , ^, short, 2, 1) +OP_AND_FETCH_2 (nand, ~, &, short, 2, 1) + +OP_AND_FETCH_2 (add, , +, signed char, 1, 0) +OP_AND_FETCH_2 (sub, , -, signed char, 1, 0) +OP_AND_FETCH_2 (or, , |, signed char, 1, 0) +OP_AND_FETCH_2 (and, , &, signed char, 1, 0) +OP_AND_FETCH_2 (xor, , ^, signed char, 1, 0) +OP_AND_FETCH_2 (nand, ~, &, signed char, 1, 0) + +#define FETCH_AND_OP_WORD(OP, PFX_OP, INF_OP) \ + int HIDDEN \ + __sync_fetch_and_##OP##_4 (int *ptr, int val) \ + { \ + int failure, tmp; \ + \ do { \ - oldval = *wordptr; \ - newval = ((PFX_OP (((oldval & mask) >> shift) \ - INF_OP (unsigned int) val)) << shift) & mask; \ - newval |= oldval & ~mask; \ - failure = __kernel_cmpxchg (oldval, newval, wordptr); \ + tmp = *ptr; \ + failure = __kernel_cmpxchg (tmp, PFX_OP (tmp INF_OP val), ptr); \ } while (failure != 0); \ \ - return (RETURN & mask) >> shift; \ + return tmp; \ } -SUBWORD_SYNC_OP (add, , +, unsigned short, 2, oldval) -SUBWORD_SYNC_OP (sub, , -, unsigned short, 2, oldval) -SUBWORD_SYNC_OP (or, , |, unsigned short, 2, oldval) -SUBWORD_SYNC_OP (and, , &, unsigned short, 2, oldval) -SUBWORD_SYNC_OP (xor, , ^, unsigned short, 2, oldval) -SUBWORD_SYNC_OP (nand, ~, &, unsigned short, 2, oldval) +FETCH_AND_OP_WORD (add, , +) +FETCH_AND_OP_WORD (sub, , -) +FETCH_AND_OP_WORD (or, , |) +FETCH_AND_OP_WORD (and, , &) +FETCH_AND_OP_WORD (xor, , ^) +FETCH_AND_OP_WORD (nand, ~, &) -SUBWORD_SYNC_OP (add, , +, unsigned char, 1, oldval) -SUBWORD_SYNC_OP (sub, , -, unsigned char, 1, oldval) -SUBWORD_SYNC_OP (or, , |, unsigned char, 1, oldval) -SUBWORD_SYNC_OP (and, , &, unsigned char, 1, oldval) -SUBWORD_SYNC_OP (xor, , ^, unsigned char, 1, oldval) -SUBWORD_SYNC_OP (nand, ~, &, unsigned char, 1, oldval) - #define OP_AND_FETCH_WORD(OP, PFX_OP, INF_OP) \ int HIDDEN \ __sync_##OP##_and_fetch_4 (int *ptr, int val) \ @@ -168,20 +221,42 @@ OP_AND_FETCH_WORD (xor, , ^) OP_AND_FETCH_WORD (nand, ~, &) -SUBWORD_SYNC_OP (add, , +, unsigned short, 2, newval) -SUBWORD_SYNC_OP (sub, , -, unsigned short, 2, newval) -SUBWORD_SYNC_OP (or, , |, unsigned short, 2, newval) -SUBWORD_SYNC_OP (and, , &, unsigned short, 2, newval) -SUBWORD_SYNC_OP (xor, , ^, unsigned short, 2, newval) -SUBWORD_SYNC_OP (nand, ~, &, unsigned short, 2, newval) +typedef unsigned char bool; -SUBWORD_SYNC_OP (add, , +, unsigned char, 1, newval) -SUBWORD_SYNC_OP (sub, , -, unsigned char, 1, newval) -SUBWORD_SYNC_OP (or, , |, unsigned char, 1, newval) -SUBWORD_SYNC_OP (and, , &, unsigned char, 1, newval) -SUBWORD_SYNC_OP (xor, , ^, unsigned char, 1, newval) -SUBWORD_SYNC_OP (nand, ~, &, unsigned char, 1, newval) +#define COMPARE_AND_SWAP_2(TYPE, WIDTH, INDEX) \ + TYPE HIDDEN \ + __sync_val_compare_and_swap_##WIDTH (TYPE *ptr, TYPE oldval, \ + TYPE newval) \ + { \ + TYPE actual_oldval; \ + int fail; \ + \ + while (1) \ + { \ + actual_oldval = *ptr; \ + \ + if (__builtin_expect (oldval != actual_oldval, 0)) \ + return actual_oldval; \ + \ + fail = __kernel_cmpxchg2 (&actual_oldval, &newval, ptr, INDEX); \ + \ + if (__builtin_expect (!fail, 1)) \ + return actual_oldval; \ + } \ + } \ + \ + bool HIDDEN \ + __sync_bool_compare_and_swap_##WIDTH (TYPE *ptr, TYPE oldval, \ + TYPE newval) \ + { \ + int failure = __kernel_cmpxchg2 (&oldval, &newval, ptr, INDEX); \ + return (failure != 0); \ + } +COMPARE_AND_SWAP_2 (long long, 8, 3) +COMPARE_AND_SWAP_2 (short, 2, 1) +COMPARE_AND_SWAP_2 (char, 1, 0) + int HIDDEN __sync_val_compare_and_swap_4 (int *ptr, int oldval, int newval) { @@ -201,41 +276,6 @@ } } -#define SUBWORD_VAL_CAS(TYPE, WIDTH) \ - TYPE HIDDEN \ - __sync_val_compare_and_swap_##WIDTH (TYPE *ptr, TYPE oldval, \ - TYPE newval) \ - { \ - int *wordptr = (int *)((unsigned long) ptr & ~3), fail; \ - unsigned int mask, shift, actual_oldval, actual_newval; \ - \ - shift = (((unsigned long) ptr & 3) << 3) ^ INVERT_MASK_##WIDTH; \ - mask = MASK_##WIDTH << shift; \ - \ - while (1) \ - { \ - actual_oldval = *wordptr; \ - \ - if (__builtin_expect (((actual_oldval & mask) >> shift) \ - != (unsigned int) oldval, 0)) \ - return (actual_oldval & mask) >> shift; \ - \ - actual_newval = (actual_oldval & ~mask) \ - | (((unsigned int) newval << shift) & mask); \ - \ - fail = __kernel_cmpxchg (actual_oldval, actual_newval, \ - wordptr); \ - \ - if (__builtin_expect (!fail, 1)) \ - return (actual_oldval & mask) >> shift; \ - } \ - } - -SUBWORD_VAL_CAS (unsigned short, 2) -SUBWORD_VAL_CAS (unsigned char, 1) - -typedef unsigned char bool; - bool HIDDEN __sync_bool_compare_and_swap_4 (int *ptr, int oldval, int newval) { @@ -243,18 +283,24 @@ return (failure == 0); } -#define SUBWORD_BOOL_CAS(TYPE, WIDTH) \ - bool HIDDEN \ - __sync_bool_compare_and_swap_##WIDTH (TYPE *ptr, TYPE oldval, \ - TYPE newval) \ +#define SYNC_LOCK_TEST_AND_SET_2(TYPE, WIDTH, INDEX) \ +TYPE HIDDEN \ + __sync_lock_test_and_set_##WIDTH (TYPE *ptr, TYPE val) \ { \ - TYPE actual_oldval \ - = __sync_val_compare_and_swap_##WIDTH (ptr, oldval, newval); \ - return (oldval == actual_oldval); \ + TYPE oldval; \ + int failure; \ + \ + do { \ + oldval = *ptr; \ + failure = __kernel_cmpxchg2 (&oldval, &val, ptr, INDEX); \ + } while (failure != 0); \ + \ + return oldval; \ } -SUBWORD_BOOL_CAS (unsigned short, 2) -SUBWORD_BOOL_CAS (unsigned char, 1) +SYNC_LOCK_TEST_AND_SET_2 (long long, 8, 3) +SYNC_LOCK_TEST_AND_SET_2 (short, 2, 1) +SYNC_LOCK_TEST_AND_SET_2 (signed char, 1, 0) int HIDDEN __sync_lock_test_and_set_4 (int *ptr, int val) @@ -269,37 +315,29 @@ return oldval; } -#define SUBWORD_TEST_AND_SET(TYPE, WIDTH) \ - TYPE HIDDEN \ - __sync_lock_test_and_set_##WIDTH (TYPE *ptr, TYPE val) \ - { \ - int failure; \ - unsigned int oldval, newval, shift, mask; \ - int *wordptr = (int *) ((unsigned long) ptr & ~3); \ - \ - shift = (((unsigned long) ptr & 3) << 3) ^ INVERT_MASK_##WIDTH; \ - mask = MASK_##WIDTH << shift; \ - \ - do { \ - oldval = *wordptr; \ - newval = (oldval & ~mask) \ - | (((unsigned int) val << shift) & mask); \ - failure = __kernel_cmpxchg (oldval, newval, wordptr); \ - } while (failure != 0); \ - \ - return (oldval & mask) >> shift; \ +#define SYNC_LOCK_RELEASE_2(TYPE, WIDTH, INDEX) \ + void HIDDEN \ + __sync_lock_release_##WIDTH (TYPE *ptr) \ + { \ + TYPE failure, oldval, zero = 0; \ + \ + do { \ + oldval = *ptr; \ + failure = __kernel_cmpxchg2 (&oldval, &zero, ptr, INDEX); \ + } while (failure != 0); \ } -SUBWORD_TEST_AND_SET (unsigned short, 2) -SUBWORD_TEST_AND_SET (unsigned char, 1) +SYNC_LOCK_RELEASE_2 (long long, 8, 3) +SYNC_LOCK_RELEASE_2 (short, 2, 1) +SYNC_LOCK_RELEASE_2 (signed char, 1, 0) -#define SYNC_LOCK_RELEASE(TYPE, WIDTH) \ - void HIDDEN \ - __sync_lock_release_##WIDTH (TYPE *ptr) \ - { \ - *ptr = 0; \ - } +void HIDDEN +__sync_lock_release_4 (int *ptr) +{ + int failure, oldval; -SYNC_LOCK_RELEASE (int, 4) -SYNC_LOCK_RELEASE (short, 2) -SYNC_LOCK_RELEASE (char, 1) + do { + oldval = *ptr; + failure = __kernel_cmpxchg (oldval, 0, ptr); + } while (failure != 0); +} Index: gcc/tree-vrp.c =================================================================== --- gcc/tree-vrp.c (.../tags/gcc_4_9_2_release) (wersja 218777) +++ gcc/tree-vrp.c (.../branches/gcc-4_9-branch) (wersja 218777) @@ -9377,8 +9377,10 @@ } else { - tree r1 = int_const_binop (subcode, vr0.min, vr1.min); - tree r2 = int_const_binop (subcode, vr0.max, vr1.max); + tree r1 = int_const_binop (subcode, vr0.min, + subcode == MINUS_EXPR ? vr1.max : vr1.min); + tree r2 = int_const_binop (subcode, vr0.max, + subcode == MINUS_EXPR ? vr1.min : vr1.max); if (r1 == NULL_TREE || TREE_OVERFLOW (r1) || r2 == NULL_TREE || TREE_OVERFLOW (r2)) return false; Index: gcc/doc/extend.texi =================================================================== --- gcc/doc/extend.texi (.../tags/gcc_4_9_2_release) (wersja 218777) +++ gcc/doc/extend.texi (.../branches/gcc-4_9-branch) (wersja 218777) @@ -13233,8 +13233,12 @@ vector bool int vec_cmplt (vector signed int, vector signed int); vector bool int vec_cmplt (vector float, vector float); +vector float vec_cpsgn (vector float, vector float); + vector float vec_ctf (vector unsigned int, const int); vector float vec_ctf (vector signed int, const int); +vector double vec_ctf (vector unsigned long, const int); +vector double vec_ctf (vector signed long, const int); vector float vec_vcfsx (vector signed int, const int); @@ -13241,8 +13245,10 @@ vector float vec_vcfux (vector unsigned int, const int); vector signed int vec_cts (vector float, const int); +vector signed long vec_cts (vector double, const int); vector unsigned int vec_ctu (vector float, const int); +vector unsigned long vec_ctu (vector double, const int); void vec_dss (const int); @@ -14078,7 +14084,17 @@ vector signed int vec_splat (vector signed int, const int); vector unsigned int vec_splat (vector unsigned int, const int); vector bool int vec_splat (vector bool int, const int); +vector signed long vec_splat (vector signed long, const int); +vector unsigned long vec_splat (vector unsigned long, const int); +vector signed char vec_splats (signed char); +vector unsigned char vec_splats (unsigned char); +vector signed short vec_splats (signed short); +vector unsigned short vec_splats (unsigned short); +vector signed int vec_splats (signed int); +vector unsigned int vec_splats (unsigned int); +vector float vec_splats (float); + vector float vec_vspltw (vector float, const int); vector signed int vec_vspltw (vector signed int, const int); vector unsigned int vec_vspltw (vector unsigned int, const int); @@ -14782,9 +14798,21 @@ vector double vec_and (vector double, vector double); vector double vec_and (vector double, vector bool long); vector double vec_and (vector bool long, vector double); +vector long vec_and (vector long, vector long); +vector long vec_and (vector long, vector bool long); +vector long vec_and (vector bool long, vector long); +vector unsigned long vec_and (vector unsigned long, vector unsigned long); +vector unsigned long vec_and (vector unsigned long, vector bool long); +vector unsigned long vec_and (vector bool long, vector unsigned long); vector double vec_andc (vector double, vector double); vector double vec_andc (vector double, vector bool long); vector double vec_andc (vector bool long, vector double); +vector long vec_andc (vector long, vector long); +vector long vec_andc (vector long, vector bool long); +vector long vec_andc (vector bool long, vector long); +vector unsigned long vec_andc (vector unsigned long, vector unsigned long); +vector unsigned long vec_andc (vector unsigned long, vector bool long); +vector unsigned long vec_andc (vector bool long, vector unsigned long); vector double vec_ceil (vector double); vector bool long vec_cmpeq (vector double, vector double); vector bool long vec_cmpge (vector double, vector double); @@ -14791,8 +14819,11 @@ vector bool long vec_cmpgt (vector double, vector double); vector bool long vec_cmple (vector double, vector double); vector bool long vec_cmplt (vector double, vector double); +vector double vec_cpsgn (vector double, vector double); vector float vec_div (vector float, vector float); vector double vec_div (vector double, vector double); +vector long vec_div (vector long, vector long); +vector unsigned long vec_div (vector unsigned long, vector unsigned long); vector double vec_floor (vector double); vector double vec_ld (int, const vector double *); vector double vec_ld (int, const double *); @@ -14802,11 +14833,25 @@ vector unsigned char vec_lvsr (int, const volatile double *); vector double vec_madd (vector double, vector double, vector double); vector double vec_max (vector double, vector double); +vector signed long vec_mergeh (vector signed long, vector signed long); +vector signed long vec_mergeh (vector signed long, vector bool long); +vector signed long vec_mergeh (vector bool long, vector signed long); +vector unsigned long vec_mergeh (vector unsigned long, vector unsigned long); +vector unsigned long vec_mergeh (vector unsigned long, vector bool long); +vector unsigned long vec_mergeh (vector bool long, vector unsigned long); +vector signed long vec_mergel (vector signed long, vector signed long); +vector signed long vec_mergel (vector signed long, vector bool long); +vector signed long vec_mergel (vector bool long, vector signed long); +vector unsigned long vec_mergel (vector unsigned long, vector unsigned long); +vector unsigned long vec_mergel (vector unsigned long, vector bool long); +vector unsigned long vec_mergel (vector bool long, vector unsigned long); vector double vec_min (vector double, vector double); vector float vec_msub (vector float, vector float, vector float); vector double vec_msub (vector double, vector double, vector double); vector float vec_mul (vector float, vector float); vector double vec_mul (vector double, vector double); +vector long vec_mul (vector long, vector long); +vector unsigned long vec_mul (vector unsigned long, vector unsigned long); vector float vec_nearbyint (vector float); vector double vec_nearbyint (vector double); vector float vec_nmadd (vector float, vector float, vector float); @@ -14813,12 +14858,25 @@ vector double vec_nmadd (vector double, vector double, vector double); vector double vec_nmsub (vector double, vector double, vector double); vector double vec_nor (vector double, vector double); +vector long vec_nor (vector long, vector long); +vector long vec_nor (vector long, vector bool long); +vector long vec_nor (vector bool long, vector long); +vector unsigned long vec_nor (vector unsigned long, vector unsigned long); +vector unsigned long vec_nor (vector unsigned long, vector bool long); +vector unsigned long vec_nor (vector bool long, vector unsigned long); vector double vec_or (vector double, vector double); vector double vec_or (vector double, vector bool long); vector double vec_or (vector bool long, vector double); -vector double vec_perm (vector double, - vector double, - vector unsigned char); +vector long vec_or (vector long, vector long); +vector long vec_or (vector long, vector bool long); +vector long vec_or (vector bool long, vector long); +vector unsigned long vec_or (vector unsigned long, vector unsigned long); +vector unsigned long vec_or (vector unsigned long, vector bool long); +vector unsigned long vec_or (vector bool long, vector unsigned long); +vector double vec_perm (vector double, vector double, vector unsigned char); +vector long vec_perm (vector long, vector long, vector unsigned char); +vector unsigned long vec_perm (vector unsigned long, vector unsigned long, + vector unsigned char); vector double vec_rint (vector double); vector double vec_recip (vector double, vector double); vector double vec_rsqrt (vector double); @@ -14825,15 +14883,33 @@ vector double vec_rsqrte (vector double); vector double vec_sel (vector double, vector double, vector bool long); vector double vec_sel (vector double, vector double, vector unsigned long); -vector double vec_sub (vector double, vector double); +vector long vec_sel (vector long, vector long, vector long); +vector long vec_sel (vector long, vector long, vector unsigned long); +vector long vec_sel (vector long, vector long, vector bool long); +vector unsigned long vec_sel (vector unsigned long, vector unsigned long, + vector long); +vector unsigned long vec_sel (vector unsigned long, vector unsigned long, + vector unsigned long); +vector unsigned long vec_sel (vector unsigned long, vector unsigned long, + vector bool long); +vector double vec_splats (double); +vector signed long vec_splats (signed long); +vector unsigned long vec_splats (unsigned long); vector float vec_sqrt (vector float); vector double vec_sqrt (vector double); void vec_st (vector double, int, vector double *); void vec_st (vector double, int, double *); +vector double vec_sub (vector double, vector double); vector double vec_trunc (vector double); vector double vec_xor (vector double, vector double); vector double vec_xor (vector double, vector bool long); vector double vec_xor (vector bool long, vector double); +vector long vec_xor (vector long, vector long); +vector long vec_xor (vector long, vector bool long); +vector long vec_xor (vector bool long, vector long); +vector unsigned long vec_xor (vector unsigned long, vector unsigned long); +vector unsigned long vec_xor (vector unsigned long, vector bool long); +vector unsigned long vec_xor (vector bool long, vector unsigned long); int vec_all_eq (vector double, vector double); int vec_all_ge (vector double, vector double); int vec_all_gt (vector double, vector double); @@ -14962,17 +15038,30 @@ vector unsigned long long); int vec_all_eq (vector long long, vector long long); +int vec_all_eq (vector unsigned long long, vector unsigned long long); int vec_all_ge (vector long long, vector long long); +int vec_all_ge (vector unsigned long long, vector unsigned long long); int vec_all_gt (vector long long, vector long long); +int vec_all_gt (vector unsigned long long, vector unsigned long long); int vec_all_le (vector long long, vector long long); +int vec_all_le (vector unsigned long long, vector unsigned long long); int vec_all_lt (vector long long, vector long long); +int vec_all_lt (vector unsigned long long, vector unsigned long long); int vec_all_ne (vector long long, vector long long); +int vec_all_ne (vector unsigned long long, vector unsigned long long); + int vec_any_eq (vector long long, vector long long); +int vec_any_eq (vector unsigned long long, vector unsigned long long); int vec_any_ge (vector long long, vector long long); +int vec_any_ge (vector unsigned long long, vector unsigned long long); int vec_any_gt (vector long long, vector long long); +int vec_any_gt (vector unsigned long long, vector unsigned long long); int vec_any_le (vector long long, vector long long); +int vec_any_le (vector unsigned long long, vector unsigned long long); int vec_any_lt (vector long long, vector long long); +int vec_any_lt (vector unsigned long long, vector unsigned long long); int vec_any_ne (vector long long, vector long long); +int vec_any_ne (vector unsigned long long, vector unsigned long long); vector long long vec_eqv (vector long long, vector long long); vector long long vec_eqv (vector bool long long, vector long long); @@ -15010,6 +15099,14 @@ vector unsigned long long vec_max (vector unsigned long long, vector unsigned long long); +vector signed int vec_mergee (vector signed int, vector signed int); +vector unsigned int vec_mergee (vector unsigned int, vector unsigned int); +vector bool int vec_mergee (vector bool int, vector bool int); + +vector signed int vec_mergeo (vector signed int, vector signed int); +vector unsigned int vec_mergeo (vector unsigned int, vector unsigned int); +vector bool int vec_mergeo (vector bool int, vector bool int); + vector long long vec_min (vector long long, vector long long); vector unsigned long long vec_min (vector unsigned long long, vector unsigned long long); @@ -15088,6 +15185,8 @@ vector unsigned long long); vector unsigned int vec_packsu (vector long long, vector long long); +vector unsigned int vec_packsu (vector unsigned long long, + vector unsigned long long); vector long long vec_rl (vector long long, vector unsigned long long); @@ -15129,6 +15228,15 @@ vector long long vec_vbpermq (vector signed char, vector signed char); vector long long vec_vbpermq (vector unsigned char, vector unsigned char); +vector long long vec_cntlz (vector long long); +vector unsigned long long vec_cntlz (vector unsigned long long); +vector int vec_cntlz (vector int); +vector unsigned int vec_cntlz (vector int); +vector short vec_cntlz (vector short); +vector unsigned short vec_cntlz (vector unsigned short); +vector signed char vec_cntlz (vector signed char); +vector unsigned char vec_cntlz (vector unsigned char); + vector long long vec_vclz (vector long long); vector unsigned long long vec_vclz (vector unsigned long long); vector int vec_vclz (vector int); Index: gcc/doc/tm.texi =================================================================== --- gcc/doc/tm.texi (.../tags/gcc_4_9_2_release) (wersja 218777) +++ gcc/doc/tm.texi (.../branches/gcc-4_9-branch) (wersja 218777) @@ -4441,10 +4441,6 @@ of spill registers and print a fatal error message. @end deftypefn -@deftypevr {Target Hook} {unsigned int} TARGET_FLAGS_REGNUM -If the target has a dedicated flags register, and it needs to use the post-reload comparison elimination pass, then this value should be set appropriately. -@end deftypevr - @node Scalar Return @subsection How Scalar Function Values Are Returned @cindex return values in registers @@ -6047,10 +6043,11 @@ @smallexample #define SELECT_CC_MODE(OP,X,Y) \ - (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT \ - ? ((OP == EQ || OP == NE) ? CCFPmode : CCFPEmode) \ - : ((GET_CODE (X) == PLUS || GET_CODE (X) == MINUS \ - || GET_CODE (X) == NEG) \ + (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT \ + ? ((OP == LT || OP == LE || OP == GT || OP == GE) \ + ? CCFPEmode : CCFPmode) \ + : ((GET_CODE (X) == PLUS || GET_CODE (X) == MINUS \ + || GET_CODE (X) == NEG || GET_CODE (x) == ASHIFT) \ ? CC_NOOVmode : CCmode)) @end smallexample @@ -6093,10 +6090,11 @@ You need not define this macro if it would always returns zero or if the floating-point format is anything other than @code{IEEE_FLOAT_FORMAT}. For example, here is the definition used on the SPARC, where floating-point -inequality comparisons are always given @code{CCFPEmode}: +inequality comparisons are given either @code{CCFPEmode} or @code{CCFPmode}: @smallexample -#define REVERSIBLE_CC_MODE(MODE) ((MODE) != CCFPEmode) +#define REVERSIBLE_CC_MODE(MODE) \ + ((MODE) != CCFPEmode && (MODE) != CCFPmode) @end smallexample @end defmac @@ -6106,7 +6104,7 @@ @code{REVERSIBLE_CC_MODE (@var{mode})} is nonzero. Define this macro in case machine has some non-standard way how to reverse certain conditionals. For instance in case all floating point conditions are non-trapping, compiler may -freely convert unordered compares to ordered one. Then definition may look +freely convert unordered compares to ordered ones. Then definition may look like: @smallexample @@ -6144,6 +6142,10 @@ returns @code{VOIDmode}. @end deftypefn +@deftypevr {Target Hook} {unsigned int} TARGET_FLAGS_REGNUM +If the target has a dedicated flags register, and it needs to use the post-reload comparison elimination pass, then this value should be set appropriately. +@end deftypevr + @node Costs @section Describing Relative Costs of Operations @cindex costs of instructions Index: gcc/doc/tm.texi.in =================================================================== --- gcc/doc/tm.texi.in (.../tags/gcc_4_9_2_release) (wersja 218777) +++ gcc/doc/tm.texi.in (.../branches/gcc-4_9-branch) (wersja 218777) @@ -3714,8 +3714,6 @@ @hook TARGET_SMALL_REGISTER_CLASSES_FOR_MODE_P -@hook TARGET_FLAGS_REGNUM - @node Scalar Return @subsection How Scalar Function Values Are Returned @cindex return values in registers @@ -4631,10 +4629,11 @@ @smallexample #define SELECT_CC_MODE(OP,X,Y) \ - (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT \ - ? ((OP == EQ || OP == NE) ? CCFPmode : CCFPEmode) \ - : ((GET_CODE (X) == PLUS || GET_CODE (X) == MINUS \ - || GET_CODE (X) == NEG) \ + (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT \ + ? ((OP == LT || OP == LE || OP == GT || OP == GE) \ + ? CCFPEmode : CCFPmode) \ + : ((GET_CODE (X) == PLUS || GET_CODE (X) == MINUS \ + || GET_CODE (X) == NEG || GET_CODE (x) == ASHIFT) \ ? CC_NOOVmode : CCmode)) @end smallexample @@ -4657,10 +4656,11 @@ You need not define this macro if it would always returns zero or if the floating-point format is anything other than @code{IEEE_FLOAT_FORMAT}. For example, here is the definition used on the SPARC, where floating-point -inequality comparisons are always given @code{CCFPEmode}: +inequality comparisons are given either @code{CCFPEmode} or @code{CCFPmode}: @smallexample -#define REVERSIBLE_CC_MODE(MODE) ((MODE) != CCFPEmode) +#define REVERSIBLE_CC_MODE(MODE) \ + ((MODE) != CCFPEmode && (MODE) != CCFPmode) @end smallexample @end defmac @@ -4670,7 +4670,7 @@ @code{REVERSIBLE_CC_MODE (@var{mode})} is nonzero. Define this macro in case machine has some non-standard way how to reverse certain conditionals. For instance in case all floating point conditions are non-trapping, compiler may -freely convert unordered compares to ordered one. Then definition may look +freely convert unordered compares to ordered ones. Then definition may look like: @smallexample @@ -4684,6 +4684,8 @@ @hook TARGET_CC_MODES_COMPATIBLE +@hook TARGET_FLAGS_REGNUM + @node Costs @section Describing Relative Costs of Operations @cindex costs of instructions Index: gcc/doc/invoke.texi =================================================================== --- gcc/doc/invoke.texi (.../tags/gcc_4_9_2_release) (wersja 218777) +++ gcc/doc/invoke.texi (.../branches/gcc-4_9-branch) (wersja 218777) @@ -21099,8 +21099,8 @@ Set the instruction set, register set, and instruction scheduling parameters for machine type @var{cpu_type}. Supported values for @var{cpu_type} are @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{hypersparc}, -@samp{leon}, @samp{leon3}, @samp{sparclite}, @samp{f930}, @samp{f934}, -@samp{sparclite86x}, @samp{sparclet}, @samp{tsc701}, @samp{v9}, +@samp{leon}, @samp{leon3}, @samp{leon3v7}, @samp{sparclite}, @samp{f930}, +@samp{f934}, @samp{sparclite86x}, @samp{sparclet}, @samp{tsc701}, @samp{v9}, @samp{ultrasparc}, @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2}, @samp{niagara3} and @samp{niagara4}. @@ -21118,7 +21118,7 @@ @table @asis @item v7 -cypress +cypress, leon3v7 @item v8 supersparc, hypersparc, leon, leon3 @@ -21183,11 +21183,11 @@ The same values for @option{-mcpu=@var{cpu_type}} can be used for @option{-mtune=@var{cpu_type}}, but the only useful values are those that select a particular CPU implementation. Those are @samp{cypress}, -@samp{supersparc}, @samp{hypersparc}, @samp{leon}, @samp{leon3}, @samp{f930}, -@samp{f934}, @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc}, -@samp{ultrasparc3}, @samp{niagara}, @samp{niagara2}, @samp{niagara3} and -@samp{niagara4}. With native Solaris and GNU/Linux toolchains, @samp{native} -can also be used. +@samp{supersparc}, @samp{hypersparc}, @samp{leon}, @samp{leon3}, +@samp{leon3v7}, @samp{f930}, @samp{f934}, @samp{sparclite86x}, @samp{tsc701}, +@samp{ultrasparc}, @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2}, +@samp{niagara3} and @samp{niagara4}. With native Solaris and GNU/Linux +toolchains, @samp{native} can also be used. @item -mv8plus @itemx -mno-v8plus Index: gcc/doc/md.texi =================================================================== --- gcc/doc/md.texi (.../tags/gcc_4_9_2_release) (wersja 218777) +++ gcc/doc/md.texi (.../branches/gcc-4_9-branch) (wersja 218777) @@ -8410,9 +8410,9 @@ @cindex @code{pc} and attributes @item (pc) -This refers to the address of the @emph{current} insn. It might have -been more consistent with other usage to make this the address of the -@emph{next} insn but this would be confusing because the length of the +For non-branch instructions and backward branch instructions, this refers +to the address of the current insn. But for forward branch instructions, +this refers to the address of the next insn, because the length of the current insn is to be computed. @end table Index: gcc/tree-ssa-tail-merge.c =================================================================== --- gcc/tree-ssa-tail-merge.c (.../tags/gcc_4_9_2_release) (wersja 218777) +++ gcc/tree-ssa-tail-merge.c (.../branches/gcc-4_9-branch) (wersja 218777) @@ -314,7 +314,8 @@ if (gimple_vdef (stmt) != NULL_TREE || gimple_has_side_effects (stmt) - || gimple_could_trap_p_1 (stmt, false, false)) + || gimple_could_trap_p_1 (stmt, false, false) + || gimple_vuse (stmt) != NULL_TREE) return false; def_p = SINGLE_SSA_DEF_OPERAND (stmt, SSA_OP_DEF); @@ -1164,7 +1165,8 @@ gimple_assign_rhs1 (s2))); else if (TREE_CODE (lhs1) == SSA_NAME && TREE_CODE (lhs2) == SSA_NAME) - return vn_valueize (lhs1) == vn_valueize (lhs2); + return operand_equal_p (gimple_assign_rhs1 (s1), + gimple_assign_rhs1 (s2), 0); return false; case GIMPLE_COND: Index: gcc/c-family/c-ubsan.c =================================================================== --- gcc/c-family/c-ubsan.c (.../tags/gcc_4_9_2_release) (wersja 218777) +++ gcc/c-family/c-ubsan.c (.../branches/gcc-4_9-branch) (wersja 218777) @@ -98,19 +98,19 @@ tree op1_utype = unsigned_type_for (type1); HOST_WIDE_INT op0_prec = TYPE_PRECISION (type0); tree uprecm1 = build_int_cst (op1_utype, op0_prec - 1); - tree precm1 = build_int_cst (type1, op0_prec - 1); t = fold_convert_loc (loc, op1_utype, op1); t = fold_build2 (GT_EXPR, boolean_type_node, t, uprecm1); /* For signed x << y, in C99/C11, the following: - (unsigned) x >> (precm1 - y) + (unsigned) x >> (uprecm1 - y) if non-zero, is undefined. */ if (code == LSHIFT_EXPR && !TYPE_UNSIGNED (type0) && flag_isoc99) { - tree x = fold_build2 (MINUS_EXPR, integer_type_node, precm1, op1); + tree x = fold_build2 (MINUS_EXPR, unsigned_type_node, uprecm1, + fold_convert (op1_utype, op1)); tt = fold_convert_loc (loc, unsigned_type_for (type0), op0); tt = fold_build2 (RSHIFT_EXPR, TREE_TYPE (tt), tt, x); tt = fold_build2 (NE_EXPR, boolean_type_node, tt, @@ -118,13 +118,14 @@ } /* For signed x << y, in C++11/C++14, the following: - x < 0 || ((unsigned) x >> (precm1 - y)) + x < 0 || ((unsigned) x >> (uprecm1 - y)) if > 1, is undefined. */ if (code == LSHIFT_EXPR && !TYPE_UNSIGNED (TREE_TYPE (op0)) && (cxx_dialect == cxx11 || cxx_dialect == cxx1y)) { - tree x = fold_build2 (MINUS_EXPR, integer_type_node, precm1, op1); + tree x = fold_build2 (MINUS_EXPR, unsigned_type_node, uprecm1, + fold_convert (op1_utype, op1)); tt = fold_convert_loc (loc, unsigned_type_for (type0), op0); tt = fold_build2 (RSHIFT_EXPR, TREE_TYPE (tt), tt, x); tt = fold_build2 (GT_EXPR, boolean_type_node, tt, Index: gcc/DATESTAMP =================================================================== --- gcc/DATESTAMP (.../tags/gcc_4_9_2_release) (wersja 218777) +++ gcc/DATESTAMP (.../branches/gcc-4_9-branch) (wersja 218777) @@ -1 +1 @@ -20141030 +20141216 Index: gcc/tree-ssa-strlen.c =================================================================== --- gcc/tree-ssa-strlen.c (.../tags/gcc_4_9_2_release) (wersja 218777) +++ gcc/tree-ssa-strlen.c (.../branches/gcc-4_9-branch) (wersja 218777) @@ -1856,7 +1856,7 @@ break; } } - else if (is_gimple_assign (stmt)) + else if (is_gimple_assign (stmt) && !gimple_clobber_p (stmt)) { tree lhs = gimple_assign_lhs (stmt); Index: gcc/tree.c =================================================================== --- gcc/tree.c (.../tags/gcc_4_9_2_release) (wersja 218777) +++ gcc/tree.c (.../branches/gcc-4_9-branch) (wersja 218777) @@ -1120,7 +1120,7 @@ const_tree const t = (const_tree) x; return (TREE_INT_CST_HIGH (t) ^ TREE_INT_CST_LOW (t) - ^ htab_hash_pointer (TREE_TYPE (t))); + ^ TYPE_UID (TREE_TYPE (t))); } /* Return nonzero if the value represented by *X (an INTEGER_CST tree node) Index: gcc/configure =================================================================== --- gcc/configure (.../tags/gcc_4_9_2_release) (wersja 218777) +++ gcc/configure (.../branches/gcc-4_9-branch) (wersja 218777) @@ -27851,8 +27851,48 @@ $as_echo "#define HAVE_cloog 1" >>confdefs.h + + # Check whether isl_schedule_constraints_compute_schedule is available; + # it's new in ISL-0.13. + saved_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $ISLINC" + saved_LIBS="$LIBS" + LIBS="$LIBS $CLOOGLIBS $ISLLIBS $GMPLIBS" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking Checking for isl_schedule_constraints_compute_schedule" >&5 +$as_echo_n "checking Checking for isl_schedule_constraints_compute_schedule... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +isl_schedule_constraints_compute_schedule (NULL); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_has_isl_schedule_constraints_compute_schedule=yes +else + ac_has_isl_schedule_constraints_compute_schedule=no fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_has_isl_schedule_constraints_compute_schedule" >&5 +$as_echo "$ac_has_isl_schedule_constraints_compute_schedule" >&6; } + LIBS="$saved_LIBS" + CFLAGS="$saved_CFLAGS" + + if test x"$ac_has_isl_schedule_constraints_compute_schedule" = x"yes"; then + +$as_echo "#define HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE 1" >>confdefs.h + + fi +fi + + # Check for plugin support # Check whether --enable-plugin was given. if test "${enable_plugin+set}" = set; then : Index: gcc/fold-const.c =================================================================== --- gcc/fold-const.c (.../tags/gcc_4_9_2_release) (wersja 218777) +++ gcc/fold-const.c (.../branches/gcc-4_9-branch) (wersja 218777) @@ -9024,7 +9024,8 @@ /* If the constant operation overflowed this can be simplified as a comparison against INT_MAX/INT_MIN. */ if (TREE_CODE (lhs) == INTEGER_CST - && TREE_OVERFLOW (lhs)) + && TREE_OVERFLOW (lhs) + && !TYPE_OVERFLOW_WRAPS (TREE_TYPE (arg0))) { int const1_sgn = tree_int_cst_sgn (const1); enum tree_code code2 = code; @@ -13295,7 +13296,7 @@ tree itype = TREE_TYPE (arg00); if (TREE_INT_CST_HIGH (arg01) == 0 && TREE_INT_CST_LOW (arg01) - == (unsigned HOST_WIDE_INT) (TYPE_PRECISION (itype) - 1)) + == (unsigned HOST_WIDE_INT) (element_precision (itype) - 1)) { if (TYPE_UNSIGNED (itype)) { Index: gcc/omp-low.c =================================================================== --- gcc/omp-low.c (.../tags/gcc_4_9_2_release) (wersja 218777) +++ gcc/omp-low.c (.../branches/gcc-4_9-branch) (wersja 218777) @@ -11181,24 +11181,24 @@ if (orig_rettype == void_type_node) return NULL_TREE; TREE_TYPE (fndecl) = build_distinct_type_copy (TREE_TYPE (fndecl)); - if (INTEGRAL_TYPE_P (TREE_TYPE (TREE_TYPE (fndecl))) - || POINTER_TYPE_P (TREE_TYPE (TREE_TYPE (fndecl)))) + t = TREE_TYPE (TREE_TYPE (fndecl)); + if (INTEGRAL_TYPE_P (t) || POINTER_TYPE_P (t)) veclen = node->simdclone->vecsize_int; else veclen = node->simdclone->vecsize_float; - veclen /= GET_MODE_BITSIZE (TYPE_MODE (TREE_TYPE (TREE_TYPE (fndecl)))); + veclen /= GET_MODE_BITSIZE (TYPE_MODE (t)); if (veclen > node->simdclone->simdlen) veclen = node->simdclone->simdlen; + if (POINTER_TYPE_P (t)) + t = pointer_sized_int_node; if (veclen == node->simdclone->simdlen) - TREE_TYPE (TREE_TYPE (fndecl)) - = build_vector_type (TREE_TYPE (TREE_TYPE (fndecl)), - node->simdclone->simdlen); + t = build_vector_type (t, node->simdclone->simdlen); else { - t = build_vector_type (TREE_TYPE (TREE_TYPE (fndecl)), veclen); + t = build_vector_type (t, veclen); t = build_array_type_nelts (t, node->simdclone->simdlen / veclen); - TREE_TYPE (TREE_TYPE (fndecl)) = t; } + TREE_TYPE (TREE_TYPE (fndecl)) = t; if (!node->definition) return NULL_TREE; @@ -11287,7 +11287,10 @@ if (veclen > node->simdclone->simdlen) veclen = node->simdclone->simdlen; adj.arg_prefix = "simd"; - adj.type = build_vector_type (parm_type, veclen); + if (POINTER_TYPE_P (parm_type)) + adj.type = build_vector_type (pointer_sized_int_node, veclen); + else + adj.type = build_vector_type (parm_type, veclen); node->simdclone->args[i].vector_type = adj.type; for (j = veclen; j < node->simdclone->simdlen; j += veclen) { @@ -11328,7 +11331,10 @@ veclen /= GET_MODE_BITSIZE (TYPE_MODE (base_type)); if (veclen > node->simdclone->simdlen) veclen = node->simdclone->simdlen; - adj.type = build_vector_type (base_type, veclen); + if (POINTER_TYPE_P (base_type)) + adj.type = build_vector_type (pointer_sized_int_node, veclen); + else + adj.type = build_vector_type (base_type, veclen); adjustments.safe_push (adj); for (j = veclen; j < node->simdclone->simdlen; j += veclen) Index: gcc/DEV-PHASE =================================================================== --- gcc/DEV-PHASE (.../tags/gcc_4_9_2_release) (wersja 218777) +++ gcc/DEV-PHASE (.../branches/gcc-4_9-branch) (wersja 218777) @@ -0,0 +1 @@ +prerelease Index: gcc/ChangeLog =================================================================== --- gcc/ChangeLog (.../tags/gcc_4_9_2_release) (wersja 218777) +++ gcc/ChangeLog (.../branches/gcc-4_9-branch) (wersja 218777) @@ -1,3 +1,600 @@ +2014-12-15 Jakub Jelinek + + PR sanitizer/64265 + * tsan.c (instrument_func_entry): Insert __tsan_func_entry + call on edge from entry block to single succ instead + of after labels of single succ of entry block. + +2014-12-14 H.J. Lu + + Backported from mainline + 2014-12-14 H.J. Lu + + PR rtl-optimization/64037 + * combine.c (setup_incoming_promotions): Pass the argument + before any promotions happen to promote_function_mode. + +2014-12-14 H.J. Lu + + Backported from mainline + 2014-12-06 H.J. Lu + + PR target/64200 + * config/i386/i386.c (decide_alg): Don't assert "alg != libcall" + for TARGET_INLINE_STRINGOPS_DYNAMICALLY. + +2014-12-13 Jakub Jelinek + + Backported from mainline + 2014-12-12 Jakub Jelinek + + PR tree-optimization/64269 + * tree-ssa-forwprop.c (simplify_builtin_call): Bail out if + len2 or diff are too large. + +2014-12-11 Eric Botcazou + + * doc/md.texi (Insn Lengths): Fix description of (pc). + +2014-12-11 Renlin Li + + Backport from mainline + 2014-12-11 Renlin Li + + * config/aarch64/aarch64.c (aarch64_parse_cpu): Don't define + selected_tune. + (aarch64_override_options): Use selected_cpu's tuning. + +2014-12-10 Bill Schmidt + + Backport from mainline + 2014-09-02 Bill Schmidt + + * config/rs6000/rs6000-builtin.def (XVCVSXDDP_SCALE): New + built-in definition. + (XVCVUXDDP_SCALE): Likewise. + (XVCVDPSXDS_SCALE): Likewise. + (XVCVDPUXDS_SCALE): Likewise. + * config/rs6000/rs6000-c.c (altivec_overloaded_builtins): Add + entries for VSX_BUILTIN_XVCVSXDDP_SCALE, + VSX_BUILTIN_XVCVUXDDP_SCALE, VSX_BUILTIN_XVCVDPSXDS_SCALE, and + VSX_BUILTIN_XVCVDPUXDS_SCALE. + * config/rs6000/rs6000-protos.h (rs6000_scale_v2df): New + prototype. + * config/rs6000/rs6000.c (real.h): New include. + (rs6000_scale_v2df): New function. + * config/rs6000/vsx.md (UNSPEC_VSX_XVCVSXDDP): New unspec. + (UNSPEC_VSX_XVCVUXDDP): Likewise. + (UNSPEC_VSX_XVCVDPSXDS): Likewise. + (UNSPEC_VSX_XVCVDPUXDS): Likewise. + (vsx_xvcvsxddp_scale): New define_expand. + (vsx_xvcvsxddp): New define_insn. + (vsx_xvcvuxddp_scale): New define_expand. + (vsx_xvcvuxddp): New define_insn. + (vsx_xvcvdpsxds_scale): New define_expand. + (vsx_xvcvdpsxds): New define_insn. + (vsx_xvcvdpuxds_scale): New define_expand. + (vsx_xvcvdpuxds): New define_insn. + * doc/extend.texi (vec_ctf): Add new prototypes. + (vec_cts): Likewise. + (vec_ctu): Likewise. + (vec_splat): Likewise. + (vec_div): Likewise. + (vec_mul): Likewise. + + Backport from mainline + 2014-08-28 Bill Schmidt + + * config/rs6000/altivec.h (vec_xl): New #define. + (vec_xst): Likewise. + * config/rs6000/rs6000-builtin.def (XXSPLTD_V2DF): New built-in. + (XXSPLTD_V2DI): Likewise. + (DIV_V2DI): Likewise. + (UDIV_V2DI): Likewise. + (MUL_V2DI): Likewise. + * config/rs6000/rs6000-c.c (altivec_overloaded_builtins): Add + entries for VSX_BUILTIN_XVRDPI, VSX_BUILTIN_DIV_V2DI, + VSX_BUILTIN_UDIV_V2DI, VSX_BUILTIN_MUL_V2DI, + VSX_BUILTIN_XXSPLTD_V2DF, and VSX_BUILTIN_XXSPLTD_V2DI). + * config/rs6000/vsx.md (UNSPEC_VSX_XXSPLTD): New unspec. + (UNSPEC_VSX_DIVSD): Likewise. + (UNSPEC_VSX_DIVUD): Likewise. + (UNSPEC_VSX_MULSD): Likewise. + (vsx_mul_v2di): New insn-and-split. + (vsx_div_v2di): Likewise. + (vsx_udiv_v2di): Likewise. + (vsx_xxspltd_): New insn. + + Backport from mainline + 2014-08-20 Bill Schmidt + + * config/rs6000/altivec.h (vec_cpsgn): New #define. + (vec_mergee): Likewise. + (vec_mergeo): Likewise. + (vec_cntlz): Likewise. + * config/rs600/rs6000-c.c (altivec_overloaded_builtins): Add new + entries for VEC_AND, VEC_ANDC, VEC_MERGEH, VEC_MERGEL, VEC_NOR, + VEC_OR, VEC_PACKSU, VEC_XOR, VEC_PERM, VEC_SEL, VEC_VCMPGT_P, + VMRGEW, and VMRGOW. + * doc/extend.texi: Document various forms of vec_cpsgn, + vec_splats, vec_and, vec_andc, vec_mergeh, vec_mergel, vec_nor, + vec_or, vec_perm, vec_sel, vec_sub, vec_xor, vec_all_eq, + vec_all_ge, vec_all_gt, vec_all_le, vec_all_lt, vec_all_ne, + vec_any_eq, vec_any_ge, vec_any_gt, vec_any_le, vec_any_lt, + vec_any_ne, vec_mergee, vec_mergeo, vec_packsu, and vec_cntlz. + + Backport from mainline + 2014-07-20 Bill Schmidt + + * config/rs6000/altivec.md (unspec enum): Fix typo in UNSPEC_VSLDOI. + (altivec_vsldoi_): Likewise. + + +2014-12-10 Jakub Jelinek + + PR tree-optimization/62021 + * omp-low.c (simd_clone_adjust_return_type): Use + vector of pointer_sized_int_node types instead vector of pointer + types. + (simd_clone_adjust_argument_types): Likewise. + +2014-12-10 Bill Schmidt + + Backport from mainline: + 2014-12-09 Bill Schmidt + + PR middle-end/64225 + * tree-ssa-reassoc.c (acceptable_pow_call): Disable transformation + for BUILT_IN_POW when flag_errno_math is present. + +2014-12-10 Marek Polacek + + Backport from mainline + 2014-12-10 Marek Polacek + + PR tree-optimization/61686 + * tree-ssa-reassoc.c (range_entry_cmp): Use q->high instead of + p->high. + +2014-12-09 David Edelsohn + + Backport from mainline + 2014-12-05 David Edelsohn + + * config/rs6000/xcoff.h (ASM_OUTPUT_ALIGNED_LOCAL): Append + alignment to section name. Increase default alignment to + word. + +2014-12-09 Uros Bizjak + + PR bootstrap/64213 + Revert: + 2014-11-28 H.J. Lu + + PR rtl-optimization/64037 + * combine.c (setup_incoming_promotions): Pass the argument + before any promotions happen to promote_function_mode. + +2014-12-09 Richard Biener + + PR tree-optimization/64191 + * tree-vect-stmts.c (vect_stmt_relevant_p): Clobbers are + not relevant (nor are their uses). + +2014-12-07 Oleg Endo + + Backport from mainline + 2014-12-07 Oleg Endo + + PR target/50751 + * config/sh/sh.md (extendqihi2): Allow only for TARGET_SH1. + +2014-12-05 H.J. Lu + + Backport from mainline + 2014-12-02 H.J. Lu + + PR target/64108 + * config/i386/i386.c (decide_alg): Stop only if there aren't + any usable algorithms. + +2014-12-05 H.J. Lu + + Backport from mainline + 2014-11-28 H.J. Lu + + PR rtl-optimization/64037 + * combine.c (setup_incoming_promotions): Pass the argument + before any promotions happen to promote_function_mode. + +2014-12-04 Tobias Burnus + + * configure.ac + (ac_has_isl_schedule_constraints_compute_schedule): + New check. + * graphite-clast-to-gimple.c: For ISL 0.14, include deprecate headers. + * graphite-interchange.c: Ditto. + * graphite-poly.c: Ditto. + * graphite-sese-to-poly.c: Ditto. + * graphite-optimize-isl.c (getScheduleForBandList): Ditto. + Conditionally use ISL 0.13+ functions. + * config.in: Regenerate. + * configure: Regenerate. + +2014-12-04 Jakub Jelinek + + PR c++/56493 + * convert.c (convert_to_real, convert_to_expr, convert_to_complex): + Handle COMPOUND_EXPR. + +2014-12-03 Jakub Jelinek + + PR c/59708 + * expmed.c (expand_widening_mult): Return const0_rtx if + coeff is 0. + +2014-12-03 Martin Jambor + + PR ipa/64153 + * ipa-inline-analysis.c (evaluate_conditions_for_known_args): Check + type sizes before view_converting. + +2014-12-03 Shanyao Chen + + Backport from mainline + 2014-11-20 Ramana Radhakrishnan + + PR target/59593 + * config/arm/arm.md (*movhi_insn): Use right formatting + for immediate. + + 2014-11-19 Felix Yang + Shanyao Chen + + PR target/59593 + * config/arm/arm.md (define_attr "arch"): Add v6t2. + (define_attr "arch_enabled"): Add test for the above. + (*movhi_insn_arch4): Add new alternative. + +2014-12-03 Renlin Li + + Backported from mainline + 2014-12-03 Renlin Li + + PR middle-end/63762 + PR target/63661 + * ira.c (ira): Update preferred class. + +2014-12-02 Uros Bizjak + + PR target/64113 + * config/alpha/alpha.md (call_value_osf_tlsgd): Do not split insn + using post-reload splitter. Use peephole2 pass instead. + (call_value_osf_tlsldm): Ditto. + (TLS_CALL): New int iterator. + (tls): New int attribute. + (call_value_osf_): Merge insn pattern from call_value_osf_tlsgd + and call_value_tlsldm using TLS_CALL int iterator. + +2014-12-02 Ulrich Weigand + + PR target/64115 + * config/rs6000/rs6000.c (rs6000_delegitimize_address): Remove + invalid UNSPEC_TOCREL sanity check under ENABLE_CHECKING. + +2014-12-01 Richard Biener + + PR middle-end/64111 + * tree.c (int_cst_hash_hash): Use TYPE_UID instead of + htab_hash_pointer to not break PCH. + +2014-12-01 Martin Jambor + + PR ipa/63551 + * ipa-inline-analysis.c (evaluate_conditions_for_known_args): Convert + value of the argument to the type of the value in the condition. + +2014-11-28 Jakub Jelinek + + Backported from mainline + 2014-11-27 Jakub Jelinek + + PR middle-end/64067 + * expr.c (expand_expr_addr_expr_1) : + Handle it by returning address of COMPOUND_LITERAL_EXPR_DECL + not only if modifier is EXPAND_INITIALIZER, but whenever + COMPOUND_LITERAL_EXPR_DECL is non-NULL and TREE_STATIC. + + 2014-11-19 Jakub Jelinek + + PR tree-optimization/63915 + * tree-vect-stmts.c (vectorizable_simd_clone_call): Pass + true instead of false as last argument to gsi_replace. + + PR sanitizer/63913 + * ubsan.c: Include tree-eh.h. + (instrument_bool_enum_load): Handle loads that can throw. + + 2014-10-31 Jakub Jelinek + + PR rtl-optimization/63659 + * ree.c (update_reg_equal_equiv_notes): New function. + (combine_set_extension, transform_ifelse): Use it. + +2014-11-28 Ramana Radhakrishnan + + Backport from mainline. + 2014-11-28 Ramana Radhakrishnan + * config/arm/t-aprofile (MULTILIB_MATCHES): New entry for + -march=armv8-a+crc. + +2014-11-26 Richard Biener + + PR middle-end/63738 + * tree-data-ref.c (split_constant_offset_1): Do not follow + SSA edges for SSA names with SSA_NAME_OCCURS_IN_ABNORMAL_PHI. + +2014-11-26 Richard Biener + + Backport from mainline + 2014-11-26 Richard Biener + + PR tree-optimization/62238 + * tree-predcom.c (ref_at_iteration): Unshare the expression + before gimplifying it. + + 2014-11-25 Richard Biener + + PR tree-optimization/61927 + * tree-vect-loop.c (vect_analyze_loop_2): Revert ordering + of group and pattern analysis to the one in GCC 4.8. + + 2014-11-07 Richard Biener + + PR tree-optimization/63605 + * fold-const.c (fold_binary_loc): Properly use element_precision + for types that may not be scalar. + + 2014-10-28 Richard Biener + + PR middle-end/63665 + * fold-const.c (fold_comparison): Properly guard simplifying + against INT_MAX/INT_MIN with !TYPE_OVERFLOW_WRAPS. + +2014-11-25 Rohit + + PR bootstrap/63703 + * config/rs6000/darwin.h (REGISTER_NAMES): Update based on 32 newly + added GCC hard register numbers for SPE high registers. + +2014-11-23 Oleg Endo + + Backport from mainline + 2014-11-23 Oleg Endo + + PR target/53976 + * config/sh/sh_optimize_sett_clrt.cc + (sh_optimize_sett_clrt::find_last_ccreg_values): Return bool instead + of void. Abort at complex edges. + (sh_optimize_sett_clrt::execute): Do nothing if find_last_ccreg_values + returned false. + +2014-11-22 Oleg Endo + + Backport from mainline + 2014-11-22 Oleg Endo + + PR target/63783 + PR target/51244 + * config/sh/sh_treg_combine.cc (sh_treg_combine::make_not_reg_insn): + Do not emit bitwise not insn. Emit logical not insn sequence instead. + Adjust related comments throughout the file. + +2014-11-22 Oleg Endo + + Backport from mainline + 2014-11-20 Segher Boessenkool + + PR target/60111 + * config/sh/sh.c: Use signed char for signed field. + +2014-11-21 Bill Schmidt + + PR target/63673 + * config/rs6000/rs6000-c.c (altivec_overloaded_builtins): Allow + the base pointer of vec_vsx_ld and vec_vsx_st to take a pointer to + double. + +2014-11-21 Richard Biener + + PR tree-optimization/61750 + * tree-ssa-forwprop.c (simplify_vce): Verify type sizes + match for the resulting VIEW_CONVERT_EXPR. + +2014-11-19 Uros Bizjak + + PR target/63947 + * config/i386/i386.c (put_condition_code) : + Output "b" and "nb" suffix for FP mode. + +2014-11-19 Tom de Vries + + Backport from mainline + PR tree-optimization/62167 + * tree-ssa-tail-merge.c (stmt_local_def): Handle statements with vuse + conservatively. + (gimple_equal_p): Don't use vn_valueize to compare for lhs equality of + assigns. + +2014-11-16 Eric Botcazou + + * doc/tm.texi.in (TARGET_FLAGS_REGNUM): Move around. + * doc/tm.texi: Regenerate. + +2014-11-14 Felix Yang + + Backport from mainline + 2014-11-14 Felix Yang + Jiji Jiang + + * config/aarch64/aarch64-simd.md (*aarch64_simd_ld1r): Use + VALL mode iterator instead of VALLDI. + +2014-11-13 Teresa Johnson + + PR tree-optimization/63841 + * tree-ssa-strlen.c (strlen_optimize_stmt): Ignore clobbers. + +2014-11-13 Christophe Lyon + + Backport from mainline + 2014-11-02 Michael Collison + + * config/arm/arm.h (CLZ_DEFINED_VALUE_AT_ZERO) : Update + to support vector modes. + (CTZ_DEFINED_VALUE_AT_ZERO): Ditto. + +2014-11-13 Eric Botcazou + + * doc/tm.texi.in (SELECT_CC_MODE): Update example. + (REVERSIBLE_CC_MODE): Fix example. + (REVERSE_CONDITION): Fix typo. + * doc/tm.texi: Regenerate. + +2014-11-12 Jakub Jelinek + + PR ipa/63838 + * ipa-pure-const.c (propagate_nothrow): Walk w->indirect_calls + chain instead of node->indirect_calls. + +2014-11-11 Eric Botcazou + + PR target/61535 + * config/sparc/sparc.c (function_arg_vector_value): Deal with vectors + smaller than 8 bytes. + (sparc_function_arg_1): Tweak. + (sparc_function_value_1): Tweak. + +2014-11-08 Eric Botcazou + + * config/arm/arm.c (arm_set_return_address): Mark the store as frame + related, if any. + (thumb_set_return_address): Likewise. + +2014-11-07 Daniel Hellstrom + + * config.gcc (sparc-*-rtems*): Clean away unused t-elf. + * config/sparc/t-rtems: Add leon3v7 and muser-mode multilibs. + +2014-11-07 Marek Polacek + + Backported from mainline + 2014-10-23 Marek Polacek + + * c-ubsan.c (ubsan_instrument_shift): Perform the MINUS_EXPR + in unsigned type. + +2014-11-06 John David Anglin + + * config/pa/pa.md (trap): New insn. Add "trap" to attribute type. + Don't allow trap insn in in_branch_delay, in_nullified_branch_delay + or in_call_delay. + +2014-11-06 Daniel Hellstrom + + * config.gcc (sparc*-*-*): Accept mcpu=leon3v7 processor. + * doc/invoke.texi (SPARC options): Add mcpu=leon3v7 comment. + * config/sparc/leon.md (leon3_load, leon_store, leon_fp_*): Handle + leon3v7 as leon3. + * config/sparc/sparc-opts.h (enum processor_type): Add LEON3V7. + * config/sparc/sparc.c (sparc_option_override): Add leon3v7 support. + * config/sparc/sparc.h (TARGET_CPU_leon3v7): New define. + * config/sparc/sparc.md (cpu): Add leon3v7. + * config/sparc/sparc.opt (enum processor_type): Add leon3v7. + +2014-11-05 Uros Bizjak + + PR target/63538 + * config/i386/i386.c (in_large_data_p): Reject automatic variables. + (ix86_encode_section_info): Do not check for non-automatic varibles + when setting SYMBOL_FLAG_FAR_ADDR flag. + (x86_64_elf_select_section): Do not check ix86_cmodel here. + (x86_64_elf_unique_section): Ditto. + (x86_elf_aligned_common): Emit tab before .largecomm. + +2014-11-05 Uros Bizjak + + Backport from mainline: + 2014-10-20 Uros Bizjak + + * varasm.c (const_alias_set): Remove. + (init_varasm_once): Remove initialization of const_alias_set. + (build_constant_desc): Do not set alias set to const_alias_set. + + Backport from mainline: + 2014-10-14 Uros Bizjak + + PR rtl-optimization/63475 + * alias.c (true_dependence_1): Always use get_addr to extract + true address operands from x_addr and mem_addr. Use extracted + address operands to check for references with alignment ANDs. + Use extracted address operands with find_base_term and + base_alias_check. For noncanonicalized operands call canon_rtx with + extracted address operand. + (write_dependence_1): Ditto. + (may_alias_p): Ditto. Remove unused calls to canon_rtx. + + Backport from mainline: + 2014-10-10 Uros Bizjak + + PR rtl-optimization/63483 + * alias.c (true_dependence_1): Do not exit early for MEM_READONLY_P + references when alignment ANDs are involved. + (write_dependence_p): Ditto. + (may_alias_p): Ditto. + +2014-10-31 DJ Delorie + + * expmed.c (strict_volatile_bitfield_p): Fix off-by-one error. + +2014-10-31 Kyrylo Tkachov + + * config/aarch64/aarch64-elf-raw.h (CA53_ERR_835769_SPEC): Define. + (LINK_SPEC): Include CA53_ERR_835769_SPEC. + * config/aarch64/aarch64-linux.h (CA53_ERR_835769_SPEC): Define. + (LINK_SPEC): Include CA53_ERR_835769_SPEC. + +2014-10-31 Jakub Jelinek + + PR sanitizer/63697 + * tree-vrp.c (simplify_internal_call_using_ranges): For subcode == + MINUS_EXPR, check overflow on vr0.min - vr1.max and vr0.max - vr1.min + instead of vr0.min - vr1.min and vr0.max - vr1.max. + +2014-10-30 Georg-Johann Lay + + PR63633 + * config/avr/avr-protos.h (regmask): New inline function. + (avr_fix_inputs, avr_emit3_fix_outputs): New protos. + * config/avr/avr.c (avr_fix_operands, avr_move_fixed_operands) + (avr_fix_inputs, avr_emit3_fix_outputs): New functions. + * config/avr/avr-fixed.md (mulqq3_nomul, muluqq3_nomul) + (mul3, mul3, 3, 3) + (3, round3): Fix input operands. + * config/avr/avr-dimode.md (add3, sub3) + (3, 3, cbranch4) + (3, mulsidi3): Fix input operands. + * config/avr/avr.md (mulqi3_call, mulhi3_call, mulsi3, mulpsi3) + (mulusi3, mulssi3, mulohisi3, mulhisi3) + (usmulhisi3, mulhi3_highpart, mulsqipsi3) + (fmul, fmuls, fmulsu): Fix operands. Turn insn into expander as + needed. + +2014-10-30 Jakub Jelinek + + * BASE-VER: Set to 4.9.3. + * DEV-PHASE: Set to prerelease. + 2014-10-30 Release Manager * GCC 4.9.2 released. @@ -150,8 +747,8 @@ Backport from mainline 2014-06-24 Max Ostapenko - * asan.c (instrument_strlen_call): Do not instrument first byte in strlen - if already instrumented. + * asan.c (instrument_strlen_call): Do not instrument first byte in + strlen if already instrumented. 2014-10-16 Yury Gribov @@ -1504,7 +2101,7 @@ * omp-low.c (create_omp_child_function): Don't set DECL_NAMELESS on the FUNCTION_DECL. - * BASE-VER: Set to 4.9.1. + * BASE-VER: Set to 4.9.2. * DEV-PHASE: Set to prerelease. 2014-07-16 Release Manager Index: gcc/testsuite/gcc.target/powerpc/builtins-1.c =================================================================== --- gcc/testsuite/gcc.target/powerpc/builtins-1.c (.../tags/gcc_4_9_2_release) (wersja 0) +++ gcc/testsuite/gcc.target/powerpc/builtins-1.c (.../branches/gcc-4_9-branch) (wersja 218777) @@ -0,0 +1,166 @@ +/* { dg-do compile { target { powerpc64le-*-* } } } */ +/* { dg-options "-mcpu=power8 -O0" } */ + +/* Test that a number of newly added builtin overloads are accepted + by the compiler. */ + +#include + +vector double y = { 2.0, 4.0 }; +vector double z; + +int main () +{ + vector float fa = {1.0, 2.0, 3.0, -4.0}; + vector float fb = {-2.0, -3.0, -4.0, -5.0}; + vector float fc = vec_cpsgn (fa, fb); + + vector long long la = {5L, 14L}; + vector long long lb = {3L, 86L}; + vector long long lc = vec_and (la, lb); + vector bool long long ld = {0, -1}; + vector long long le = vec_and (la, ld); + vector long long lf = vec_and (ld, lb); + + vector unsigned long long ua = {5L, 14L}; + vector unsigned long long ub = {3L, 86L}; + vector unsigned long long uc = vec_and (ua, ub); + vector bool long long ud = {0, -1}; + vector unsigned long long ue = vec_and (ua, ud); + vector unsigned long long uf = vec_and (ud, ub); + + vector long long lg = vec_andc (la, lb); + vector long long lh = vec_andc (la, ld); + vector long long li = vec_andc (ld, lb); + + vector unsigned long long ug = vec_andc (ua, ub); + vector unsigned long long uh = vec_andc (ua, ud); + vector unsigned long long ui = vec_andc (ud, ub); + + vector double da = {1.0, -4.0}; + vector double db = {-2.0, 5.0}; + vector double dc = vec_cpsgn (da, db); + + vector long long lj = vec_mergeh (la, lb); + vector long long lk = vec_mergeh (la, ld); + vector long long ll = vec_mergeh (ld, la); + + vector unsigned long long uj = vec_mergeh (ua, ub); + vector unsigned long long uk = vec_mergeh (ua, ud); + vector unsigned long long ul = vec_mergeh (ud, ua); + + vector long long lm = vec_mergel (la, lb); + vector long long ln = vec_mergel (la, ld); + vector long long lo = vec_mergel (ld, la); + + vector unsigned long long um = vec_mergel (ua, ub); + vector unsigned long long un = vec_mergel (ua, ud); + vector unsigned long long uo = vec_mergel (ud, ua); + + vector long long lp = vec_nor (la, lb); + vector long long lq = vec_nor (la, ld); + vector long long lr = vec_nor (ld, la); + + vector unsigned long long up = vec_nor (ua, ub); + vector unsigned long long uq = vec_nor (ua, ud); + vector unsigned long long ur = vec_nor (ud, ua); + + vector long long ls = vec_or (la, lb); + vector long long lt = vec_or (la, ld); + vector long long lu = vec_or (ld, la); + + vector unsigned long long us = vec_or (ua, ub); + vector unsigned long long ut = vec_or (ua, ud); + vector unsigned long long uu = vec_or (ud, ua); + + vector unsigned char ca = {0,4,8,1,5,9,2,6,10,3,7,11,15,12,14,13}; + vector long long lv = vec_perm (la, lb, ca); + vector unsigned long long uv = vec_perm (ua, ub, ca); + + vector long long lw = vec_sel (la, lb, lc); + vector long long lx = vec_sel (la, lb, uc); + vector long long ly = vec_sel (la, lb, ld); + + vector unsigned long long uw = vec_sel (ua, ub, lc); + vector unsigned long long ux = vec_sel (ua, ub, uc); + vector unsigned long long uy = vec_sel (ua, ub, ld); + + vector long long lz = vec_xor (la, lb); + vector long long l0 = vec_xor (la, ld); + vector long long l1 = vec_xor (ld, la); + + vector unsigned long long uz = vec_xor (ua, ub); + vector unsigned long long u0 = vec_xor (ua, ud); + vector unsigned long long u1 = vec_xor (ud, ua); + + int ia = vec_all_eq (ua, ub); + int ib = vec_all_ge (ua, ub); + int ic = vec_all_gt (ua, ub); + int id = vec_all_le (ua, ub); + int ie = vec_all_lt (ua, ub); + int ig = vec_all_ne (ua, ub); + + int ih = vec_any_eq (ua, ub); + int ii = vec_any_ge (ua, ub); + int ij = vec_any_gt (ua, ub); + int ik = vec_any_le (ua, ub); + int il = vec_any_lt (ua, ub); + int im = vec_any_ne (ua, ub); + + vector int sia = {9, 16, 25, 36}; + vector int sib = {-8, -27, -64, -125}; + vector int sic = vec_mergee (sia, sib); + vector int sid = vec_mergeo (sia, sib); + + vector unsigned int uia = {9, 16, 25, 36}; + vector unsigned int uib = {8, 27, 64, 125}; + vector unsigned int uic = vec_mergee (uia, uib); + vector unsigned int uid = vec_mergeo (uia, uib); + + vector bool int bia = {0, -1, -1, 0}; + vector bool int bib = {-1, -1, 0, -1}; + vector bool int bic = vec_mergee (bia, bib); + vector bool int bid = vec_mergeo (bia, bib); + + vector unsigned int uie = vec_packsu (ua, ub); + + vector long long l2 = vec_cntlz (la); + vector unsigned long long u2 = vec_cntlz (ua); + vector int sie = vec_cntlz (sia); + vector unsigned int uif = vec_cntlz (uia); + vector short ssa = {20, -40, -60, 80, 100, -120, -140, 160}; + vector short ssb = vec_cntlz (ssa); + vector unsigned short usa = {81, 72, 63, 54, 45, 36, 27, 18}; + vector unsigned short usb = vec_cntlz (usa); + vector signed char sca = {-4, 3, -9, 15, -31, 31, 0, 0, + 1, 117, -36, 99, 98, 97, 96, 95}; + vector signed char scb = vec_cntlz (sca); + vector unsigned char cb = vec_cntlz (ca); + + vector double dd = vec_xl (0, &y); + vec_xst (dd, 0, &z); + + vector double de = vec_round (dd); + + vector double df = vec_splat (de, 0); + vector double dg = vec_splat (de, 1); + vector long long l3 = vec_splat (l2, 0); + vector long long l4 = vec_splat (l2, 1); + vector unsigned long long u3 = vec_splat (u2, 0); + vector unsigned long long u4 = vec_splat (u2, 1); + vector bool long long l5 = vec_splat (ld, 0); + vector bool long long l6 = vec_splat (ld, 1); + + vector long long l7 = vec_div (l3, l4); + vector unsigned long long u5 = vec_div (u3, u4); + + vector long long l8 = vec_mul (l3, l4); + vector unsigned long long u6 = vec_mul (u3, u4); + + vector double dh = vec_ctf (la, -2); + vector double di = vec_ctf (ua, 2); + vector long long l9 = vec_cts (dh, -2); + vector unsigned long long u7 = vec_ctu (di, 2); + + return 0; +} Index: gcc/testsuite/gcc.target/powerpc/builtins-2.c =================================================================== --- gcc/testsuite/gcc.target/powerpc/builtins-2.c (.../tags/gcc_4_9_2_release) (wersja 0) +++ gcc/testsuite/gcc.target/powerpc/builtins-2.c (.../branches/gcc-4_9-branch) (wersja 218777) @@ -0,0 +1,47 @@ +/* { dg-do run { target { powerpc64le-*-* } } } */ +/* { dg-options "-mcpu=power8 " } */ + +#include + +void abort (void); + +int main () +{ + vector long long sa = {27L, -14L}; + vector long long sb = {-9L, -2L}; + + vector unsigned long long ua = {27L, 14L}; + vector unsigned long long ub = {9L, 2L}; + + vector long long sc = vec_div (sa, sb); + vector unsigned long long uc = vec_div (ua, ub); + + if (sc[0] != -3L || sc[1] != 7L || uc[0] != 3L || uc[1] != 7L) + abort (); + + vector long long sd = vec_mul (sa, sb); + vector unsigned long long ud = vec_mul (ua, ub); + + if (sd[0] != -243L || sd[1] != 28L || ud[0] != 243L || ud[1] != 28L) + abort (); + + vector long long se = vec_splat (sa, 0); + vector long long sf = vec_splat (sa, 1); + vector unsigned long long ue = vec_splat (ua, 0); + vector unsigned long long uf = vec_splat (ua, 1); + + if (se[0] != 27L || se[1] != 27L || sf[0] != -14L || sf[1] != -14L + || ue[0] != 27L || ue[1] != 27L || uf[0] != 14L || uf[1] != 14L) + abort (); + + vector double da = vec_ctf (sa, -2); + vector double db = vec_ctf (ua, 2); + vector long long sg = vec_cts (da, -2); + vector unsigned long long ug = vec_ctu (db, 2); + + if (da[0] != 108.0 || da[1] != -56.0 || db[0] != 6.75 || db[1] != 3.5 + || sg[0] != 27L || sg[1] != -14L || ug[0] != 27L || ug[1] != 14L) + abort (); + + return 0; +} Index: gcc/testsuite/gcc.target/avr/torture/pr63633-ice-mult.c =================================================================== --- gcc/testsuite/gcc.target/avr/torture/pr63633-ice-mult.c (.../tags/gcc_4_9_2_release) (wersja 0) +++ gcc/testsuite/gcc.target/avr/torture/pr63633-ice-mult.c (.../branches/gcc-4_9-branch) (wersja 218777) @@ -0,0 +1,37 @@ +/* { dg-do compile } */ + +void ice_mult32 (int x) +{ + register long reg __asm ("22"); + __asm volatile (" " :: "r" (reg = 0x12345 * x)); +} + +void ice_mult24 (int x) +{ + register __int24 reg __asm ("20"); + __asm volatile (" " :: "r" (reg = 0x12345 * x)); +} + +void ice_sh24 (__int24 x) +{ + register __int24 reg __asm ("20"); + __asm volatile (" " :: "r" (reg = x << 3)); +} + +void ice_sh24b (__int24 x) +{ + register __int24 reg __asm ("20"); + __asm volatile (" " :: "r" (reg = x << 22)); +} + +void ice_s16s16 (int x) +{ + register long reg __asm ("20"); + __asm volatile (" " :: "r" (reg = (long) x*x)); +} + +void ice_u16s16 (int x) +{ + register long reg __asm ("20"); + __asm volatile (" " :: "r" (reg = (long) x*0x1234u)); +} Index: gcc/testsuite/gcc.target/i386/memcpy-strategy-4.c =================================================================== --- gcc/testsuite/gcc.target/i386/memcpy-strategy-4.c (.../tags/gcc_4_9_2_release) (wersja 0) +++ gcc/testsuite/gcc.target/i386/memcpy-strategy-4.c (.../branches/gcc-4_9-branch) (wersja 218777) @@ -0,0 +1,21 @@ +/* PR target/64200 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -march=atom -mmemcpy-strategy=libcall:-1:align -minline-stringops-dynamically" } */ + +#include + +extern void bar(char *x); + +void foo (int size, ...) +{ + struct + { + char x[size]; + } d; + + va_list ap; + va_start(ap, size); + d = va_arg(ap, typeof (d)); + va_end(ap); + bar(d.x); +} Index: gcc/testsuite/gcc.target/i386/avx256-unaligned-store-7.c =================================================================== --- gcc/testsuite/gcc.target/i386/avx256-unaligned-store-7.c (.../tags/gcc_4_9_2_release) (wersja 218777) +++ gcc/testsuite/gcc.target/i386/avx256-unaligned-store-7.c (.../branches/gcc-4_9-branch) (wersja 218777) @@ -29,13 +29,13 @@ ap = ep; bp = fp; - for (i = N; i >= 0; i--) + for (i = N; i > 0; i--) { *ap++ = str; *bp++ = str; } - for (i = N; i >= 0; i--) + for (i = N; i > 0; i--) { if (strcmp (*--ap, "STR") != 0) abort (); Index: gcc/testsuite/gcc.target/i386/pr63661.c =================================================================== --- gcc/testsuite/gcc.target/i386/pr63661.c (.../tags/gcc_4_9_2_release) (wersja 0) +++ gcc/testsuite/gcc.target/i386/pr63661.c (.../branches/gcc-4_9-branch) (wersja 218777) @@ -0,0 +1,80 @@ +/* PR target/63661 */ +/* { dg-do run } */ +/* { dg-require-effective-target fpic } */ +/* { dg-options "-mtune=nehalem -fPIC -O2" } */ + +static void __attribute__((noinline,noclone,hot)) +foo (double a, double q, double *ff, double *gx, int e, int ni) +{ + union + { + double n; + unsigned long long o; + } punner; + double d; + + punner.n = q; + __builtin_printf("B: 0x%016llx ---- %g\n", punner.o, q); + + d = q - 5; + if(d < 0) + d = -d; + if (d > 0.1) + __builtin_abort(); +} + +static int __attribute__((noinline,noclone,hot)) +bar (int order, double q, double c[]) +{ + int ni, nn, i, e; + double g2, x2, de, s, ratio, ff; + + nn = 0; + e = order & 1; + s = 0; + ratio = 0; + x2 = 0; + g2 = 0; + + if(q == 0.0) + return 0; + + if (order < 5) + { + ratio = 1.0 / q; + nn = order; + } + + ni = -nn; + + while(1) + { + de = ratio - g2 - x2; + + foo (0, q, &ff, &g2, e, ni); + + if((int)de == 0) + break; + } + + s += 2 * nn * c[nn]; + + for (i = 0; i < 1; i++) + { + c[0] = nn; + for (; i < 10; i++) + c[i] = 0.0; + c[0] /= s; + } + + return 0; +} + +int +main () +{ + double c[1000]; + + bar (1, 5.0, c); + return 0; +} Index: gcc/testsuite/gcc.target/i386/pr63538.c =================================================================== --- gcc/testsuite/gcc.target/i386/pr63538.c (.../tags/gcc_4_9_2_release) (wersja 0) +++ gcc/testsuite/gcc.target/i386/pr63538.c (.../branches/gcc-4_9-branch) (wersja 218777) @@ -0,0 +1,13 @@ +/* PR target/63538 */ +/* { dg-do compile } */ +/* { dg-require-effective-target lp64 } */ +/* { dg-options "-O2 -mcmodel=medium -mlarge-data-threshold=0" } */ + +static char *str = "Hello World"; + +char *foo () +{ + return str; +} + +/* { dg-final { scan-assembler "movabs" } } */ Index: gcc/testsuite/gcc.target/i386/avx256-unaligned-load-7.c =================================================================== --- gcc/testsuite/gcc.target/i386/avx256-unaligned-load-7.c (.../tags/gcc_4_9_2_release) (wersja 218777) +++ gcc/testsuite/gcc.target/i386/avx256-unaligned-load-7.c (.../branches/gcc-4_9-branch) (wersja 218777) @@ -33,7 +33,7 @@ cp = mp; dp = lp; - for (i = N; i >= 0; i--) + for (i = N; i > 0; i--) { *cp++ = str; *dp++ = str; @@ -44,13 +44,13 @@ cp = mp; dp = lp; - for (i = N; i >= 0; i--) + for (i = N; i > 0; i--) { *ap++ = *cp++; *bp++ = *dp++; } - for (i = N; i >= 0; i--) + for (i = N; i > 0; i--) { if (strcmp (*--ap, "STR") != 0) abort (); Index: gcc/testsuite/gcc.target/i386/pr63947.c =================================================================== --- gcc/testsuite/gcc.target/i386/pr63947.c (.../tags/gcc_4_9_2_release) (wersja 0) +++ gcc/testsuite/gcc.target/i386/pr63947.c (.../branches/gcc-4_9-branch) (wersja 218777) @@ -0,0 +1,9 @@ +/* PR target/63947 */ +/* { dg-do assemble } */ +/* { dg-options "-Os" } */ +/* { dg-additional-options "-march=i686" { target ia32 } } */ + +long double foo (unsigned a, unsigned b) +{ + return a + b < a; +} Index: gcc/testsuite/gcc.target/i386/memset-strategy-2.c =================================================================== --- gcc/testsuite/gcc.target/i386/memset-strategy-2.c (.../tags/gcc_4_9_2_release) (wersja 0) +++ gcc/testsuite/gcc.target/i386/memset-strategy-2.c (.../branches/gcc-4_9-branch) (wersja 218777) @@ -0,0 +1,10 @@ +/* PR target/64108 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -march=atom -mmemset-strategy=libcall:-1:align -minline-all-stringops" } */ + +char a[2048]; +void t (void) +{ + __builtin_memset (a, 1, 2048); +} + Index: gcc/testsuite/gcc.target/h8300/pragma-isr.c =================================================================== --- gcc/testsuite/gcc.target/h8300/pragma-isr.c (.../tags/gcc_4_9_2_release) (wersja 218777) +++ gcc/testsuite/gcc.target/h8300/pragma-isr.c (.../branches/gcc-4_9-branch) (wersja 218777) @@ -18,23 +18,3 @@ { foo (); } -/* Check whether rte is generated for two ISRs. */ -/* { dg-do compile { target h8300-*-* } } */ -/* { dg-options "-O3" } */ -/* { dg-final { scan-assembler-times "rte" 2} } */ - -extern void foo (void); - -#pragma interrupt -void -isr1 (void) -{ - foo (); -} - -#pragma interrupt -void -isr2 (void) -{ - foo (); -} Index: gcc/testsuite/gcc.target/h8300/pragma-isr2.c =================================================================== --- gcc/testsuite/gcc.target/h8300/pragma-isr2.c (.../tags/gcc_4_9_2_release) (wersja 218777) +++ gcc/testsuite/gcc.target/h8300/pragma-isr2.c (.../branches/gcc-4_9-branch) (wersja 218777) @@ -19,24 +19,3 @@ { return 0; } -/* Check whether rte is generated only for an ISR. */ -/* { dg-do compile { target h8300-*-* } } */ -/* { dg-options "-O" } */ -/* { dg-final { scan-assembler-times "rte" 1 } } */ - -#pragma interrupt -void -isr (void) -{ -} - -void -delay (int a) -{ -} - -int -main (void) -{ - return 0; -} Index: gcc/testsuite/gcc.target/h8300/h8300.exp =================================================================== --- gcc/testsuite/gcc.target/h8300/h8300.exp (.../tags/gcc_4_9_2_release) (wersja 218777) +++ gcc/testsuite/gcc.target/h8300/h8300.exp (.../branches/gcc-4_9-branch) (wersja 218777) @@ -39,44 +39,3 @@ # All done. dg-finish -# Copyright (C) 2013-2014 Free Software Foundation, Inc. - -# This program 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 of the License, or -# (at your option) any later version. -# -# This program 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 GCC; see the file COPYING3. If not see -# . - -# GCC testsuite that uses the `dg.exp' driver. - -# Exit immediately if this isn't a h8300 target. -if ![istarget h8300*-*-*] then { - return -} - -# Load support procs. -load_lib gcc-dg.exp - -# If a testcase doesn't have special options, use these. -global DEFAULT_CFLAGS -if ![info exists DEFAULT_CFLAGS] then { - set DEFAULT_CFLAGS " -ansi -pedantic-errors" -} - -# Initialize `dg'. -dg-init - -# Main loop. -dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] \ - "" $DEFAULT_CFLAGS - -# All done. -dg-finish Index: gcc/testsuite/gcc.target/sh/pr51244-20-sh2a.c =================================================================== --- gcc/testsuite/gcc.target/sh/pr51244-20-sh2a.c (.../tags/gcc_4_9_2_release) (wersja 218777) +++ gcc/testsuite/gcc.target/sh/pr51244-20-sh2a.c (.../branches/gcc-4_9-branch) (wersja 218777) @@ -3,12 +3,12 @@ /* { dg-do compile } */ /* { dg-options "-O2" } */ /* { dg-skip-if "" { "sh*-*-*" } { "*" } { "-m2a*" } } */ -/* { dg-final { scan-assembler-times "tst" 5 } } */ -/* { dg-final { scan-assembler-times "movt" 0 } } */ +/* { dg-final { scan-assembler-times "tst" 6 } } */ +/* { dg-final { scan-assembler-times "movt" 1 } } */ /* { dg-final { scan-assembler-times "nott" 1 } } */ /* { dg-final { scan-assembler-times "cmp/eq" 2 } } */ /* { dg-final { scan-assembler-times "cmp/hi" 4 } } */ /* { dg-final { scan-assembler-times "cmp/gt" 3 } } */ -/* { dg-final { scan-assembler-times "not\t" 1 } } */ +/* { dg-final { scan-assembler-not "not\t" } } */ #include "pr51244-20.c" Index: gcc/testsuite/gcc.target/sh/pr51244-20.c =================================================================== --- gcc/testsuite/gcc.target/sh/pr51244-20.c (.../tags/gcc_4_9_2_release) (wersja 218777) +++ gcc/testsuite/gcc.target/sh/pr51244-20.c (.../branches/gcc-4_9-branch) (wersja 218777) @@ -1,15 +1,15 @@ /* Check that the SH specific sh_treg_combine RTL optimization pass works as expected. On SH2A the expected insns are slightly different, see - pr51244-21.c. */ + pr51244-20-sh2a.c. */ /* { dg-do compile } */ /* { dg-options "-O2" } */ /* { dg-skip-if "" { "sh*-*-*" } { "-m5*" "-m2a*" } { "" } } */ -/* { dg-final { scan-assembler-times "tst" 6 } } */ -/* { dg-final { scan-assembler-times "movt" 1 } } */ +/* { dg-final { scan-assembler-times "tst" 7 } } */ +/* { dg-final { scan-assembler-times "movt" 2 } } */ /* { dg-final { scan-assembler-times "cmp/eq" 2 } } */ /* { dg-final { scan-assembler-times "cmp/hi" 4 } } */ /* { dg-final { scan-assembler-times "cmp/gt" 2 } } */ -/* { dg-final { scan-assembler-times "not\t" 1 } } */ +/* { dg-final { scan-assembler-not "not\t" } } */ /* non-SH2A: 2x tst, 1x movt, 2x cmp/eq, 1x cmp/hi @@ -81,7 +81,7 @@ } -/* 2x tst, 1x cmp/hi, 1x not */ +/* 3x tst, 1x movt, 1x cmp/hi, 1x not */ static inline int blk_oversized_queue_5 (int* q) { Index: gcc/testsuite/gcc.target/sh/torture/pr63783-1.c =================================================================== --- gcc/testsuite/gcc.target/sh/torture/pr63783-1.c (.../tags/gcc_4_9_2_release) (wersja 0) +++ gcc/testsuite/gcc.target/sh/torture/pr63783-1.c (.../branches/gcc-4_9-branch) (wersja 218777) @@ -0,0 +1,29 @@ +/* { dg-do run } */ +/* { dg-additional-options "-std=c99" } */ + +#include + +int decision_result; +int val; +int truecount = 0; + +static void __attribute__((noinline)) +buggy (int flag) +{ + int condition; + if(flag == 0) + condition = val != 0; + else + condition = !decision_result; + if (condition) + truecount++; +} + +int +main (void) +{ + decision_result = 1; + buggy(1); + assert (truecount == 0); + return 0; +} Index: gcc/testsuite/gcc.target/sh/torture/pr63783-2.c =================================================================== --- gcc/testsuite/gcc.target/sh/torture/pr63783-2.c (.../tags/gcc_4_9_2_release) (wersja 0) +++ gcc/testsuite/gcc.target/sh/torture/pr63783-2.c (.../branches/gcc-4_9-branch) (wersja 218777) @@ -0,0 +1,29 @@ +/* { dg-do run } */ +/* { dg-additional-options "-std=c99" } */ + +#include + +long long decision_result; +long long val; +int truecount = 0; + +static void __attribute__((noinline)) +buggy (int flag) +{ + int condition; + if(flag == 0) + condition = val != 0; + else + condition = !decision_result; + if (condition) + truecount++; +} + +int +main (void) +{ + decision_result = 1; + buggy(1); + assert (truecount == 0); + return 0; +} Index: gcc/testsuite/gcc.c-torture/execute/pr63659.c =================================================================== --- gcc/testsuite/gcc.c-torture/execute/pr63659.c (.../tags/gcc_4_9_2_release) (wersja 0) +++ gcc/testsuite/gcc.c-torture/execute/pr63659.c (.../branches/gcc-4_9-branch) (wersja 218777) @@ -0,0 +1,29 @@ +/* PR rtl-optimization/63659 */ + +int a, b, c, *d = &b, g, h, i; +unsigned char e; +char f; + +int +main () +{ + while (a) + { + for (a = 0; a; a++) + for (; c; c++) + ; + if (i) + break; + } + + char j = c, k = -1, l; + l = g = j >> h; + f = l == 0 ? k : k % l; + e = 0 ? 0 : f; + *d = e; + + if (b != 255) + __builtin_abort (); + + return 0; +} Index: gcc/testsuite/gcc.c-torture/compile/pr64067.c =================================================================== --- gcc/testsuite/gcc.c-torture/compile/pr64067.c (.../tags/gcc_4_9_2_release) (wersja 0) +++ gcc/testsuite/gcc.c-torture/compile/pr64067.c (.../branches/gcc-4_9-branch) (wersja 218777) @@ -0,0 +1,10 @@ +/* PR middle-end/64067 */ + +struct S { int s; }; +int *const v[1] = { &((struct S) { .s = 42 }).s }; + +int * +foo (void) +{ + return v[0]; +} Index: gcc/testsuite/gcc.c-torture/compile/pr64269.c =================================================================== --- gcc/testsuite/gcc.c-torture/compile/pr64269.c (.../tags/gcc_4_9_2_release) (wersja 0) +++ gcc/testsuite/gcc.c-torture/compile/pr64269.c (.../branches/gcc-4_9-branch) (wersja 218777) @@ -0,0 +1,9 @@ +/* PR tree-optimization/64269 */ + +void +foo (char *p) +{ + __SIZE_TYPE__ s = ~(__SIZE_TYPE__)0; + *p = 0; + __builtin_memset (p + 1, 0, s); +} Index: gcc/testsuite/gnat.dg/opt45.adb =================================================================== --- gcc/testsuite/gnat.dg/opt45.adb (.../tags/gcc_4_9_2_release) (wersja 0) +++ gcc/testsuite/gnat.dg/opt45.adb (.../branches/gcc-4_9-branch) (wersja 218777) @@ -0,0 +1,38 @@ +-- { dg-do compile } +-- { dg-options "-O3" } + +procedure Opt45 is + + type Index_T is mod 2 ** 32; + for Index_T'Size use 32; + for Index_T'Alignment use 1; + + type Array_T is array (Index_T range <>) of Natural; + type Array_Ptr_T is access all Array_T; + + My_Array_1 : aliased Array_T := (1, 2); + My_Array_2 : aliased Array_T := (3, 4); + + Array_Ptr : Array_Ptr_T := null; + Index : Index_T := Index_T'First; + + My_Value : Natural := Natural'First; + + procedure Proc (Selection : Positive) is + begin + if Selection = 1 then + Array_Ptr := My_Array_1'Access; + Index := My_Array_1'First; + else + Array_Ptr := My_Array_2'Access; + Index := My_Array_2'First; + end if; + + if My_Value = Natural'First then + My_Value := Array_Ptr.all (Index); + end if; + end; + +begin + Proc (2); +end; Index: gcc/testsuite/gcc.dg/pr63762.c =================================================================== --- gcc/testsuite/gcc.dg/pr63762.c (.../tags/gcc_4_9_2_release) (wersja 0) +++ gcc/testsuite/gcc.dg/pr63762.c (.../branches/gcc-4_9-branch) (wersja 218777) @@ -0,0 +1,77 @@ +/* PR middle-end/63762 */ +/* { dg-do assemble } */ +/* { dg-options "-O2" } */ + +#include + +void *astFree (); +void *astMalloc (); +void astNegate (void *); +int astGetNegated (void *); +void astGetRegionBounds (void *, double *, double *); +int astResampleF (void *, ...); + +extern int astOK; + +int +MaskF (int inside, int ndim, const int lbnd[], const int ubnd[], + float in[], float val) +{ + + void *used_region; + float *c, *d, *out, *tmp_out; + double *lbndgd, *ubndgd; + int *lbndg, *ubndg, idim, ipix, nax, nin, nout, npix, npixg, result = 0; + if (!astOK) return result; + lbndg = astMalloc (sizeof (int)*(size_t) ndim); + ubndg = astMalloc (sizeof (int)*(size_t) ndim); + lbndgd = astMalloc (sizeof (double)*(size_t) ndim); + ubndgd = astMalloc (sizeof (double)*(size_t) ndim); + if (astOK) + { + astGetRegionBounds (used_region, lbndgd, ubndgd); + npix = 1; + npixg = 1; + for (idim = 0; idim < ndim; idim++) + { + lbndg[ idim ] = lbnd[ idim ]; + ubndg[ idim ] = ubnd[ idim ]; + npix *= (ubnd[ idim ] - lbnd[ idim ] + 1); + if (npixg >= 0) npixg *= (ubndg[ idim ] - lbndg[ idim ] + 1); + } + if (npixg <= 0 && astOK) + { + if ((inside != 0) == (astGetNegated( used_region ) != 0)) + { + c = in; + for (ipix = 0; ipix < npix; ipix++) *(c++) = val; + result = npix; + } + } + else if (npixg > 0 && astOK) + { + if ((inside != 0) == (astGetNegated (used_region) != 0)) + { + tmp_out = astMalloc (sizeof (float)*(size_t) npix); + if (tmp_out) + { + c = tmp_out; + for (ipix = 0; ipix < npix; ipix++) *(c++) = val; + result = npix - npixg; + } + out = tmp_out; + } + else + { + tmp_out = NULL; + out = in; + } + if (inside) astNegate (used_region); + result += astResampleF (used_region, ndim, lbnd, ubnd, in, NULL, + NULL, NULL, 0, 0.0, 100, val, ndim, + lbnd, ubnd, lbndg, ubndg, out, NULL); + if (inside) astNegate (used_region); + } + } + return result; +} Index: gcc/testsuite/gcc.dg/pr51879-12.c =================================================================== --- gcc/testsuite/gcc.dg/pr51879-12.c (.../tags/gcc_4_9_2_release) (wersja 218777) +++ gcc/testsuite/gcc.dg/pr51879-12.c (.../branches/gcc-4_9-branch) (wersja 218777) @@ -24,6 +24,6 @@ baz (a); } -/* { dg-final { scan-tree-dump-times "bar \\(" 1 "pre"} } */ -/* { dg-final { scan-tree-dump-times "bar2 \\(" 1 "pre"} } */ +/* { dg-final { scan-tree-dump-times "bar \\(" 1 "pre" { xfail *-*-* } } } */ +/* { dg-final { scan-tree-dump-times "bar2 \\(" 1 "pre" { xfail *-*-* } } } */ /* { dg-final { cleanup-tree-dump "pre" } } */ Index: gcc/testsuite/gcc.dg/pr63665.c =================================================================== --- gcc/testsuite/gcc.dg/pr63665.c (.../tags/gcc_4_9_2_release) (wersja 0) +++ gcc/testsuite/gcc.dg/pr63665.c (.../branches/gcc-4_9-branch) (wersja 218777) @@ -0,0 +1,18 @@ +/* { dg-do run } */ +/* { dg-require-effective-target int32plus } */ +/* { dg-options "-O -fno-tree-ccp -fno-tree-fre -fno-tree-copy-prop -fwrapv" } */ + +static inline int +test5 (int x) +{ + int y = 0x80000000; + return x + y; +} + +int +main () +{ + if (test5 (0x80000000) != 0) + __builtin_abort (); + return 0; +} Index: gcc/testsuite/gcc.dg/pr62167-run.c =================================================================== --- gcc/testsuite/gcc.dg/pr62167-run.c (.../tags/gcc_4_9_2_release) (wersja 0) +++ gcc/testsuite/gcc.dg/pr62167-run.c (.../branches/gcc-4_9-branch) (wersja 218777) @@ -0,0 +1,47 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -ftree-tail-merge" } */ + +struct node +{ + struct node *next; + struct node *prev; +}; + +struct node node; + +struct head +{ + struct node *first; +}; + +struct head heads[5]; + +int k = 2; + +struct head *head = &heads[2]; + +int +main () +{ + struct node *p; + + node.next = (void*)0; + + node.prev = (void *)head; + + head->first = &node; + + struct node *n = head->first; + + struct head *h = &heads[k]; + + heads[2].first = n->next; + + if ((void*)n->prev == (void *)h) + p = h->first; + else + /* Dead tbaa-unsafe load from ((struct node *)&heads[2])->next. */ + p = n->prev->next; + + return !(p == (void*)0); +} Index: gcc/testsuite/gcc.dg/pr52769.c =================================================================== --- gcc/testsuite/gcc.dg/pr52769.c (.../tags/gcc_4_9_2_release) (wersja 0) +++ gcc/testsuite/gcc.dg/pr52769.c (.../branches/gcc-4_9-branch) (wersja 218777) @@ -0,0 +1,24 @@ +/* PR c/52769 */ +/* { dg-do run } */ +/* { dg-options "-O3" } */ + +typedef struct +{ + int should_be_zero; + char s[6]; + int x; +} foo_t; + +int +main (void) +{ + volatile foo_t foo = { + .s = "123456", + .x = 2 + }; + + if (foo.should_be_zero != 0) + __builtin_abort (); + + return 0; +} Index: gcc/testsuite/gcc.dg/pr62167.c =================================================================== --- gcc/testsuite/gcc.dg/pr62167.c (.../tags/gcc_4_9_2_release) (wersja 0) +++ gcc/testsuite/gcc.dg/pr62167.c (.../branches/gcc-4_9-branch) (wersja 218777) @@ -0,0 +1,50 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -ftree-tail-merge -fdump-tree-pre" } */ + +struct node +{ + struct node *next; + struct node *prev; +}; + +struct node node; + +struct head +{ + struct node *first; +}; + +struct head heads[5]; + +int k = 2; + +struct head *head = &heads[2]; + +int +main () +{ + struct node *p; + + node.next = (void*)0; + + node.prev = (void *)head; + + head->first = &node; + + struct node *n = head->first; + + struct head *h = &heads[k]; + + heads[2].first = n->next; + + if ((void*)n->prev == (void *)h) + p = h->first; + else + /* Dead tbaa-unsafe load from ((struct node *)&heads[2])->next. */ + p = n->prev->next; + + return !(p == (void*)0); +} + +/* { dg-final { scan-tree-dump-not "Removing basic block" "pre"} } */ +/* { dg-final { cleanup-tree-dump "pre" } } */ Index: gcc/testsuite/gcc.dg/torture/pr63738.c =================================================================== --- gcc/testsuite/gcc.dg/torture/pr63738.c (.../tags/gcc_4_9_2_release) (wersja 0) +++ gcc/testsuite/gcc.dg/torture/pr63738.c (.../branches/gcc-4_9-branch) (wersja 218777) @@ -0,0 +1,27 @@ +/* { dg-do compile } */ + +#include + +struct longjmp_buffer { + jmp_buf buf; +}; + +void plouf(); + +extern long interprete() +{ + long * sp; + int i; + long *args; + int n; + + struct longjmp_buffer raise_buf; + setjmp (raise_buf.buf); + + plouf(); + sp -= 4; + for (i = 0; i < n; i++) + args[i] = sp[10-i]; + plouf(); + return 0; +} Index: gcc/testsuite/gcc.dg/torture/pr62238.c =================================================================== --- gcc/testsuite/gcc.dg/torture/pr62238.c (.../tags/gcc_4_9_2_release) (wersja 0) +++ gcc/testsuite/gcc.dg/torture/pr62238.c (.../branches/gcc-4_9-branch) (wersja 218777) @@ -0,0 +1,30 @@ +/* { dg-do run } */ + +int a[4], b, c, d; + +int +fn1 (int p) +{ + for (; d; d++) + { + unsigned int h; + for (h = 0; h < 3; h++) + { + if (a[c+c+h]) + { + if (p) + break; + return 0; + } + b = 0; + } + } + return 0; +} + +int +main () +{ + fn1 (0); + return 0; +} Index: gcc/testsuite/gcc.dg/ipa/pr64041.c =================================================================== --- gcc/testsuite/gcc.dg/ipa/pr64041.c (.../tags/gcc_4_9_2_release) (wersja 0) +++ gcc/testsuite/gcc.dg/ipa/pr64041.c (.../branches/gcc-4_9-branch) (wersja 218777) @@ -0,0 +1,64 @@ +/* { dg-do run } */ +/* { dg-options "-O2" } */ + +int printf (const char *, ...); + +int a, b = 1, d; + +union U1 +{ + unsigned int f0; + int f1; +}; + +union U2 +{ + int f2; + int f3; +} c; + +int +fn1 (int p) +{ + int t = p && a || p && a && p; + return t ? t : a; +} + +unsigned +fn2 (union U1 p1, union U2 p2) +{ + if (p1.f1 <= 0) + { + for (; p2.f2;) + c.f2 = 0; + p2.f2 = fn1 (d); + } + return p2.f3; +} + +int g = 0; + +int +foo () +{ + if (b) + { + union U1 f = { 0xFFFFFFFFU }; + + fn2 (f, c); + } + g = 1; + return 0; +} + + +int +main () +{ + foo (); + + if (g == 0) + __builtin_abort (); + + return 0; +} Index: gcc/testsuite/gcc.dg/ipa/pr63551.c =================================================================== --- gcc/testsuite/gcc.dg/ipa/pr63551.c (.../tags/gcc_4_9_2_release) (wersja 0) +++ gcc/testsuite/gcc.dg/ipa/pr63551.c (.../branches/gcc-4_9-branch) (wersja 218777) @@ -0,0 +1,33 @@ +/* { dg-do run } */ +/* { dg-options "-Os" } */ + +union U +{ + unsigned int f0; + int f1; +}; + +int a, d; + +void +fn1 (union U p) +{ + if (p.f1 <= 0) + if (a) + d = 0; +} + +void +fn2 () +{ + d = 0; + union U b = { 4294967286U }; + fn1 (b); +} + +int +main () +{ + fn2 (); + return 0; +} Index: gcc/testsuite/gcc.dg/vect/pr63605.c =================================================================== --- gcc/testsuite/gcc.dg/vect/pr63605.c (.../tags/gcc_4_9_2_release) (wersja 0) +++ gcc/testsuite/gcc.dg/vect/pr63605.c (.../branches/gcc-4_9-branch) (wersja 218777) @@ -0,0 +1,22 @@ +/* { dg-do run } */ + +#include "tree-vect.h" + +extern void abort (void); + +int a, b[8] = { 2, 0, 0, 0, 0, 0, 0, 0 }, c[8]; + +int +main () +{ + int d; + check_vect (); + for (; a < 8; a++) + { + d = b[a] >> 1; + c[a] = d != 0; + } + if (c[0] != 1) + abort (); + return 0; +} Index: gcc/testsuite/gcc.dg/vect/pr62021.c =================================================================== --- gcc/testsuite/gcc.dg/vect/pr62021.c (.../tags/gcc_4_9_2_release) (wersja 0) +++ gcc/testsuite/gcc.dg/vect/pr62021.c (.../branches/gcc-4_9-branch) (wersja 218777) @@ -0,0 +1,30 @@ +/* { dg-require-effective-target vect_simd_clones } */ +/* { dg-additional-options "-fopenmp-simd" } */ +/* { dg-additional-options "-mavx" { target avx_runtime } } */ + +#pragma omp declare simd linear(y) +__attribute__((noinline)) int * +foo (int *x, int y) +{ + return x + y; +} + +int a[1024]; +int *b[1024] = { &a[0] }; + +int +main () +{ + int i; + for (i = 0; i < 1024; i++) + b[i] = &a[1023 - i]; + #pragma omp simd + for (i = 0; i < 1024; i++) + b[i] = foo (b[i], i); + for (i = 0; i < 1024; i++) + if (b[i] != &a[1023]) + __builtin_abort (); + return 0; +} + +/* { dg-final { cleanup-tree-dump "vect" } } */ Index: gcc/testsuite/gcc.dg/20141029-1.c =================================================================== --- gcc/testsuite/gcc.dg/20141029-1.c (.../tags/gcc_4_9_2_release) (wersja 0) +++ gcc/testsuite/gcc.dg/20141029-1.c (.../branches/gcc-4_9-branch) (wersja 218777) @@ -0,0 +1,28 @@ +/* { dg-do compile } */ +/* { dg-options "-fstrict-volatile-bitfields -fdump-rtl-final" } */ + +#define PERIPH (*(volatile struct system_periph *)0x81234) + +struct system_periph { + union { + unsigned short WORD; + struct { + unsigned short a:1; + unsigned short b:1; + unsigned short :5; + unsigned short c:1; + unsigned short :8; + } BIT; + } ALL; +}; + +void +foo() +{ + while (1) + { + PERIPH.ALL.BIT.a = 1; + } +} +/* { dg-final { scan-rtl-dump-times "mem/v(/.)*:HI" 4 "final" } } */ +/* { dg-final { cleanup-rtl-dump "final" } } */ Index: gcc/testsuite/ChangeLog =================================================================== --- gcc/testsuite/ChangeLog (.../tags/gcc_4_9_2_release) (wersja 218777) +++ gcc/testsuite/ChangeLog (.../branches/gcc-4_9-branch) (wersja 218777) @@ -1,3 +1,246 @@ +2014-12-15 Jakub Jelinek + + PR tree-optimization/63551 + * gcc.dg/ipa/pr63551.c (fn2): Use 4294967286U instead of + 4294967286 to avoid warnings. + +2014-12-14 H.J. Lu + + Backported from mainline + 2014-12-14 H.J. Lu + + PR rtl-optimization/64037 + * g++.dg/pr64037.C: New test. + +2014-12-14 H.J. Lu + + Backported from mainline + 2014-12-06 H.J. Lu + + PR target/64200 + * gcc.target/i386/memcpy-strategy-4.c: New test. + +2014-12-13 Jakub Jelinek + + Backported from mainline + 2014-12-12 Jakub Jelinek + + PR tree-optimization/64269 + * gcc.c-torture/compile/pr64269.c: New test. + +2014-12-10 Bill Schmidt + + Backport from mainline + 2014-09-02 Bill Schmidt + + * gcc.target/powerpc/builtins-1.c: Add tests for vec_ctf, + vec_cts, and vec_ctu. + * gcc.target/powerpc/builtins-2.c: Likewise. + + Backport from mainline + 2014-08-28 Bill Schmidt + + * gcc.target/powerpc/builtins-1.c: Add tests for vec_xl, vec_xst, + vec_round, vec_splat, vec_div, and vec_mul. + * gcc.target/powerpc/builtins-2.c: New test. + + Backport from mainline + 2014-08-20 Bill Schmidt + + * testsuite/gcc.target/powerpc/builtins-1.c: New test. + +2014-12-10 Jakub Jelinek + + PR tree-optimization/62021 + * gcc.dg/vect/pr62021.c: New test. + +2014-12-09 Uros Bizjak + + PR bootstrap/64213 + Revert: + 2014-11-28 H.J. Lu + + PR rtl-optimization/64037 + * g++.dg/pr64037.C: New test. + +2014-12-07 Oleg Endo + + Backport from mainline + 2014-12-07 Oleg Endo + + * gcc.target/h8300/h8300.exp: Fix duplicated text. + * gcc.target/h8300/pragma-isr.c: Likewise. + * gcc.target/h8300/pragma-isr2.c: Likewise. + +2014-12-05 H.J. Lu + + Backport from mainline + 2014-12-02 H.J. Lu + + PR target/64108 + * gcc.target/i386/memset-strategy-2.c: New test. + +2014-12-05 H.J. Lu + + Backport from mainline + 2014-11-28 H.J. Lu + + PR rtl-optimization/64037 + * g++.dg/pr64037.C: New test. + +2014-12-04 Jakub Jelinek + + PR c++/56493 + * c-c++-common/pr56493.c: New test. + +2014-12-03 Renlin Li + + Backported from mainline + 2014-12-03 Renlin Li + H.J. Lu + + PR middle-end/63762 + PR target/63661 + * gcc.dg/pr63762.c: New test. + * gcc.target/i386/pr63661.c: New test. + +2014-12-01 Martin Jambor + + PR ipa/63551 + * gcc.dg/ipa/pr63551.c: New test. + * gcc.dg/ipa/pr64041.c: Likewise. + +2014-12-01 Richard Biener + + PR tree-optimization/63738 + * gcc.dg/torture/pr63738.c: Fix call to setjmp. + +2014-11-28 Jakub Jelinek + + Backported from mainline + 2014-11-27 Jakub Jelinek + + PR middle-end/64067 + * gcc.c-torture/compile/pr64067.c: New test. + + 2014-11-19 Jakub Jelinek + + PR tree-optimization/63915 + * c-c++-common/gomp/pr60823-4.c: New test. + + PR sanitizer/63913 + * g++.dg/ubsan/pr63913.C: New test. + + 2014-10-31 Jakub Jelinek + + PR rtl-optimization/63659 + * gcc.c-torture/execute/pr63659.c: New test. + +2014-11-26 Richard Biener + + PR middle-end/63738 + * gcc.dg/torture/pr63738.c: New testcase. + +2014-11-26 Richard Biener + + Backport from mainline + 2014-11-26 Richard Biener + + PR tree-optimization/62238 + * gcc.dg/torture/pr62238.c: New testcase. + + 2014-11-07 Richard Biener + + PR tree-optimization/63605 + * gcc.dg/vect/pr63605.c: New testcase. + + 2014-10-28 Richard Biener + + PR middle-end/63665 + * gcc.dg/pr63665.c: New testcase. + +2014-11-24 Eric Botcazou + + * gnat.dg/opt45.adb: New test. + +2014-11-22 Oleg Endo + + Backport from mainline + 2014-11-22 Oleg Endo + + PR target/63783 + PR target/51244 + * gcc.target/sh/torture/pr63783-1.c: New. + * gcc.target/sh/torture/pr63783-2.c: New. + * gcc.target/sh/pr51244-20.c: Adjust. + * gcc.target/sh/pr51244-20-sh2a.c: Adjust. + +2014-11-19 Uros Bizjak + + PR target/63947 + * gcc.target/i386/pr63947.c: New test. + +2014-11-19 Tom de Vries + + Backport from mainline + PR tree-optimization/62167 + * gcc.dg/pr51879-12.c: Add xfails. + * gcc.dg/pr62167-run.c: New test. + * gcc.dg/pr62167.c: New test. + +2014-11-13 Teresa Johnson + + PR tree-optimization/63841 + * g++.dg/tree-ssa/pr63841.C: New test. + +2014-11-12 Jakub Jelinek + + PR ipa/63838 + * g++.dg/ipa/pr63838.C: New test. + +2014-11-11 Paolo Carlini + + PR c++/63265 + * g++.dg/cpp0x/constexpr-63265.C: New. + +2014-11-09 H.J. Lu + + Backported from mainline + 2014-11-09 H.J. Lu + + PR testsuite/63305 + * gcc.target/i386/avx256-unaligned-load-7.c (avx_test): Fix + buffer overflow. + * gcc.target/i386/avx256-unaligned-store-7.c (avx_test): Likewise. + +2014-11-07 Marek Polacek + + * c-c++-common/ubsan/undefined-2.c: New test. + +2014-11-05 Uros Bizjak + + PR target/63538 + * gcc.target/i386/pr63538.c: New test. + +2014-11-03 Marek Polacek + + PR c/52769 + * gcc.dg/pr52769.c: New test. + +2014-10-31 DJ Delorie + + * gcc.dg/20141029-1.c: New. + +2014-10-31 Jakub Jelinek + + PR sanitizer/63697 + * c-c++-common/ubsan/overflow-sub-3.c: New test. + +2014-10-30 Georg-Johann Lay + + PR63633 + * gcc.target/avr/torture/pr63633-ice-mult.c: New test. + 2014-10-30 Release Manager * GCC 4.9.2 released. Index: gcc/testsuite/g++.dg/pr64037.C =================================================================== --- gcc/testsuite/g++.dg/pr64037.C (.../tags/gcc_4_9_2_release) (wersja 0) +++ gcc/testsuite/g++.dg/pr64037.C (.../branches/gcc-4_9-branch) (wersja 218777) @@ -0,0 +1,27 @@ +// { dg-do run { target i?86-*-* x86_64-*-* } } +// { dg-options "-std=c++11 -Os" } + +enum class X : unsigned char { + V = 2, +}; + +static void +__attribute__((noinline,noclone)) +foo(unsigned &out, unsigned a, X b) +{ + out = static_cast(b); +} + +int main() +{ + unsigned deadbeef = 0xDEADBEEF; + asm volatile ("" : "+d" (deadbeef), "+c" (deadbeef)); + + unsigned out; + foo(out, 2, X::V); + + if (out != 2) + __builtin_abort (); + + return 0; +} Index: gcc/testsuite/g++.dg/ubsan/pr63913.C =================================================================== --- gcc/testsuite/g++.dg/ubsan/pr63913.C (.../tags/gcc_4_9_2_release) (wersja 0) +++ gcc/testsuite/g++.dg/ubsan/pr63913.C (.../branches/gcc-4_9-branch) (wersja 218777) @@ -0,0 +1,12 @@ +// PR sanitizer/63913 +// { dg-do compile } +// { dg-options "-fsanitize=bool -fnon-call-exceptions" } + +struct B { B (); ~B (); }; + +double +foo (bool *x) +{ + B b; + return *x; +} Index: gcc/testsuite/g++.dg/tree-ssa/pr63841.C =================================================================== --- gcc/testsuite/g++.dg/tree-ssa/pr63841.C (.../tags/gcc_4_9_2_release) (wersja 0) +++ gcc/testsuite/g++.dg/tree-ssa/pr63841.C (.../branches/gcc-4_9-branch) (wersja 218777) @@ -0,0 +1,35 @@ +/* { dg-do run } */ +/* { dg-options "-O2" } */ + +#include + +std::string __attribute__ ((noinline)) comp_test_write() { + std::string data; + + for (int i = 0; i < 2; ++i) { + char b = 1 >> (i * 8); + data.append(&b, 1); + } + + return data; +} + +std::string __attribute__ ((noinline)) comp_test_write_good() { + std::string data; + + char b; + for (int i = 0; i < 2; ++i) { + b = 1 >> (i * 8); + data.append(&b, 1); + } + + return data; +} + +int main() { + std::string good = comp_test_write_good(); + std::string bad = comp_test_write(); + + if (good != bad) + __builtin_abort (); +} Index: gcc/testsuite/g++.dg/cpp0x/constexpr-63265.C =================================================================== --- gcc/testsuite/g++.dg/cpp0x/constexpr-63265.C (.../tags/gcc_4_9_2_release) (wersja 0) +++ gcc/testsuite/g++.dg/cpp0x/constexpr-63265.C (.../branches/gcc-4_9-branch) (wersja 218777) @@ -0,0 +1,19 @@ +// PR c++/63265 +// { dg-do compile { target c++11 } } + +#define LSHIFT (sizeof(unsigned int) * __CHAR_BIT__) + +template +struct SpuriouslyWarns1 { + static constexpr unsigned int v = lshift < LSHIFT ? 1U << lshift : 0; +}; + +static_assert(SpuriouslyWarns1::v == 0, "Impossible occurred"); + +template +struct SpuriouslyWarns2 { + static constexpr bool okay = lshift < LSHIFT; + static constexpr unsigned int v = okay ? 1U << lshift : 0; +}; + +static_assert(SpuriouslyWarns2::v == 0, "Impossible occurred"); Index: gcc/testsuite/g++.dg/cpp0x/alias-decl-44.C =================================================================== --- gcc/testsuite/g++.dg/cpp0x/alias-decl-44.C (.../tags/gcc_4_9_2_release) (wersja 0) +++ gcc/testsuite/g++.dg/cpp0x/alias-decl-44.C (.../branches/gcc-4_9-branch) (wersja 218777) @@ -0,0 +1,43 @@ +// PR c++/63849 +// { dg-do compile { target c++11 } } + +template +using First = _T; // we should not use this + // alias with only + // one pack parameter (?) + +template