[gcc-6] 240/401: * Update to SVN 20161026 (r241546, 6.2.1) from the gcc-6-branch.
Ximin Luo
infinity0 at debian.org
Wed Apr 5 15:49:48 UTC 2017
This is an automated email from the git hooks/post-receive script.
infinity0 pushed a commit to branch pu/reproducible_builds
in repository gcc-6.
commit 70a5a4a2d48d17b05f09dfac961ff41c784f722e
Author: doko <doko at 6ca36cf4-e1d1-0310-8c6f-e303bb2178ca>
Date: Thu Oct 27 12:17:04 2016 +0000
* Update to SVN 20161026 (r241546, 6.2.1) from the gcc-6-branch.
git-svn-id: svn://anonscm.debian.org/gcccvs/branches/sid/gcc-6@9015 6ca36cf4-e1d1-0310-8c6f-e303bb2178ca
---
debian/changelog | 5 +
debian/patches/svn-updates.diff | 2607 ++++++++++++++++++++++++++++++++++++++-
2 files changed, 2570 insertions(+), 42 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 1511c92..4e02611 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,10 @@
gcc-6 (6.2.0-10) UNRELEASED; urgency=medium
+ * Update to SVN 20161026 (r241546, 6.2.1) from the gcc-6-branch.
+ - Fix PR libstdc++/77288, PR libstdc++/77727, PR libstdc++/78052,
+ PR tree-optimization/77550, PR tree-optimization/77916,
+ PR fortran/71895, PR fortran/77763, PR fortran/61420, PR fortran/78013,
+ PR fortran/78021, PR fortran/72832.
* Include go-relocation-test-gcc620-sparc64.obj.uue to fix libgo's
debug/elf TestDWARFRelocations test case (James Clark).
diff --git a/debian/patches/svn-updates.diff b/debian/patches/svn-updates.diff
index 65d2f01..b7ce70f 100644
--- a/debian/patches/svn-updates.diff
+++ b/debian/patches/svn-updates.diff
@@ -1,10 +1,10 @@
-# DP: updates from the 6 branch upto 20161019 (r241346).
+# DP: updates from the 6 branch upto 20161026 (r241546).
last_update()
{
cat > ${dir}LAST_UPDATED <EOF
-Wed Oct 19 17:55:55 CEST 2016
-Wed Oct 19 15:55:55 UTC 2016 (revision 241346)
+Wed Oct 26 11:25:03 CEST 2016
+Wed Oct 26 09:25:03 UTC 2016 (revision 241546)
EOF
}
@@ -1155,6 +1155,280 @@ Index: libstdc++-v3/include/experimental/optional
namespace std _GLIBCXX_VISIBILITY(default)
{
+@@ -213,12 +214,6 @@
+ : _Optional_base{} { }
+
+ // Constructors for engaged optionals.
+- constexpr _Optional_base(const _Tp& __t)
+- : _M_payload(__t), _M_engaged(true) { }
+-
+- constexpr _Optional_base(_Tp&& __t)
+- : _M_payload(std::move(__t)), _M_engaged(true) { }
+-
+ template<typename... _Args>
+ constexpr explicit _Optional_base(in_place_t, _Args&&... __args)
+ : _M_payload(std::forward<_Args>(__args)...), _M_engaged(true) { }
+@@ -355,12 +350,6 @@
+ constexpr _Optional_base(nullopt_t) noexcept
+ : _Optional_base{} { }
+
+- constexpr _Optional_base(const _Tp& __t)
+- : _M_payload(__t), _M_engaged(true) { }
+-
+- constexpr _Optional_base(_Tp&& __t)
+- : _M_payload(std::move(__t)), _M_engaged(true) { }
+-
+ template<typename... _Args>
+ constexpr explicit _Optional_base(in_place_t, _Args&&... __args)
+ : _M_payload(std::forward<_Args>(__args)...), _M_engaged(true) { }
+@@ -473,20 +462,24 @@
+ template<typename _Tp>
+ class optional;
+
+- template<typename>
+- struct __is_optional_impl : false_type
+- { };
++ template<typename _Tp, typename _Up>
++ using __converts_from_optional =
++ __or_<is_constructible<_Tp, const optional<_Up>&>,
++ is_constructible<_Tp, optional<_Up>&>,
++ is_constructible<_Tp, const optional<_Up>&&>,
++ is_constructible<_Tp, optional<_Up>&&>,
++ is_convertible<const optional<_Up>&, _Tp>,
++ is_convertible<optional<_Up>&, _Tp>,
++ is_convertible<const optional<_Up>&&, _Tp>,
++ is_convertible<optional<_Up>&&, _Tp>>;
+
+- template<typename _Tp>
+- struct __is_optional_impl<optional<_Tp>> : true_type
+- { };
++ template<typename _Tp, typename _Up>
++ using __assigns_from_optional =
++ __or_<is_assignable<_Tp&, const optional<_Up>&>,
++ is_assignable<_Tp&, optional<_Up>&>,
++ is_assignable<_Tp&, const optional<_Up>&&>,
++ is_assignable<_Tp&, optional<_Up>&&>>;
+
+- template<typename _Tp>
+- struct __is_optional
+- : public __is_optional_impl<std::remove_cv_t<std::remove_reference_t<_Tp>>>
+- { };
+-
+-
+ /**
+ * @brief Class template for optional values.
+ */
+@@ -521,75 +514,75 @@
+
+ constexpr optional() = default;
+ // Converting constructors for engaged optionals.
+- template <typename _Up,
++ template <typename _Up = _Tp,
+ enable_if_t<__and_<
+- __not_<is_same<_Tp, _Up>>,
++ __not_<is_same<optional<_Tp>, decay_t<_Up>>>,
+ is_constructible<_Tp, _Up&&>,
+ is_convertible<_Up&&, _Tp>
+ >::value, bool> = true>
+ constexpr optional(_Up&& __t)
+- : _Base(_Tp(std::forward<_Up>(__t))) { }
++ : _Base(in_place, std::forward<_Up>(__t)) { }
+
+- template <typename _Up,
++ template <typename _Up = _Tp,
+ enable_if_t<__and_<
+- __not_<is_same<_Tp, _Up>>,
+- is_constructible<_Tp, _Up&&>,
+- __not_<is_convertible<_Up&&, _Tp>>
+- >::value, bool> = false>
++ __not_<is_same<optional<_Tp>, decay_t<_Up>>>,
++ is_constructible<_Tp, _Up&&>,
++ __not_<is_convertible<_Up&&, _Tp>>
++ >::value, bool> = false>
+ explicit constexpr optional(_Up&& __t)
+- : _Base(_Tp(std::forward<_Up>(__t))) { }
++ : _Base(in_place, std::forward<_Up>(__t)) { }
+
+ template <typename _Up,
+ enable_if_t<__and_<
+ __not_<is_same<_Tp, _Up>>,
+- __not_<is_constructible<
+- _Tp, const optional<_Up>&>>,
+- __not_<is_convertible<
+- const optional<_Up>&, _Tp>>,
+ is_constructible<_Tp, const _Up&>,
+- is_convertible<const _Up&, _Tp>
++ is_convertible<const _Up&, _Tp>,
++ __not_<__converts_from_optional<_Tp, _Up>>
+ >::value, bool> = true>
+ constexpr optional(const optional<_Up>& __t)
+- : _Base(__t ? optional<_Tp>(*__t) : optional<_Tp>()) { }
++ {
++ if (__t)
++ emplace(*__t);
++ }
+
+ template <typename _Up,
+ enable_if_t<__and_<
+ __not_<is_same<_Tp, _Up>>,
+- __not_<is_constructible<
+- _Tp, const optional<_Up>&>>,
+- __not_<is_convertible<
+- const optional<_Up>&, _Tp>>,
+ is_constructible<_Tp, const _Up&>,
+- __not_<is_convertible<const _Up&, _Tp>>
++ __not_<is_convertible<const _Up&, _Tp>>,
++ __not_<__converts_from_optional<_Tp, _Up>>
+ >::value, bool> = false>
+ explicit constexpr optional(const optional<_Up>& __t)
+- : _Base(__t ? optional<_Tp>(*__t) : optional<_Tp>()) { }
++ {
++ if (__t)
++ emplace(*__t);
++ }
+
+ template <typename _Up,
+ enable_if_t<__and_<
+ __not_<is_same<_Tp, _Up>>,
+- __not_<is_constructible<
+- _Tp, optional<_Up>&&>>,
+- __not_<is_convertible<
+- optional<_Up>&&, _Tp>>,
+ is_constructible<_Tp, _Up&&>,
+- is_convertible<_Up&&, _Tp>
++ is_convertible<_Up&&, _Tp>,
++ __not_<__converts_from_optional<_Tp, _Up>>
+ >::value, bool> = true>
+ constexpr optional(optional<_Up>&& __t)
+- : _Base(__t ? optional<_Tp>(std::move(*__t)) : optional<_Tp>()) { }
++ {
++ if (__t)
++ emplace(std::move(*__t));
++ }
+
+ template <typename _Up,
+ enable_if_t<__and_<
+ __not_<is_same<_Tp, _Up>>,
+- __not_<is_constructible<
+- _Tp, optional<_Up>&&>>,
+- __not_<is_convertible<
+- optional<_Up>&&, _Tp>>,
+ is_constructible<_Tp, _Up&&>,
+- __not_<is_convertible<_Up&&, _Tp>>
++ __not_<is_convertible<_Up&&, _Tp>>,
++ __not_<__converts_from_optional<_Tp, _Up>>
+ >::value, bool> = false>
+ explicit constexpr optional(optional<_Up>&& __t)
+- : _Base(__t ? optional<_Tp>(std::move(*__t)) : optional<_Tp>()) { }
++ {
++ if (__t)
++ emplace(std::move(*__t));
++ }
+
+ // [X.Y.4.3] (partly) Assignment.
+ optional&
+@@ -599,18 +592,16 @@
+ return *this;
+ }
+
+- template<typename _Up,
+- enable_if_t<__and_<
+- __not_<is_same<_Up, nullopt_t>>,
+- __not_<__is_optional<_Up>>>::value,
+- bool> = true>
+- optional&
++ template<typename _Up = _Tp>
++ enable_if_t<__and_<
++ __not_<is_same<optional<_Tp>, decay_t<_Up>>>,
++ is_constructible<_Tp, _Up>,
++ __not_<__and_<is_scalar<_Tp>,
++ is_same<_Tp, decay_t<_Up>>>>,
++ is_assignable<_Tp&, _Up>>::value,
++ optional&>
+ operator=(_Up&& __u)
+ {
+- static_assert(__and_<is_constructible<_Tp, _Up>,
+- is_assignable<_Tp&, _Up>>(),
+- "Cannot assign to value type from argument");
+-
+ if (this->_M_is_engaged())
+ this->_M_get() = std::forward<_Up>(__u);
+ else
+@@ -619,17 +610,17 @@
+ return *this;
+ }
+
+- template<typename _Up,
+- enable_if_t<__and_<
+- __not_<is_same<_Tp, _Up>>>::value,
+- bool> = true>
+- optional&
++ template<typename _Up>
++ enable_if_t<__and_<
++ __not_<is_same<_Tp, _Up>>,
++ is_constructible<_Tp, const _Up&>,
++ is_assignable<_Tp&, _Up>,
++ __not_<__converts_from_optional<_Tp, _Up>>,
++ __not_<__assigns_from_optional<_Tp, _Up>>
++ >::value,
++ optional&>
+ operator=(const optional<_Up>& __u)
+ {
+- static_assert(__and_<is_constructible<_Tp, _Up>,
+- is_assignable<_Tp&, _Up>>(),
+- "Cannot assign to value type from argument");
+-
+ if (__u)
+ {
+ if (this->_M_is_engaged())
+@@ -644,17 +635,17 @@
+ return *this;
+ }
+
+- template<typename _Up,
+- enable_if_t<__and_<
+- __not_<is_same<_Tp, _Up>>>::value,
+- bool> = true>
+- optional&
++ template<typename _Up>
++ enable_if_t<__and_<
++ __not_<is_same<_Tp, _Up>>,
++ is_constructible<_Tp, _Up>,
++ is_assignable<_Tp&, _Up>,
++ __not_<__converts_from_optional<_Tp, _Up>>,
++ __not_<__assigns_from_optional<_Tp, _Up>>
++ >::value,
++ optional&>
+ operator=(optional<_Up>&& __u)
+ {
+- static_assert(__and_<is_constructible<_Tp, _Up>,
+- is_assignable<_Tp&, _Up>>(),
+- "Cannot assign to value type from argument");
+-
+ if (__u)
+ {
+ if (this->_M_is_engaged())
+@@ -671,18 +662,15 @@
+ }
+
+ template<typename... _Args>
+- void
++ enable_if_t<is_constructible<_Tp, _Args&&...>::value>
+ emplace(_Args&&... __args)
+ {
+- static_assert(is_constructible<_Tp, _Args&&...>(),
+- "Cannot emplace value type from arguments");
+-
+ this->_M_reset();
+ this->_M_construct(std::forward<_Args>(__args)...);
+ }
+
+ template<typename _Up, typename... _Args>
+- enable_if_t<is_constructible<_Tp, initializer_list<_Up>&,
++ enable_if_t<is_constructible<_Tp, initializer_list<_Up>&,
+ _Args&&...>::value>
+ emplace(initializer_list<_Up> __il, _Args&&... __args)
+ {
Index: libstdc++-v3/include/experimental/algorithm
===================================================================
--- a/src/libstdc++-v3/include/experimental/algorithm (.../tags/gcc_6_2_0_release)
@@ -2272,6 +2546,26 @@ Index: libstdc++-v3/include/bits/regex.h
void
_M_resize(unsigned int __size)
+Index: libstdc++-v3/include/bits/allocator.h
+===================================================================
+--- a/src/libstdc++-v3/include/bits/allocator.h (.../tags/gcc_6_2_0_release)
++++ b/src/libstdc++-v3/include/bits/allocator.h (.../branches/gcc-6-branch)
+@@ -82,6 +82,15 @@
+
+ #define __cpp_lib_allocator_is_always_equal 201411
+ typedef true_type is_always_equal;
++
++ template<typename _Up, typename... _Args>
++ void
++ construct(_Up* __p, _Args&&... __args)
++ { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
++
++ template<typename _Up>
++ void
++ destroy(_Up* __p) { __p->~_Up(); }
+ #endif
+ };
+
Index: libstdc++-v3/include/bits/stl_tree.h
===================================================================
--- a/src/libstdc++-v3/include/bits/stl_tree.h (.../tags/gcc_6_2_0_release)
@@ -2386,7 +2680,40 @@ Index: libstdc++-v3/ChangeLog
===================================================================
--- a/src/libstdc++-v3/ChangeLog (.../tags/gcc_6_2_0_release)
+++ b/src/libstdc++-v3/ChangeLog (.../branches/gcc-6-branch)
-@@ -1,3 +1,341 @@
+@@ -1,3 +1,374 @@
++2016-10-24 Ville Voutilainen <ville.voutilainen at gmail.com>
++
++ Backport from mainline:
++
++ 2016-10-24 Ville Voutilainen <ville.voutilainen at gmail.com>
++ Cross-port the latest resolution of LWG2756 and some
++ bug-fixes to experimental::optional.
++ PR libstdc++/77288
++ PR libstdc++/77727
++ * include/experimental/optional (_Optional_base):
++ Remove constructors that take a _Tp.
++ (__is_optional_impl, __is_optional): Remove.
++ (__converts_from_optional): New.
++ (optional(_Up&&)): Fix constraints, call base with in_place.
++ (optional(const optional<_Up>&)): Fix constraints, use emplace.
++ (optional(optional<_Up>&&)): Likewise.
++ (operator=(_Up&&)): Fix constraints.
++ (operator=(const optional<_Up>&)): Likewise.
++ (operator=(optional<_Up>&&)): Likewise.
++ (emplace(_Args&&...)): Constrain.
++ (emplace(initializer_list<_Up>, _Args&&...)): Likewise.
++ * testsuite/experimental/optional/77288.cc: New.
++ * testsuite/experimental/optional/assignment/5.cc: Adjust.
++ * testsuite/experimental/optional/cons/77727.cc: New.
++ * testsuite/experimental/optional/cons/value.cc: Adjust.
++
++2016-10-20 Jonathan Wakely <jwakely at redhat.com>
++
++ PR libstdc++/78052
++ * include/bits/allocator.h (allocator<void>::construct)
++ (allocator<void>::destroy): Define.
++ * testsuite/20_util/allocator/void.cc: New test.
++
+2016-10-19 Jonathan Wakely <jwakely at redhat.com>
+
+ * testsuite/20_util/unique_ptr/cons/cv_qual.cc: Move negative tests
@@ -3094,6 +3421,537 @@ Index: libstdc++-v3/testsuite/26_numerics/random/default_random_engine.cc
}
int main()
+Index: libstdc++-v3/testsuite/experimental/optional/cons/value.cc
+===================================================================
+--- a/src/libstdc++-v3/testsuite/experimental/optional/cons/value.cc (.../tags/gcc_6_2_0_release)
++++ b/src/libstdc++-v3/testsuite/experimental/optional/cons/value.cc (.../branches/gcc-6-branch)
+@@ -255,4 +255,31 @@
+ std::experimental::optional<X> ox4;
+ ox4 = oi;
+ }
++
++ {
++ std::experimental::optional<std::experimental::optional<int>> ooi =
++ std::experimental::optional<int>();
++ VERIFY(bool(ooi));
++ ooi = std::experimental::optional<int>();
++ VERIFY(bool(ooi));
++ ooi = std::experimental::optional<int>(42);
++ VERIFY(bool(ooi));
++ VERIFY(bool(*ooi));
++ std::experimental::optional<std::experimental::optional<int>> ooi2 =
++ std::experimental::optional<short>();
++ VERIFY(bool(ooi2));
++ ooi2 = std::experimental::optional<short>();
++ VERIFY(bool(ooi2));
++ ooi2 = std::experimental::optional<short>(6);
++ VERIFY(bool(ooi2));
++ VERIFY(bool(*ooi2));
++ std::experimental::optional<std::experimental::optional<int>> ooi3 =
++ std::experimental::optional<int>(42);
++ VERIFY(bool(ooi3));
++ VERIFY(bool(*ooi3));
++ std::experimental::optional<std::experimental::optional<int>> ooi4 =
++ std::experimental::optional<short>(6);
++ VERIFY(bool(ooi4));
++ VERIFY(bool(*ooi4));
++ }
+ }
+Index: libstdc++-v3/testsuite/experimental/optional/cons/77727.cc
+===================================================================
+--- a/src/libstdc++-v3/testsuite/experimental/optional/cons/77727.cc (.../tags/gcc_6_2_0_release)
++++ b/src/libstdc++-v3/testsuite/experimental/optional/cons/77727.cc (.../branches/gcc-6-branch)
+@@ -0,0 +1,51 @@
++// { dg-options "-std=gnu++14" }
++// { dg-do run }
++
++// Copyright (C) 2016 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 moved_to of the GNU General Public License along
++// with this library; see the file COPYING3. If not see
++// <http://www.gnu.org/licenses/>.
++
++#include <experimental/optional>
++#include <testsuite_hooks.h>
++
++
++struct NonTransferable
++{
++ int x;
++ NonTransferable(int x) : x(x) {}
++ NonTransferable(NonTransferable&&) = delete;
++ NonTransferable& operator=(NonTransferable&&) = delete;
++ operator int() {return x;}
++};
++
++int main()
++{
++ std::experimental::optional<int> oi;
++ std::experimental::optional<NonTransferable> ot(std::move(oi));
++ VERIFY(!ot);
++
++ std::experimental::optional<int> oi2;
++ std::experimental::optional<NonTransferable> ot2(oi2);
++ VERIFY(!ot);
++
++ std::experimental::optional<int> oi3{42};
++ std::experimental::optional<NonTransferable> ot3(std::move(oi3));
++ VERIFY(ot3 && *ot3 == 42);
++
++ std::experimental::optional<int> oi4{666};
++ std::experimental::optional<NonTransferable> ot4(oi4);
++ VERIFY(ot4 && *ot4 == 666);
++}
+Index: libstdc++-v3/testsuite/experimental/optional/77288.cc
+===================================================================
+--- a/src/libstdc++-v3/testsuite/experimental/optional/77288.cc (.../tags/gcc_6_2_0_release)
++++ b/src/libstdc++-v3/testsuite/experimental/optional/77288.cc (.../branches/gcc-6-branch)
+@@ -0,0 +1,406 @@
++// { dg-options "-std=gnu++14" }
++// { dg-do run }
++
++// Copyright (C) 2016 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 moved_to of the GNU General Public License along
++// with this library; see the file COPYING3. If not see
++// <http://www.gnu.org/licenses/>.
++
++#include <experimental/optional>
++#include <experimental/any>
++
++using std::experimental::optional;
++
++#include <testsuite_hooks.h>
++
++void test01()
++{
++ optional<optional<int>> nested_element;
++ optional<int> element = {};
++ nested_element = element;
++ VERIFY(nested_element);
++}
++
++template <class T>
++struct service_result
++{
++ static optional<T> get_result()
++ {
++ T sr;
++ return sr;
++ }
++
++ static optional<T> get_result_with_cond(bool cond)
++ {
++ if (cond)
++ return T{};
++ return {};
++ }
++};
++
++void test02()
++{
++ VERIFY(service_result<int>::get_result());
++ VERIFY(service_result<optional<int>>::get_result());
++ VERIFY(service_result<int>::get_result_with_cond(true));
++ VERIFY(service_result<optional<int>>::get_result_with_cond(true));
++ VERIFY(!service_result<int>::get_result_with_cond(false));
++ VERIFY(!service_result<optional<int>>::get_result_with_cond(false));
++}
++
++struct Widget
++{
++ Widget(int) {}
++ Widget(optional<int>) {}
++};
++
++
++void test03()
++{
++ optional<Widget> w;
++ w = optional<int>();
++ VERIFY(w);
++ static_assert(!std::is_assignable<optional<Widget>&,
++ optional<short>>::value);
++ w = optional<optional<int>>();
++ VERIFY(!w);
++ static_assert(!std::is_assignable<optional<Widget>&,
++ optional<optional<short>>>::value);
++
++ optional<Widget> w2{optional<int>()};
++ VERIFY(w2);
++ optional<Widget> w3 = optional<int>();
++ VERIFY(w3);
++ optional<Widget> w4{optional<short>()};
++ VERIFY(w4);
++ static_assert(!std::is_convertible<optional<short>&&,
++ optional<Widget>>::value);
++
++ optional<Widget> w6{optional<optional<int>>()};
++ VERIFY(!w6);
++ optional<Widget> w7 = optional<optional<int>>();
++ VERIFY(!w7);
++ optional<Widget> w8{optional<optional<short>>()};
++ VERIFY(!w8);
++ static_assert(!std::is_convertible<optional<optional<short>>&&,
++ optional<Widget>>::value);
++ optional<Widget> w10{optional<optional<short>>(10)};
++ VERIFY(w10);
++ optional<Widget> w11 = std::experimental::nullopt;
++ VERIFY(!w11);
++ optional<Widget> w12 = {};
++ VERIFY(!w12);
++ optional<Widget> w13{std::experimental::nullopt};
++ VERIFY(!w13);
++ optional<Widget> w14;
++ w14 = {};
++ VERIFY(!w14);
++}
++
++struct Widget2
++{
++ Widget2(int) {}
++ Widget2(optional<int>) {}
++ Widget2& operator=(int) {return *this;}
++ Widget2& operator=(optional<int>) {return *this;}
++};
++
++void test04()
++{
++ optional<Widget2> w;
++ w = optional<int>();
++ VERIFY(w);
++ w = optional<short>();
++ VERIFY(w);
++ w = optional<optional<int>>();
++ VERIFY(!w);
++ w = optional<optional<short>>();
++ VERIFY(!w);
++ w = optional<optional<short>>(10);
++ optional<Widget2> w2 = std::experimental::nullopt;
++ VERIFY(!w2);
++ optional<Widget2> w3 = {};
++ VERIFY(!w3);
++ optional<Widget2> w4{std::experimental::nullopt};
++ VERIFY(!w4);
++ optional<Widget2> w5;
++ w5 = {};
++ VERIFY(!w5);
++}
++
++struct Thingy
++{
++ Thingy(int) {}
++ Thingy(Widget) {}
++};
++
++void test05()
++{
++ optional<Thingy> ot;
++
++ static_assert(!std::is_assignable<optional<Thingy>&,
++ optional<int>>::value);
++ static_assert(std::is_assignable<optional<Thingy>&,
++ optional<short>>::value);
++ static_assert(!std::is_assignable<optional<Thingy>&,
++ optional<optional<int>>>::value);
++ ot = optional<Widget>();
++ VERIFY(!ot);
++ optional<Thingy> ot2{optional<int>()};
++ VERIFY(ot2);
++ static_assert(!std::is_convertible<optional<int>&&,
++ optional<Thingy>>::value);
++ optional<Thingy> ot3{optional<short>()};
++ VERIFY(!ot3);
++ optional<Thingy> ot4 = optional<short>();
++ VERIFY(!ot4);
++
++ optional<Thingy> ot5{optional<optional<int>>()};
++ VERIFY(!ot5);
++ static_assert(!std::is_convertible<optional<optional<int>>&&,
++ optional<Thingy>>::value);
++
++ optional<Thingy> ot7{optional<Widget>()};
++ VERIFY(!ot7);
++ optional<Thingy> ot8 = optional<Widget>();
++ VERIFY(!ot8);
++ static_assert(!std::is_constructible<optional<Thingy>,
++ optional<optional<short>>>::value);
++ static_assert(!std::is_convertible<optional<optional<short>>,
++ optional<Thingy>>::value);
++ static_assert(!std::is_assignable<optional<Thingy>&,
++ optional<optional<short>>>::value);
++ optional<Thingy> ot9 = std::experimental::nullopt;
++ VERIFY(!ot9);
++ optional<Thingy> ot10 = {};
++ VERIFY(!ot10);
++ optional<Thingy> ot11{std::experimental::nullopt};
++ VERIFY(!ot11);
++ optional<Thingy> ot12;
++ ot12 = {};
++ VERIFY(!ot12);
++}
++
++struct RvalueConstructible
++{
++ RvalueConstructible(int) {}
++ RvalueConstructible(optional<int>&&) {}
++};
++
++void test06()
++{
++ optional<int> oi;
++ optional<RvalueConstructible> ori;
++ static_assert(!std::is_assignable<optional<RvalueConstructible>&,
++ optional<int>&>::value);
++ ori = std::move(oi);
++ VERIFY(ori);
++
++ optional<optional<int>> ooi;
++ static_assert(!std::is_assignable<optional<RvalueConstructible>&,
++ optional<optional<int>>&>::value);
++ ori = std::move(ooi);
++ VERIFY(!ori);
++
++ static_assert(!std::is_constructible<optional<RvalueConstructible>,
++ optional<int>&>::value);
++ static_assert(!std::is_convertible<optional<int>&,
++ optional<RvalueConstructible>>::value);
++
++ optional<RvalueConstructible> ori2(std::move(oi));
++ VERIFY(ori2);
++ optional<RvalueConstructible> ori3 = std::move(oi);
++ VERIFY(ori3);
++
++ static_assert(!std::is_constructible<optional<RvalueConstructible>,
++ optional<optional<int>>&>::value);
++ static_assert(!std::is_convertible<optional<optional<int>>&,
++ optional<RvalueConstructible>>::value);
++ optional<RvalueConstructible> ori6(std::move(ooi));
++ VERIFY(!ori6);
++ optional<RvalueConstructible> ori7 = std::move(ooi);
++ VERIFY(!ori7);
++ optional<RvalueConstructible> ori8 = std::experimental::nullopt;
++ VERIFY(!ori8);
++ optional<RvalueConstructible> ori9 = {};
++ VERIFY(!ori9);
++ optional<RvalueConstructible> ori10{std::experimental::nullopt};
++ VERIFY(!ori10);
++ optional<RvalueConstructible> ori11;
++ ori11 = {};
++ VERIFY(!ori11);
++}
++
++struct Thingy2
++{
++ Thingy2(int) {}
++ explicit Thingy2(optional<int>) {}
++ Thingy2(Widget) {}
++};
++
++void test07()
++{
++ optional<Thingy2> ot{optional<int>{}};
++ VERIFY(ot);
++ static_assert(!std::is_convertible<optional<int>,
++ optional<Thingy2>>::value);
++ optional<Thingy2> ot2{optional<short>{}};
++ VERIFY(ot2);
++ static_assert(!std::is_convertible<optional<short>,
++ optional<Thingy2>>::value);
++ optional<Thingy2> ot3{optional<optional<int>>{}};
++ VERIFY(!ot3);
++ static_assert(!std::is_convertible<optional<optional<int>>,
++ optional<Thingy2>>::value);
++ optional<Thingy2> ot4{optional<optional<short>>{}};
++ VERIFY(!ot4);
++ static_assert(!std::is_convertible<optional<optional<short>>,
++ optional<Thingy2>>::value);
++
++ optional<Thingy2> ot5{optional<Widget>{}};
++ VERIFY(!ot5);
++ optional<Thingy2> ot6 = optional<Widget>();
++ VERIFY(!ot6);
++
++ static_assert(!std::is_assignable<optional<Thingy2>&,
++ optional<int>>::value);
++ static_assert(!std::is_assignable<optional<Thingy2>&,
++ optional<short>>::value);
++ static_assert(!std::is_assignable<optional<Thingy2>&,
++ optional<optional<int>>>::value);
++ static_assert(!std::is_assignable<optional<Thingy2>&,
++ optional<optional<short>>>::value);
++ optional<Thingy2> ot7;
++ ot = optional<Widget>();
++ VERIFY(!ot7);
++ optional<Thingy2> ot8 = std::experimental::nullopt;
++ VERIFY(!ot8);
++ optional<Thingy2> ot9 = {};
++ VERIFY(!ot9);
++ optional<Thingy2> ot10{std::experimental::nullopt};
++ VERIFY(!ot10);
++ optional<Thingy2> ot11;
++ ot11 = {};
++ VERIFY(!ot11);
++}
++
++struct Thingy3
++{
++ Thingy3(int) {}
++ template<class... Args,
++ std::enable_if_t<std::is_constructible<Widget, Args&&...>::value,
++ bool> = true>
++ explicit Thingy3(Args&&... args) {}
++ Thingy3(Widget) {}
++};
++
++void test08()
++{
++ optional<Thingy3> ot{optional<int>{}};
++ VERIFY(ot);
++ static_assert(!std::is_convertible<optional<int>,
++ optional<Thingy3>>::value);
++ optional<Thingy3> ot2{optional<short>{}};
++ VERIFY(ot2);
++ static_assert(!std::is_convertible<optional<short>,
++ optional<Thingy3>>::value);
++ optional<Thingy3> ot3{optional<optional<int>>{}};
++ VERIFY(!ot3);
++ static_assert(!std::is_convertible<optional<optional<int>>,
++ optional<Thingy3>>::value);
++ optional<Thingy3> ot4{optional<optional<short>>{}};
++ VERIFY(!ot4);
++ static_assert(!std::is_convertible<optional<optional<short>>,
++ optional<Thingy3>>::value);
++
++ optional<Thingy3> ot5{optional<Widget>{}};
++ VERIFY(!ot5);
++ optional<Thingy3> ot6 = optional<Widget>();
++ VERIFY(!ot6);
++
++ static_assert(!std::is_assignable<optional<Thingy3>&,
++ optional<int>>::value);
++ static_assert(!std::is_assignable<optional<Thingy3>&,
++ optional<short>>::value);
++ static_assert(!std::is_assignable<optional<Thingy3>&,
++ optional<optional<int>>>::value);
++ static_assert(!std::is_assignable<optional<Thingy3>&,
++ optional<optional<short>>>::value);
++ optional<Thingy3> ot7;
++ ot = optional<Widget>();
++ VERIFY(!ot7);
++ optional<Thingy3> ot8 = std::experimental::nullopt;
++ VERIFY(!ot8);
++ optional<Thingy3> ot9 = {};
++ VERIFY(!ot9);
++ optional<Thingy3> ot10{std::experimental::nullopt};
++ VERIFY(!ot10);
++ optional<Thingy3> ot11;
++ ot11 = {};
++ VERIFY(!ot11);
++}
++
++void test09()
++{
++ std::experimental::any a = 42;
++ optional<std::experimental::any> oa2 = a;
++ VERIFY(oa2);
++ VERIFY(std::experimental::any_cast<int>(*oa2) == 42);
++ optional<std::experimental::any> oa3 = oa2;
++ VERIFY(oa3);
++ VERIFY(std::experimental::any_cast<int>(*oa3) == 42);
++ optional<std::experimental::any> oa4{oa2};
++ VERIFY(oa4);
++ VERIFY(std::experimental::any_cast<int>(*oa4) == 42);
++ optional<std::experimental::any> oa5(oa2);
++ VERIFY(oa5);
++ VERIFY(std::experimental::any_cast<int>(*oa5) == 42);
++ optional<std::experimental::any> oa6;
++ VERIFY(!oa6);
++ optional<std::experimental::any> oa7 = oa6;
++ VERIFY(!oa7);
++ optional<std::experimental::any> oa8{oa6};
++ VERIFY(!oa8);
++ optional<std::experimental::any> oa9(oa6);
++ VERIFY(!oa9);
++}
++
++void test10()
++{
++ struct X {};
++ optional<int> oi(std::experimental::in_place);
++ oi = {};
++ VERIFY(bool(oi) == false);
++ optional<X> ot(std::experimental::in_place);
++ ot = {};
++ VERIFY(bool(ot) == false);
++ optional<int> oi2(std::experimental::in_place);
++ short int si = 6;
++ oi2 = si;
++}
++
++int main()
++{
++ test01();
++ test02();
++ test03();
++ test04();
++ test05();
++ test06();
++ test07();
++ test08();
++ test09();
++ test10();
++}
+Index: libstdc++-v3/testsuite/experimental/optional/assignment/5.cc
+===================================================================
+--- a/src/libstdc++-v3/testsuite/experimental/optional/assignment/5.cc (.../tags/gcc_6_2_0_release)
++++ b/src/libstdc++-v3/testsuite/experimental/optional/assignment/5.cc (.../branches/gcc-6-branch)
+@@ -19,6 +19,7 @@
+ // <http://www.gnu.org/licenses/>.
+
+ #include <experimental/optional>
++#include <vector>
+ #include <testsuite_hooks.h>
+
+ int counter = 0;
+@@ -62,5 +63,15 @@
+ VERIFY( !o );
+ }
+
++ {
++ std::experimental::optional<std::vector<int>> ovi{{1, 2, 3}};
++ VERIFY(ovi->size() == 3);
++ VERIFY((*ovi)[0] == 1 && (*ovi)[1] == 2 && (*ovi)[2] == 3);
++ ovi = {4, 5, 6, 7};
++ VERIFY(ovi->size() == 4);
++ VERIFY((*ovi)[0] == 4 && (*ovi)[1] == 5 &&
++ (*ovi)[2] == 6 && (*ovi)[3] == 7);
++ }
++
+ VERIFY( counter == 0 );
+ }
Index: libstdc++-v3/testsuite/experimental/algorithm/sample.cc
===================================================================
--- a/src/libstdc++-v3/testsuite/experimental/algorithm/sample.cc (.../tags/gcc_6_2_0_release)
@@ -3811,6 +4669,51 @@ Index: libstdc++-v3/testsuite/20_util/unique_ptr/assign/cv_qual.cc
- // { dg-error "no type" "" { target *-*-* } 537 }
- // { dg-error "no matching function" "" { target *-*-* } 614 }
-}
+Index: libstdc++-v3/testsuite/20_util/allocator/void.cc
+===================================================================
+--- a/src/libstdc++-v3/testsuite/20_util/allocator/void.cc (.../tags/gcc_6_2_0_release)
++++ b/src/libstdc++-v3/testsuite/20_util/allocator/void.cc (.../branches/gcc-6-branch)
+@@ -0,0 +1,40 @@
++// Copyright (C) 2016 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 <memory>
++#include <testsuite_hooks.h>
++
++template class std::allocator<void>;
++
++void
++test01()
++{
++ int i;
++ using alloc_type = std::allocator<void>;
++ alloc_type a;
++ std::allocator_traits<alloc_type>::construct(a, &i, 42);
++ VERIFY( i == 42 );
++ std::allocator_traits<alloc_type>::destroy(a, &i);
++}
++
++int
++main()
++{
++ test01();
++}
Index: libstdc++-v3/testsuite/20_util/tuple/77395.cc
===================================================================
--- a/src/libstdc++-v3/testsuite/20_util/tuple/77395.cc (.../tags/gcc_6_2_0_release)
@@ -4389,7 +5292,7 @@ Index: gcc/DATESTAMP
+++ b/src/gcc/DATESTAMP (.../branches/gcc-6-branch)
@@ -1 +1 @@
-20160822
-+20161019
++20161026
Index: gcc/tree.c
===================================================================
--- a/src/gcc/tree.c (.../tags/gcc_6_2_0_release)
@@ -4426,7 +5329,30 @@ Index: gcc/tree.c
{
const char *name;
if (component_type == char_type_node)
-@@ -10242,10 +10247,11 @@
+@@ -8967,8 +8972,8 @@
+ return win;
+ }
+
+-/* Returns true if integer constant C has a value that is permissible
+- for type TYPE (an INTEGER_TYPE). */
++/* Return true if integer constant C has a value that is permissible
++ for TYPE, an integral type. */
+
+ bool
+ int_fits_type_p (const_tree c, const_tree type)
+@@ -8977,6 +8982,11 @@
+ bool ok_for_low_bound, ok_for_high_bound;
+ signop sgn_c = TYPE_SIGN (TREE_TYPE (c));
+
++ /* Short-circuit boolean types since various transformations assume that
++ they can only take values 0 and 1. */
++ if (TREE_CODE (type) == BOOLEAN_TYPE)
++ return integer_zerop (c) || integer_onep (c);
++
+ retry:
+ type_low_bound = TYPE_MIN_VALUE (type);
+ type_high_bound = TYPE_MAX_VALUE (type);
+@@ -10242,10 +10252,11 @@
SET_TYPE_MODE (dfloat128_type_node, TDmode);
dfloat128_ptr_type_node = build_pointer_type (dfloat128_type_node);
@@ -4455,6 +5381,18 @@ Index: gcc/tree.h
extern tree array_type_nelts (const_tree);
extern tree value_member (tree, tree);
+@@ -5289,6 +5289,11 @@
+ bool
+ wi::fits_to_tree_p (const T &x, const_tree type)
+ {
++ /* Short-circuit boolean types since various transformations assume that
++ they can only take values 0 and 1. */
++ if (TREE_CODE (type) == BOOLEAN_TYPE)
++ return eq_p (x, 0) || eq_p (x, 1);
++
+ if (TYPE_SIGN (type) == UNSIGNED)
+ return eq_p (x, zext (x, TYPE_PRECISION (type)));
+ else
Index: gcc/configure
===================================================================
--- a/src/gcc/configure (.../tags/gcc_6_2_0_release)
@@ -4603,7 +5541,54 @@ Index: gcc/ChangeLog
===================================================================
--- a/src/gcc/ChangeLog (.../tags/gcc_6_2_0_release)
+++ b/src/gcc/ChangeLog (.../branches/gcc-6-branch)
-@@ -1,3 +1,547 @@
+@@ -1,3 +1,594 @@
++2016-10-25 Eric Botcazou <ebotcazou at adacore.com>
++
++ * tree.h (wi::fits_to_tree_p): Accept only 0 and 1 for boolean types.
++ * tree.c (int_fits_type_p): Likewise. Adjust head comment.
++
++2016-10-24 Bernd Edlinger <bernd.edlinger at hotmail.de>
++
++ Backport from mainline
++ 2016-09-21 Bernd Edlinger <bernd.edlinger at hotmail.de>
++
++ PR tree-optimization/77550
++ * tree-vect-stmts.c (create_array_ref): Change parameters.
++ (get_group_alias_ptr_type): New function.
++ (vectorizable_store, vectorizable_load): Use get_group_alias_ptr_type.
++
++2016-10-23 Bill Schmidt <wschmidt at linux.vnet.ibm.com>
++
++ Backport from mainline
++ 2016-10-17 Bill Schmidt <wschmidt at linux.vnet.ibm.com>
++
++ PR tree-optimization/77916
++ * gimple-ssa-strength-reduction.c (create_add_on_incoming_edge):
++ Don't allow a MINUS_EXPR for pointer arithmetic for either known
++ or unknown strides.
++ (record_increment): Increments of -1 for unknown strides just use
++ a multiply initializer like other negative values.
++ (analyze_increments): Remove stopgap solution for -1 increment
++ applied to pointer arithmetic.
++ (insert_initializers): Requirement of initializer for -1 should be
++ based on pointer-typedness of the candidate basis.
++
++2016-10-23 Eric Botcazou <ebotcazou at adacore.com>
++
++ * config/sparc/sparc.md (cpu_feature): Minor tweak.
++ (enabled): Likewise.
++ (movsi_insn, movdi_insn_sp32, movdi_insn_sp64, movsf_insn,
++ movdf_insn_sp32, movdf_insn_sp64, zero_extendsidi2_insn_sp64,
++ sign_extendsidi2_insn, mov<VM32:mode>_insn, mov<VM64:mode>_insn_sp64,
++ mov<VM64:mode>_insn_sp32, not_<code><mode>, nand<mode>_vis,
++ <code>_not1<mode>_vi, <code>_not2<mode>_vis, one_cmpl<mode>2,
++ fcmp<code><GCM:gcm_name>, pdistn<mode>_vis): Likewise.
++
++2016-10-23 Eric Botcazou <ebotcazou at adacore.com>
++
++ * config/sparc/sparc-c.c (sparc_target_macros): Replace TARGET_64BIT
++ with TARGET_ARCH64. Define __VIS to 0x400 if TARGET_VIS4.
++
+2016-10-19 Uros Bizjak <ubizjak at gmail.com>
+
+ PR target/77991
@@ -4617,7 +5602,7 @@ Index: gcc/ChangeLog
+ 2016-10-11 Kugan Vivekanandarajah <kuganv at linaro.org>
+
+ * tree-vrp.c (vrp_intersect_ranges_1): Allocate bitmap before
-+ copying.
++ copying.
+
+2016-10-17 Bill Schmidt <wschmidt at linux.vnet.ibm.com>
+
@@ -5151,7 +6136,7 @@ Index: gcc/ChangeLog
2016-08-22 Release Manager
* GCC 6.2.0 released.
-@@ -205,9 +753,9 @@
+@@ -205,9 +800,9 @@
2016-08-09 Martin Jambor <mjambor at suse.cz>
@@ -6248,6 +7233,17 @@ Index: gcc/testsuite/gfortran.dg/matmul_11.f90
+end program x
+
+! { dg-final { scan-tree-dump-times "_gfortran_matmul" 1 "original" } }
+Index: gcc/testsuite/gfortran.dg/pr77763.f90
+===================================================================
+--- a/src/gcc/testsuite/gfortran.dg/pr77763.f90 (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/testsuite/gfortran.dg/pr77763.f90 (.../branches/gcc-6-branch)
+@@ -0,0 +1,6 @@
++! { dg-do compile }
++! { dg-options "-fdec" }
++block data
++ structure /s1/
++ end structure
++end block data
Index: gcc/testsuite/gfortran.dg/pr77460.f90
===================================================================
--- a/src/gcc/testsuite/gfortran.dg/pr77460.f90 (.../tags/gcc_6_2_0_release)
@@ -6346,6 +7342,78 @@ Index: gcc/testsuite/gfortran.dg/defined_operators_1.f90
end function foo_3
end module mymod
+
+Index: gcc/testsuite/gfortran.dg/allocate_with_source_23.f03
+===================================================================
+--- a/src/gcc/testsuite/gfortran.dg/allocate_with_source_23.f03 (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/testsuite/gfortran.dg/allocate_with_source_23.f03 (.../branches/gcc-6-branch)
+@@ -0,0 +1,67 @@
++! { dg-do run }
++! { dg-options "-fcheck=bounds" }
++! { dg-shouldfail "Array bounds mismatch" }
++!
++! Test that pr72832 is fixed now.
++! Contributed by Daan van Vugt
++
++program allocate_source
++ type :: t
++ integer :: i
++ end type t
++ type, extends(t) :: tt
++ end type tt
++
++ call test_type()
++ call test_class_correct()
++ call test_class_fail()
++
++contains
++
++subroutine test_class_correct()
++ class(t), allocatable, dimension(:) :: a, b
++ allocate(tt::a(1:2))
++ a(:)%i = [ 1,2 ]
++ if (size(a) /= 2) call abort()
++ if (any(a(:)%i /= [ 1,2])) call abort()
++
++ allocate(b(1:4), source=a(1))
++ if (size(b) /= 4) call abort()
++ if (any(b(:)%i /= [ 1,1,1,1])) call abort()
++ select type (b(1))
++ class is (tt)
++ continue
++ class default
++ call abort()
++ end select
++end subroutine
++
++subroutine test_class_fail()
++ class(t), allocatable, dimension(:) :: a, b
++ allocate(tt::a(1:2))
++ a(:)%i = [ 1,2 ]
++ if (size(a) /= 2) call abort()
++ if (any(a(:)%i /= [ 1,2])) call abort()
++
++ allocate(b(1:4), source=a) ! Fail expected: sizes do not conform
++ if (size(b) /= 4) call abort()
++ if (any(b(1:2)%i /= [ 1,2])) call abort()
++ select type (b(1))
++ class is (tt)
++ continue
++ class default
++ call abort()
++ end select
++end subroutine
++
++subroutine test_type()
++ type(t), allocatable, dimension(:) :: a, b
++ allocate(a(1:2))
++ if (size(a) /= 2) call abort()
++
++ allocate(b(1:4), source=a)
++ if (size(b) /= 4) call abort()
++end subroutine
++end program allocate_source
++
++
Index: gcc/testsuite/gfortran.dg/pr77420_4.f90
===================================================================
--- a/src/gcc/testsuite/gfortran.dg/pr77420_4.f90 (.../tags/gcc_6_2_0_release)
@@ -6527,6 +7595,74 @@ Index: gcc/testsuite/gfortran.dg/ieee/pr77372.f90
+ real(kind=ieee_selected_real_kind(10_2)) :: z2
+ real(kind=ieee_selected_real_kind(10_4)) :: z4
+end
+Index: gcc/testsuite/gfortran.dg/pr71895.f90
+===================================================================
+--- a/src/gcc/testsuite/gfortran.dg/pr71895.f90 (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/testsuite/gfortran.dg/pr71895.f90 (.../branches/gcc-6-branch)
+@@ -0,0 +1,10 @@
++! { dg-do compile }
++program p
++ type t
++ integer :: n
++ end type
++ type(t) :: x
++ class(t) :: y ! { dg-error "must be dummy, allocatable or pointer" }
++ print *, extends_type_of(x, y)
++ print *, extends_type_of(y, x)
++end
+Index: gcc/testsuite/gfortran.dg/allocate_with_source_22.f03
+===================================================================
+--- a/src/gcc/testsuite/gfortran.dg/allocate_with_source_22.f03 (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/testsuite/gfortran.dg/allocate_with_source_22.f03 (.../branches/gcc-6-branch)
+@@ -0,0 +1,48 @@
++! { dg-do run }
++!
++! Test that pr72832 is fixed now.
++! Contributed by Daan van Vugt
++
++program allocate_source
++ type :: t
++ integer :: i
++ end type t
++ type, extends(t) :: tt
++ end type tt
++
++ call test_type()
++ call test_class()
++
++contains
++
++subroutine test_class()
++ class(t), allocatable, dimension(:) :: a, b
++ allocate(tt::a(1:2))
++ a(:)%i = [ 1,2 ]
++ if (size(a) /= 2) call abort()
++ if (any(a(:)%i /= [ 1,2])) call abort()
++
++ allocate(b(1:4), source=a)
++ ! b is incorrectly initialized here. This only is diagnosed when compiled
++ ! with -fcheck=bounds.
++ if (size(b) /= 4) call abort()
++ if (any(b(1:2)%i /= [ 1,2])) call abort()
++ select type (b(1))
++ class is (tt)
++ continue
++ class default
++ call abort()
++ end select
++end subroutine
++
++subroutine test_type()
++ type(t), allocatable, dimension(:) :: a, b
++ allocate(a(1:2))
++ if (size(a) /= 2) call abort()
++
++ allocate(b(1:4), source=a)
++ if (size(b) /= 4) call abort()
++end subroutine
++end program allocate_source
++
++
Index: gcc/testsuite/gfortran.dg/coarray_collectives_1.f90
===================================================================
--- a/src/gcc/testsuite/gfortran.dg/coarray_collectives_1.f90 (.../tags/gcc_6_2_0_release)
@@ -7027,6 +8163,30 @@ Index: gcc/testsuite/gfortran.dg/pr77391.f90
+character(len=:) :: good
+pointer good
+end program picky
+Index: gcc/testsuite/gfortran.dg/string_length_3.f90
+===================================================================
+--- a/src/gcc/testsuite/gfortran.dg/string_length_3.f90 (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/testsuite/gfortran.dg/string_length_3.f90 (.../branches/gcc-6-branch)
+@@ -0,0 +1,19 @@
++! { dg-do run }
++! { dg-options "-ffrontend-optimize -fdump-tree-original" }
++! PR 78021 - calls to mylen were folded after shortening the
++! argument list.
++
++PROGRAM test_o_char
++ implicit none
++ integer :: n
++ n = mylen('c') + mylen('c ')
++ if (n /= 5) call abort
++CONTAINS
++
++ FUNCTION mylen(c)
++ CHARACTER(len=*),INTENT(in) :: c
++ INTEGER :: mylen
++ mylen=LEN(c)
++ END FUNCTION mylen
++END PROGRAM test_o_char
++! { dg-final { scan-tree-dump-times "__var" 0 "original" } }
Index: gcc/testsuite/gfortran.dg/pr69867.f90
===================================================================
--- a/src/gcc/testsuite/gfortran.dg/pr69867.f90 (.../tags/gcc_6_2_0_release)
@@ -7169,6 +8329,61 @@ Index: gcc/testsuite/gfortran.dg/pr70006.f90
+ goto 2 ! { dg-error "Label 2 referenced" " " { target *-*-* } 7 }
+!2 continue
+end program
+Index: gcc/testsuite/gfortran.dg/proc_ptr_49.f90
+===================================================================
+--- a/src/gcc/testsuite/gfortran.dg/proc_ptr_49.f90 (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/testsuite/gfortran.dg/proc_ptr_49.f90 (.../branches/gcc-6-branch)
+@@ -0,0 +1,50 @@
++! { dg-do compile }
++!
++! Tests the fix for PRs 78013 and 61420, both of which gave a
++! no IMPLICIT type message for the procedure pointer at assignment.
++!
++module m
++
++ implicit none
++
++ abstract interface
++ function I_f() result( r )
++ real :: r
++ end function I_f
++ end interface
++
++ type, abstract :: a_t
++ private
++ procedure(I_f), nopass, pointer :: m_f => null()
++ contains
++ private
++ procedure, pass(this), public :: f => get_f
++ end type a_t
++
++contains
++
++ function get_f( this ) result( f_ptr ) ! Error message here.
++ class(a_t), intent(in) :: this
++ procedure(I_f), pointer :: f_ptr
++ f_ptr => this%m_f ! Error here :-)
++ end function get_f
++
++end module m
++
++module test
++ implicit none
++
++ type functions
++ contains
++ procedure, nopass :: get_pf => get_it ! Error here
++ end type
++
++ class(functions), allocatable :: f
++
++contains
++
++ function get_it() ! Error message here.
++ procedure (real), pointer :: get_it
++ end function
++
++end module
Index: gcc/testsuite/gfortran.dg/bounds_check_strlen_2.f90
===================================================================
--- a/src/gcc/testsuite/gfortran.dg/bounds_check_strlen_2.f90 (.../tags/gcc_6_2_0_release)
@@ -7261,6 +8476,60 @@ Index: gcc/testsuite/gnat.dg/biased_subtype.adb
+ raise Program_Error;
+ end if;
+end;
+Index: gcc/testsuite/gnat.dg/opt59.adb
+===================================================================
+--- a/src/gcc/testsuite/gnat.dg/opt59.adb (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/testsuite/gnat.dg/opt59.adb (.../branches/gcc-6-branch)
+@@ -0,0 +1,49 @@
++-- { dg-do run }
++-- { dg-options "-O" }
++
++with Opt59_Pkg; use Opt59_Pkg;
++
++procedure Opt59 is
++
++ type Enum is (Zero, One, Two);
++
++ function Has_True (V : Boolean_Vector) return Boolean is
++ begin
++ for I in V'Range loop
++ if V (I) then
++ return True;
++ end if;
++ end loop;
++ return False;
++ end;
++
++ Data1 : constant Boolean_Vector := Get_BV1;
++ Data2 : constant Boolean_Vector := Get_BV2;
++ Result : Boolean_Vector;
++
++ function F return Enum is
++ Res : Enum := Zero;
++ Set1 : constant Boolean := Has_True (Data1);
++ Set2 : constant Boolean := Has_True (Data2);
++ begin
++ if Set1 then
++ Res := Two;
++ elsif Set2 then
++ Res := One;
++ end if;
++ return Res;
++ end;
++
++ Val : constant Enum := F;
++
++begin
++
++ for I in Result'Range loop
++ Result (I) := Data1 (I) or Data2 (I);
++ end loop;
++
++ if Val /= Zero then
++ Test (Val = Two);
++ end if;
++
++end;
Index: gcc/testsuite/gnat.dg/inline13_pkg.adb
===================================================================
--- a/src/gcc/testsuite/gnat.dg/inline13_pkg.adb (.../tags/gcc_6_2_0_release)
@@ -7289,6 +8558,47 @@ Index: gcc/testsuite/gnat.dg/inline13_pkg.ads
+ pragma Inline_Always (Padded);
+
+end Inline13_Pkg;
+Index: gcc/testsuite/gnat.dg/opt59_pkg.adb
+===================================================================
+--- a/src/gcc/testsuite/gnat.dg/opt59_pkg.adb (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/testsuite/gnat.dg/opt59_pkg.adb (.../branches/gcc-6-branch)
+@@ -0,0 +1,20 @@
++package body Opt59_Pkg is
++
++ function Get_BV1 return Boolean_Vector is
++ begin
++ return (others => True);
++ end;
++
++ function Get_BV2 return Boolean_Vector is
++ begin
++ return (others => False);
++ end;
++
++ procedure Test (B : Boolean) is
++ begin
++ if not B then
++ raise Program_Error;
++ end if;
++ end;
++
++end Opt59_Pkg;
+Index: gcc/testsuite/gnat.dg/opt59_pkg.ads
+===================================================================
+--- a/src/gcc/testsuite/gnat.dg/opt59_pkg.ads (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/testsuite/gnat.dg/opt59_pkg.ads (.../branches/gcc-6-branch)
+@@ -0,0 +1,11 @@
++package Opt59_Pkg is
++
++ type Boolean_Vector is array (1 .. 8) of Boolean;
++
++ function Get_BV1 return Boolean_Vector;
++
++ function Get_BV2 return Boolean_Vector;
++
++ procedure Test (B : Boolean);
++
++end Opt59_Pkg;
Index: gcc/testsuite/gnat.dg/inline13.adb
===================================================================
--- a/src/gcc/testsuite/gnat.dg/inline13.adb (.../tags/gcc_6_2_0_release)
@@ -7484,6 +8794,31 @@ Index: gcc/testsuite/gcc.dg/lto/pr70955_1.c
+ __builtin_ms_va_end (ap);
+ return sum;
+}
+Index: gcc/testsuite/gcc.dg/torture/pr77916.c
+===================================================================
+--- a/src/gcc/testsuite/gcc.dg/torture/pr77916.c (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/testsuite/gcc.dg/torture/pr77916.c (.../branches/gcc-6-branch)
+@@ -0,0 +1,20 @@
++/* { dg-do compile } */
++/* { dg-options "-O3 -Wno-int-conversion" } */
++
++/* PR77916: This failed with "error: invalid (pointer) operands to plus/minus"
++ after SLSR. */
++
++typedef struct
++{
++ void *f1;
++} S;
++
++S *a;
++int b;
++
++void
++fn1 (void)
++{
++ for (; b; b++, a++)
++ a->f1 = b;
++}
Index: gcc/testsuite/gcc.dg/torture/pr77478.c
===================================================================
--- a/src/gcc/testsuite/gcc.dg/torture/pr77478.c (.../tags/gcc_6_2_0_release)
@@ -7891,7 +9226,68 @@ Index: gcc/testsuite/ChangeLog
===================================================================
--- a/src/gcc/testsuite/ChangeLog (.../tags/gcc_6_2_0_release)
+++ b/src/gcc/testsuite/ChangeLog (.../branches/gcc-6-branch)
-@@ -1,3 +1,532 @@
+@@ -1,3 +1,593 @@
++2016-10-25 Eric Botcazou <ebotcazou at adacore.com>
++
++ * gnat.dg/opt59.adb: New test.
++ * gnat.dg/opt59_pkg.ad[sb]: New helper.
++
++2016-10-24 Bernd Edlinge <bernd.edlinger at hotmail.de>
++
++ Backport from mainline r240313, r240355, r240573
++ 2016-09-21 Bernd Edlinger <bernd.edlinger at hotmail.de>
++
++ PR tree-optimization/77550
++ * g++.dg/pr77550.C: New test.
++
++ 2016-09-22 Bernd Edlinger <bernd.edlinger at hotmail.de>
++
++ * g++.dg/pr77550.C: Use __SIZE_TYPE__.
++
++ 2016-09-28 Bernd Edlinger <bernd.edlinger at hotmail.de>
++
++ PR c++/77748
++ * g++.dg/pr77550.C: Avoid undefined behavior.
++
++2016-10-24 Steven G. Kargl <kargl at gcc.gnu.org>
++
++ PR fortran/71895
++ * gfortran.dg/pr71895.f90: New test.
++
++2016-10-23 Bill Schmidt <wschmidt at linux.vnet.ibm.com>
++
++ Backport from mainline
++ 2016-10-17 Bill Schmidt <wschmidt at linux.vnet.ibm.com>
++
++ PR tree-optimization/77916
++ * gcc.dg/torture/pr77916.c: New.
++
++2016-10-23 Steven G. Kargl <kargl at gcc.gnu.org>
++
++ PR fortran/77763
++ * gfortran.dg/pr77763.f90
++
++2016-10-23 Paul Thomas <pault at gcc.gnu.org>
++
++ Backport from trunk
++ PR fortran/61420
++ PR fortran/78013
++ * gfortran.dg/proc_ptr_49.f90: New test.
++
++2016-10-23 Thomas Koenig <tkoenig at gcc.gnu.org>
++
++ Backport from trunk
++ PR fortran/78021
++ * gfortran.dg/string_length_3.f90: New test.
++
++2016-10-23 Andre Vehreschild <vehre at gcc.gnu.org>
++
++ Backported from trunk
++ PR fortran/72832
++ * gfortran.dg/allocate_with_source_22.f03: New test.
++ * gfortran.dg/allocate_with_source_23.f03: New test. Expected to
++ fail.
++
+2016-10-19 Uros Bizjak <ubizjak at gmail.com>
+
+ PR target/77991
@@ -8424,7 +9820,7 @@ Index: gcc/testsuite/ChangeLog
2016-08-22 Release Manager
* GCC 6.2.0 released.
-@@ -150,8 +679,8 @@
+@@ -150,8 +740,8 @@
2016-08-09 Martin Jambor <mjambor at suse.cz>
@@ -8435,7 +9831,7 @@ Index: gcc/testsuite/ChangeLog
2016-08-09 Richard Biener <rguenther at suse.de>
-@@ -276,8 +805,8 @@
+@@ -276,8 +866,8 @@
2016-07-20 Martin Jambor <mjambor at suse.cz>
@@ -8446,7 +9842,7 @@ Index: gcc/testsuite/ChangeLog
2016-07-19 Jakub Jelinek <jakub at redhat.com>
-@@ -418,7 +947,7 @@
+@@ -418,7 +1008,7 @@
2016-07-06 Yuri Rumyantsev <ysrumyan at gmail.com>
PR tree-optimization/71518
@@ -9007,6 +10403,309 @@ Index: gcc/testsuite/g++.dg/warn/Wplacement-new-size-4.C
+ int* p = new (buf) (int[n]); // { dg-warning "non-constant array new length must be specified without parentheses around the type-id" }
+ // { dg-warning "ISO C\\+\\+ forbids variable length array" "vla warning" { target *-*-* } .-1 }
+}
+Index: gcc/testsuite/g++.dg/pr77550.C
+===================================================================
+--- a/src/gcc/testsuite/g++.dg/pr77550.C (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/testsuite/g++.dg/pr77550.C (.../branches/gcc-6-branch)
+@@ -0,0 +1,298 @@
++// { dg-do run }
++// { dg-options "-std=c++14 -O3" }
++
++#define enum enum __attribute((mode(SI)))
++namespace std {
++typedef int size_t;
++inline namespace __cxx11 {}
++template <typename...> using _Require = void;
++template <typename> using __void_t = void;
++template <typename, typename, template <typename...> class, typename...>
++struct A {
++ using type = int;
++};
++template <typename _Default, template <typename...> class _Op,
++ typename... _Args>
++struct A<_Default, __void_t<_Op<_Args...>>, _Op, _Args...> {
++ using type = _Op<_Args...>;
++};
++template <typename _Default, template <typename...> class _Op,
++ typename... _Args>
++using __detected_or = A<_Default, void, _Op, _Args...>;
++template <typename _Default, template <typename...> class _Op,
++ typename... _Args>
++using __detected_or_t = typename __detected_or<_Default, _Op, _Args...>::type;
++template <template <typename...> class _Default,
++ template <typename...> class _Op, typename... _Args>
++using __detected_or_t_ = __detected_or_t<_Default<_Args...>, _Op, _Args...>;
++template <typename _InputIterator> void __distance(_InputIterator p1) { ++p1; }
++template <typename _InputIterator>
++void distance(_InputIterator p1, _InputIterator) {
++ __distance(p1);
++}
++template <typename, typename> using __replace_first_arg_t = int;
++struct B {
++ template <typename _Up> using rebind = _Up *;
++};
++template <typename, typename> using __ptr_rebind = B;
++template <typename _Tp> _Tp max(_Tp p1, _Tp) { return p1; }
++}
++void *operator new(__SIZE_TYPE__, void *p2) { return p2; }
++template <typename _Tp> struct C {
++ typedef _Tp *pointer;
++ pointer allocate(int p1) {
++ return static_cast<_Tp *>(operator new(p1 * sizeof(_Tp)));
++ }
++ template <typename _Up> void construct(_Up *p1) { new (p1) _Up; }
++};
++namespace std {
++template <typename _Tp> using __allocator_base = C<_Tp>;
++template <typename _Tp> struct allocator : __allocator_base<_Tp> {
++ typedef __SIZE_TYPE__ size_type;
++ template <typename _Tp1> struct rebind { typedef allocator<_Tp1> other; };
++};
++struct D {
++ template <typename _Alloc, typename _Up>
++ using __rebind = typename _Alloc::template rebind<_Up>::other;
++ template <typename _Tp> using __pointer = typename _Tp::pointer;
++ template <typename _Tp> using __c_pointer = typename _Tp::const_pointer;
++ template <typename _Tp> using __size_type = typename _Tp::size_type;
++};
++template <typename _Alloc, typename _Up>
++using __alloc_rebind =
++ __detected_or_t_<__replace_first_arg_t, D::__rebind, _Alloc, _Up>;
++template <typename _Alloc> struct K : D {
++ typedef _Alloc value_type;
++ using pointer = __detected_or_t<value_type, __pointer, _Alloc>;
++ using const_pointer =
++ __detected_or_t<__ptr_rebind<pointer, value_type>, __c_pointer>;
++ using size_type = __detected_or_t<int, __size_type, _Alloc>;
++ template <typename _Tp> using rebind_alloc = __alloc_rebind<_Alloc, _Tp>;
++ template <typename _Tp> static _Require<> _S_construct(_Tp p1) {
++ _Alloc __a;
++ __a.construct(p1);
++ }
++ static pointer allocate(_Alloc p1, size_type p2) { return p1.allocate(p2); }
++ template <typename _Tp, typename _Args>
++ static auto construct(_Alloc, _Tp p2, _Args) {
++ _S_construct(p2);
++ }
++};
++}
++template <typename _Alloc> struct O : std::K<_Alloc> {
++ template <typename _Tp> struct rebind {
++ typedef typename std::K<_Alloc>::template rebind_alloc<_Tp> other;
++ };
++};
++namespace std {
++template <typename _ForwardIterator, typename _Tp, typename _Allocator>
++void __uninitialized_fill_a(_ForwardIterator p1, _ForwardIterator, _Tp,
++ _Allocator p4) try {
++ O<_Allocator>::construct(p4, p1, 0);
++} catch (...) {
++}
++size_t __deque_buf_size(size_t p1) { return 1 ? 512 / p1 : 0; }
++template <typename _Tp, typename _Ref, typename> struct F {
++ template <typename _Up> using __ptr_to = B::rebind<_Up>;
++ template <typename _CvTp> using __iter = F<_Tp, _CvTp &, __ptr_to<_CvTp>>;
++ typedef __ptr_to<_Tp> _Elt_pointer;
++ typedef __ptr_to<_Elt_pointer> _Map_pointer;
++ _Elt_pointer _M_cur;
++ _Elt_pointer _M_first;
++ _Elt_pointer _M_last;
++ _Map_pointer _M_node;
++ F() {}
++ F(__iter<_Tp> &p1) : _M_cur(p1._M_cur), _M_node(p1._M_node) {}
++ _Ref operator*() { return *_M_cur; }
++ void operator++() {
++ _M_set_node(_M_node + 1);
++ _M_cur = _M_first;
++ }
++ void _M_set_node(_Map_pointer p1) {
++ _M_node = p1;
++ _M_first = *p1;
++ _M_last = _M_first;
++ }
++};
++template <typename _Tp, typename _Ref, typename _Ptr>
++int operator==(F<_Tp, _Ref, _Ptr> p1, F<_Tp, _Ref, _Ptr> p2) {
++ return p1._M_cur == p2._M_cur;
++}
++template <typename _Tp, typename _Ref, typename _Ptr>
++int operator!=(F<_Tp, _Ref, _Ptr> p1, F<_Tp, _Ref, _Ptr> p2) {
++ return !(p1 == p2);
++}
++template <typename _Tp, typename _Alloc> struct _Deque_base {
++ typedef typename _Alloc::template rebind<_Tp>::other _Tp_alloc_type;
++ typedef O<_Tp_alloc_type> _Alloc_traits;
++ typedef typename _Alloc_traits::pointer _Ptr;
++ typedef typename _Alloc_traits::template rebind<_Ptr>::other _Map_alloc_type;
++ typedef F<_Tp, _Tp &, _Ptr> iterator;
++ typedef F<_Tp, _Tp &, typename _Alloc_traits::const_pointer> const_iterator;
++ _Deque_base(_Alloc p1, size_t) : _M_impl(p1) { _M_initialize_map(0); }
++ ~_Deque_base() noexcept;
++ typedef typename iterator::_Map_pointer _Map_pointer;
++ struct L : _Tp_alloc_type {
++ _Map_pointer _M_map;
++ size_t _M_map_size;
++ iterator _M_start;
++ iterator _M_finish;
++ L(_Tp_alloc_type) {}
++ };
++ _Tp_alloc_type _M_get_Tp_allocator() { return _M_impl; }
++ _Ptr _M_allocate_node() { return O<_Tp_alloc_type>::allocate(_M_impl, 1); }
++ _Map_pointer _M_allocate_map(size_t p1) {
++ _Map_alloc_type __map_alloc;
++ return O<_Map_alloc_type>::allocate(__map_alloc, p1);
++ }
++ void _M_initialize_map(size_t);
++ void _M_create_nodes(_Map_pointer, _Map_pointer);
++ enum { _S_initial_map_size = 8 };
++ L _M_impl;
++};
++template <typename _Tp, typename _Alloc>
++_Deque_base<_Tp, _Alloc>::~_Deque_base() noexcept {}
++template <typename _Tp, typename _Alloc>
++void _Deque_base<_Tp, _Alloc>::_M_initialize_map(size_t) {
++ size_t __num_nodes(__deque_buf_size(sizeof(_Tp)));
++ _M_impl._M_map_size = max((size_t)_S_initial_map_size, 0);
++ _M_impl._M_map = _M_allocate_map(_M_impl._M_map_size);
++ _Map_pointer __nstart(_M_impl._M_map);
++ _Map_pointer __nfinish = __nstart + __num_nodes;
++ try {
++ _M_create_nodes(__nstart, __nfinish);
++ } catch (...) {
++ }
++ _M_impl._M_start._M_set_node(__nstart);
++ _M_impl._M_finish._M_set_node(__nfinish - 1);
++ _M_impl._M_start._M_cur = _M_impl._M_start._M_first;
++ _M_impl._M_finish._M_cur = _M_impl._M_finish._M_first;
++}
++template <typename _Tp, typename _Alloc>
++void _Deque_base<_Tp, _Alloc>::_M_create_nodes(_Map_pointer __nstart,
++ _Map_pointer __nfinish) {
++ _Map_pointer __cur;
++ try {
++ for (__cur = __nstart; __cur < __nfinish; ++__cur)
++ *__cur = _M_allocate_node();
++ } catch (...) {
++ }
++}
++template <typename _Tp, typename _Alloc = allocator<_Tp>>
++struct deque : _Deque_base<_Tp, _Alloc> {
++ typedef _Deque_base<_Tp, _Alloc> _Base;
++ typedef typename _Base::_Map_pointer _Map_pointer;
++ typedef _Tp value_type;
++ typedef typename _Base::const_iterator const_iterator;
++ typedef size_t size_type;
++ typedef _Alloc allocator_type;
++ using _Base::_M_get_Tp_allocator;
++ deque(size_type, value_type __value, allocator_type __a = allocator_type())
++ : _Base(__a, 0) {
++ _M_fill_initialize(__value);
++ }
++ const_iterator begin() { return this->_M_impl._M_start; }
++ const_iterator end() { return this->_M_impl._M_finish; }
++ void _M_fill_initialize(const value_type &);
++};
++template <typename _Container> auto begin(_Container p1) { return p1.begin(); }
++template <typename _Container> auto end(_Container p1) { return p1.end(); }
++template <typename _Container> auto cbegin(_Container p1) { return begin(p1); }
++template <typename _Container> auto cend(_Container p1) { return end(p1); }
++template <typename _Tp, typename _Alloc>
++void deque<_Tp, _Alloc>::_M_fill_initialize(const value_type &) {
++ _Map_pointer __cur;
++ try {
++ for (__cur = this->_M_impl._M_start._M_node;
++ __cur < this->_M_impl._M_finish._M_node; ++__cur)
++ __uninitialized_fill_a(*__cur, *__cur, 0, _M_get_Tp_allocator());
++ } catch (...) {
++ }
++}
++template <class> struct char_traits;
++namespace __cxx11 {
++template <typename _CharT, typename = char_traits<_CharT>,
++ typename = allocator<_CharT>>
++struct basic_string;
++typedef basic_string<char> string;
++}
++template <> struct char_traits<char> {
++ typedef char char_type;
++ static int compare(char_type, char_type *p2, size_t p3) {
++ return __builtin_memcmp(0, p2, p3);
++ }
++};
++namespace __cxx11 {
++template <typename, typename, typename> struct basic_string {
++ typedef O<allocator<char>> _Alloc_traits;
++ typedef _Alloc_traits::size_type size_type;
++ typedef _Alloc_traits::pointer pointer;
++ struct _Alloc_hider {
++ _Alloc_hider(pointer, allocator<char> && = allocator<char>());
++ } _M_dataplus;
++ size_type _M_string_length = 0;
++ enum { _S_local_capacity = 15 } _M_local_buf[_S_local_capacity];
++ basic_string() : _M_dataplus(0) {}
++ basic_string(const basic_string &) : _M_dataplus(0) {}
++ size_type size() { return _M_string_length; }
++ char *data() const {}
++};
++//template<> basic_string<char, std::char_traits<char>, std::allocator<char>>::
++//_Alloc_hider::_Alloc_hider(char*, std::allocator<char>&&) {}
++extern "C" void
++_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderC1EPcOS3_ (...) {}
++}
++template <typename _CharT>
++int operator==(basic_string<_CharT> &p1, const basic_string<_CharT> &p2) {
++ return p1.size() && char_traits<_CharT>::compare(0, p2.data(), p1.size());
++}
++}
++struct G {
++ template <class Facade> static void increment(Facade p1) { p1.increment(); }
++};
++template <class Derived> struct H {
++ Derived derived() { return *static_cast<Derived *>(this); }
++ void operator++() {
++ Derived __trans_tmp_1 = derived();
++ G::increment(__trans_tmp_1);
++ }
++};
++template <class Derived> struct I { typedef H<Derived> type; };
++template <class Derived, class Base> struct M : I<Derived>::type {
++ M(Base p1) : m_iterator(p1) {}
++ Base base() { return m_iterator; }
++ Base &base_reference() { return m_iterator; }
++ Base m_iterator;
++};
++template <class, class> struct N;
++template <class Predicate, class Iterator> struct J {
++ typedef M<N<Predicate, Iterator>, Iterator> type;
++};
++template <class Predicate, class Iterator>
++struct N : J<Predicate, Iterator>::type {
++ typedef typename J<Predicate, Iterator>::type super_t;
++ N(Predicate p1, Iterator p2, Iterator p3)
++ : super_t(p2), m_predicate(p1), m_end(p3) {}
++ void increment() {
++ while (this->base() != m_end && !m_predicate(*this->base()))
++ ++this->base_reference();
++ }
++ Predicate m_predicate;
++ Iterator m_end;
++};
++template <class Predicate, class Iterator>
++N<Predicate, Iterator> make_filter_iterator(Predicate p1, Iterator p2,
++ Iterator p3) {
++ return N<Predicate, Iterator>(p1, p2, p3);
++}
++struct Foo {
++ std::string bar;
++};
++int main() {
++ std::deque<Foo> foos(0, {});
++ std::string test;
++ auto p = [test](auto &foo) { return foo.bar == test; };
++ auto begin = make_filter_iterator(p, cbegin(foos), cend(foos));
++ auto end = make_filter_iterator(p, cend(foos), cend(foos));
++ distance(begin, end);
++}
Index: gcc/testsuite/g++.dg/asan/pr77396-2.C
===================================================================
--- a/src/gcc/testsuite/g++.dg/asan/pr77396-2.C (.../tags/gcc_6_2_0_release)
@@ -11461,7 +13160,71 @@ Index: gcc/gimple-ssa-strength-reduction.c
===================================================================
--- a/src/gcc/gimple-ssa-strength-reduction.c (.../tags/gcc_6_2_0_release)
+++ b/src/gcc/gimple-ssa-strength-reduction.c (.../branches/gcc-6-branch)
-@@ -2818,9 +2818,13 @@
+@@ -2155,35 +2155,41 @@
+ basis_type = TREE_TYPE (basis_name);
+ lhs = make_temp_ssa_name (basis_type, NULL, "slsr");
+
++ /* Occasionally people convert integers to pointers without a
++ cast, leading us into trouble if we aren't careful. */
++ enum tree_code plus_code
++ = POINTER_TYPE_P (basis_type) ? POINTER_PLUS_EXPR : PLUS_EXPR;
++
+ if (known_stride)
+ {
+ tree bump_tree;
+- enum tree_code code = PLUS_EXPR;
++ enum tree_code code = plus_code;
+ widest_int bump = increment * wi::to_widest (c->stride);
+- if (wi::neg_p (bump))
++ if (wi::neg_p (bump) && !POINTER_TYPE_P (basis_type))
+ {
+ code = MINUS_EXPR;
+ bump = -bump;
+ }
+
+- bump_tree = wide_int_to_tree (basis_type, bump);
++ tree stride_type = POINTER_TYPE_P (basis_type) ? sizetype : basis_type;
++ bump_tree = wide_int_to_tree (stride_type, bump);
+ new_stmt = gimple_build_assign (lhs, code, basis_name, bump_tree);
+ }
+ else
+ {
+ int i;
+- bool negate_incr = (!address_arithmetic_p && wi::neg_p (increment));
++ bool negate_incr = !POINTER_TYPE_P (basis_type) && wi::neg_p (increment);
+ i = incr_vec_index (negate_incr ? -increment : increment);
+ gcc_assert (i >= 0);
+
+ if (incr_vec[i].initializer)
+ {
+- enum tree_code code = negate_incr ? MINUS_EXPR : PLUS_EXPR;
++ enum tree_code code = negate_incr ? MINUS_EXPR : plus_code;
+ new_stmt = gimple_build_assign (lhs, code, basis_name,
+ incr_vec[i].initializer);
+ }
+ else if (increment == 1)
+- new_stmt = gimple_build_assign (lhs, PLUS_EXPR, basis_name, c->stride);
++ new_stmt = gimple_build_assign (lhs, plus_code, basis_name, c->stride);
+ else if (increment == -1)
+ new_stmt = gimple_build_assign (lhs, MINUS_EXPR, basis_name,
+ c->stride);
+@@ -2501,13 +2507,13 @@
+ /* Optimistically record the first occurrence of this increment
+ as providing an initializer (if it does); we will revise this
+ opinion later if it doesn't dominate all other occurrences.
+- Exception: increments of -1, 0, 1 never need initializers;
++ Exception: increments of 0, 1 never need initializers;
+ and phi adjustments don't ever provide initializers. */
+ if (c->kind == CAND_ADD
+ && !is_phi_adjust
+ && c->index == increment
+ && (wi::gts_p (increment, 1)
+- || wi::lts_p (increment, -1))
++ || wi::lts_p (increment, 0))
+ && (gimple_assign_rhs_code (c->cand_stmt) == PLUS_EXPR
+ || gimple_assign_rhs_code (c->cand_stmt) == POINTER_PLUS_EXPR))
+ {
+@@ -2818,10 +2824,9 @@
else if (incr == 0
|| incr == 1
|| (incr == -1
@@ -11469,14 +13232,20 @@ Index: gcc/gimple-ssa-strength-reduction.c
- != POINTER_PLUS_EXPR)))
+ && !POINTER_TYPE_P (first_dep->cand_type)))
incr_vec[i].cost = COST_NEUTRAL;
+-
+
-+ /* FIXME: We don't handle pointers with a -1 increment yet.
-+ They are usually unprofitable anyway. */
-+ else if (incr == -1 && POINTER_TYPE_P (first_dep->cand_type))
-+ incr_vec[i].cost = COST_INFINITE;
-
/* FORNOW: If we need to add an initializer, give up if a cast from
the candidate's type to its stride's type can lose precision.
+ This could eventually be handled better by expressly retaining the
+@@ -3108,7 +3113,7 @@
+ if (!profitable_increment_p (i)
+ || incr == 1
+ || (incr == -1
+- && gimple_assign_rhs_code (c->cand_stmt) != POINTER_PLUS_EXPR)
++ && (!POINTER_TYPE_P (lookup_cand (c->basis)->cand_type)))
+ || incr == 0)
+ continue;
+
Index: gcc/fortran/openmp.c
===================================================================
--- a/src/gcc/fortran/openmp.c (.../tags/gcc_6_2_0_release)
@@ -11525,7 +13294,17 @@ Index: gcc/fortran/interface.c
===================================================================
--- a/src/gcc/fortran/interface.c (.../tags/gcc_6_2_0_release)
+++ b/src/gcc/fortran/interface.c (.../branches/gcc-6-branch)
-@@ -1604,8 +1604,9 @@
+@@ -517,7 +517,8 @@
+ if (derived1 == derived2)
+ return 1;
+
+- gcc_assert (derived1 && derived2);
++ if (!derived1 || !derived2)
++ gfc_internal_error ("gfc_compare_derived_types: invalid derived type");
+
+ /* MAP and anonymous STRUCTURE types have internal names of the form
+ mM* and sS* (we can get away this this because source names are converted
+@@ -1604,8 +1605,9 @@
f1 = gfc_sym_get_dummy_args (s1);
f2 = gfc_sym_get_dummy_args (s2);
@@ -11536,7 +13315,7 @@ Index: gcc/fortran/interface.c
if (generic_flag)
{
-@@ -1612,6 +1613,14 @@
+@@ -1612,6 +1614,14 @@
if (count_types_test (f1, f2, p1, p2)
|| count_types_test (f2, f1, p2, p1))
return 0;
@@ -11551,7 +13330,7 @@ Index: gcc/fortran/interface.c
if (generic_correspondence (f1, f2, p1, p2)
|| generic_correspondence (f2, f1, p2, p1))
return 0;
-@@ -1779,13 +1788,15 @@
+@@ -1779,13 +1789,15 @@
generic_flag, 0, NULL, 0, NULL, NULL))
{
if (referenced)
@@ -11573,7 +13352,7 @@ Index: gcc/fortran/interface.c
else
gfc_warning (0, "Although not referenced, %qs has ambiguous "
"interfaces at %L", interface_name, &p->where);
-@@ -2146,7 +2157,7 @@
+@@ -2146,7 +2158,7 @@
{
if (where)
gfc_error ("Type mismatch in argument %qs at %L; passed %s to %s",
@@ -11607,6 +13386,50 @@ Index: gcc/fortran/intrinsic.c
make_from_module();
add_sym_1 ("c_loc", GFC_ISYM_C_LOC, CLASS_INQUIRY, ACTUAL_NO,
+Index: gcc/fortran/trans-expr.c
+===================================================================
+--- a/src/gcc/fortran/trans-expr.c (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/fortran/trans-expr.c (.../branches/gcc-6-branch)
+@@ -1166,6 +1166,7 @@
+ stmtblock_t body;
+ stmtblock_t ifbody;
+ gfc_loopinfo loop;
++ tree orig_nelems = nelems; /* Needed for bounds check. */
+
+ gfc_init_block (&body);
+ tmp = fold_build2_loc (input_location, MINUS_EXPR,
+@@ -1193,6 +1194,31 @@
+ }
+ vec_safe_push (args, to_ref);
+
++ /* Add bounds check. */
++ if ((gfc_option.rtcheck & GFC_RTCHECK_BOUNDS) > 0 && is_from_desc)
++ {
++ char *msg;
++ const char *name = "<<unknown>>";
++ tree from_len;
++
++ if (DECL_P (to))
++ name = (const char *)(DECL_NAME (to)->identifier.id.str);
++
++ from_len = gfc_conv_descriptor_size (from_data, 1);
++ tmp = fold_build2_loc (input_location, NE_EXPR,
++ boolean_type_node, from_len, orig_nelems);
++ msg = xasprintf ("Array bound mismatch for dimension %d "
++ "of array '%s' (%%ld/%%ld)",
++ 1, name);
++
++ gfc_trans_runtime_check (true, false, tmp, &body,
++ &gfc_current_locus, msg,
++ fold_convert (long_integer_type_node, orig_nelems),
++ fold_convert (long_integer_type_node, from_len));
++
++ free (msg);
++ }
++
+ tmp = build_call_vec (fcn_type, fcn, args);
+
+ /* Build the body of the loop. */
Index: gcc/fortran/class.c
===================================================================
--- a/src/gcc/fortran/class.c (.../tags/gcc_6_2_0_release)
@@ -11897,7 +13720,46 @@ Index: gcc/fortran/ChangeLog
===================================================================
--- a/src/gcc/fortran/ChangeLog (.../tags/gcc_6_2_0_release)
+++ b/src/gcc/fortran/ChangeLog (.../branches/gcc-6-branch)
-@@ -1,3 +1,183 @@
+@@ -1,3 +1,222 @@
++2016-10-24 Steven G. Kargl <kargl at gcc.gnu.org>
++
++ PR fortran/71895
++ * interface.c (gfc_compare_derived_types): Convert gcc_assert()
++ to a gfc_internal_error() to prevent an ICE.
++
++2016-10-23 Steven G. Kargl <kargl at gcc.gnu.org>
++
++ PR fortran/77763
++ * parse.c (parse_spec): Allow STRUCTURE in BLOCK DATA. Sort
++ case labels.
++
++2016-10-23 Paul Thomas <pault at gcc.gnu.org>
++
++ Backport from trunk
++ PR fortran/61420
++ PR fortran/78013
++ * resolve.c (resolve_variable): Obtain the typespec for a
++ variable expression, when the variable is a function result
++ that is a procedure pointer.
++
++2016-10-23 Thomas Koenig <tkoenig at gcc.gnu.org>
++
++ Backport from trunk
++ PR fortran/78021
++ * gfc_compare_functions: Strings with different lengths in
++ argument lists compare unequal.
++
++2016-10-23 Andre Vehreschild <vehre at gcc.gnu.org>
++
++ Backported from trunk
++ PR fortran/72832
++ * trans-expr.c (gfc_copy_class_to_class): Add generation of
++ runtime array bounds check.
++ * trans-intrinsic.c (gfc_conv_intrinsic_size): Add a crutch to
++ get the descriptor of a function returning a class object.
++ * trans-stmt.c (gfc_trans_allocate): Use the array spec on the
++ array to allocate instead of the array spec from source=.
++
+2016-10-17 Steven G. Kargl <kargl at gcc.gnu.org>
+
+ Backport from trunk
@@ -11954,7 +13816,7 @@ Index: gcc/fortran/ChangeLog
+
+ PR fortran/69514
+ * array.c (gfc_match_array_constructor): If type-spec is present,
-+ walk the array constructor performing possible conversions for
++ walk the array constructor performing possible conversions for
+ numeric types.
+
+ PR fortran/69867
@@ -12009,7 +13871,7 @@ Index: gcc/fortran/ChangeLog
+ * trans-common.c: Handle array elements in equivalence when
+ the lower and upper bounds of array spec are NULL.
+
-+ PR fortran/77429
++ PR fortran/77429
+ * dependency.c (gfc_check_dependency): Convert gcc_assert() to
+ a conditional and possible call to gfc_internal_error().
+
@@ -12025,7 +13887,7 @@ Index: gcc/fortran/ChangeLog
+ * intrinsic.c (add_functions): Use correct keyword.
+
+ PR fortran/77612
-+ * decl.c (char_len_param_value): Check parent namespace for
++ * decl.c (char_len_param_value): Check parent namespace for
+ seen_implicit_none.
+
+ PR fortran/77694
@@ -12081,6 +13943,20 @@ Index: gcc/fortran/ChangeLog
2016-08-22 Release Manager
* GCC 6.2.0 released.
+Index: gcc/fortran/trans-stmt.c
+===================================================================
+--- a/src/gcc/fortran/trans-stmt.c (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/fortran/trans-stmt.c (.../branches/gcc-6-branch)
+@@ -5476,7 +5476,8 @@
+ desc = tmp;
+ tmp = gfc_class_data_get (tmp);
+ }
+- e3_is = E3_DESC;
++ if (code->ext.alloc.arr_spec_from_expr3)
++ e3_is = E3_DESC;
+ }
+ else
+ desc = !is_coarray ? se.expr
Index: gcc/fortran/io.c
===================================================================
--- a/src/gcc/fortran/io.c (.../tags/gcc_6_2_0_release)
@@ -12143,7 +14019,19 @@ Index: gcc/fortran/resolve.c
===================================================================
--- a/src/gcc/fortran/resolve.c (.../tags/gcc_6_2_0_release)
+++ b/src/gcc/fortran/resolve.c (.../branches/gcc-6-branch)
-@@ -6508,15 +6508,15 @@
+@@ -5105,6 +5105,11 @@
+
+ if (sym->ts.type != BT_UNKNOWN)
+ gfc_variable_attr (e, &e->ts);
++ else if (sym->attr.flavor == FL_PROCEDURE
++ && sym->attr.function && sym->result
++ && sym->result->ts.type != BT_UNKNOWN
++ && sym->result->attr.proc_pointer)
++ e->ts = sym->result->ts;
+ else
+ {
+ /* Must be a simple variable reference. */
+@@ -6508,15 +6513,15 @@
/* Convert start, end, and step to the same type as var. */
if (iter->start->ts.kind != iter->var->ts.kind
|| iter->start->ts.type != iter->var->ts.type)
@@ -12162,7 +14050,7 @@ Index: gcc/fortran/resolve.c
if (iter->start->expr_type == EXPR_CONSTANT
&& iter->end->expr_type == EXPR_CONSTANT
-@@ -8244,6 +8244,18 @@
+@@ -8244,6 +8249,18 @@
/* Mark this as an associate variable. */
sym->attr.associate_var = 1;
@@ -12181,7 +14069,7 @@ Index: gcc/fortran/resolve.c
/* If the target is a good class object, so is the associate variable. */
if (sym->ts.type == BT_CLASS && gfc_expr_attr (target).class_ok)
sym->attr.class_ok = 1;
-@@ -8936,7 +8948,7 @@
+@@ -8936,7 +8953,7 @@
if (label->defined == ST_LABEL_UNKNOWN)
{
gfc_error ("Label %d referenced at %L is never defined", label->value,
@@ -12190,7 +14078,7 @@ Index: gcc/fortran/resolve.c
return;
}
-@@ -9431,6 +9443,24 @@
+@@ -9431,6 +9448,24 @@
case EXEC_WAIT:
break;
@@ -12215,7 +14103,7 @@ Index: gcc/fortran/resolve.c
case EXEC_OACC_PARALLEL_LOOP:
case EXEC_OACC_PARALLEL:
case EXEC_OACC_KERNELS_LOOP:
-@@ -9443,9 +9473,7 @@
+@@ -9443,9 +9478,7 @@
case EXEC_OACC_CACHE:
case EXEC_OACC_ENTER_DATA:
case EXEC_OACC_EXIT_DATA:
@@ -12225,7 +14113,7 @@ Index: gcc/fortran/resolve.c
case EXEC_OMP_CRITICAL:
case EXEC_OMP_DISTRIBUTE:
case EXEC_OMP_DISTRIBUTE_PARALLEL_DO:
-@@ -11479,6 +11507,27 @@
+@@ -11479,6 +11512,27 @@
}
@@ -12253,7 +14141,7 @@ Index: gcc/fortran/resolve.c
/* Resolve symbols with flavor variable. */
static bool
-@@ -11518,19 +11567,10 @@
+@@ -11518,19 +11572,10 @@
}
/* Constraints on deferred type parameter. */
@@ -12276,7 +14164,7 @@ Index: gcc/fortran/resolve.c
{
/* Make sure that character string variables with assumed length are
dummy arguments. */
-@@ -11961,6 +12001,13 @@
+@@ -11961,6 +12006,13 @@
iface = sym->ts.interface;
sym->ts.interface = NULL;
@@ -12290,7 +14178,7 @@ Index: gcc/fortran/resolve.c
if (iface == NULL)
goto check_formal;
-@@ -13640,6 +13687,10 @@
+@@ -13640,6 +13692,10 @@
return false;
}
@@ -12301,7 +14189,7 @@ Index: gcc/fortran/resolve.c
/* Make sure a parameter that has been implicitly typed still
matches the implicit type, since PARAMETER statements can precede
IMPLICIT statements. */
-@@ -15660,7 +15711,8 @@
+@@ -15660,7 +15716,8 @@
/* As gfc_resolve can be called during resolution of an OpenMP construct
body, we should clear any state associated to it, so that say NS's
DO loops are not interpreted as OpenMP loops. */
@@ -12311,7 +14199,7 @@ Index: gcc/fortran/resolve.c
resolve_types (ns);
component_assignment_level = 0;
-@@ -15672,5 +15724,6 @@
+@@ -15672,5 +15729,6 @@
gfc_run_passes (ns);
@@ -12615,7 +14503,31 @@ Index: gcc/fortran/parse.c
gfc_current_locus.lb->truncated = 0;
gfc_advance_line ();
-@@ -4701,6 +4695,7 @@
+@@ -3565,17 +3559,18 @@
+ /* Fortran 2008, C1116. */
+ switch (st)
+ {
+- case ST_DATA_DECL:
++ case ST_ATTR_DECL:
+ case ST_COMMON:
+ case ST_DATA:
+- case ST_TYPE:
++ case ST_DATA_DECL:
++ case ST_DERIVED_DECL:
+ case ST_END_BLOCK_DATA:
+- case ST_ATTR_DECL:
+ case ST_EQUIVALENCE:
+- case ST_PARAMETER:
+ case ST_IMPLICIT:
+ case ST_IMPLICIT_NONE:
+- case ST_DERIVED_DECL:
++ case ST_PARAMETER:
++ case ST_STRUCTURE_DECL:
++ case ST_TYPE:
+ case ST_USE:
+ break;
+
+@@ -4701,6 +4696,7 @@
np = new_level (cp);
np->op = cp->op;
np->block = NULL;
@@ -12663,7 +14575,38 @@ Index: gcc/fortran/dependency.c
===================================================================
--- a/src/gcc/fortran/dependency.c (.../tags/gcc_6_2_0_release)
+++ b/src/gcc/fortran/dependency.c (.../branches/gcc-6-branch)
-@@ -1252,8 +1252,15 @@
+@@ -226,10 +226,27 @@
+ if ((args1->expr == NULL) ^ (args2->expr == NULL))
+ return -2;
+
+- if (args1->expr != NULL && args2->expr != NULL
+- && gfc_dep_compare_expr (args1->expr, args2->expr) != 0)
+- return -2;
++ if (args1->expr != NULL && args2->expr != NULL)
++ {
++ gfc_expr *e1, *e2;
++ e1 = args1->expr;
++ e2 = args2->expr;
+
++ if (gfc_dep_compare_expr (e1, e2) != 0)
++ return -2;
++
++ /* Special case: String arguments which compare equal can have
++ different lengths, which makes them different in calls to
++ procedures. */
++
++ if (e1->expr_type == EXPR_CONSTANT
++ && e1->ts.type == BT_CHARACTER
++ && e2->expr_type == EXPR_CONSTANT
++ && e2->ts.type == BT_CHARACTER
++ && e1->value.character.length != e2->value.character.length)
++ return -2;
++ }
++
+ args1 = args1->next;
+ args2 = args2->next;
+ }
+@@ -1252,8 +1269,15 @@
gfc_constructor *c;
int n;
@@ -12680,6 +14623,33 @@ Index: gcc/fortran/dependency.c
switch (expr2->expr_type)
{
case EXPR_OP:
+Index: gcc/fortran/trans-intrinsic.c
+===================================================================
+--- a/src/gcc/fortran/trans-intrinsic.c (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/fortran/trans-intrinsic.c (.../branches/gcc-6-branch)
+@@ -5815,9 +5815,20 @@
+ if (actual->expr->ts.type == BT_CLASS)
+ gfc_add_class_array_ref (actual->expr);
+
+- argse.want_pointer = 1;
+ argse.data_not_needed = 1;
+- gfc_conv_expr_descriptor (&argse, actual->expr);
++ if (gfc_is_alloc_class_array_function (actual->expr))
++ {
++ /* For functions that return a class array conv_expr_descriptor is not
++ able to get the descriptor right. Therefore this special case. */
++ gfc_conv_expr_reference (&argse, actual->expr);
++ argse.expr = gfc_build_addr_expr (NULL_TREE,
++ gfc_class_data_get (argse.expr));
++ }
++ else
++ {
++ argse.want_pointer = 1;
++ gfc_conv_expr_descriptor (&argse, actual->expr);
++ }
+ gfc_add_block_to_block (&se->pre, &argse.pre);
+ gfc_add_block_to_block (&se->post, &argse.post);
+ arg1 = gfc_evaluate_now (argse.expr, &se->pre);
Index: gcc/fortran/simplify.c
===================================================================
--- a/src/gcc/fortran/simplify.c (.../tags/gcc_6_2_0_release)
@@ -578439,6 +580409,283 @@ Index: gcc/tree-vect-patterns.c
/* Function vect_recog_bool_pattern
Try to find pattern like following:
+Index: gcc/tree-vect-stmts.c
+===================================================================
+--- a/src/gcc/tree-vect-stmts.c (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/tree-vect-stmts.c (.../branches/gcc-6-branch)
+@@ -162,11 +162,10 @@
+ (and its group). */
+
+ static tree
+-create_array_ref (tree type, tree ptr, struct data_reference *first_dr)
++create_array_ref (tree type, tree ptr, tree alias_ptr_type)
+ {
+- tree mem_ref, alias_ptr_type;
++ tree mem_ref;
+
+- alias_ptr_type = reference_alias_ptr_type (DR_REF (first_dr));
+ mem_ref = build2 (MEM_REF, type, ptr, build_int_cst (alias_ptr_type, 0));
+ /* Arrays have the same alignment as their type. */
+ set_ptr_info_alignment (get_ptr_info (ptr), TYPE_ALIGN_UNIT (type), 0);
+@@ -5179,6 +5178,35 @@
+ return vect_gen_perm_mask_checked (vectype, sel);
+ }
+
++/* Function get_group_alias_ptr_type.
++
++ Return the alias type for the group starting at FIRST_STMT. */
++
++static tree
++get_group_alias_ptr_type (gimple *first_stmt)
++{
++ struct data_reference *first_dr, *next_dr;
++ gimple *next_stmt;
++
++ first_dr = STMT_VINFO_DATA_REF (vinfo_for_stmt (first_stmt));
++ next_stmt = GROUP_NEXT_ELEMENT (vinfo_for_stmt (first_stmt));
++ while (next_stmt)
++ {
++ next_dr = STMT_VINFO_DATA_REF (vinfo_for_stmt (next_stmt));
++ if (get_alias_set (DR_REF (first_dr))
++ != get_alias_set (DR_REF (next_dr)))
++ {
++ if (dump_enabled_p ())
++ dump_printf_loc (MSG_NOTE, vect_location,
++ "conflicting alias set types.\n");
++ return ptr_type_node;
++ }
++ next_stmt = GROUP_NEXT_ELEMENT (vinfo_for_stmt (next_stmt));
++ }
++ return reference_alias_ptr_type (DR_REF (first_dr));
++}
++
++
+ /* Function vectorizable_store.
+
+ Check if STMT defines a non scalar data-ref (array/pointer/structure) that
+@@ -5233,6 +5261,7 @@
+ enum vect_def_type scatter_idx_dt = vect_unknown_def_type;
+ enum vect_def_type scatter_src_dt = vect_unknown_def_type;
+ gimple *new_stmt;
++ tree ref_type;
+
+ if (!STMT_VINFO_RELEVANT_P (stmt_info) && !bb_vinfo)
+ return false;
+@@ -5596,6 +5625,8 @@
+ /* VEC_NUM is the number of vect stmts to be created for this
+ group. */
+ vec_num = group_size;
++
++ ref_type = get_group_alias_ptr_type (first_stmt);
+ }
+ else
+ {
+@@ -5602,6 +5633,7 @@
+ first_stmt = stmt;
+ first_dr = dr;
+ group_size = vec_num = 1;
++ ref_type = reference_alias_ptr_type (DR_REF (first_dr));
+ }
+
+ if (dump_enabled_p ())
+@@ -5628,7 +5660,7 @@
+ (unshare_expr (DR_BASE_ADDRESS (first_dr)),
+ size_binop (PLUS_EXPR,
+ convert_to_ptrofftype (unshare_expr (DR_OFFSET (first_dr))),
+- convert_to_ptrofftype (DR_INIT(first_dr))));
++ convert_to_ptrofftype (DR_INIT (first_dr))));
+ stride_step = fold_convert (sizetype, unshare_expr (DR_STEP (first_dr)));
+
+ /* For a store with loop-invariant (but other than power-of-2)
+@@ -5681,7 +5713,7 @@
+ gsi_insert_seq_on_edge_immediate (loop_preheader_edge (loop), stmts);
+
+ prev_stmt_info = NULL;
+- alias_off = build_int_cst (reference_alias_ptr_type (DR_REF (first_dr)), 0);
++ alias_off = build_int_cst (ref_type, 0);
+ next_stmt = first_stmt;
+ for (g = 0; g < group_size; g++)
+ {
+@@ -5883,11 +5915,10 @@
+ && integer_zerop (DR_OFFSET (first_dr))
+ && integer_zerop (DR_INIT (first_dr))
+ && alias_sets_conflict_p (get_alias_set (aggr_type),
+- get_alias_set (DR_REF (first_dr))))
++ get_alias_set (TREE_TYPE (ref_type))))
+ {
+ dataref_ptr = unshare_expr (DR_BASE_ADDRESS (first_dr));
+- dataref_offset = build_int_cst (reference_alias_ptr_type
+- (DR_REF (first_dr)), 0);
++ dataref_offset = build_int_cst (ref_type, 0);
+ inv_p = false;
+ }
+ else
+@@ -5938,7 +5969,7 @@
+
+ /* Emit:
+ MEM_REF[...all elements...] = STORE_LANES (VEC_ARRAY). */
+- data_ref = create_array_ref (aggr_type, dataref_ptr, first_dr);
++ data_ref = create_array_ref (aggr_type, dataref_ptr, ref_type);
+ new_stmt = gimple_build_call_internal (IFN_STORE_LANES, 1, vec_array);
+ gimple_call_set_lhs (new_stmt, data_ref);
+ vect_finish_stmt_generation (stmt, new_stmt, gsi);
+@@ -5976,8 +6007,7 @@
+ dataref_ptr,
+ dataref_offset
+ ? dataref_offset
+- : build_int_cst (reference_alias_ptr_type
+- (DR_REF (first_dr)), 0));
++ : build_int_cst (ref_type, 0));
+ align = TYPE_ALIGN_UNIT (vectype);
+ if (aligned_access_p (first_dr))
+ misalign = 0;
+@@ -6200,7 +6230,7 @@
+ tree dataref_offset = NULL_TREE;
+ gimple *ptr_incr = NULL;
+ int ncopies;
+- int i, j, group_size = -1, group_gap_adj;
++ int i, j, group_size, group_gap_adj;
+ tree msq = NULL_TREE, lsq;
+ tree offset = NULL_TREE;
+ tree byte_offset = NULL_TREE;
+@@ -6227,6 +6257,7 @@
+ int gather_scale = 1;
+ enum vect_def_type gather_dt = vect_unknown_def_type;
+ vec_info *vinfo = stmt_info->vinfo;
++ tree ref_type;
+
+ if (!STMT_VINFO_RELEVANT_P (stmt_info) && !bb_vinfo)
+ return false;
+@@ -6697,10 +6728,19 @@
+ gcc_assert (!nested_in_vect_loop);
+
+ if (slp && grouped_load)
+- first_dr = STMT_VINFO_DATA_REF
+- (vinfo_for_stmt (GROUP_FIRST_ELEMENT (stmt_info)));
++ {
++ first_stmt = GROUP_FIRST_ELEMENT (stmt_info);
++ first_dr = STMT_VINFO_DATA_REF (vinfo_for_stmt (first_stmt));
++ group_size = GROUP_SIZE (vinfo_for_stmt (first_stmt));
++ ref_type = get_group_alias_ptr_type (first_stmt);
++ }
+ else
+- first_dr = dr;
++ {
++ first_stmt = stmt;
++ first_dr = dr;
++ group_size = 1;
++ ref_type = reference_alias_ptr_type (DR_REF (first_dr));
++ }
+
+ stride_base
+ = fold_build_pointer_plus
+@@ -6744,7 +6784,7 @@
+
+ prev_stmt_info = NULL;
+ running_off = offvar;
+- alias_off = build_int_cst (reference_alias_ptr_type (DR_REF (first_dr)), 0);
++ alias_off = build_int_cst (ref_type, 0);
+ int nloads = nunits;
+ tree ltype = TREE_TYPE (vectype);
+ auto_vec<tree> dr_chain;
+@@ -6836,6 +6876,7 @@
+ if (grouped_load)
+ {
+ first_stmt = GROUP_FIRST_ELEMENT (stmt_info);
++ group_size = GROUP_SIZE (vinfo_for_stmt (first_stmt));
+ /* For SLP vectorization we directly vectorize a subchain
+ without permutation. */
+ if (slp && ! SLP_TREE_LOAD_PERMUTATION (slp_node).exists ())
+@@ -6861,7 +6902,6 @@
+ return true;
+ }
+ first_dr = STMT_VINFO_DATA_REF (vinfo_for_stmt (first_stmt));
+- group_size = GROUP_SIZE (vinfo_for_stmt (first_stmt));
+ group_gap_adj = 0;
+
+ /* VEC_NUM is the number of vect stmts to be created for this group. */
+@@ -6879,6 +6919,8 @@
+ }
+ else
+ vec_num = group_size;
++
++ ref_type = get_group_alias_ptr_type (first_stmt);
+ }
+ else
+ {
+@@ -6886,6 +6928,7 @@
+ first_dr = dr;
+ group_size = vec_num = 1;
+ group_gap_adj = 0;
++ ref_type = reference_alias_ptr_type (DR_REF (first_dr));
+ }
+
+ alignment_support_scheme = vect_supportable_dr_alignment (first_dr, false);
+@@ -7046,13 +7089,12 @@
+ && integer_zerop (DR_OFFSET (first_dr))
+ && integer_zerop (DR_INIT (first_dr))
+ && alias_sets_conflict_p (get_alias_set (aggr_type),
+- get_alias_set (DR_REF (first_dr)))
++ get_alias_set (TREE_TYPE (ref_type)))
+ && (alignment_support_scheme == dr_aligned
+ || alignment_support_scheme == dr_unaligned_supported))
+ {
+ dataref_ptr = unshare_expr (DR_BASE_ADDRESS (first_dr));
+- dataref_offset = build_int_cst (reference_alias_ptr_type
+- (DR_REF (first_dr)), 0);
++ dataref_offset = build_int_cst (ref_type, 0);
+ inv_p = false;
+ }
+ else if (first_stmt_for_drptr
+@@ -7098,7 +7140,7 @@
+
+ /* Emit:
+ VEC_ARRAY = LOAD_LANES (MEM_REF[...all elements...]). */
+- data_ref = create_array_ref (aggr_type, dataref_ptr, first_dr);
++ data_ref = create_array_ref (aggr_type, dataref_ptr, ref_type);
+ new_stmt = gimple_build_call_internal (IFN_LOAD_LANES, 1, data_ref);
+ gimple_call_set_lhs (new_stmt, vec_array);
+ vect_finish_stmt_generation (stmt, new_stmt, gsi);
+@@ -7134,8 +7176,7 @@
+ = fold_build2 (MEM_REF, vectype, dataref_ptr,
+ dataref_offset
+ ? dataref_offset
+- : build_int_cst (reference_alias_ptr_type
+- (DR_REF (first_dr)), 0));
++ : build_int_cst (ref_type, 0));
+ align = TYPE_ALIGN_UNIT (vectype);
+ if (alignment_support_scheme == dr_aligned)
+ {
+@@ -7191,8 +7232,7 @@
+ vect_finish_stmt_generation (stmt, new_stmt, gsi);
+ data_ref
+ = build2 (MEM_REF, vectype, ptr,
+- build_int_cst (reference_alias_ptr_type
+- (DR_REF (first_dr)), 0));
++ build_int_cst (ref_type, 0));
+ vec_dest = vect_create_destination_var (scalar_dest,
+ vectype);
+ new_stmt = gimple_build_assign (vec_dest, data_ref);
+@@ -7217,8 +7257,7 @@
+ vect_finish_stmt_generation (stmt, new_stmt, gsi);
+ data_ref
+ = build2 (MEM_REF, vectype, ptr,
+- build_int_cst (reference_alias_ptr_type
+- (DR_REF (first_dr)), 0));
++ build_int_cst (ref_type, 0));
+ break;
+ }
+ case dr_explicit_realign_optimized:
+@@ -7234,8 +7273,7 @@
+ vect_finish_stmt_generation (stmt, new_stmt, gsi);
+ data_ref
+ = build2 (MEM_REF, vectype, new_temp,
+- build_int_cst (reference_alias_ptr_type
+- (DR_REF (first_dr)), 0));
++ build_int_cst (ref_type, 0));
+ break;
+ default:
+ gcc_unreachable ();
Index: gcc/config.gcc
===================================================================
--- a/src/gcc/config.gcc (.../tags/gcc_6_2_0_release)
@@ -578593,7 +580840,250 @@ Index: gcc/config/sparc/sparc.md
===================================================================
--- a/src/gcc/config/sparc/sparc.md (.../tags/gcc_6_2_0_release)
+++ b/src/gcc/config/sparc/sparc.md (.../branches/gcc-6-branch)
-@@ -8468,7 +8468,7 @@
+@@ -248,12 +248,13 @@
+ (symbol_ref "TARGET_SPARCLET") (const_string "sparclet")]
+ (const_string "v7"))))
+
+-(define_attr "cpu_feature" "none,fpu,fpunotv9,v9,vis,vis3,vis4" (const_string "none"))
++(define_attr "cpu_feature" "none,fpu,fpunotv9,v9,vis,vis3,vis4"
++ (const_string "none"))
+
+ (define_attr "enabled" ""
+ (cond [(eq_attr "cpu_feature" "none") (const_int 1)
+ (eq_attr "cpu_feature" "fpu") (symbol_ref "TARGET_FPU")
+- (eq_attr "cpu_feature" "fpunotv9") (symbol_ref "TARGET_FPU && ! TARGET_V9")
++ (eq_attr "cpu_feature" "fpunotv9") (symbol_ref "TARGET_FPU && !TARGET_V9")
+ (eq_attr "cpu_feature" "v9") (symbol_ref "TARGET_V9")
+ (eq_attr "cpu_feature" "vis") (symbol_ref "TARGET_VIS")
+ (eq_attr "cpu_feature" "vis3") (symbol_ref "TARGET_VIS3")
+@@ -478,8 +479,7 @@
+ (const_string "true")
+ ] (const_string "false")))
+
+-;; True if the instruction executes in the V3 pipeline, in M7 and
+-;; later processors.
++;; True if the instruction executes in the V3 pipeline, in M7 and later processors.
+ (define_attr "v3pipe" "false,true" (const_string "false"))
+
+ (define_delay (eq_attr "type" "call")
+@@ -1464,8 +1464,8 @@
+ fzeros\t%0
+ fones\t%0"
+ [(set_attr "type" "*,*,load,store,vismv,vismv,fpmove,fpload,fpstore,visl,visl")
+- (set_attr "v3pipe" "*,*,*,*,true,true,*,*,*,true,true")
+- (set_attr "cpu_feature" "*,*,*,*,vis3,vis3,*,*,*,vis,vis")])
++ (set_attr "cpu_feature" "*,*,*,*,vis3,vis3,*,*,*,vis,vis")
++ (set_attr "v3pipe" "*,*,*,*,true,true,*,*,*,true,true")])
+
+ (define_insn "*movsi_lo_sum"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+@@ -1630,10 +1630,10 @@
+ fzero\t%0
+ fone\t%0"
+ [(set_attr "type" "store,store,store,load,*,*,*,*,fpstore,fpload,*,*,fpmove,*,*,*,fpload,fpstore,visl,visl")
+- (set_attr "v3pipe" "false, false, false, false,false,false,false,false,false,false,false,false,false,false,false,false,false,false, true, true")
+ (set_attr "length" "*,2,*,*,2,2,2,2,*,*,2,2,*,2,2,2,*,*,*,*")
+ (set_attr "fptype" "*,*,*,*,*,*,*,*,*,*,*,*,double,*,*,*,*,*,double,double")
+- (set_attr "cpu_feature" "v9,*,*,*,*,*,*,*,fpu,fpu,fpu,fpu,v9,fpunotv9,vis3,vis3,fpu,fpu,vis,vis")])
++ (set_attr "cpu_feature" "v9,*,*,*,*,*,*,*,fpu,fpu,fpu,fpu,v9,fpunotv9,vis3,vis3,fpu,fpu,vis,vis")
++ (set_attr "v3pipe" "*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,true,true")])
+
+ (define_insn "*movdi_insn_sp64"
+ [(set (match_operand:DI 0 "nonimmediate_operand" "=r,r,r, m, r,*e,?*e,?*e,?W,b,b")
+@@ -1654,9 +1654,9 @@
+ fzero\t%0
+ fone\t%0"
+ [(set_attr "type" "*,*,load,store,vismv,vismv,fpmove,fpload,fpstore,visl,visl")
+- (set_attr "v3pipe" "*, *, *, *, *, *, *, *, *, true, true")
+ (set_attr "fptype" "*,*,*,*,*,*,double,*,*,double,double")
+- (set_attr "cpu_feature" "*,*,*,*,vis3,vis3,*,*,*,vis,vis")])
++ (set_attr "cpu_feature" "*,*,*,*,vis3,vis3,*,*,*,vis,vis")
++ (set_attr "v3pipe" "*,*,*,*,*,*,*,*,*,true,true")])
+
+ (define_expand "movdi_pic_label_ref"
+ [(set (match_dup 3) (high:DI
+@@ -2218,8 +2218,8 @@
+ }
+ }
+ [(set_attr "type" "visl,visl,fpmove,*,*,*,vismv,vismv,fpload,load,fpstore,store")
+- (set_attr "v3pipe" "true, true, *, *, *, *, true, true, *, *, *, *")
+- (set_attr "cpu_feature" "vis,vis,fpu,*,*,*,vis3,vis3,fpu,*,fpu,*")])
++ (set_attr "cpu_feature" "vis,vis,fpu,*,*,*,vis3,vis3,fpu,*,fpu,*")
++ (set_attr "v3pipe" "true,true,*,*,*,*,true,true,*,*,*,*")])
+
+ ;; The following 3 patterns build SFmode constants in integer registers.
+
+@@ -2287,10 +2287,10 @@
+ #
+ #"
+ [(set_attr "type" "visl,visl,fpmove,*,*,*,fpload,store,fpstore,load,store,*,*,*,*")
+- (set_attr "v3pipe" "true, true, *, *, *, *, *, *, *, *, *, *, *, *, *")
+ (set_attr "length" "*,*,*,2,2,2,*,*,*,*,*,2,2,2,2")
+ (set_attr "fptype" "double,double,double,*,*,*,*,*,*,*,*,*,*,*,*")
+- (set_attr "cpu_feature" "vis,vis,v9,fpunotv9,vis3,vis3,fpu,v9,fpu,*,*,fpu,*,*,fpu")])
++ (set_attr "cpu_feature" "vis,vis,v9,fpunotv9,vis3,vis3,fpu,v9,fpu,*,*,fpu,*,*,fpu")
++ (set_attr "v3pipe" "true,true,*,*,*,*,*,*,*,*,*,*,*,*,*")])
+
+ (define_insn "*movdf_insn_sp64"
+ [(set (match_operand:DF 0 "nonimmediate_operand" "=b,b,e,*r, e, e,W, *r,*r, m,*r")
+@@ -2311,10 +2311,10 @@
+ stx\t%r1, %0
+ #"
+ [(set_attr "type" "visl,visl,fpmove,vismv,vismv,load,store,*,load,store,*")
+- (set_attr "v3pipe" "true, true, *, *, *, *, *, *, *, *, *")
+ (set_attr "length" "*,*,*,*,*,*,*,*,*,*,2")
+ (set_attr "fptype" "double,double,double,double,double,*,*,*,*,*,*")
+- (set_attr "cpu_feature" "vis,vis,fpu,vis3,vis3,fpu,fpu,*,*,*,*")])
++ (set_attr "cpu_feature" "vis,vis,fpu,vis3,vis3,fpu,fpu,*,*,*,*")
++ (set_attr "v3pipe" "true,true,*,*,*,*,*,*,*,*,*")])
+
+ ;; This pattern builds DFmode constants in integer registers.
+ (define_split
+@@ -2993,8 +2993,8 @@
+ lduw\t%1, %0
+ movstouw\t%1, %0"
+ [(set_attr "type" "shift,load,*")
+- (set_attr "v3pipe" "*,*,true")
+- (set_attr "cpu_feature" "*,*,vis3")])
++ (set_attr "cpu_feature" "*,*,vis3")
++ (set_attr "v3pipe" "*,*,true")])
+
+ (define_insn_and_split "*zero_extendsidi2_insn_sp32"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+@@ -3308,9 +3308,9 @@
+ ldsw\t%1, %0
+ movstosw\t%1, %0"
+ [(set_attr "type" "shift,sload,*")
+- (set_attr "v3pipe" "*,*,true")
+ (set_attr "us3load_type" "*,3cycle,*")
+- (set_attr "cpu_feature" "*,*,vis3")])
++ (set_attr "cpu_feature" "*,*,vis3")
++ (set_attr "v3pipe" "*,*,true")])
+
+
+ ;; Special pattern for optimizing bit-field compares. This is needed
+@@ -7794,7 +7794,8 @@
+ (define_mode_iterator VM64 [V1DI V2SI V4HI V8QI])
+ (define_mode_iterator VMALL [V1SI V2HI V4QI V1DI V2SI V4HI V8QI])
+
+-(define_mode_attr vbits [(V2SI "32") (V4HI "16") (V1SI "32s") (V2HI "16s") (V8QI "8")])
++(define_mode_attr vbits [(V2SI "32") (V4HI "16") (V1SI "32s") (V2HI "16s")
++ (V8QI "8")])
+ (define_mode_attr vconstr [(V1SI "f") (V2HI "f") (V4QI "f")
+ (V1DI "e") (V2SI "e") (V4HI "e") (V8QI "e")])
+ (define_mode_attr vfptype [(V1SI "single") (V2HI "single") (V4QI "single")
+@@ -7829,8 +7830,8 @@
+ movstouw\t%1, %0
+ movwtos\t%1, %0"
+ [(set_attr "type" "visl,visl,vismv,fpload,fpstore,store,load,store,*,vismv,vismv")
+- (set_attr "v3pipe" "true,true,true,false,false,false,false,false,false,true,true")
+- (set_attr "cpu_feature" "vis,vis,vis,*,*,*,*,*,*,vis3,vis3")])
++ (set_attr "cpu_feature" "vis,vis,vis,*,*,*,*,*,*,vis3,vis3")
++ (set_attr "v3pipe" "true,true,true,*,*,*,*,*,*,true,true")])
+
+ (define_insn "*mov<VM64:mode>_insn_sp64"
+ [(set (match_operand:VM64 0 "nonimmediate_operand" "=e,e,e,e,m,m,*r, m,*r, e,*r")
+@@ -7852,8 +7853,8 @@
+ movxtod\t%1, %0
+ mov\t%1, %0"
+ [(set_attr "type" "visl,visl,vismv,fpload,fpstore,store,load,store,vismv,vismv,*")
+- (set_attr "v3pipe" "true, true, true, false, false, false, false, false, false, false, false")
+- (set_attr "cpu_feature" "vis,vis,vis,*,*,*,*,*,vis3,vis3,*")])
++ (set_attr "cpu_feature" "vis,vis,vis,*,*,*,*,*,vis3,vis3,*")
++ (set_attr "v3pipe" "true,true,true,*,*,*,*,*,*,*,*")])
+
+ (define_insn "*mov<VM64:mode>_insn_sp32"
+ [(set (match_operand:VM64 0 "nonimmediate_operand" "=e,e,e,*r, f,e,m,m,U,T, o,*r")
+@@ -7876,9 +7877,9 @@
+ #
+ #"
+ [(set_attr "type" "visl,visl,vismv,*,*,fpload,fpstore,store,load,store,*,*")
+- (set_attr "v3pipe" "true, true, true, false, false, false, false, false, false, false, false, false")
+ (set_attr "length" "*,*,*,2,2,*,*,*,*,*,2,2")
+- (set_attr "cpu_feature" "vis,vis,vis,vis3,vis3,*,*,*,*,*,*,*")])
++ (set_attr "cpu_feature" "vis,vis,vis,vis3,vis3,*,*,*,*,*,*,*")
++ (set_attr "v3pipe" "true,true,true,*,*,*,*,*,*,*,*,*")])
+
+ (define_split
+ [(set (match_operand:VM64 0 "memory_operand" "")
+@@ -7973,8 +7974,8 @@
+ "TARGET_VIS"
+ "f<vlinsn><vlsuf>\t%1, %2, %0"
+ [(set_attr "type" "visl")
+- (set_attr "v3pipe" "true")
+- (set_attr "fptype" "<vfptype>")])
++ (set_attr "fptype" "<vfptype>")
++ (set_attr "v3pipe" "true")])
+
+ (define_insn "*not_<code><mode>3"
+ [(set (match_operand:VL 0 "register_operand" "=<vconstr>")
+@@ -7983,8 +7984,8 @@
+ "TARGET_VIS"
+ "f<vlninsn><vlsuf>\t%1, %2, %0"
+ [(set_attr "type" "visl")
+- (set_attr "v3pipe" "true")
+- (set_attr "fptype" "<vfptype>")])
++ (set_attr "fptype" "<vfptype>")
++ (set_attr "v3pipe" "true")])
+
+ ;; (ior (not (op1)) (not (op2))) is the canonical form of NAND.
+ (define_insn "*nand<mode>_vis"
+@@ -7994,8 +7995,8 @@
+ "TARGET_VIS"
+ "fnand<vlsuf>\t%1, %2, %0"
+ [(set_attr "type" "visl")
+- (set_attr "v3pipe" "true")
+- (set_attr "fptype" "<vfptype>")])
++ (set_attr "fptype" "<vfptype>")
++ (set_attr "v3pipe" "true")])
+
+ (define_code_iterator vlnotop [ior and])
+
+@@ -8006,8 +8007,8 @@
+ "TARGET_VIS"
+ "f<vlinsn>not1<vlsuf>\t%1, %2, %0"
+ [(set_attr "type" "visl")
+- (set_attr "v3pipe" "true")
+- (set_attr "fptype" "<vfptype>")])
++ (set_attr "fptype" "<vfptype>")
++ (set_attr "v3pipe" "true")])
+
+ (define_insn "*<code>_not2<mode>_vis"
+ [(set (match_operand:VL 0 "register_operand" "=<vconstr>")
+@@ -8016,8 +8017,8 @@
+ "TARGET_VIS"
+ "f<vlinsn>not2<vlsuf>\t%1, %2, %0"
+ [(set_attr "type" "visl")
+- (set_attr "v3pipe" "true")
+- (set_attr "fptype" "<vfptype>")])
++ (set_attr "fptype" "<vfptype>")
++ (set_attr "v3pipe" "true")])
+
+ (define_insn "one_cmpl<mode>2"
+ [(set (match_operand:VL 0 "register_operand" "=<vconstr>")
+@@ -8025,8 +8026,8 @@
+ "TARGET_VIS"
+ "fnot1<vlsuf>\t%1, %0"
+ [(set_attr "type" "visl")
+- (set_attr "v3pipe" "true")
+- (set_attr "fptype" "<vfptype>")])
++ (set_attr "fptype" "<vfptype>")
++ (set_attr "v3pipe" "true")])
+
+ ;; Hard to generate VIS instructions. We have builtins for these.
+
+@@ -8392,8 +8393,8 @@
+ "TARGET_VIS"
+ "fcmp<code><GCM:gcm_name>\t%1, %2, %0"
+ [(set_attr "type" "visl")
+- (set_attr "v3pipe" "true")
+- (set_attr "fptype" "double")])
++ (set_attr "fptype" "double")
++ (set_attr "v3pipe" "true")])
+
+ (define_insn "fpcmp<code>8<P:mode>_vis"
+ [(set (match_operand:P 0 "register_operand" "=r")
+@@ -8468,7 +8469,7 @@
(match_operand:DI 2 "register_or_zero_operand" "rJ")))
(set (zero_extract:DI (reg:DI GSR_REG) (const_int 32) (const_int 32))
(plus:DI (match_dup 1) (match_dup 2)))]
@@ -578602,7 +581092,7 @@ Index: gcc/config/sparc/sparc.md
"bmask\t%r1, %r2, %0"
[(set_attr "type" "array")
(set_attr "v3pipe" "true")])
-@@ -8513,7 +8513,7 @@
+@@ -8513,7 +8514,7 @@
mask |= (INTVAL (XVECEXP (sel, 0, i)) & 0xf) << (28 - i*4);
sel = force_reg (SImode, gen_int_mode (mask, SImode));
@@ -578611,6 +581101,39 @@ Index: gcc/config/sparc/sparc.md
emit_insn (gen_bshufflev8qi_vis (operands[0], operands[1], operands[2]));
DONE;
})
+@@ -8650,8 +8651,8 @@
+ "TARGET_VIS3"
+ "pdistn\t%1, %2, %0"
+ [(set_attr "type" "pdistn")
+- (set_attr "v3pipe" "true")
+- (set_attr "fptype" "double")])
++ (set_attr "fptype" "double")
++ (set_attr "v3pipe" "true")])
+
+ (define_insn "fmean16_vis"
+ [(set (match_operand:V4HI 0 "register_operand" "=e")
+Index: gcc/config/sparc/sparc-c.c
+===================================================================
+--- a/src/gcc/config/sparc/sparc-c.c (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/config/sparc/sparc-c.c (.../branches/gcc-6-branch)
+@@ -29,7 +29,7 @@
+ {
+ builtin_define_std ("sparc");
+
+- if (TARGET_64BIT)
++ if (TARGET_ARCH64)
+ {
+ cpp_assert (parse_in, "cpu=sparc64");
+ cpp_assert (parse_in, "machine=sparc64");
+@@ -43,7 +43,7 @@
+ if (TARGET_VIS4)
+ {
+ cpp_define (parse_in, "__VIS__=0x400");
+- cpp_define (parse_in, "__VIS__=0x400");
++ cpp_define (parse_in, "__VIS=0x400");
+ }
+ else if (TARGET_VIS3)
+ {
Index: gcc/config/sparc/sparc.c
===================================================================
--- a/src/gcc/config/sparc/sparc.c (.../tags/gcc_6_2_0_release)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/gcc-6.git
More information about the Reproducible-commits
mailing list