summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordoko <doko@6ca36cf4-e1d1-0310-8c6f-e303bb2178ca>2015-09-09 17:52:58 +0000
committerdoko <doko@6ca36cf4-e1d1-0310-8c6f-e303bb2178ca>2015-09-09 17:52:58 +0000
commiteb3b8977074440ab09b58268eafbdea0174dc5bd (patch)
treec83fbb4608a5ab41d44571cf2384a6517485240a
parent1778b45e337c6590e2f0b2d44f676715843c5f7f (diff)
downloadgcc-5-eb3b8977074440ab09b58268eafbdea0174dc5bd.tar.gz
* Update to SVN 20150909 (r227597, 5.2.1) from the gcc-5-branch.
- Fix PR c++/67369, ICE on valid code. LP: #1489173. git-svn-id: svn://anonscm.debian.org/gcccvs/branches/sid/gcc-5@8221 6ca36cf4-e1d1-0310-8c6f-e303bb2178ca
-rw-r--r--debian/changelog5
-rw-r--r--debian/patches/pr62258.diff92
-rw-r--r--debian/patches/svn-updates.diff1182
-rw-r--r--debian/rules.patch1
4 files changed, 1165 insertions, 115 deletions
diff --git a/debian/changelog b/debian/changelog
index 9ca3f92..ccaddc7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,8 @@
gcc-5 (5.2.1-17) UNRELEASED; urgency=medium
+ * Update to SVN 20150909 (r227597, 5.2.1) from the gcc-5-branch.
+ - Fix PR c++/67369, ICE on valid code. LP: #1489173.
+
[ Matthias Klose ]
* Build-depend on linux-libc-dev [m68k] for gcc and gcc-snapshot builds.
Closes: #796906.
@@ -15,7 +18,7 @@ gcc-5 (5.2.1-17) UNRELEASED; urgency=medium
* Optimize for R2 ISA on mipsel.
* Only apply mips-fix-loongson2f-nop on mipsel.
- -- Matthias Klose <doko@debian.org> Mon, 07 Sep 2015 21:51:27 +0200
+ -- Matthias Klose <doko@debian.org> Wed, 09 Sep 2015 19:38:13 +0200
gcc-5 (5.2.1-16) unstable; urgency=medium
diff --git a/debian/patches/pr62258.diff b/debian/patches/pr62258.diff
deleted file mode 100644
index bc5cee7..0000000
--- a/debian/patches/pr62258.diff
+++ /dev/null
@@ -1,92 +0,0 @@
-# DP: PR libstdc++/62258, fix for std::uncaught_exception.
-
-libstdc++-v3/
-
-2015-04-27 Dmitry Prokoptsev <dprokoptsev@gmail.com>
- Michael Hanselmann <public@hansmi.ch>
-
- PR libstdc++/62258
- * libsupc++/eh_ptr.cc (rethrow_exception): Increment count of
- uncaught exceptions.
- * testsuite/18_support/exception_ptr/62258.cc: New.
-
-Index: b/src/libstdc++-v3/libsupc++/eh_ptr.cc
-===================================================================
---- a/src/libstdc++-v3/libsupc++/eh_ptr.cc
-+++ b/src/libstdc++-v3/libsupc++/eh_ptr.cc
-@@ -245,6 +245,9 @@ std::rethrow_exception(std::exception_pt
- __GXX_INIT_DEPENDENT_EXCEPTION_CLASS(dep->unwindHeader.exception_class);
- dep->unwindHeader.exception_cleanup = __gxx_dependent_exception_cleanup;
-
-+ __cxa_eh_globals *globals = __cxa_get_globals ();
-+ globals->uncaughtExceptions += 1;
-+
- #ifdef _GLIBCXX_SJLJ_EXCEPTIONS
- _Unwind_SjLj_RaiseException (&dep->unwindHeader);
- #else
-Index: b/src/libstdc++-v3/testsuite/18_support/exception_ptr/62258.cc
-===================================================================
---- /dev/null
-+++ b/src/libstdc++-v3/testsuite/18_support/exception_ptr/62258.cc
-@@ -0,0 +1,61 @@
-+// { dg-options "-std=gnu++11" }
-+// { dg-require-atomic-builtins "" }
-+
-+// Copyright (C) 2015 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library. This library is free
-+// software; you can redistribute it and/or modify it under the
-+// terms of the GNU General Public License as published by the
-+// Free Software Foundation; either version 3, or (at your option)
-+// any later version.
-+
-+// This library is distributed in the hope that it will be useful,
-+// but WITHOUT ANY WARRANTY; without even the implied warranty of
-+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+// GNU General Public License for more details.
-+
-+// You should have received a copy of the GNU General Public License along
-+// with this library; see the file COPYING3. If not see
-+// <http://www.gnu.org/licenses/>.
-+
-+// PR libstdc++/62258
-+
-+#include <exception>
-+#include <testsuite_hooks.h>
-+
-+struct check_on_destruct
-+{
-+ ~check_on_destruct();
-+};
-+
-+check_on_destruct::~check_on_destruct()
-+{
-+ VERIFY(std::uncaught_exception());
-+}
-+
-+int main ()
-+{
-+ VERIFY(!std::uncaught_exception());
-+
-+ try
-+ {
-+ check_on_destruct check;
-+
-+ try
-+ {
-+ throw 1;
-+ }
-+ catch (...)
-+ {
-+ VERIFY(!std::uncaught_exception());
-+
-+ std::rethrow_exception(std::current_exception());
-+ }
-+ }
-+ catch (...)
-+ {
-+ VERIFY(!std::uncaught_exception());
-+ }
-+
-+ VERIFY(!std::uncaught_exception());
-+}
diff --git a/debian/patches/svn-updates.diff b/debian/patches/svn-updates.diff
index 1befccd..80f0c37 100644
--- a/debian/patches/svn-updates.diff
+++ b/debian/patches/svn-updates.diff
@@ -1,10 +1,10 @@
-# DP: updates from the 5 branch upto 20150903 (r227431).
+# DP: updates from the 5 branch upto 20150909 (r227597).
last_update()
{
cat > ${dir}LAST_UPDATED <EOF
-Thu Sep 3 12:02:38 CEST 2015
-Thu Sep 3 10:02:38 UTC 2015 (revision 227431)
+Wed Sep 9 19:35:03 CEST 2015
+Wed Sep 9 17:35:03 UTC 2015 (revision 227597)
EOF
}
@@ -89,6 +89,43 @@ Index: libgomp/config/linux/wait.h
count = gomp_throttled_spin_count_var;
for (i = 0; i < count; i++)
if (__builtin_expect (__atomic_load_n (addr, MEMMODEL_RELAXED) != val, 0))
+Index: libsanitizer/ChangeLog
+===================================================================
+--- a/src/libsanitizer/ChangeLog (.../tags/gcc_5_2_0_release)
++++ b/src/libsanitizer/ChangeLog (.../branches/gcc-5-branch)
+@@ -1,3 +1,8 @@
++2015-09-09 Markus Trippelsdorf <markus@trippelsdorf.de>
++
++ PR sanitizer/67258
++ * ubsan/ubsan_type_hash.cc: Cherry pick upstream r244101.
++
+ 2015-07-16 Release Manager
+
+ * GCC 5.2.0 released.
+Index: libsanitizer/ubsan/ubsan_type_hash.cc
+===================================================================
+--- a/src/libsanitizer/ubsan/ubsan_type_hash.cc (.../tags/gcc_5_2_0_release)
++++ b/src/libsanitizer/ubsan/ubsan_type_hash.cc (.../branches/gcc-5-branch)
+@@ -186,8 +186,8 @@
+
+ struct VtablePrefix {
+ /// The offset from the vptr to the start of the most-derived object.
+- /// This should never be greater than zero, and will usually be exactly
+- /// zero.
++ /// This will only be greater than zero in some virtual base class vtables
++ /// used during object con-/destruction, and will usually be exactly zero.
+ sptr Offset;
+ /// The type_info object describing the most-derived class type.
+ std::type_info *TypeInfo;
+@@ -197,7 +197,7 @@
+ if (!*VptrPtr)
+ return 0;
+ VtablePrefix *Prefix = *VptrPtr - 1;
+- if (Prefix->Offset > 0 || !Prefix->TypeInfo)
++ if (!Prefix->TypeInfo)
+ // This can't possibly be a valid vtable.
+ return 0;
+ return Prefix;
Index: libstdc++-v3/configure
===================================================================
--- a/src/libstdc++-v3/configure (.../tags/gcc_5_2_0_release)
@@ -4488,6 +4525,23 @@ Index: libstdc++-v3/src/c++11/Makefile.in
mostlyclean-generic:
clean-generic:
+Index: libstdc++-v3/src/c++11/codecvt.cc
+===================================================================
+--- a/src/libstdc++-v3/src/c++11/codecvt.cc (.../tags/gcc_5_2_0_release)
++++ b/src/libstdc++-v3/src/c++11/codecvt.cc (.../branches/gcc-5-branch)
+@@ -1264,7 +1264,11 @@
+ {
+ range<const char> from{ __from, __from_end };
+ range<char16_t> to{ __to, __to_end };
+- auto res = utf16_in(from, to, _M_maxcode, _M_mode);
++ codecvt_mode mode = codecvt_mode(_M_mode | (consume_header|generate_header));
++#if __BYTE_ORDER__ != __ORDER_BIG_ENDIAN__
++ mode = codecvt_mode(mode | little_endian);
++#endif
++ auto res = utf16_in(from, to, _M_maxcode, mode);
+ __from_next = from.next;
+ __to_next = to.next;
+ return res;
Index: libstdc++-v3/configure.ac
===================================================================
--- a/src/libstdc++-v3/configure.ac (.../tags/gcc_5_2_0_release)
@@ -4779,6 +4833,19 @@ Index: libstdc++-v3/include/Makefile.in
mostlyclean-generic:
clean-generic:
+Index: libstdc++-v3/include/std/shared_mutex
+===================================================================
+--- a/src/libstdc++-v3/include/std/shared_mutex (.../tags/gcc_5_2_0_release)
++++ b/src/libstdc++-v3/include/std/shared_mutex (.../branches/gcc-5-branch)
+@@ -74,7 +74,7 @@
+ {
+ int __ret = pthread_rwlock_init(&_M_rwlock, NULL);
+ if (__ret == ENOMEM)
+- throw bad_alloc();
++ __throw_bad_alloc();
+ else if (__ret == EAGAIN)
+ __throw_system_error(int(errc::resource_unavailable_try_again));
+ else if (__ret == EPERM)
Index: libstdc++-v3/include/std/iomanip
===================================================================
--- a/src/libstdc++-v3/include/std/iomanip (.../tags/gcc_5_2_0_release)
@@ -5923,6 +5990,76 @@ Index: libstdc++-v3/include/experimental/fs_fwd.h
+#endif // C++11
+
+#endif // _GLIBCXX_EXPERIMENTAL_FS_FWD_H
+Index: libstdc++-v3/include/experimental/functional
+===================================================================
+--- a/src/libstdc++-v3/include/experimental/functional (.../tags/gcc_5_2_0_release)
++++ b/src/libstdc++-v3/include/experimental/functional (.../branches/gcc-5-branch)
+@@ -376,8 +376,11 @@
+
+ /// Generalized negator.
+ template<typename _Fn>
+- struct _Not_fn
++ class _Not_fn
+ {
++ _Fn _M_fn;
++
++ public:
+ template<typename _Fn2>
+ explicit
+ _Not_fn(_Fn2&& __fn) : _M_fn(std::forward<_Fn2>(__fn)) { }
+@@ -389,34 +392,43 @@
+ ~_Not_fn() = default;
+
+ template<typename... _Args>
+- decltype(auto)
++ auto
+ operator()(_Args&&... __args)
++ noexcept(noexcept(!_M_fn(std::forward<_Args>(__args)...)))
++ -> decltype(!_M_fn(std::forward<_Args>(__args)...))
+ { return !_M_fn(std::forward<_Args>(__args)...); }
+
+ template<typename... _Args>
+- decltype(auto)
++ auto
+ operator()(_Args&&... __args) const
++ noexcept(noexcept(!_M_fn(std::forward<_Args>(__args)...)))
++ -> decltype(!_M_fn(std::forward<_Args>(__args)...))
+ { return !_M_fn(std::forward<_Args>(__args)...); }
+
+ template<typename... _Args>
+- decltype(auto)
++ auto
+ operator()(_Args&&... __args) volatile
++ noexcept(noexcept(!_M_fn(std::forward<_Args>(__args)...)))
++ -> decltype(!_M_fn(std::forward<_Args>(__args)...))
+ { return !_M_fn(std::forward<_Args>(__args)...); }
+
+ template<typename... _Args>
+- decltype(auto)
++ auto
+ operator()(_Args&&... __args) const volatile
++ noexcept(noexcept(!_M_fn(std::forward<_Args>(__args)...)))
++ -> decltype(!_M_fn(std::forward<_Args>(__args)...))
+ { return !_M_fn(std::forward<_Args>(__args)...); }
+-
+- private:
+- _Fn _M_fn;
+ };
+
+ /// [func.not_fn] Function template not_fn
+- template <class _Fn>
++ template<typename _Fn>
+ inline auto
+ not_fn(_Fn&& __fn)
+- { return _Not_fn<std::decay_t<_Fn>>{std::forward<_Fn>(__fn)}; }
++ noexcept(std::is_nothrow_constructible<std::decay_t<_Fn>, _Fn&&>::value)
++ {
++ using __maybe_type = _Maybe_wrap_member_pointer<std::decay_t<_Fn>>;
++ return _Not_fn<typename __maybe_type::type>{std::forward<_Fn>(__fn)};
++ }
+
+ _GLIBCXX_END_NAMESPACE_VERSION
+ } // namespace fundamentals_v2
Index: libstdc++-v3/include/experimental/fs_path.h
===================================================================
--- a/src/libstdc++-v3/include/experimental/fs_path.h (.../tags/gcc_5_2_0_release)
@@ -7208,6 +7345,50 @@ Index: libstdc++-v3/include/bits/locale_conv.h
_GLIBCXX_END_NAMESPACE_CXX11
/// Buffer conversions
+Index: libstdc++-v3/include/bits/atomic_futex.h
+===================================================================
+--- a/src/libstdc++-v3/include/bits/atomic_futex.h (.../tags/gcc_5_2_0_release)
++++ b/src/libstdc++-v3/include/bits/atomic_futex.h (.../branches/gcc-5-branch)
+@@ -93,15 +93,15 @@
+ {
+ for (;;)
+ {
+- // Don't bother checking the value again because we expect the caller to
+- // have done it recently.
++ // Don't bother checking the value again because we expect the caller
++ // to have done it recently.
+ // memory_order_relaxed is sufficient because we can rely on just the
+ // modification order (store_notify uses an atomic RMW operation too),
+ // and the futex syscalls synchronize between themselves.
+ _M_data.fetch_or(_Waiter_bit, memory_order_relaxed);
+- bool __ret;
+- __ret = _M_futex_wait_until((unsigned*)(void*)&_M_data,
+- __assumed | _Waiter_bit, __has_timeout, __s, __ns);
++ bool __ret = _M_futex_wait_until((unsigned*)(void*)&_M_data,
++ __assumed | _Waiter_bit,
++ __has_timeout, __s, __ns);
+ // Fetch the current value after waiting (clears _Waiter_bit).
+ __assumed = _M_load(__mo);
+ if (!__ret || ((__operand == __assumed) == __equal))
+@@ -119,7 +119,7 @@
+ bool __equal, memory_order __mo)
+ {
+ return _M_load_and_test_until(__assumed, __operand, __equal, __mo,
+- false, chrono::seconds(0), chrono::nanoseconds(0));
++ false, {}, {});
+ }
+
+ // If a timeout occurs, returns a current value after the timeout;
+@@ -146,7 +146,8 @@
+ _M_load_when_not_equal(unsigned __val, memory_order __mo)
+ {
+ unsigned __i = _M_load(__mo);
+- if ((__i & ~_Waiter_bit) != __val) return;
++ if ((__i & ~_Waiter_bit) != __val)
++ return (__i & ~_Waiter_bit);
+ // TODO Spin-wait first.
+ return _M_load_and_test(__i, __val, false, __mo);
+ }
Index: libstdc++-v3/include/bits/regex_scanner.tcc
===================================================================
--- a/src/libstdc++-v3/include/bits/regex_scanner.tcc (.../tags/gcc_5_2_0_release)
@@ -7394,6 +7575,25 @@ Index: libstdc++-v3/include/bits/quoted_string.h
+
+#endif // C++11
+#endif /* _GLIBCXX_QUOTED_STRING_H */
+Index: libstdc++-v3/include/bits/range_access.h
+===================================================================
+--- a/src/libstdc++-v3/include/bits/range_access.h (.../tags/gcc_5_2_0_release)
++++ b/src/libstdc++-v3/include/bits/range_access.h (.../branches/gcc-5-branch)
+@@ -98,6 +98,14 @@
+ { return __arr + _Nm; }
+
+ #if __cplusplus >= 201402L
++
++ template<typename _Tp> class valarray;
++ // These overloads must be declared for cbegin and cend to use them.
++ template<typename _Tp> _Tp* begin(valarray<_Tp>&);
++ template<typename _Tp> const _Tp* begin(const valarray<_Tp>&);
++ template<typename _Tp> _Tp* end(valarray<_Tp>&);
++ template<typename _Tp> const _Tp* end(const valarray<_Tp>&);
++
+ /**
+ * @brief Return an iterator pointing to the first element of
+ * the const container.
Index: libstdc++-v3/include/bits/regex_compiler.tcc
===================================================================
--- a/src/libstdc++-v3/include/bits/regex_compiler.tcc (.../tags/gcc_5_2_0_release)
@@ -7633,11 +7833,71 @@ Index: libstdc++-v3/libsupc++/Makefile.in
mostlyclean-generic:
clean-generic:
+Index: libstdc++-v3/libsupc++/eh_ptr.cc
+===================================================================
+--- a/src/libstdc++-v3/libsupc++/eh_ptr.cc (.../tags/gcc_5_2_0_release)
++++ b/src/libstdc++-v3/libsupc++/eh_ptr.cc (.../branches/gcc-5-branch)
+@@ -245,6 +245,9 @@
+ __GXX_INIT_DEPENDENT_EXCEPTION_CLASS(dep->unwindHeader.exception_class);
+ dep->unwindHeader.exception_cleanup = __gxx_dependent_exception_cleanup;
+
++ __cxa_eh_globals *globals = __cxa_get_globals ();
++ globals->uncaughtExceptions += 1;
++
+ #ifdef _GLIBCXX_SJLJ_EXCEPTIONS
+ _Unwind_SjLj_RaiseException (&dep->unwindHeader);
+ #else
Index: libstdc++-v3/ChangeLog
===================================================================
--- a/src/libstdc++-v3/ChangeLog (.../tags/gcc_5_2_0_release)
+++ b/src/libstdc++-v3/ChangeLog (.../branches/gcc-5-branch)
-@@ -1,3 +1,144 @@
+@@ -1,3 +1,190 @@
++2015-09-03 Jonathan Wakely <jwakely@redhat.com>
++
++ * include/std/shared_mutex (shared_timed_mutex::shared_timed_mutex):
++ Replace throw with __throw_bad_alloc.
++
++ PR libstdc++/66998
++ * include/experimental/functional (_Not_fn): Add exception
++ specifications and non-deduced return types.
++ (not_fn): Add exception specification and wrap pointer-to-member.
++ * testsuite/experimental/functional/not_fn.cc: Test in SFINAE context
++ and test pointer-to-member.
++
++ Backport from mainline
++ 2015-08-27 Jonathan Wakely <jwakely@redhat.com>
++
++ PR libstdc++/67374
++ * include/bits/range_access.h (valarray, begin, end): Declare.
++ * testsuite/26_numerics/valarray/range_access.cc: Test const
++ overloads.
++ * testsuite/26_numerics/valarray/range_access2.cc: New.
++
++ Backport from mainline
++ 2015-07-24 Jonathan Wakely <jwakely@redhat.com>
++
++ * include/bits/atomic_futex.h [_GLIBCXX_HAVE_LINUX_FUTEX]
++ (_M_load_and_test_until): Whitespace.
++ (_M_load_and_test): Value-initialize the unused durations.
++ (_M_load_when_equal): Add missing return value.
++
++ Backport from mainline
++ 2015-07-13 Jonathan Wakely <jwakely@redhat.com>
++
++ PR libstdc++/66855
++ * src/c++11/codecvt.cc (__codecvt_utf8_utf16_base::do_in): Override
++ endianness bit in mode.
++ * testsuite/22_locale/codecvt/codecvt_utf8_utf16/66855.cc: New.
++
++ Backport from mainline
++ 2015-04-27 Dmitry Prokoptsev <dprokoptsev@gmail.com>
++ Michael Hanselmann <public@hansmi.ch>
++
++ PR libstdc++/62258
++ * libsupc++/eh_ptr.cc (rethrow_exception): Increment count of
++ uncaught exceptions.
++ * testsuite/18_support/exception_ptr/62258.cc: New.
++
+2015-08-28 Tim Shen <timshen@google.com>
+
+ Backport from mainline
@@ -7991,6 +8251,129 @@ Index: libstdc++-v3/testsuite/28_regex/algorithms/regex_match/cstring_bracket_01
+
return 0;
}
+Index: libstdc++-v3/testsuite/18_support/exception_ptr/62258.cc
+===================================================================
+--- a/src/libstdc++-v3/testsuite/18_support/exception_ptr/62258.cc (.../tags/gcc_5_2_0_release)
++++ b/src/libstdc++-v3/testsuite/18_support/exception_ptr/62258.cc (.../branches/gcc-5-branch)
+@@ -0,0 +1,61 @@
++// { dg-options "-std=gnu++11" }
++// { dg-require-atomic-builtins "" }
++
++// Copyright (C) 2015 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 3, or (at your option)
++// any later version.
++
++// This library is distributed in the hope that it will be useful,
++// but WITHOUT ANY WARRANTY; without even the implied warranty of
++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++// GNU General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING3. If not see
++// <http://www.gnu.org/licenses/>.
++
++// PR libstdc++/62258
++
++#include <exception>
++#include <testsuite_hooks.h>
++
++struct check_on_destruct
++{
++ ~check_on_destruct();
++};
++
++check_on_destruct::~check_on_destruct()
++{
++ VERIFY(std::uncaught_exception());
++}
++
++int main ()
++{
++ VERIFY(!std::uncaught_exception());
++
++ try
++ {
++ check_on_destruct check;
++
++ try
++ {
++ throw 1;
++ }
++ catch (...)
++ {
++ VERIFY(!std::uncaught_exception());
++
++ std::rethrow_exception(std::current_exception());
++ }
++ }
++ catch (...)
++ {
++ VERIFY(!std::uncaught_exception());
++ }
++
++ VERIFY(!std::uncaught_exception());
++}
+Index: libstdc++-v3/testsuite/22_locale/codecvt/codecvt_utf8_utf16/66855.cc
+===================================================================
+--- a/src/libstdc++-v3/testsuite/22_locale/codecvt/codecvt_utf8_utf16/66855.cc (.../tags/gcc_5_2_0_release)
++++ b/src/libstdc++-v3/testsuite/22_locale/codecvt/codecvt_utf8_utf16/66855.cc (.../branches/gcc-5-branch)
+@@ -0,0 +1,52 @@
++// Copyright (C) 2015 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 3, or (at your option)
++// any later version.
++
++// This library is distributed in the hope that it will be useful,
++// but WITHOUT ANY WARRANTY; without even the implied warranty of
++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++// GNU General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING3. If not see
++// <http://www.gnu.org/licenses/>.
++
++// { dg-options "-std=gnu++11" }
++
++#include <codecvt>
++#include <testsuite_hooks.h>
++
++void
++test01()
++{
++ std::codecvt_utf8_utf16<char16_t> cvt;
++ char16_t utf16[] = u"\ub098\ub294\ud0dc\uc624";
++ const char16_t* nf16;
++ char utf8[16];
++ char* nt8;
++ std::mbstate_t st{};
++ auto res = cvt.out(st, utf16, utf16+4, nf16, utf8, utf8+16, nt8);
++ VERIFY( res == std::codecvt_base::ok );
++
++ st = {};
++ char16_t buf[4] = {};
++ const char* nf8 = nt8;
++ char16_t* nt16;
++ res = cvt.in(st, utf8, nf8, nf8, buf, buf+4, nt16);
++ VERIFY( res == std::codecvt_base::ok );
++ VERIFY( nt16 == buf+4 );
++ VERIFY( buf[0] == utf16[0] );
++ VERIFY( buf[1] == utf16[1] );
++ VERIFY( buf[2] == utf16[2] );
++ VERIFY( buf[3] == utf16[3] );
++}
++
++int
++main()
++{
++ test01();
++}
Index: libstdc++-v3/testsuite/lib/libstdc++.exp
===================================================================
--- a/src/libstdc++-v3/testsuite/lib/libstdc++.exp (.../tags/gcc_5_2_0_release)
@@ -8075,6 +8458,118 @@ Index: libstdc++-v3/testsuite/lib/dg-options.exp
proc add_options_for_no_pch { flags } {
# This forces any generated and possibly included PCH to be invalid.
return "-D__GLIBCXX__=99999999"
+Index: libstdc++-v3/testsuite/26_numerics/valarray/range_access2.cc
+===================================================================
+--- a/src/libstdc++-v3/testsuite/26_numerics/valarray/range_access2.cc (.../tags/gcc_5_2_0_release)
++++ b/src/libstdc++-v3/testsuite/26_numerics/valarray/range_access2.cc (.../branches/gcc-5-branch)
+@@ -0,0 +1,36 @@
++// { dg-do compile }
++// { dg-options "-std=gnu++14" }
++
++// Copyright (C) 2015 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 3, or (at your option)
++// any later version.
++
++// This library is distributed in the hope that it will be useful,
++// but WITHOUT ANY WARRANTY; without even the implied warranty of
++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++// GNU General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING3. If not see
++// <http://www.gnu.org/licenses/>.
++
++// 26.6.10 valarray range access: [valarray.range]
++
++#include <iterator>
++#include <valarray>
++
++// PR libstdc++/67374
++void
++test01()
++{
++ std::valarray<double> va{1.0, 2.0, 3.0};
++ std::cbegin(va);
++ std::cend(va);
++ const auto& cva = va;
++ std::cbegin(cva);
++ std::cend(cva);
++}
+Index: libstdc++-v3/testsuite/26_numerics/valarray/range_access.cc
+===================================================================
+--- a/src/libstdc++-v3/testsuite/26_numerics/valarray/range_access.cc (.../tags/gcc_5_2_0_release)
++++ b/src/libstdc++-v3/testsuite/26_numerics/valarray/range_access.cc (.../branches/gcc-5-branch)
+@@ -28,4 +28,7 @@
+ std::valarray<double> va{1.0, 2.0, 3.0};
+ std::begin(va);
+ std::end(va);
++ const auto& cva = va;
++ std::begin(cva);
++ std::end(cva);
+ }
+Index: libstdc++-v3/testsuite/experimental/functional/not_fn.cc
+===================================================================
+--- a/src/libstdc++-v3/testsuite/experimental/functional/not_fn.cc (.../tags/gcc_5_2_0_release)
++++ b/src/libstdc++-v3/testsuite/experimental/functional/not_fn.cc (.../branches/gcc-5-branch)
+@@ -20,6 +20,8 @@
+ #include <experimental/functional>
+ #include <testsuite_hooks.h>
+
++using std::experimental::not_fn;
++
+ int func(int, char) { return 0; }
+
+ struct F
+@@ -33,8 +35,6 @@
+ void
+ test01()
+ {
+- using std::experimental::not_fn;
+-
+ auto f1 = not_fn(func);
+ VERIFY( f1(1, '2') == true );
+
+@@ -50,8 +50,36 @@
+ VERIFY( f5(1) == false );
+ }
+
++template<typename F, typename Arg>
++auto foo(F f, Arg arg) -> decltype(not_fn(f)(arg)) { return not_fn(f)(arg); }
++
++template<typename F, typename Arg>
++auto foo(F f, Arg arg) -> decltype(not_fn(f)()) { return not_fn(f)(); }
++
++struct negator
++{
++ bool operator()(int) const { return false; }
++ void operator()() const {}
++};
++
++void
++test02()
++{
++ foo(negator{}, 1); // PR libstdc++/66998
++}
++
++void
++test03()
++{
++ struct X { bool b; };
++ X x{ false };
++ VERIFY( not_fn(&X::b)(x) );
++}
++
+ int
+ main()
+ {
+ test01();
++ test02();
++ test03();
+ }
Index: libstdc++-v3/testsuite/experimental/filesystem/operations/absolute.cc
===================================================================
--- a/src/libstdc++-v3/testsuite/experimental/filesystem/operations/absolute.cc (.../tags/gcc_5_2_0_release)
@@ -11709,6 +12204,20 @@ Index: gcc/tree-chkp.h
extern void chkp_expand_bounds_reset_for_mem (tree mem, tree ptr);
extern tree chkp_insert_retbnd_call (tree bndval, tree retval,
gimple_stmt_iterator *gsi);
+Index: gcc/tree-ssa-uninit.c
+===================================================================
+--- a/src/gcc/tree-ssa-uninit.c (.../tags/gcc_5_2_0_release)
++++ b/src/gcc/tree-ssa-uninit.c (.../branches/gcc-5-branch)
+@@ -1310,7 +1310,8 @@
+ return false;
+
+ c1 = x1.cond_code;
+- if (x1.invert != x2.invert)
++ if (x1.invert != x2.invert
++ && TREE_CODE_CLASS (x2.cond_code) == tcc_comparison)
+ c2 = invert_tree_comparison (x2.cond_code, false);
+ else
+ c2 = x2.cond_code;
Index: gcc/c-family/ChangeLog
===================================================================
--- a/src/gcc/c-family/ChangeLog (.../tags/gcc_5_2_0_release)
@@ -11772,6 +12281,218 @@ Index: gcc/c-family/c-ubsan.c
t = fold_convert_loc (loc, op1_utype, op1);
t = fold_build2 (GT_EXPR, boolean_type_node, t, uprecm1);
+Index: gcc/c/ChangeLog
+===================================================================
+--- a/src/gcc/c/ChangeLog (.../tags/gcc_5_2_0_release)
++++ b/src/gcc/c/ChangeLog (.../branches/gcc-5-branch)
+@@ -1,3 +1,22 @@
++2015-09-09 Jakub Jelinek <jakub@redhat.com>
++
++ PR c/67501
++ * c-parser.c (c_parser_oacc_all_clauses,
++ c_parser_omp_all_clauses): Remove invalid clause from
++ list of clauses even if parser->error is set.
++
++ PR c/67500
++ * c-parser.c (c_parser_omp_clause_aligned,
++ c_parser_omp_clause_safelen, c_parser_omp_clause_simdlen): Fix up
++ test for errors.
++ * c-decl.c (temp_pop_parm_decls): Allow b->decl equal to
++ error_mark_node.
++
++ PR c/67495
++ * c-parser.c (c_parser_omp_atomic): Use c_parser_cast_expression
++ instead of c_parser_unary_expression. If the result is !lvalue_p,
++ wrap the result of c_fully_fold into NON_LVALUE_EXPR.
++
+ 2015-07-16 Release Manager
+
+ * GCC 5.2.0 released.
+Index: gcc/c/c-parser.c
+===================================================================
+--- a/src/gcc/c/c-parser.c (.../tags/gcc_5_2_0_release)
++++ b/src/gcc/c/c-parser.c (.../branches/gcc-5-branch)
+@@ -11185,9 +11185,9 @@
+ tree alignment = c_parser_expr_no_commas (parser, NULL).value;
+ mark_exp_read (alignment);
+ alignment = c_fully_fold (alignment, false, NULL);
+- if (!INTEGRAL_TYPE_P (TREE_TYPE (alignment))
+- && TREE_CODE (alignment) != INTEGER_CST
+- && tree_int_cst_sgn (alignment) != 1)
++ if (TREE_CODE (alignment) != INTEGER_CST
++ || !INTEGRAL_TYPE_P (TREE_TYPE (alignment))
++ || tree_int_cst_sgn (alignment) != 1)
+ {
+ error_at (clause_loc, "%<aligned%> clause alignment expression must "
+ "be positive constant integer expression");
+@@ -11264,9 +11264,9 @@
+ t = c_parser_expr_no_commas (parser, NULL).value;
+ mark_exp_read (t);
+ t = c_fully_fold (t, false, NULL);
+- if (!INTEGRAL_TYPE_P (TREE_TYPE (t))
+- && TREE_CODE (t) != INTEGER_CST
+- && tree_int_cst_sgn (t) != 1)
++ if (TREE_CODE (t) != INTEGER_CST
++ || !INTEGRAL_TYPE_P (TREE_TYPE (t))
++ || tree_int_cst_sgn (t) != 1)
+ {
+ error_at (clause_loc, "%<safelen%> clause expression must "
+ "be positive constant integer expression");
+@@ -11300,9 +11300,9 @@
+ t = c_parser_expr_no_commas (parser, NULL).value;
+ mark_exp_read (t);
+ t = c_fully_fold (t, false, NULL);
+- if (!INTEGRAL_TYPE_P (TREE_TYPE (t))
+- && TREE_CODE (t) != INTEGER_CST
+- && tree_int_cst_sgn (t) != 1)
++ if (TREE_CODE (t) != INTEGER_CST
++ || !INTEGRAL_TYPE_P (TREE_TYPE (t))
++ || tree_int_cst_sgn (t) != 1)
+ {
+ error_at (clause_loc, "%<simdlen%> clause expression must "
+ "be positive constant integer expression");
+@@ -11706,7 +11706,7 @@
+
+ first = false;
+
+- if (((mask >> c_kind) & 1) == 0 && !parser->error)
++ if (((mask >> c_kind) & 1) == 0)
+ {
+ /* Remove the invalid clause(s) from the list to avoid
+ confusing the rest of the compiler. */
+@@ -11935,7 +11935,7 @@
+
+ first = false;
+
+- if (((mask >> c_kind) & 1) == 0 && !parser->error)
++ if (((mask >> c_kind) & 1) == 0)
+ {
+ /* Remove the invalid clause(s) from the list to avoid
+ confusing the rest of the compiler. */
+@@ -12379,6 +12379,7 @@
+ bool structured_block = false;
+ bool swapped = false;
+ bool seq_cst = false;
++ bool non_lvalue_p;
+
+ if (c_parser_next_token_is (parser, CPP_NAME))
+ {
+@@ -12432,20 +12433,33 @@
+ {
+ case OMP_ATOMIC_READ:
+ case NOP_EXPR: /* atomic write */
+- v = c_parser_unary_expression (parser).value;
++ v = c_parser_cast_expression (parser, NULL).value;
++ non_lvalue_p = !lvalue_p (v);
+ v = c_fully_fold (v, false, NULL);
+ if (v == error_mark_node)
+ goto saw_error;
++ if (non_lvalue_p)
++ v = non_lvalue (v);
+ loc = c_parser_peek_token (parser)->location;
+ if (!c_parser_require (parser, CPP_EQ, "expected %<=%>"))
+ goto saw_error;
+ if (code == NOP_EXPR)
+- lhs = c_parser_expression (parser).value;
++ {
++ lhs = c_parser_expression (parser).value;
++ lhs = c_fully_fold (lhs, false, NULL);
++ if (lhs == error_mark_node)
++ goto saw_error;
++ }
+ else
+- lhs = c_parser_unary_expression (parser).value;
+- lhs = c_fully_fold (lhs, false, NULL);
+- if (lhs == error_mark_node)
+- goto saw_error;
++ {
++ lhs = c_parser_cast_expression (parser, NULL).value;
++ non_lvalue_p = !lvalue_p (lhs);
++ lhs = c_fully_fold (lhs, false, NULL);
++ if (lhs == error_mark_node)
++ goto saw_error;
++ if (non_lvalue_p)
++ lhs = non_lvalue (lhs);
++ }
+ if (code == NOP_EXPR)
+ {
+ /* atomic write is represented by OMP_ATOMIC with NOP_EXPR
+@@ -12464,10 +12478,13 @@
+ }
+ else
+ {
+- v = c_parser_unary_expression (parser).value;
++ v = c_parser_cast_expression (parser, NULL).value;
++ non_lvalue_p = !lvalue_p (v);
+ v = c_fully_fold (v, false, NULL);
+ if (v == error_mark_node)
+ goto saw_error;
++ if (non_lvalue_p)
++ v = non_lvalue (v);
+ if (!c_parser_require (parser, CPP_EQ, "expected %<=%>"))
+ goto saw_error;
+ }
+@@ -12480,7 +12497,7 @@
+ old or new x should be captured. */
+ restart:
+ eloc = c_parser_peek_token (parser)->location;
+- expr = c_parser_unary_expression (parser);
++ expr = c_parser_cast_expression (parser, NULL);
+ lhs = expr.value;
+ expr = default_function_array_conversion (eloc, expr);
+ unfolded_lhs = expr.value;
+@@ -12573,6 +12590,8 @@
+ }
+ /* FALLTHRU */
+ default:
++ if (!lvalue_p (unfolded_lhs))
++ lhs = non_lvalue (lhs);
+ switch (c_parser_peek_token (parser)->type)
+ {
+ case CPP_MULT_EQ:
+@@ -12687,14 +12706,17 @@
+ {
+ if (!c_parser_require (parser, CPP_SEMICOLON, "expected %<;%>"))
+ goto saw_error;
+- v = c_parser_unary_expression (parser).value;
++ v = c_parser_cast_expression (parser, NULL).value;
++ non_lvalue_p = !lvalue_p (v);
+ v = c_fully_fold (v, false, NULL);
+ if (v == error_mark_node)
+ goto saw_error;
++ if (non_lvalue_p)
++ v = non_lvalue (v);
+ if (!c_parser_require (parser, CPP_EQ, "expected %<=%>"))
+ goto saw_error;
+ eloc = c_parser_peek_token (parser)->location;
+- expr = c_parser_unary_expression (parser);
++ expr = c_parser_cast_expression (parser, NULL);
+ lhs1 = expr.value;
+ expr = default_function_array_read_conversion (eloc, expr);
+ unfolded_lhs1 = expr.value;
+@@ -12701,6 +12723,8 @@
+ lhs1 = c_fully_fold (lhs1, false, NULL);
+ if (lhs1 == error_mark_node)
+ goto saw_error;
++ if (!lvalue_p (unfolded_lhs1))
++ lhs1 = non_lvalue (lhs1);
+ }
+ if (structured_block)
+ {
+Index: gcc/c/c-decl.c
+===================================================================
+--- a/src/gcc/c/c-decl.c (.../tags/gcc_5_2_0_release)
++++ b/src/gcc/c/c-decl.c (.../branches/gcc-5-branch)
+@@ -8883,7 +8883,8 @@
+ current_scope->bindings = NULL;
+ for (; b; b = free_binding_and_advance (b))
+ {
+- gcc_assert (TREE_CODE (b->decl) == PARM_DECL);
++ gcc_assert (TREE_CODE (b->decl) == PARM_DECL
++ || b->decl == error_mark_node);
+ gcc_assert (I_SYMBOL_BINDING (b->id) == b);
+ I_SYMBOL_BINDING (b->id) = b->shadowed;
+ if (b->shadowed && b->shadowed->u.type)
Index: gcc/lra-int.h
===================================================================
--- a/src/gcc/lra-int.h (.../tags/gcc_5_2_0_release)
@@ -11886,7 +12607,7 @@ Index: gcc/DATESTAMP
+++ b/src/gcc/DATESTAMP (.../branches/gcc-5-branch)
@@ -1 +1 @@
-20150716
-+20150903
++20150909
Index: gcc/postreload.c
===================================================================
--- a/src/gcc/postreload.c (.../tags/gcc_5_2_0_release)
@@ -12351,7 +13072,34 @@ Index: gcc/ChangeLog
===================================================================
--- a/src/gcc/ChangeLog (.../tags/gcc_5_2_0_release)
+++ b/src/gcc/ChangeLog (.../branches/gcc-5-branch)
-@@ -1,3 +1,609 @@
+@@ -1,3 +1,636 @@
++2015-09-09 Marek Polacek <polacek@redhat.com>
++
++ Backport from mainline:
++ 2015-09-09 Marek Polacek <polacek@redhat.com>
++
++ PR middle-end/67512
++ * tree-ssa-uninit.c (pred_equal_p): Only call invert_tree_comparison
++ for comparisons.
++
++2015-09-09 Alan Modra <amodra@gmail.com>
++
++ PR target/67378
++ * config/rs6000/rs6000.c (rs6000_secondary_reload_gpr): Find
++ reload replacement for PRE_MODIFY address reg.
++
++2015-09-07 Ilya Verbin <ilya.verbin@intel.com>
++
++ * config/i386/intelmic-mkoffload.c (prepare_target_image): Handle all
++ non-alphanumeric characters in the symbol name.
++
++2015-09-04 Jakub Jelinek <jakub@redhat.com>
++
++ PR middle-end/67452
++ * tree-ssa-live.c: Include cfgloop.h.
++ (remove_unused_locals): Clear loop->simduid if simduid is about
++ to be removed from cfun->local_decls.
++
+2015-09-03 Richard Biener <rguenther@suse.de>
+
+ PR ipa/66705
@@ -12961,7 +13709,7 @@ Index: gcc/ChangeLog
2015-07-16 Release Manager
* GCC 5.2.0 released.
-@@ -119,8 +725,8 @@
+@@ -119,8 +752,8 @@
2015-07-09 Iain Sandoe <iain@codesourcery.com>
PR target/66523
@@ -14516,6 +15264,116 @@ Index: gcc/testsuite/gfortran.dg/structure_constructor_13.f03
+ end select
+ end subroutine
+end program
+Index: gcc/testsuite/gcc.dg/gomp/pr67500.c
+===================================================================
+--- a/src/gcc/testsuite/gcc.dg/gomp/pr67500.c (.../tags/gcc_5_2_0_release)
++++ b/src/gcc/testsuite/gcc.dg/gomp/pr67500.c (.../branches/gcc-5-branch)
+@@ -0,0 +1,42 @@
++/* PR c/67500 */
++/* { dg-do compile } */
++/* { dg-options "-fopenmp" } */
++
++#pragma omp declare simd simdlen(d) /* { dg-error "clause expression must be positive constant integer expression" } */
++void f1 (int); /* { dg-error "undeclared here" "" { target *-*-* } 5 } */
++#pragma omp declare simd simdlen(0.5) /* { dg-error "clause expression must be positive constant integer expression" } */
++void f2 (int);
++#pragma omp declare simd simdlen(-2) /* { dg-error "clause expression must be positive constant integer expression" } */
++void f3 (int);
++#pragma omp declare simd simdlen(0) /* { dg-error "clause expression must be positive constant integer expression" } */
++void f4 (int);
++
++void
++foo (int *p)
++{
++ int i;
++ #pragma omp simd safelen(d) /* { dg-error "must be positive constant integer expression" } */
++ for (i = 0; i < 16; ++i) /* { dg-error "undeclared" "" { target *-*-* } 18 } */
++ ;
++ #pragma omp simd safelen(0.5) /* { dg-error "must be positive constant integer expression" } */
++ for (i = 0; i < 16; ++i)
++ ;
++ #pragma omp simd safelen(-2) /* { dg-error "must be positive constant integer expression" } */
++ for (i = 0; i < 16; ++i)
++ ;
++ #pragma omp simd safelen(0) /* { dg-error "must be positive constant integer expression" } */
++ for (i = 0; i < 16; ++i)
++ ;
++ #pragma omp simd aligned(p:d) /* { dg-error "must be positive constant integer expression" } */
++ for (i = 0; i < 16; ++i)
++ ;
++ #pragma omp simd aligned(p:0.5) /* { dg-error "must be positive constant integer expression" } */
++ for (i = 0; i < 16; ++i)
++ ;
++ #pragma omp simd aligned(p:-2) /* { dg-error "must be positive constant integer expression" } */
++ for (i = 0; i < 16; ++i)
++ ;
++ #pragma omp simd aligned(p:0) /* { dg-error "must be positive constant integer expression" } */
++ for (i = 0; i < 16; ++i)
++ ;
++}
+Index: gcc/testsuite/gcc.dg/gomp/pr67495.c
+===================================================================
+--- a/src/gcc/testsuite/gcc.dg/gomp/pr67495.c (.../tags/gcc_5_2_0_release)
++++ b/src/gcc/testsuite/gcc.dg/gomp/pr67495.c (.../branches/gcc-5-branch)
+@@ -0,0 +1,38 @@
++/* PR c/67495 */
++/* { dg-do compile } */
++/* { dg-options "-fopenmp" } */
++
++int a, b, c;
++
++void
++foo (void)
++{
++#pragma omp atomic capture
++ a = (float)a + b; /* { dg-error "invalid operator" } */
++#pragma omp atomic read
++ (float) a = b; /* { dg-error "lvalue required" } */
++#pragma omp atomic write
++ (float) a = b; /* { dg-error "lvalue required" } */
++#pragma omp atomic read
++ a = (float) b; /* { dg-error "lvalue required" } */
++#pragma omp atomic capture
++ (float) a = b += c; /* { dg-error "lvalue required" } */
++#pragma omp atomic capture
++ { a += b; (float) c = a; } /* { dg-error "lvalue required" } */
++#pragma omp atomic capture
++ { a += b; c = (float) a; } /* { dg-error "uses two different expressions for memory" } */
++#pragma omp atomic capture
++ a = (int)a + b; /* { dg-error "invalid operator" } */
++#pragma omp atomic read
++ (int) a = b; /* { dg-error "lvalue required" } */
++#pragma omp atomic write
++ (int) a = b; /* { dg-error "lvalue required" } */
++#pragma omp atomic read
++ a = (int) b; /* { dg-error "lvalue required" } */
++#pragma omp atomic capture
++ (int) a = b += c; /* { dg-error "lvalue required" } */
++#pragma omp atomic capture
++ { a += b; (int) c = a; } /* { dg-error "lvalue required" } */
++#pragma omp atomic capture
++ { a += b; c = (int) a; } /* { dg-error "lvalue required" } */
++}
+Index: gcc/testsuite/gcc.dg/pr67512.c
+===================================================================
+--- a/src/gcc/testsuite/gcc.dg/pr67512.c (.../tags/gcc_5_2_0_release)
++++ b/src/gcc/testsuite/gcc.dg/pr67512.c (.../branches/gcc-5-branch)
+@@ -0,0 +1,15 @@
++/* PR middle-end/67512 */
++/* { dg-do compile } */
++/* { dg-options "-O -Wuninitialized" } */
++
++extern int fn2 (void);
++extern int fn3 (int);
++void
++fn1 (void)
++{
++ int z, m;
++ if (1 & m) /* { dg-warning "is used uninitialized" } */
++ z = fn2 ();
++ z = 1 == m ? z : 2 == m;
++ fn3 (z);
++}
Index: gcc/testsuite/gcc.dg/graphite/interchange-15.c
===================================================================
--- a/src/gcc/testsuite/gcc.dg/graphite/interchange-15.c (.../tags/gcc_5_2_0_release)
@@ -15025,6 +15883,34 @@ Index: gcc/testsuite/gcc.dg/lto/chkp-removed-alias_0.c
+{
+ return s.fnptr[argc] (argv[0]);
+}
+Index: gcc/testsuite/gcc.dg/lto/pr67452_0.c
+===================================================================
+--- a/src/gcc/testsuite/gcc.dg/lto/pr67452_0.c (.../tags/gcc_5_2_0_release)
++++ b/src/gcc/testsuite/gcc.dg/lto/pr67452_0.c (.../branches/gcc-5-branch)
+@@ -0,0 +1,23 @@
++/* { dg-lto-do link } */
++/* { dg-lto-options { { -O2 -flto -fopenmp-simd } } } */
++
++float b[3][3];
++
++__attribute__((used, noinline)) void
++foo ()
++{
++ int v1, v2;
++#pragma omp simd collapse(2)
++ for (v1 = 0; v1 < 3; v1++)
++ for (v2 = 0; v2 < 3; v2++)
++ b[v1][v2] = 2.5;
++}
++
++int
++main ()
++{
++ asm volatile ("" : : "g" (b) : "memory");
++ foo ();
++ asm volatile ("" : : "g" (b) : "memory");
++ return 0;
++}
Index: gcc/testsuite/gcc.dg/torture/pr67005.c
===================================================================
--- a/src/gcc/testsuite/gcc.dg/torture/pr67005.c (.../tags/gcc_5_2_0_release)
@@ -15075,7 +15961,39 @@ Index: gcc/testsuite/ChangeLog
===================================================================
--- a/src/gcc/testsuite/ChangeLog (.../tags/gcc_5_2_0_release)
+++ b/src/gcc/testsuite/ChangeLog (.../branches/gcc-5-branch)
-@@ -1,3 +1,410 @@
+@@ -1,3 +1,442 @@
++2015-09-09 Marek Polacek <polacek@redhat.com>
++
++ Backport from mainline:
++ 2015-09-09 Marek Polacek <polacek@redhat.com>
++
++ PR middle-end/67512
++ * gcc.dg/pr67512.c: New test.
++
++2015-09-09 Jakub Jelinek <jakub@redhat.com>
++
++ PR c++/67504
++ * g++.dg/gomp/pr67504.C: New test.
++
++ PR c/67501
++ * c-c++-common/gomp/pr67501.c: New test.
++
++ PR c/67500
++ * gcc.dg/gomp/pr67500.c: New test.
++
++ PR c/67495
++ * gcc.dg/gomp/pr67495.c: New test.
++
++2015-09-08 Paolo Carlini <paolo.carlini@oracle.com>
++
++ PR c++/67369
++ * g++.dg/cpp1y/lambda-generic-ice4.C: New.
++
++2015-09-04 Jakub Jelinek <jakub@redhat.com>
++
++ PR middle-end/67452
++ * gcc.dg/lto/pr67452_0.c: New test.
++
+2015-09-03 Richard Biener <rguenther@suse.de>
+
+ PR ipa/66705
@@ -15486,7 +16404,7 @@ Index: gcc/testsuite/ChangeLog
2015-07-16 Release Manager
* GCC 5.2.0 released.
-@@ -792,7 +1199,7 @@
+@@ -792,7 +1231,7 @@
Add missing ChangeLog entry for r222341.
Backport from trunk r222273
@@ -15495,6 +16413,26 @@ Index: gcc/testsuite/ChangeLog
* gcc.target/i386/avx512bw-vpermi2w-2.c: Fix includes to use actual
headers.
* gcc.target/i386/avx512bw-vpermt2w-2.c: Likewise.
+Index: gcc/testsuite/g++.dg/ubsan/vptr-10.C
+===================================================================
+--- a/src/gcc/testsuite/g++.dg/ubsan/vptr-10.C (.../tags/gcc_5_2_0_release)
++++ b/src/gcc/testsuite/g++.dg/ubsan/vptr-10.C (.../branches/gcc-5-branch)
+@@ -0,0 +1,15 @@
++// { dg-do run }
++// { dg-options "-fsanitize=vptr -fno-sanitize-recover=vptr" }
++
++struct A
++{
++ virtual ~A() {}
++};
++struct B : virtual A {};
++struct C : virtual A {};
++struct D : B, virtual C {};
++
++int main()
++{
++ D d;
++}
Index: gcc/testsuite/g++.dg/pr67211.C
===================================================================
--- a/src/gcc/testsuite/g++.dg/pr67211.C (.../tags/gcc_5_2_0_release)
@@ -15890,6 +16828,21 @@ Index: gcc/testsuite/g++.dg/cpp1y/constexpr-array1.C
+
+constexpr auto bottle_count = make_bottle_count ();
+static_assert (bottle_count[65], "");
+Index: gcc/testsuite/g++.dg/cpp1y/lambda-generic-ice4.C
+===================================================================
+--- a/src/gcc/testsuite/g++.dg/cpp1y/lambda-generic-ice4.C (.../tags/gcc_5_2_0_release)
++++ b/src/gcc/testsuite/g++.dg/cpp1y/lambda-generic-ice4.C (.../branches/gcc-5-branch)
+@@ -0,0 +1,10 @@
++// PR c++/67369
++// { dg-do compile { target c++14 } }
++
++int main() {
++ unsigned const nsz = 0;
++ auto repeat_conditional = [&](auto) {
++ auto new_sz = nsz;
++ };
++ repeat_conditional(1);
++}
Index: gcc/testsuite/g++.dg/cpp1y/var-templ33.C
===================================================================
--- a/src/gcc/testsuite/g++.dg/cpp1y/var-templ33.C (.../tags/gcc_5_2_0_release)
@@ -15987,6 +16940,26 @@ Index: gcc/testsuite/g++.dg/abi/abi-tag15.C
+// PR c++/66748
+
+enum __attribute__((abi_tag("foo"))) E {}; // { dg-error "redeclaration of" }
+Index: gcc/testsuite/g++.dg/gomp/pr67504.C
+===================================================================
+--- a/src/gcc/testsuite/g++.dg/gomp/pr67504.C (.../tags/gcc_5_2_0_release)
++++ b/src/gcc/testsuite/g++.dg/gomp/pr67504.C (.../branches/gcc-5-branch)
+@@ -0,0 +1,15 @@
++// PR c++/67504
++// { dg-do compile }
++// { dg-options "-fopenmp" }
++
++int bar (int);
++double bar (double);
++
++template <typename T>
++void
++foo (T x)
++{
++ #pragma omp for collapse (x + 1) // { dg-error "collapse argument needs positive constant integer expression" }
++ for (int i = 0; i < 10; i++)
++ ;
++}
Index: gcc/testsuite/g++.dg/init/pr66857.C
===================================================================
--- a/src/gcc/testsuite/g++.dg/init/pr66857.C (.../tags/gcc_5_2_0_release)
@@ -16138,6 +17111,23 @@ Index: gcc/testsuite/c-c++-common/ubsan/pr66908.c
+ for (i = 0; i < 22; ++i)
+ res[i] = ((s->a[i] + e[i]) << m);
+}
+Index: gcc/testsuite/c-c++-common/gomp/pr67501.c
+===================================================================
+--- a/src/gcc/testsuite/c-c++-common/gomp/pr67501.c (.../tags/gcc_5_2_0_release)
++++ b/src/gcc/testsuite/c-c++-common/gomp/pr67501.c (.../branches/gcc-5-branch)
+@@ -0,0 +1,12 @@
++/* PR c/67501 */
++/* { dg-do compile } */
++/* { dg-options "-fopenmp" } */
++
++void
++foo (void)
++{
++ int i, j;
++ #pragma omp for simd copyprivate(j /* { dg-error "before end of line" } */
++ for (i = 0; i < 16; ++i) /* { dg-error "is not valid for" "" { target *-*-* } 9 } */
++ ;
++}
Index: gcc/cp/class.c
===================================================================
--- a/src/gcc/cp/class.c (.../tags/gcc_5_2_0_release)
@@ -16272,7 +17262,19 @@ Index: gcc/cp/ChangeLog
===================================================================
--- a/src/gcc/cp/ChangeLog (.../tags/gcc_5_2_0_release)
+++ b/src/gcc/cp/ChangeLog (.../branches/gcc-5-branch)
-@@ -1,3 +1,94 @@
+@@ -1,3 +1,106 @@
++2015-09-09 Jakub Jelinek <jakub@redhat.com>
++
++ PR c++/67504
++ * parser.c (cp_parser_omp_clause_collapse): Test tree_fits_shwi_p
++ before INTEGRAL_TYPE_P test.
++
++2015-09-08 Paolo Carlini <paolo.carlini@oracle.com>
++
++ PR c++/67369
++ * pt.c (tsubst_copy, [case FUNCTION_DECL]): Do not call tsubst
++ if the first argument isn't a template.
++
+2015-08-17 Jason Merrill <jason@redhat.com>
+
+ PR c++/66957
@@ -16440,7 +17442,19 @@ Index: gcc/cp/pt.c
}
layout_decl (r, 0);
-@@ -13138,7 +13159,8 @@
+@@ -13089,8 +13110,9 @@
+ if (r)
+ {
+ /* Make sure that the one we found is the one we want. */
+- tree ctx = tsubst (DECL_CONTEXT (t), args,
+- complain, in_decl);
++ tree ctx = DECL_CONTEXT (t);
++ if (DECL_LANG_SPECIFIC (ctx) && DECL_TEMPLATE_INFO (ctx))
++ ctx = tsubst (ctx, args, complain, in_decl);
+ if (ctx != DECL_CONTEXT (r))
+ r = NULL_TREE;
+ }
+@@ -13138,7 +13160,8 @@
}
else
r = t;
@@ -16450,7 +17464,7 @@ Index: gcc/cp/pt.c
return r;
case NAMESPACE_DECL:
-@@ -14714,7 +14736,20 @@
+@@ -14714,7 +14737,20 @@
if (targs)
targs = tsubst_template_args (targs, args, complain, in_decl);
@@ -16471,7 +17485,7 @@ Index: gcc/cp/pt.c
if (TREE_CODE (templ) == COMPONENT_REF)
{
object = TREE_OPERAND (templ, 0);
-@@ -15826,6 +15861,8 @@
+@@ -15826,6 +15862,8 @@
LAMBDA_EXPR_THIS_CAPTURE (r) = NULL_TREE;
@@ -16480,7 +17494,7 @@ Index: gcc/cp/pt.c
RETURN (build_lambda_object (r));
}
-@@ -16112,6 +16149,8 @@
+@@ -16112,6 +16150,8 @@
/* The DECL_TI_TEMPLATE should always be the immediate parent
template, not the most general template. */
DECL_TI_TEMPLATE (fndecl) = tmpl;
@@ -16529,6 +17543,17 @@ Index: gcc/cp/parser.c
cp_parser_skip_to_end_of_statement (parser);
return expr;
+@@ -28181,8 +28182,8 @@
+ if (num == error_mark_node)
+ return list;
+ num = fold_non_dependent_expr (num);
+- if (!INTEGRAL_TYPE_P (TREE_TYPE (num))
+- || !tree_fits_shwi_p (num)
++ if (!tree_fits_shwi_p (num)
++ || !INTEGRAL_TYPE_P (TREE_TYPE (num))
+ || (n = tree_to_shwi (num)) <= 0
+ || (int) n != n)
+ {
Index: gcc/cp/cvt.c
===================================================================
--- a/src/gcc/cp/cvt.c (.../tags/gcc_5_2_0_release)
@@ -16780,11 +17805,31 @@ Index: gcc/fortran/class.c
final->attr.if_source = expr_null_wrapper ? IFSRC_IFBODY : IFSRC_DECL;
if (ns->proc_name->attr.flavor == FL_MODULE)
final->module = ns->proc_name->name;
+Index: gcc/fortran/error.c
+===================================================================
+--- a/src/gcc/fortran/error.c (.../tags/gcc_5_2_0_release)
++++ b/src/gcc/fortran/error.c (.../branches/gcc-5-branch)
+@@ -804,6 +804,9 @@
+ pp->buffer = this_buffer;
+ pp_clear_output_area (pp);
+ pp->buffer = tmp_buffer;
++ /* We need to reset last_location, otherwise we may skip caret lines
++ when we actually give a diagnostic. */
++ global_dc->last_location = UNKNOWN_LOCATION;
+ }
+
+
Index: gcc/fortran/ChangeLog
===================================================================
--- a/src/gcc/fortran/ChangeLog (.../tags/gcc_5_2_0_release)
+++ b/src/gcc/fortran/ChangeLog (.../branches/gcc-5-branch)
-@@ -1,3 +1,79 @@
+@@ -1,3 +1,85 @@
++2015-09-04 Manuel López-Ibáñez <manu@gcc.gnu.org>
++
++ PR fortran/67429
++ * error.c (gfc_clear_pp_buffer): Reset last_location, otherwise
++ caret lines might be skipped when actually giving a diagnostic.
++
+2015-08-07 Mikael Morin <mikael@gcc.gnu.org>
+
+ PR fortran/66929
@@ -16864,6 +17909,24 @@ Index: gcc/fortran/ChangeLog
2015-07-16 Release Manager
* GCC 5.2.0 released.
+@@ -94,7 +176,7 @@
+ 2015-05-19 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/66052
+- * decl.c(gfc_match_protected): Prevent dereference of NULL pointer.
++ * decl.c(gfc_match_protected): Prevent dereference of NULL pointer.
+
+ 2015-05-19 Steven G. Kargl <kargl@gcc.gnu.org>
+
+@@ -106,7 +188,7 @@
+
+ PR fortran/66044
+ * decl.c(gfc_match_entry): Change a gfc_internal_error() into
+- a gfc_error()
++ a gfc_error()
+
+ 2015-05-19 Steven G. Kargl <kargl@gcc.gnu.org>
+
Index: gcc/fortran/io.c
===================================================================
--- a/src/gcc/fortran/io.c (.../tags/gcc_5_2_0_release)
@@ -18046,6 +19109,33 @@ Index: gcc/cfgexpand.c
break;
case GIMPLE_ASSIGN:
+Index: gcc/tree-ssa-live.c
+===================================================================
+--- a/src/gcc/tree-ssa-live.c (.../tags/gcc_5_2_0_release)
++++ b/src/gcc/tree-ssa-live.c (.../branches/gcc-5-branch)
+@@ -80,6 +80,7 @@
+ #include "ipa-ref.h"
+ #include "cgraph.h"
+ #include "ipa-utils.h"
++#include "cfgloop.h"
+
+ #ifdef ENABLE_CHECKING
+ static void verify_live_on_entry (tree_live_info_p);
+@@ -941,6 +942,14 @@
+ }
+ }
+
++ if (cfun->has_simduid_loops)
++ {
++ struct loop *loop;
++ FOR_EACH_LOOP (loop, 0)
++ if (loop->simduid && !is_used_p (loop->simduid))
++ loop->simduid = NULL_TREE;
++ }
++
+ cfun->has_local_explicit_reg_vars = false;
+
+ /* Remove unmarked local and global vars from local_decls. */
Index: gcc/ipa-prop.c
===================================================================
--- a/src/gcc/ipa-prop.c (.../tags/gcc_5_2_0_release)
@@ -534416,6 +535506,33 @@ Index: gcc/config/i386/sync.md
emit_insn (gen_mem_thread_fence (operands[2]));
DONE;
})
+Index: gcc/config/i386/intelmic-mkoffload.c
+===================================================================
+--- a/src/gcc/config/i386/intelmic-mkoffload.c (.../tags/gcc_5_2_0_release)
++++ b/src/gcc/config/i386/intelmic-mkoffload.c (.../branches/gcc-5-branch)
+@@ -453,17 +453,18 @@
+ fork_execute (objcopy_argv[0], CONST_CAST (char **, objcopy_argv), false);
+
+ /* Objcopy has created symbols, containing the input file name with
+- special characters replaced with '_'. We are going to rename these
+- new symbols. */
++ non-alphanumeric characters replaced by underscores.
++ We are going to rename these new symbols. */
+ size_t symbol_name_len = strlen (target_so_filename);
+ char *symbol_name = XALLOCAVEC (char, symbol_name_len + 1);
+- for (size_t i = 0; i <= symbol_name_len; i++)
++ for (size_t i = 0; i < symbol_name_len; i++)
+ {
+ char c = target_so_filename[i];
+- if ((c == '/') || (c == '.'))
++ if (!ISALNUM (c))
+ c = '_';
+ symbol_name[i] = c;
+ }
++ symbol_name[symbol_name_len] = '\0';
+
+ char *opt_for_objcopy[3];
+ opt_for_objcopy[0] = XALLOCAVEC (char, sizeof ("_binary__start=")
Index: gcc/config/i386/i386.c
===================================================================
--- a/src/gcc/config/i386/i386.c (.../tags/gcc_5_2_0_release)
@@ -535361,7 +536478,30 @@ Index: gcc/config/rs6000/rs6000.c
/* Set the builtin mask of the various options used that could affect which
builtins were used. In the past we used target_flags, but we've run out
of bits, and some options like SPE and PAIRED are no longer in
-@@ -20537,12 +20560,15 @@
+@@ -17678,8 +17701,21 @@
+
+ if (GET_CODE (addr) == PRE_MODIFY)
+ {
++ gcc_assert (REG_P (XEXP (addr, 0))
++ && GET_CODE (XEXP (addr, 1)) == PLUS
++ && XEXP (XEXP (addr, 1), 0) == XEXP (addr, 0));
+ scratch_or_premodify = XEXP (addr, 0);
+- gcc_assert (REG_P (scratch_or_premodify));
++ if (!HARD_REGISTER_P (scratch_or_premodify))
++ /* If we have a pseudo here then reload will have arranged
++ to have it replaced, but only in the original insn.
++ Use the replacement here too. */
++ scratch_or_premodify = find_replacement (&XEXP (addr, 0));
++
++ /* RTL emitted by rs6000_secondary_reload_gpr uses RTL
++ expressions from the original insn, without unsharing them.
++ Any RTL that points into the original insn will of course
++ have register replacements applied. That is why we don't
++ need to look for replacements under the PLUS. */
+ addr = XEXP (addr, 1);
+ }
+ gcc_assert (GET_CODE (addr) == PLUS || GET_CODE (addr) == LO_SUM);
+@@ -20537,12 +20573,15 @@
case MEMMODEL_RELAXED:
case MEMMODEL_CONSUME:
case MEMMODEL_ACQUIRE:
@@ -535377,7 +536517,7 @@ Index: gcc/config/rs6000/rs6000.c
emit_insn (gen_hwsync ());
break;
default:
-@@ -20559,10 +20585,13 @@
+@@ -20559,10 +20598,13 @@
case MEMMODEL_RELAXED:
case MEMMODEL_CONSUME:
case MEMMODEL_RELEASE:
@@ -535391,7 +536531,7 @@ Index: gcc/config/rs6000/rs6000.c
emit_insn (gen_isync ());
break;
default:
-@@ -20662,8 +20691,8 @@
+@@ -20662,8 +20704,8 @@
oldval = operands[3];
newval = operands[4];
is_weak = (INTVAL (operands[5]) != 0);
@@ -535402,7 +536542,7 @@ Index: gcc/config/rs6000/rs6000.c
orig_mode = mode = GET_MODE (mem);
mask = shift = NULL_RTX;
-@@ -20751,12 +20780,12 @@
+@@ -20751,12 +20793,12 @@
emit_unlikely_jump (x, label1);
}
@@ -535417,7 +536557,7 @@ Index: gcc/config/rs6000/rs6000.c
emit_label (XEXP (label2, 0));
if (shift)
-@@ -22311,6 +22340,7 @@
+@@ -22311,6 +22353,7 @@
|| ((DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_ELFv2)
&& decl
&& !DECL_EXTERNAL (decl)
@@ -535425,7 +536565,7 @@ Index: gcc/config/rs6000/rs6000.c
&& (*targetm.binds_local_p) (decl))
|| (DEFAULT_ABI == ABI_V4
&& (!TARGET_SECURE_PLT
-@@ -32274,6 +32304,8 @@
+@@ -32274,6 +32317,8 @@
{ "crypto", OPTION_MASK_CRYPTO, false, true },
{ "direct-move", OPTION_MASK_DIRECT_MOVE, false, true },
{ "dlmzb", OPTION_MASK_DLMZB, false, true },
diff --git a/debian/rules.patch b/debian/rules.patch
index d4c427f..d147709 100644
--- a/debian/rules.patch
+++ b/debian/rules.patch
@@ -78,7 +78,6 @@ debian_patches += \
libitm-no-fortify-source \
sparc64-biarch-long-double-128 \
gcc-ia64-bootstrap-ignore \
- pr62258 \
gotools-configury \
go-escape-analysis \
go-escape-analysis2 \