[gcc-6] 228/401: * Update to SVN 20161018 (r241295, 6.2.1) from the gcc-6-branch.
Ximin Luo
infinity0 at debian.org
Wed Apr 5 15:49:41 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 b78545c685e10bdb1b9faa0b10d9fb161ad9e96f
Author: doko <doko at 6ca36cf4-e1d1-0310-8c6f-e303bb2178ca>
Date: Tue Oct 18 07:54:45 2016 +0000
* Update to SVN 20161018 (r241295, 6.2.1) from the gcc-6-branch.
git-svn-id: svn://anonscm.debian.org/gcccvs/branches/sid/gcc-6@9000 6ca36cf4-e1d1-0310-8c6f-e303bb2178ca
---
debian/changelog | 8 +-
debian/patches/svn-updates.diff | 4005 ++++++++++++++++++++++++++++++++++++++-
2 files changed, 3970 insertions(+), 43 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 0e7451d..f2aecd0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,11 @@
gcc-6 (6.2.0-7) UNRELEASED; urgency=medium
+ * Update to SVN 20161018 (r241295, 6.2.1) from the gcc-6-branch.
+ - Fix PR libstdc++/77987, PR libstdc++/77322, PR libstdc++/72820,
+ PR libstdc++/77994, PR tree-optimization/77937, PR c++/71912,
+ PR tree-optimization/77937, PR tree-optimization/77943,
+ PR bootstrap/77995, PR fortran/77978, PR fortran/77915, PR fortran/77942.
+
[ Matthias Klose ]
* Backport Mips go closure support, taken from libffi. Closes: #839132.
* Configure with --enable-default-pie and pass -z now when pie is enabled;
@@ -9,7 +15,7 @@ gcc-6 (6.2.0-7) UNRELEASED; urgency=medium
[ Aurelien Jarno ]
* Enable logwatch on mips64el.
- -- Matthias Klose <doko at debian.org> Tue, 11 Oct 2016 08:27:46 +0200
+ -- Matthias Klose <doko at debian.org> Tue, 18 Oct 2016 09:47:37 +0200
gcc-6 (6.2.0-6) unstable; urgency=medium
diff --git a/debian/patches/svn-updates.diff b/debian/patches/svn-updates.diff
index 1b4cf6b..cda2aa2 100644
--- a/debian/patches/svn-updates.diff
+++ b/debian/patches/svn-updates.diff
@@ -1,10 +1,10 @@
-# DP: updates from the 6 branch upto 20161010 (r240907).
+# DP: updates from the 6 branch upto 20161018 (r241295).
last_update()
{
cat > ${dir}LAST_UPDATED <EOF
-Mon Oct 10 05:12:04 CEST 2016
-Mon Oct 10 03:12:04 UTC 2016 (revision 240907)
+Tue Oct 18 09:45:08 CEST 2016
+Tue Oct 18 07:45:08 UTC 2016 (revision 241295)
EOF
}
@@ -351,6 +351,309 @@ Index: libstdc++-v3/doc/xml/api.xml
<para>
The rendered HTML, as above, is also available for download on the
gcc.gnu.org site in a directory located at
+Index: libstdc++-v3/doc/xml/manual/intro.xml
+===================================================================
+--- a/src/libstdc++-v3/doc/xml/manual/intro.xml (.../tags/gcc_6_2_0_release)
++++ b/src/libstdc++-v3/doc/xml/manual/intro.xml (.../branches/gcc-6-branch)
+@@ -850,6 +850,12 @@
+ <listitem><para>Add additional overloads.
+ </para></listitem></varlistentry>
+
++ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#2062">2062</link>:
++ <emphasis>2062. Effect contradictions w/o no-throw guarantee of <code>std::function</code> swaps</emphasis>
++ </term>
++ <listitem><para>Add <code>noexcept</code> to swap functions.
++ </para></listitem></varlistentry>
++
+ <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#2063">2063</link>:
+ <emphasis>Contradictory requirements for string move assignment</emphasis>
+ </term>
+Index: libstdc++-v3/doc/xml/manual/status_cxx2011.xml
+===================================================================
+--- a/src/libstdc++-v3/doc/xml/manual/status_cxx2011.xml (.../tags/gcc_6_2_0_release)
++++ b/src/libstdc++-v3/doc/xml/manual/status_cxx2011.xml (.../branches/gcc-6-branch)
+@@ -1340,12 +1340,10 @@
+ <entry/>
+ </row>
+ <row>
+- <?dbhtml bgcolor="#B0B0B0" ?>
+ <entry>23.2.1</entry>
+ <entry>General container requirements</entry>
+- <entry>Partial</entry>
+- <entry><code>list</code> does not meet the requirements
+- relating to allocator use and propagation.</entry>
++ <entry>Y</entry>
++ <entry/>
+ </row>
+ <row>
+ <entry>23.2.2</entry>
+@@ -1396,11 +1394,10 @@
+ <entry/>
+ </row>
+ <row>
+- <?dbhtml bgcolor="#B0B0B0" ?>
+ <entry>23.3.5</entry>
+ <entry>Class template <code>list</code></entry>
+- <entry>Partial</entry>
+- <entry>Incomplete allocator support.</entry>
++ <entry>Y</entry>
++ <entry/>
+ </row>
+ <row>
+ <entry>23.3.6</entry>
+@@ -2349,8 +2346,7 @@
+ <entry>30.4.1.3</entry>
+ <entry>Timed mutex types</entry>
+ <entry/>
+- <entry>On POSIX sytems these types are only defined if the OS
+- supports the POSIX Timeouts option. </entry>
++ <entry/>
+ </row>
+ <row>
+ <entry>30.4.1.3.1</entry>
+Index: libstdc++-v3/doc/xml/manual/appendix_contributing.xml
+===================================================================
+--- a/src/libstdc++-v3/doc/xml/manual/appendix_contributing.xml (.../tags/gcc_6_2_0_release)
++++ b/src/libstdc++-v3/doc/xml/manual/appendix_contributing.xml (.../branches/gcc-6-branch)
+@@ -199,96 +199,199 @@
+
+
+ <para>
+- The unpacked source directory of libstdc++ contains the files
+- needed to create the GNU C++ Library.
++ The <filename class="directory">libstdc++-v3</filename> directory in the
++ GCC sources contains the files needed to create the GNU C++ Library.
+ </para>
+
+- <literallayout class="normal">
++<para>
+ It has subdirectories:
++</para>
+
+- doc
++<variablelist>
++ <varlistentry>
++ <term><filename class="directory">doc</filename></term>
++ <listitem>
+ Files in HTML and text format that document usage, quirks of the
+ implementation, and contributor checklists.
++ </listitem>
++ </varlistentry>
+
+- include
++ <varlistentry>
++ <term><filename class="directory">include</filename></term>
++ <listitem>
+ All header files for the C++ library are within this directory,
+ modulo specific runtime-related files that are in the libsupc++
+ directory.
+
+- include/std
+- Files meant to be found by #include <name> directives in
+- standard-conforming user programs.
++ <variablelist>
++ <varlistentry>
++ <term><filename class="directory">include/std</filename></term>
++ <listitem>
++ Files meant to be found by <code>#include <name></code> directives
++ in standard-conforming user programs.
++ </listitem>
++ </varlistentry>
+
+- include/c
++ <varlistentry>
++ <term><filename class="directory">include/c</filename></term>
++ <listitem>
+ Headers intended to directly include standard C headers.
+- [NB: this can be enabled via --enable-cheaders=c]
++ [NB: this can be enabled via <option>--enable-cheaders=c</option>]
++ </listitem>
++ </varlistentry>
+
+- include/c_global
++ <varlistentry>
++ <term><filename class="directory">include/c_global</filename></term>
++ <listitem>
+ Headers intended to include standard C headers in
+- the global namespace, and put select names into the std::
++ the global namespace, and put select names into the <code>std::</code>
+ namespace. [NB: this is the default, and is the same as
+- --enable-cheaders=c_global]
++ <option>--enable-cheaders=c_global</option>]
++ </listitem>
++ </varlistentry>
+
+- include/c_std
++ <varlistentry>
++ <term><filename class="directory">include/c_std</filename></term>
++ <listitem>
+ Headers intended to include standard C headers
+- already in namespace std, and put select names into the std::
+- namespace. [NB: this is the same as --enable-cheaders=c_std]
++ already in namespace std, and put select names into the <code>std::</code>
++ namespace. [NB: this is the same as
++ <option>--enable-cheaders=c_std</option>]
++ </listitem>
++ </varlistentry>
+
+- include/bits
++ <varlistentry>
++ <term><filename class="directory">include/bits</filename></term>
++ <listitem>
+ Files included by standard headers and by other files in
+ the bits directory.
++ </listitem>
++ </varlistentry>
+
+- include/backward
+- Headers provided for backward compatibility, such as <iostream.h>.
++ <varlistentry>
++ <term><filename class="directory">include/backward</filename></term>
++ <listitem>
++ Headers provided for backward compatibility, such as
++ <filename class="headerfile"><backward/hash_map></filename>.
+ They are not used in this library.
++ </listitem>
++ </varlistentry>
+
+- include/ext
++ <varlistentry>
++ <term><filename class="directory">include/ext</filename></term>
++ <listitem>
+ Headers that define extensions to the standard library. No
+- standard header refers to any of them.
++ standard header refers to any of them, in theory (there are some
++ exceptions).
++ </listitem>
++ </varlistentry>
++ </variablelist>
++ </listitem>
++ </varlistentry>
+
+- scripts
++ <varlistentry>
++ <term><filename class="directory">scripts</filename></term>
++ <listitem>
+ Scripts that are used during the configure, build, make, or test
+ process.
++ </listitem>
++ </varlistentry>
+
+- src
++ <varlistentry>
++ <term><filename class="directory">src</filename></term>
++ <listitem>
+ Files that are used in constructing the library, but are not
+ installed.
+
+- testsuites/[backward, demangle, ext, performance, thread, 17_* to 30_*]
++ <variablelist>
++ <varlistentry>
++ <term><filename class="directory">src/c++98</filename></term>
++ <listitem>
++ Source files compiled using <option>-std=gnu++98</option>.
++ </listitem>
++ </varlistentry>
++
++ <varlistentry>
++ <term><filename class="directory">src/c++11</filename></term>
++ <listitem>
++ Source files compiled using <option>-std=gnu++11</option>.
++ </listitem>
++ </varlistentry>
++
++ <varlistentry>
++ <term><filename class="directory">src/filesystem</filename></term>
++ <listitem>
++ Source files for the Filesystem TS.
++ </listitem>
++ </varlistentry>
++
++ <varlistentry>
++ <term><filename class="directory">src/shared</filename></term>
++ <listitem>
++ Source code included by other files under both
++ <filename class="directory">src/c++98</filename> and
++ <filename class="directory">src/c++11</filename>
++ </listitem>
++ </varlistentry>
++ </variablelist>
++ </listitem>
++ </varlistentry>
++
++ <varlistentry>
++ <term><filename class="directory">testsuites/[backward, demangle, ext, performance, thread, 17_* to 30_*]</filename></term>
++ <listitem>
+ Test programs are here, and may be used to begin to exercise the
+ library. Support for "make check" and "make check-install" is
+ complete, and runs through all the subdirectories here when this
+ command is issued from the build directory. Please note that
+- "make check" requires DejaGNU 1.4 or later to be installed. Please
+- note that "make check-script" calls the script mkcheck, which
+- requires bash, and which may need the paths to bash adjusted to
+- work properly, as /bin/bash is assumed.
++ "make check" requires DejaGNU 1.4 or later to be installed.
++ </listitem>
++ </varlistentry>
++</variablelist>
+
++<para>
+ Other subdirectories contain variant versions of certain files
+ that are meant to be copied or linked by the configure script.
+ Currently these are:
++<literallayout><filename class="directory">config/abi</filename>
++<filename class="directory">config/allocator</filename>
++<filename class="directory">config/cpu</filename>
++<filename class="directory">config/io</filename>
++<filename class="directory">config/locale</filename>
++<filename class="directory">config/os</filename>
++</literallayout>
++</para>
+
+- config/abi
+- config/cpu
+- config/io
+- config/locale
+- config/os
+-
++<para>
+ In addition, a subdirectory holds the convenience library libsupc++.
++</para>
+
+- libsupc++
++<variablelist>
++<varlistentry>
++ <term><filename class="directory">libsupc++</filename></term>
++ <listitem>
+ Contains the runtime library for C++, including exception
+ handling and memory allocation and deallocation, RTTI, terminate
+ handlers, etc.
++ </listitem>
++</varlistentry>
++</variablelist>
+
+-Note that glibc also has a bits/ subdirectory. We will either
+-need to be careful not to collide with names in its bits/
+-directory; or rename bits to (e.g.) cppbits/.
++<para>
++Note that glibc also has a <filename class="directory">bits/</filename>
++subdirectory. We need to be careful not to collide with names in its
++<filename class="directory">bits/</filename> directory. For example
++<filename class="headerfile"><bits/std_mutex.h></filename> has to be
++renamed from <filename class="headerfile"><bits/mutex.h></filename>.
++Another solution would be to rename <filename class="directory">bits</filename>
++to (e.g.) <filename class="directory">cppbits</filename>.
++</para>
+
++<para>
+ In files throughout the system, lines marked with an "XXX" indicate
+ a bug or incompletely-implemented feature. Lines marked "XXX MT"
+ indicate a place that may require attention for multi-thread safety.
+- </literallayout>
++</para>
+
+ </section>
+
Index: libstdc++-v3/doc/html/api.html
===================================================================
--- a/src/libstdc++-v3/doc/html/api.html (.../tags/gcc_6_2_0_release)
@@ -406,6 +709,235 @@ Index: libstdc++-v3/doc/html/api.html
The rendered HTML, as above, is also available for download on the
gcc.gnu.org site in a directory located at
<code class="literal"><URL:ftp://gcc.gnu.org/pub/gcc/libstdc++/doxygen/></code>.
+Index: libstdc++-v3/doc/html/manual/status.html
+===================================================================
+--- a/src/libstdc++-v3/doc/html/manual/status.html (.../tags/gcc_6_2_0_release)
++++ b/src/libstdc++-v3/doc/html/manual/status.html (.../branches/gcc-6-branch)
+@@ -186,8 +186,7 @@
+ <span class="emphasis"><em>23</em></span>
+ </td><td colspan="3" align="left">
+ <span class="emphasis"><em>Containers</em></span>
+- </td></tr><tr><td align="left">23.1</td><td align="left">General</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">23.2</td><td align="left">Container requirements</td><td align="left"> </td><td align="left"> </td></tr><tr bgcolor="#B0B0B0"><td align="left">23.2.1</td><td align="left">General container requirements</td><td align="left">Partial</td><td align="left"><code class="code">list</code> does not meet the requirements
+- relating to allocator use and propagation.</td></tr><tr><td align="left">23.2.2</td><td align="left">Container data races</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">23.2.3</td><td align="left">Sequence containers</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">23.2.4</td><td align="left">Associative containers</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">23.2.5</td><td align="left">U [...]
++ </td></tr><tr><td align="left">23.1</td><td align="left">General</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">23.2</td><td align="left">Container requirements</td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">23.2.1</td><td align="left">General container requirements</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">23.2.2</td><td align="left">Container data races</td><td align="left">Y</td><td alig [...]
+ <span class="emphasis"><em>24</em></span>
+ </td><td colspan="3" align="left">
+ <span class="emphasis"><em>Iterators</em></span>
+@@ -215,8 +214,7 @@
+ <span class="emphasis"><em>30</em></span>
+ </td><td colspan="3" align="left">
+ <span class="emphasis"><em>Thread support</em></span>
+- </td></tr><tr><td align="left">30.1</td><td align="left">General</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">30.2</td><td align="left">Requirements</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">30.3</td><td align="left">Threads</td><td align="left"> </td><td align="left"> </td></tr><tr bgcolor="#B0B0B0"><td align="left">30.3.1</td><td align="left">Class <code class="code">thread</code></td><td align="left">Partial</td>< [...]
+- supports the POSIX Timeouts option. </td></tr><tr><td align="left">30.4.1.3.1</td><td align="left">Class <code class="code">timed_mutex</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">30.4.1.3.2</td><td align="left">Class <code class="code">recursive_timed_mutex</code></td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">30.4.2</td><td align="left">Locks</td><td align="left"> </td><td align="left"> </td></tr><tr><td alig [...]
++ </td></tr><tr><td align="left">30.1</td><td align="left">General</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">30.2</td><td align="left">Requirements</td><td align="left">Y</td><td align="left"> </td></tr><tr><td align="left">30.3</td><td align="left">Threads</td><td align="left"> </td><td align="left"> </td></tr><tr bgcolor="#B0B0B0"><td align="left">30.3.1</td><td align="left">Class <code class="code">thread</code></td><td align="left">Partial</td>< [...]
+ <span class="emphasis"><em>Appendix D</em></span>
+ </td><td colspan="3" align="left">
+ <span class="emphasis"><em>Compatibility features</em></span>
+Index: libstdc++-v3/doc/html/manual/bugs.html
+===================================================================
+--- a/src/libstdc++-v3/doc/html/manual/bugs.html (.../tags/gcc_6_2_0_release)
++++ b/src/libstdc++-v3/doc/html/manual/bugs.html (.../branches/gcc-6-branch)
+@@ -366,6 +366,9 @@
+ </p></dd><dt><span class="term"><a class="link" href="../ext/lwg-defects.html#2059" target="_top">2059</a>:
+ <span class="emphasis"><em>C++0x ambiguity problem with map::erase</em></span>
+ </span></dt><dd><p>Add additional overloads.
++ </p></dd><dt><span class="term"><a class="link" href="../ext/lwg-defects.html#2062" target="_top">2062</a>:
++ <span class="emphasis"><em>2062. Effect contradictions w/o no-throw guarantee of <code class="code">std::function</code> swaps</em></span>
++ </span></dt><dd><p>Add <code class="code">noexcept</code> to swap functions.
+ </p></dd><dt><span class="term"><a class="link" href="../ext/lwg-defects.html#2063" target="_top">2063</a>:
+ <span class="emphasis"><em>Contradictory requirements for string move assignment</em></span>
+ </span></dt><dd><p>Respect propagation trait for move assignment.
+Index: libstdc++-v3/doc/html/manual/source_organization.html
+===================================================================
+--- a/src/libstdc++-v3/doc/html/manual/source_organization.html (.../tags/gcc_6_2_0_release)
++++ b/src/libstdc++-v3/doc/html/manual/source_organization.html (.../branches/gcc-6-branch)
+@@ -3,94 +3,97 @@
+ Contributing
+
+ </th><td width="20%" align="right"> <a accesskey="n" href="source_code_style.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="contrib.organization"></a>Directory Layout and Source Conventions</h2></div></div></div><p>
+- The unpacked source directory of libstdc++ contains the files
+- needed to create the GNU C++ Library.
+- </p><div class="literallayout"><p><br />
+-It has subdirectories:<br />
+-<br />
+- doc<br />
+- Files in HTML and text format that document usage, quirks of the<br />
+- implementation, and contributor checklists.<br />
+-<br />
+- include<br />
+- All header files for the C++ library are within this directory,<br />
+- modulo specific runtime-related files that are in the libsupc++<br />
+- directory.<br />
+-<br />
+- include/std<br />
+- Files meant to be found by #include <name> directives in<br />
+- standard-conforming user programs.<br />
+-<br />
+- include/c<br />
+- Headers intended to directly include standard C headers.<br />
+- [NB: this can be enabled via --enable-cheaders=c]<br />
+-<br />
+- include/c_global<br />
+- Headers intended to include standard C headers in<br />
+- the global namespace, and put select names into the std::<br />
+- namespace. [NB: this is the default, and is the same as<br />
+- --enable-cheaders=c_global]<br />
+-<br />
+- include/c_std<br />
+- Headers intended to include standard C headers<br />
+- already in namespace std, and put select names into the std::<br />
+- namespace. [NB: this is the same as --enable-cheaders=c_std]<br />
+-<br />
+- include/bits<br />
+- Files included by standard headers and by other files in<br />
+- the bits directory.<br />
+-<br />
+- include/backward<br />
+- Headers provided for backward compatibility, such as <iostream.h>.<br />
+- They are not used in this library.<br />
+-<br />
+- include/ext<br />
+- Headers that define extensions to the standard library. No<br />
+- standard header refers to any of them.<br />
+-<br />
+- scripts<br />
+- Scripts that are used during the configure, build, make, or test<br />
+- process.<br />
+-<br />
+- src<br />
+- Files that are used in constructing the library, but are not<br />
+- installed.<br />
+-<br />
+- testsuites/[backward, demangle, ext, performance, thread, 17_* to 30_*]<br />
+- Test programs are here, and may be used to begin to exercise the<br />
+- library. Support for "make check" and "make check-install" is<br />
+- complete, and runs through all the subdirectories here when this<br />
+- command is issued from the build directory. Please note that<br />
+- "make check" requires DejaGNU 1.4 or later to be installed. Please<br />
+- note that "make check-script" calls the script mkcheck, which<br />
+- requires bash, and which may need the paths to bash adjusted to<br />
+- work properly, as /bin/bash is assumed.<br />
+-<br />
+-Other subdirectories contain variant versions of certain files<br />
+-that are meant to be copied or linked by the configure script.<br />
+-Currently these are:<br />
+-<br />
+- config/abi<br />
+- config/cpu<br />
+- config/io<br />
+- config/locale<br />
+- config/os<br />
+-<br />
+-In addition, a subdirectory holds the convenience library libsupc++.<br />
+-<br />
+- libsupc++<br />
+- Contains the runtime library for C++, including exception<br />
+- handling and memory allocation and deallocation, RTTI, terminate<br />
+- handlers, etc.<br />
+-<br />
+-Note that glibc also has a bits/ subdirectory. We will either<br />
+-need to be careful not to collide with names in its bits/<br />
+-directory; or rename bits to (e.g.) cppbits/.<br />
+-<br />
+-In files throughout the system, lines marked with an "XXX" indicate<br />
+-a bug or incompletely-implemented feature. Lines marked "XXX MT"<br />
+-indicate a place that may require attention for multi-thread safety.<br />
+- </p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="appendix_contributing.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="appendix_contributing.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="source_code_style.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Appendix A.
++ The <code class="filename">libstdc++-v3</code> directory in the
++ GCC sources contains the files needed to create the GNU C++ Library.
++ </p><p>
++It has subdirectories:
++</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="filename">doc</code></span></dt><dd>
++ Files in HTML and text format that document usage, quirks of the
++ implementation, and contributor checklists.
++ </dd><dt><span class="term"><code class="filename">include</code></span></dt><dd>
++ All header files for the C++ library are within this directory,
++ modulo specific runtime-related files that are in the libsupc++
++ directory.
++
++ <div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="filename">include/std</code></span></dt><dd>
++ Files meant to be found by <code class="code">#include <name></code> directives
++ in standard-conforming user programs.
++ </dd><dt><span class="term"><code class="filename">include/c</code></span></dt><dd>
++ Headers intended to directly include standard C headers.
++ [NB: this can be enabled via <code class="option">--enable-cheaders=c</code>]
++ </dd><dt><span class="term"><code class="filename">include/c_global</code></span></dt><dd>
++ Headers intended to include standard C headers in
++ the global namespace, and put select names into the <code class="code">std::</code>
++ namespace. [NB: this is the default, and is the same as
++ <code class="option">--enable-cheaders=c_global</code>]
++ </dd><dt><span class="term"><code class="filename">include/c_std</code></span></dt><dd>
++ Headers intended to include standard C headers
++ already in namespace std, and put select names into the <code class="code">std::</code>
++ namespace. [NB: this is the same as
++ <code class="option">--enable-cheaders=c_std</code>]
++ </dd><dt><span class="term"><code class="filename">include/bits</code></span></dt><dd>
++ Files included by standard headers and by other files in
++ the bits directory.
++ </dd><dt><span class="term"><code class="filename">include/backward</code></span></dt><dd>
++ Headers provided for backward compatibility, such as
++ <code class="filename"><backward/hash_map></code>.
++ They are not used in this library.
++ </dd><dt><span class="term"><code class="filename">include/ext</code></span></dt><dd>
++ Headers that define extensions to the standard library. No
++ standard header refers to any of them, in theory (there are some
++ exceptions).
++ </dd></dl></div></dd><dt><span class="term"><code class="filename">scripts</code></span></dt><dd>
++ Scripts that are used during the configure, build, make, or test
++ process.
++ </dd><dt><span class="term"><code class="filename">src</code></span></dt><dd>
++ Files that are used in constructing the library, but are not
++ installed.
++
++ <div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="filename">src/c++98</code></span></dt><dd>
++ Source files compiled using <code class="option">-std=gnu++98</code>.
++ </dd><dt><span class="term"><code class="filename">src/c++11</code></span></dt><dd>
++ Source files compiled using <code class="option">-std=gnu++11</code>.
++ </dd><dt><span class="term"><code class="filename">src/filesystem</code></span></dt><dd>
++ Source files for the Filesystem TS.
++ </dd><dt><span class="term"><code class="filename">src/shared</code></span></dt><dd>
++ Source code included by other files under both
++ <code class="filename">src/c++98</code> and
++ <code class="filename">src/c++11</code></dd></dl></div></dd><dt><span class="term"><code class="filename">testsuites/[backward, demangle, ext, performance, thread, 17_* to 30_*]</code></span></dt><dd>
++ Test programs are here, and may be used to begin to exercise the
++ library. Support for "make check" and "make check-install" is
++ complete, and runs through all the subdirectories here when this
++ command is issued from the build directory. Please note that
++ "make check" requires DejaGNU 1.4 or later to be installed.
++ </dd></dl></div><p>
++Other subdirectories contain variant versions of certain files
++that are meant to be copied or linked by the configure script.
++Currently these are:
++</p><div class="literallayout"><p><code class="filename">config/abi</code><br />
++<code class="filename">config/allocator</code><br />
++<code class="filename">config/cpu</code><br />
++<code class="filename">config/io</code><br />
++<code class="filename">config/locale</code><br />
++<code class="filename">config/os</code><br />
++</p></div><p>
++</p><p>
++In addition, a subdirectory holds the convenience library libsupc++.
++</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="filename">libsupc++</code></span></dt><dd>
++ Contains the runtime library for C++, including exception
++ handling and memory allocation and deallocation, RTTI, terminate
++ handlers, etc.
++ </dd></dl></div><p>
++Note that glibc also has a <code class="filename">bits/</code>
++subdirectory. We need to be careful not to collide with names in its
++<code class="filename">bits/</code> directory. For example
++<code class="filename"><bits/std_mutex.h></code> has to be
++renamed from <code class="filename"><bits/mutex.h></code>.
++Another solution would be to rename <code class="filename">bits</code>
++to (e.g.) <code class="filename">cppbits</code>.
++</p><p>
++In files throughout the system, lines marked with an "XXX" indicate
++a bug or incompletely-implemented feature. Lines marked "XXX MT"
++indicate a place that may require attention for multi-thread safety.
++</p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="appendix_contributing.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="appendix_contributing.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="source_code_style.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Appendix A.
+ Contributing
+
+ </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Coding Style</td></tr></table></div></body></html>
+\ No newline at end of file
Index: libstdc++-v3/include/Makefile.in
===================================================================
--- a/src/libstdc++-v3/include/Makefile.in (.../tags/gcc_6_2_0_release)
@@ -502,6 +1034,46 @@ Index: libstdc++-v3/include/std/functional
{
void* _M_access() { return &_M_pod_data[0]; }
const void* _M_access() const { return &_M_pod_data[0]; }
+@@ -1568,7 +1568,7 @@
+ static void
+ _M_clone(_Any_data& __dest, const _Any_data& __source, true_type)
+ {
+- new (__dest._M_access()) _Functor(__source._M_access<_Functor>());
++ ::new (__dest._M_access()) _Functor(__source._M_access<_Functor>());
+ }
+
+ // Clone a function object that is not location-invariant or
+@@ -1649,7 +1649,7 @@
+ private:
+ static void
+ _M_init_functor(_Any_data& __functor, _Functor&& __f, true_type)
+- { new (__functor._M_access()) _Functor(std::move(__f)); }
++ { ::new (__functor._M_access()) _Functor(std::move(__f)); }
+
+ static void
+ _M_init_functor(_Any_data& __functor, _Functor&& __f, false_type)
+@@ -2020,7 +2020,7 @@
+ * Swap the targets of @c this function object and @a __f. This
+ * function will not throw an %exception.
+ */
+- void swap(function& __x)
++ void swap(function& __x) noexcept
+ {
+ std::swap(_M_functor, __x._M_functor);
+ std::swap(_M_manager, __x._M_manager);
+@@ -2233,9 +2233,11 @@
+ *
+ * This function will not throw an %exception.
+ */
++ // _GLIBCXX_RESOLVE_LIB_DEFECTS
++ // 2062. Effect contradictions w/o no-throw guarantee of std::function swaps
+ template<typename _Res, typename... _Args>
+ inline void
+- swap(function<_Res(_Args...)>& __x, function<_Res(_Args...)>& __y)
++ swap(function<_Res(_Args...)>& __x, function<_Res(_Args...)>& __y) noexcept
+ { __x.swap(__y); }
+
+ _GLIBCXX_END_NAMESPACE_VERSION
Index: libstdc++-v3/include/std/complex
===================================================================
--- a/src/libstdc++-v3/include/std/complex (.../tags/gcc_6_2_0_release)
@@ -595,6 +1167,33 @@ Index: libstdc++-v3/include/experimental/algorithm
namespace std _GLIBCXX_VISIBILITY(default)
{
+@@ -67,9 +68,12 @@
+ __distrib_type __d{};
+ _Size __sample_sz = 0;
+ while (__first != __last && __sample_sz != __n)
+- __out[__sample_sz++] = *__first++;
++ {
++ __out[__sample_sz++] = *__first;
++ ++__first;
++ }
+ for (auto __pop_sz = __sample_sz; __first != __last;
+- ++__first, ++__pop_sz)
++ ++__first, (void)++__pop_sz)
+ {
+ const auto __k = __d(__g, __param_type{0, __pop_sz});
+ if (__k < __n)
+@@ -122,9 +126,10 @@
+ static_assert(is_integral<_Distance>::value,
+ "sample size must be an integer type");
+
++ typename iterator_traits<_PopulationIterator>::difference_type __d = __n;
+ return std::experimental::__sample(
+ __first, __last, __pop_cat{}, __out, __samp_cat{},
+- __n, std::forward<_UniformRandomNumberGenerator>(__g));
++ __d, std::forward<_UniformRandomNumberGenerator>(__g));
+ }
+
+ _GLIBCXX_END_NAMESPACE_VERSION
Index: libstdc++-v3/include/experimental/any
===================================================================
--- a/src/libstdc++-v3/include/experimental/any (.../tags/gcc_6_2_0_release)
@@ -619,6 +1218,15 @@ Index: libstdc++-v3/include/experimental/propagate_const
namespace std _GLIBCXX_VISIBILITY(default)
{
+@@ -62,7 +63,7 @@
+ class propagate_const
+ {
+ public:
+- typedef remove_reference_t<decltype(*declval<_Tp&>())> element_type;
++ typedef remove_reference_t<decltype(*std::declval<_Tp&>())> element_type;
+
+ private:
+ template <typename _Up>
Index: libstdc++-v3/include/experimental/chrono
===================================================================
--- a/src/libstdc++-v3/include/experimental/chrono (.../tags/gcc_6_2_0_release)
@@ -687,6 +1295,15 @@ Index: libstdc++-v3/include/experimental/string_view
namespace std _GLIBCXX_VISIBILITY(default)
{
+@@ -419,7 +420,7 @@
+
+ private:
+
+- static constexpr const int
++ static constexpr int
+ _S_compare(size_type __n1, size_type __n2) noexcept
+ {
+ return difference_type{__n1 - __n2} > std::numeric_limits<int>::max()
@@ -651,13 +652,12 @@
namespace experimental
@@ -900,6 +1517,42 @@ Index: libstdc++-v3/include/experimental/functional
namespace std _GLIBCXX_VISIBILITY(default)
{
+@@ -118,7 +119,7 @@
+ _Pred
+ _M_pred() const { return _M_bad_char.key_eq(); }
+
+- std::unordered_map<_Key, _Tp, _Hash, _Pred> _M_bad_char;
++ _GLIBCXX_STD_C::unordered_map<_Key, _Tp, _Hash, _Pred> _M_bad_char;
+ };
+
+ template<typename _Tp, size_t _Len, typename _Pred>
+@@ -127,7 +128,7 @@
+ template<typename _RAIter, typename _Unused>
+ __boyer_moore_array_base(_RAIter __pat, size_t __patlen,
+ _Unused&&, _Pred&& __pred)
+- : _M_bad_char{ std::array<_Tp, _Len>{}, std::move(__pred) }
++ : _M_bad_char{ _GLIBCXX_STD_C::array<_Tp, _Len>{}, std::move(__pred) }
+ {
+ std::get<0>(_M_bad_char).fill(__patlen);
+ if (__patlen > 0)
+@@ -155,7 +156,7 @@
+ const _Pred&
+ _M_pred() const { return std::get<1>(_M_bad_char); }
+
+- std::tuple<std::array<_Tp, _Len>, _Pred> _M_bad_char;
++ std::tuple<_GLIBCXX_STD_C::array<_Tp, _Len>, _Pred> _M_bad_char;
+ };
+
+ template<typename _Pred>
+@@ -228,7 +229,7 @@
+
+ _RAIter _M_pat;
+ _RAIter _M_pat_end;
+- std::vector<__diff_type> _M_good_suffix;
++ _GLIBCXX_STD_C::vector<__diff_type> _M_good_suffix;
+ };
+
+ template<typename _RAIter, typename _Hash
@@ -386,7 +387,7 @@
public:
template<typename _Fn2>
@@ -1067,6 +1720,25 @@ Index: libstdc++-v3/include/bits/stl_set.h
: _M_t() { }
/**
+Index: libstdc++-v3/include/bits/unique_ptr.h
+===================================================================
+--- a/src/libstdc++-v3/include/bits/unique_ptr.h (.../tags/gcc_6_2_0_release)
++++ b/src/libstdc++-v3/include/bits/unique_ptr.h (.../branches/gcc-6-branch)
+@@ -610,10 +610,11 @@
+ void
+ reset(_Up __p) noexcept
+ {
++ pointer __ptr = __p;
+ using std::swap;
+- swap(std::get<0>(_M_t), __p);
+- if (__p != nullptr)
+- get_deleter()(__p);
++ swap(std::get<0>(_M_t), __ptr);
++ if (__ptr != nullptr)
++ get_deleter()(__ptr);
+ }
+
+ void reset(nullptr_t = nullptr) noexcept
Index: libstdc++-v3/include/bits/basic_string.h
===================================================================
--- a/src/libstdc++-v3/include/bits/basic_string.h (.../tags/gcc_6_2_0_release)
@@ -1698,7 +2370,121 @@ 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,212 @@
+@@ -1,3 +1,326 @@
++2016-10-17 Jonathan Wakely <jwakely at redhat.com>
++
++ PR libstdc++/77987
++ * include/bits/unique_ptr.h (unique_ptr<T[], D>::reset<U>(U)): Copy
++ value to pointer of the correct type to swap, to support conversions
++ allowed by LWG 2118 / N4089.
++ * testsuite/20_util/unique_ptr/assign/assign_neg.cc: Move test for
++ incompatible deleters from ...
++ * testsuite/20_util/unique_ptr/assign/cv_qual.cc: ... here.
++ * testsuite/20_util/unique_ptr/modifiers/cv_qual.cc: Move tests for
++ incompatible pointers to ...
++ * testsuite/20_util/unique_ptr/modifiers/reset_neg.cc: ... here. Move
++ destructor definition to base class. Test for invalid derived-to-base
++ conversion.
++
++2016-10-17 Jonathan Wakely <jwakely at redhat.com>
++
++ * testsuite/20_util/function/77322.cc: Remove effective-target from
++ dg-do directive.
++ * testsuite/20_util/function/cons/72820.cc: Likewise.
++
++2016-10-17 Jonathan Wakely <jwakely at redhat.com>
++
++ Backport from mainline:
++ 2016-10-10 Jonathan Wakely <jwakely at redhat.com>
++
++ * doc/xml/manual/appendix_contributing.xml (contrib.organization):
++ Replace <literallayout> with nested <variablelist> elements. Update
++ some more outdated text.
++ * doc/html/*: Regenerate.
++
++ Backport from mainline:
++ 2016-10-10 Jonathan Wakely <jwakely at redhat.com>
++
++ * doc/xml/manual/appendix_contributing.xml (contrib.organization):
++ Describe other subdirectories and add markup. Remove outdated
++ reference to check-script target.
++
++2016-10-17 Jonathan Wakely <jwakely at redhat.com>
++
++ Backport from mainline:
++ 2016-10-10 Jonathan Wakely <jwakely at redhat.com>
++
++ * doc/xml/manual/status_cxx2011.xml: Correct C++11 status.
++
++2016-10-17 Jonathan Wakely <jwakely at redhat.com>
++
++ Backport from mainline:
++ 2016-10-13 Jonathan Wakely <jwakely at redhat.com>
++
++ * testsuite/26_numerics/random/default_random_engine.cc: Use VERIFY
++ instead of assert.
++
++2016-10-17 Jonathan Wakely <jwakely at redhat.com>
++
++ Backport from mainline:
++ 2016-10-11 Jonathan Wakely <jwakely at redhat.com>
++
++ * include/experimental/string_view (basic_string_view::_S_compare):
++ Remove redundant const from return type.
++
++2016-10-17 Jonathan Wakely <jwakely at redhat.com>
++
++ Backport from mainline:
++ 2016-10-13 Jonathan Wakely <jwakely at redhat.com>
++
++ * include/experimental/functional (boyer_moore_searcher)
++ (__boyer_moore_map_base, __boyer_moore_array_base): Qualify containers
++ with _GLIBCXX_STD_C.
++
++2016-10-17 Jonathan Wakely <jwakely at redhat.com>
++
++ Backport from mainline:
++ 2016-10-13 Jonathan Wakely <jwakely at redhat.com>
++
++ * include/experimental/propagate_const (element_type): Qualify
++ declval.
++
++2016-10-17 Jonathan Wakely <jwakely at redhat.com>
++
++ Backport from mainline:
++ 2016-08-22 Jonathan Wakely <jwakely at redhat.com>
++
++ PR libstdc++/77322
++ * doc/xml/manual/intro.xml: Document DR 2062 change.
++ * include/std/functional (function::swap): Add noexcept.
++ (swap(function<Res(Args...)&, function<Res(Args...)&)): Likewise.
++ * testsuite/20_util/function/77322.cc: New test.
++
++2016-10-17 Jonathan Wakely <jwakely at redhat.com>
++
++ Backport from mainline:
++ 2016-08-17 Jonathan Wakely <jwakely at redhat.com>
++
++ * testsuite/20_util/reference_wrapper/invoke-2.cc: Fix invalid dg-do
++ directive and use effective target instead of dg-options.
++
++2016-10-17 Jonathan Wakely <jwakely at redhat.com>
++
++ Backport from mainline:
++ 2016-08-06 Jonathan Wakely <jwakely at redhat.com>
++
++ PR libstdc++/72820
++ * include/std/functional (_Function_base::_Base_manager::_M_clone):
++ Qualify new operator.
++ * testsuite/20_util/function/cons/72820.cc: New test.
++
++2016-10-17 Jonathan Wakely <jwakely at redhat.com>
++
++ PR libstdc++/77994
++ * include/experimental/algorithm (experimental::sample): Convert size
++ argument to iterator difference type. Fix invalid use of input
++ iterator. Defend against overloaded comma operator.
++
+2016-10-05 Jonathan Wakely <jwakely at redhat.com>
+
+ PR libstdc++/70101
@@ -2255,6 +3041,40 @@ Index: libstdc++-v3/testsuite/27_io/headers/cstdio/functions_neg.cc
+{
+ using std::gets; // { dg-error "has not been declared" }
+}
+Index: libstdc++-v3/testsuite/26_numerics/random/default_random_engine.cc
+===================================================================
+--- a/src/libstdc++-v3/testsuite/26_numerics/random/default_random_engine.cc (.../tags/gcc_6_2_0_release)
++++ b/src/libstdc++-v3/testsuite/26_numerics/random/default_random_engine.cc (.../branches/gcc-6-branch)
+@@ -20,7 +20,7 @@
+ // with this library; see the file COPYING3. If not see
+ // <http://www.gnu.org/licenses/>.
+
+-// 26.4.5 Engines and egine adaptors with predefined parameters [rand.predef]
++// 26.4.5 Engines and engine adaptors with predefined parameters [rand.predef]
+ // 26.4.5 [10]
+
+ #include <random>
+@@ -38,7 +38,7 @@
+ std::minstd_rand0 b;
+ b.discard(9999);
+
+- assert( a() == b() );
++ VERIFY( a() == b() );
+ }
+
+ int main()
+Index: libstdc++-v3/testsuite/experimental/algorithm/sample.cc
+===================================================================
+--- a/src/libstdc++-v3/testsuite/experimental/algorithm/sample.cc (.../tags/gcc_6_2_0_release)
++++ b/src/libstdc++-v3/testsuite/experimental/algorithm/sample.cc (.../branches/gcc-6-branch)
+@@ -22,6 +22,7 @@
+ #include <sstream>
+ #include <forward_list>
+ #include <vector>
++#include <random>
+ #include <testsuite_hooks.h>
+
+ std::mt19937 rng;
Index: libstdc++-v3/testsuite/experimental/any/misc/any_cast_neg.cc
===================================================================
--- a/src/libstdc++-v3/testsuite/experimental/any/misc/any_cast_neg.cc (.../tags/gcc_6_2_0_release)
@@ -2606,6 +3426,197 @@ Index: libstdc++-v3/testsuite/20_util/pair/traits.cc
+ std::unique_ptr<int>>>::value,
+ "");
+}
+Index: libstdc++-v3/testsuite/20_util/function/cons/72820.cc
+===================================================================
+--- a/src/libstdc++-v3/testsuite/20_util/function/cons/72820.cc (.../tags/gcc_6_2_0_release)
++++ b/src/libstdc++-v3/testsuite/20_util/function/cons/72820.cc (.../branches/gcc-6-branch)
+@@ -0,0 +1,28 @@
++// 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" }
++// { dg-do compile }
++
++#include <functional>
++
++struct foo {
++ void operator()() { }
++ static void* operator new(std::size_t, void* p);
++};
++
++std::function<void()> f = foo{};
+Index: libstdc++-v3/testsuite/20_util/function/77322.cc
+===================================================================
+--- a/src/libstdc++-v3/testsuite/20_util/function/77322.cc (.../tags/gcc_6_2_0_release)
++++ b/src/libstdc++-v3/testsuite/20_util/function/77322.cc (.../branches/gcc-6-branch)
+@@ -0,0 +1,26 @@
++// 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" }
++// { dg-do compile }
++
++#include <functional>
++
++// PR libstdc++/77322
++std::function<void()> f, g;
++static_assert( noexcept(f.swap(g)), "member swap is noexcept" );
++static_assert( noexcept(swap(f, g)), "non-member swap is noexcept" );
+Index: libstdc++-v3/testsuite/20_util/unique_ptr/modifiers/reset_neg.cc
+===================================================================
+--- a/src/libstdc++-v3/testsuite/20_util/unique_ptr/modifiers/reset_neg.cc (.../tags/gcc_6_2_0_release)
++++ b/src/libstdc++-v3/testsuite/20_util/unique_ptr/modifiers/reset_neg.cc (.../branches/gcc-6-branch)
+@@ -22,17 +22,37 @@
+
+ struct A
+ {
++ virtual ~A() { }
+ };
+
+ struct B : A
+ {
+- virtual ~B() { }
+ };
+
+-void test01()
++void
++test01()
+ {
+ std::unique_ptr<B[]> up;
+- up.reset(new A[3]); // { dg-error "" }
++ up.reset(new A[3]); // { dg-error "no matching function" }
++
++ std::unique_ptr<A[]> up2;
++ up2.reset(new B[3]); // { dg-error "no matching function" }
+ }
+
+-// { dg-prune-output "include" }
++struct A_pointer { operator A*() const { return nullptr; } };
++
++void
++test02()
++{
++ A_pointer p;
++ // Disallow conversions from user-defined pointer-like types
++ // for the array version
++ std::unique_ptr<A[]> upA3;
++ upA3.reset(p); // { dg-error "no matching function" }
++ std::unique_ptr<const A[]> cA3;
++ cA3.reset(p); // { dg-error "no matching function" }
++ std::unique_ptr<volatile A[]> vA3;
++ vA3.reset(p); // { dg-error "no matching function" }
++ std::unique_ptr<const volatile A[]> cvA3;
++ cvA3.reset(p); // { dg-error "no matching function" }
++}
+Index: libstdc++-v3/testsuite/20_util/unique_ptr/modifiers/cv_qual.cc
+===================================================================
+--- a/src/libstdc++-v3/testsuite/20_util/unique_ptr/modifiers/cv_qual.cc (.../tags/gcc_6_2_0_release)
++++ b/src/libstdc++-v3/testsuite/20_util/unique_ptr/modifiers/cv_qual.cc (.../branches/gcc-6-branch)
+@@ -87,15 +87,4 @@
+ vA2.reset((A*)p);
+ std::unique_ptr<const volatile A[]> cvA2;
+ cvA2.reset((A*)p);
+- // Disallow conversions from user-defined pointer-like types
+- // for the array version
+- std::unique_ptr<A[]> upA3;
+- upA3.reset(p); // { dg-error "no matching function" }
+- std::unique_ptr<const A[]> cA3;
+- cA3.reset(p); // { dg-error "no matching function" }
+- std::unique_ptr<volatile A[]> vA3;
+- vA3.reset(p); // { dg-error "no matching function" }
+- std::unique_ptr<const volatile A[]> cvA3;
+- cvA3.reset(p); // { dg-error "no matching function" }
+- // { dg-error "no matching function" "" { target *-*-* } 614 }
+ }
+Index: libstdc++-v3/testsuite/20_util/unique_ptr/assign/assign_neg.cc
+===================================================================
+--- a/src/libstdc++-v3/testsuite/20_util/unique_ptr/assign/assign_neg.cc (.../tags/gcc_6_2_0_release)
++++ b/src/libstdc++-v3/testsuite/20_util/unique_ptr/assign/assign_neg.cc (.../branches/gcc-6-branch)
+@@ -49,4 +49,25 @@
+ std::unique_ptr<int[2]> p2 = p1; // { dg-error "deleted" }
+ }
+
++struct base_pointer { operator base*() const { return nullptr; } };
++
++template<typename T>
++struct deleter
++{
++ deleter() = default;
++ template<typename U>
++ deleter(const deleter<U>) { }
++ typedef T pointer;
++ void operator()(T) const { }
++};
++
++void
++test04()
++{
++ // Disallow conversions from incompatible deleter
++ std::unique_ptr<derived[], deleter<base_pointer>> p;
++ std::unique_ptr<base[], deleter<base*>> upA;
++ upA = std::move(p); // { dg-error "no match" }
++}
++
+ // { dg-prune-output "include" }
+Index: libstdc++-v3/testsuite/20_util/unique_ptr/assign/cv_qual.cc
+===================================================================
+--- a/src/libstdc++-v3/testsuite/20_util/unique_ptr/assign/cv_qual.cc (.../tags/gcc_6_2_0_release)
++++ b/src/libstdc++-v3/testsuite/20_util/unique_ptr/assign/cv_qual.cc (.../branches/gcc-6-branch)
+@@ -66,26 +66,3 @@
+ std::unique_ptr<const volatile A[]> cvA;
+ cvA = std::move(upA);
+ }
+-
+-struct A_pointer { operator A*() const { return nullptr; } };
+-
+-template<typename T>
+-struct deleter
+-{
+- deleter() = default;
+- template<typename U>
+- deleter(const deleter<U>) { }
+- typedef T pointer;
+- void operator()(T) const { }
+-};
+-
+-void
+-test04()
+-{
+- // Disallow conversions from incompatible deleter
+- std::unique_ptr<B[], deleter<A_pointer>> p;
+- std::unique_ptr<A[], deleter<A*>> upA;
+- upA = std::move(p); // { dg-error "no match" }
+- // { dg-error "no type" "" { target *-*-* } 537 }
+- // { dg-error "no matching function" "" { target *-*-* } 614 }
+-}
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)
@@ -2658,6 +3669,17 @@ Index: libstdc++-v3/testsuite/20_util/tuple/77395.cc
+ auto d = std::get<0>(test(derived{}));
+ return 0;
+}
+Index: libstdc++-v3/testsuite/20_util/reference_wrapper/invoke-2.cc
+===================================================================
+--- a/src/libstdc++-v3/testsuite/20_util/reference_wrapper/invoke-2.cc (.../tags/gcc_6_2_0_release)
++++ b/src/libstdc++-v3/testsuite/20_util/reference_wrapper/invoke-2.cc (.../branches/gcc-6-branch)
+@@ -1,5 +1,5 @@
+ // { dg-options "-std=gnu++11" }
+-// { dg-do compile}
++// { dg-do compile }
+ // Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ //
+ // This file is part of the GNU ISO C++ Library. This library is free
Index: libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc
===================================================================
--- a/src/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc (.../tags/gcc_6_2_0_release)
@@ -3025,6 +4047,29 @@ Index: gcc/tree-vrp.c
/* [] is vr0, () is vr1 in the following classification comments. */
if (mineq && maxeq)
+Index: gcc/tree-ssa-tail-merge.c
+===================================================================
+--- a/src/gcc/tree-ssa-tail-merge.c (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/tree-ssa-tail-merge.c (.../branches/gcc-6-branch)
+@@ -204,6 +204,7 @@
+ #include "params.h"
+ #include "tree-ssa-sccvn.h"
+ #include "cfgloop.h"
++#include "tree-eh.h"
+
+ /* Describes a group of bbs with the same successors. The successor bbs are
+ cached in succs, and the successor edge flags are cached in succ_flags.
+@@ -1222,6 +1223,10 @@
+ if (is_tm_ending (stmt1))
+ return false;
+
++ /* Verify EH landing pads. */
++ if (lookup_stmt_eh_lp_fn (cfun, stmt1) != lookup_stmt_eh_lp_fn (cfun, stmt2))
++ return false;
++
+ if (is_gimple_call (stmt1)
+ && gimple_call_internal_p (stmt1))
+ switch (gimple_call_internal_fn (stmt1))
Index: gcc/c-family/ChangeLog
===================================================================
--- a/src/gcc/c-family/ChangeLog (.../tags/gcc_6_2_0_release)
@@ -3138,7 +4183,72 @@ Index: gcc/DATESTAMP
+++ b/src/gcc/DATESTAMP (.../branches/gcc-6-branch)
@@ -1 +1 @@
-20160822
-+20161010
++20161018
+Index: gcc/tree.c
+===================================================================
+--- a/src/gcc/tree.c (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/tree.c (.../branches/gcc-6-branch)
+@@ -8659,10 +8659,15 @@
+ return t;
+ }
+
+-/* Create a complex type whose components are COMPONENT_TYPE. */
++/* Create a complex type whose components are COMPONENT_TYPE.
+
++ If NAMED is true, the type is given a TYPE_NAME. We do not always
++ do so because this creates a DECL node and thus make the DECL_UIDs
++ dependent on the type canonicalization hashtable, which is GC-ed,
++ so the DECL_UIDs would not be stable wrt garbage collection. */
++
+ tree
+-build_complex_type (tree component_type)
++build_complex_type (tree component_type, bool named)
+ {
+ tree t;
+ inchash::hash hstate;
+@@ -8689,11 +8694,11 @@
+ SET_TYPE_STRUCTURAL_EQUALITY (t);
+ else if (TYPE_CANONICAL (component_type) != component_type)
+ TYPE_CANONICAL (t)
+- = build_complex_type (TYPE_CANONICAL (component_type));
++ = build_complex_type (TYPE_CANONICAL (component_type), named);
+ }
+
+ /* We need to create a name, since complex is a fundamental type. */
+- if (! TYPE_NAME (t))
++ if (!TYPE_NAME (t) && named)
+ {
+ const char *name;
+ if (component_type == char_type_node)
+@@ -10242,10 +10247,11 @@
+ SET_TYPE_MODE (dfloat128_type_node, TDmode);
+ dfloat128_ptr_type_node = build_pointer_type (dfloat128_type_node);
+
+- complex_integer_type_node = build_complex_type (integer_type_node);
+- complex_float_type_node = build_complex_type (float_type_node);
+- complex_double_type_node = build_complex_type (double_type_node);
+- complex_long_double_type_node = build_complex_type (long_double_type_node);
++ complex_integer_type_node = build_complex_type (integer_type_node, true);
++ complex_float_type_node = build_complex_type (float_type_node, true);
++ complex_double_type_node = build_complex_type (double_type_node, true);
++ complex_long_double_type_node = build_complex_type (long_double_type_node,
++ true);
+
+ /* Make fixed-point nodes based on sat/non-sat and signed/unsigned. */
+ #define MAKE_FIXED_TYPE_NODE(KIND,SIZE) \
+Index: gcc/tree.h
+===================================================================
+--- a/src/gcc/tree.h (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/tree.h (.../branches/gcc-6-branch)
+@@ -4006,7 +4006,7 @@
+ extern tree build_method_type_directly (tree, tree, tree);
+ extern tree build_method_type (tree, tree);
+ extern tree build_offset_type (tree, tree);
+-extern tree build_complex_type (tree);
++extern tree build_complex_type (tree, bool named = false);
+ extern tree array_type_nelts (const_tree);
+
+ extern tree value_member (tree, tree);
Index: gcc/configure
===================================================================
--- a/src/gcc/configure (.../tags/gcc_6_2_0_release)
@@ -3287,7 +4397,104 @@ Index: gcc/ChangeLog
===================================================================
--- a/src/gcc/ChangeLog (.../tags/gcc_6_2_0_release)
+++ b/src/gcc/ChangeLog (.../branches/gcc-6-branch)
-@@ -1,3 +1,435 @@
+@@ -1,3 +1,532 @@
++2016-10-17 Bill Schmidt <wschmidt at linux.vnet.ibm.com>
++
++ Backport from mainline
++ 2016-10-12 Bill Schmidt <wschmidt at linux.vnet.ibm.com>
++
++ PR tree-optimization/77937
++ * gimple-ssa-strength-reduction.c (analyze_increments): Use
++ POINTER_TYPE_P on the candidate type to determine whether
++ candidates in this chain require pointer arithmetic.
++
++ 2016-10-13 Bill Schmidt <wschmidt at linux.vnet.ibm.com>
++
++ PR tree-optimization/77937
++ * gimple-ssa-strength-reduction.c (analyze_increments): Set cost
++ to infinite when we have a pointer with an increment of -1.
++
++2016-10-17 Martin Liska <mliska at suse.cz>
++
++ Backported from mainline
++ 2016-10-13 Martin Liska <mliska at suse.cz>
++
++ PR tree-optimization/77943
++ * tree-ssa-tail-merge.c (merge_stmts_p): Do not merge BBs with
++ a different EH landing pads.
++
++2016-10-17 Eric Botcazou <ebotcazou at adacore.com>
++
++ PR bootstrap/77995
++ Backport from mainline
++ 2016-10-11 Eric Botcazou <ebotcazou at adacore.com>
++
++ * tree.h (build_complex_type): Add second parameter with default.
++ * tree.c (build_complex_type): Add NAMED second parameter and adjust
++ recursive call. Create a TYPE_DECL only if NAMED is true.
++ (build_common_tree_nodes): Pass true in calls to build_complex_type.
++
++2016-10-16 Eric Botcazou <ebotcazou at adacore.com>
++
++ * config/sparc/sparc.c (sparc_expand_vector_init): Only accept literal
++ constants in CONST_VECTORs.
++
++2016-10-15 Eric Botcazou <ebotcazou at adacore.com>
++
++ * config/sparc/sparc.c (sparc_expand_vec_perm_bmask): Use a scratch
++ register as destination of bmask.
++ (vector_init_bshuffle): Likewise.
++ * config/sparc/sparc.md (vec_perm_constv8qi): Likewise.
++ (bmaskdi_vis): Enable only in 64-bit mode.
++
++2016-10-13 Andrew Senkevich <andrew.senkevich at intel.com>
++
++ Backport from trunk
++ * common/config/i386/i386-common.c (OPTION_MASK_ISA_PCOMMIT_UNSET,
++ OPTION_MASK_ISA_PCOMMIT_SET): Deleted definitions.
++ (ix86_handle_option): Deleted handle of OPT_mpcommit.
++ * config.gcc: Deleted pcommitintrin.h
++ * config/i386/pcommitintrin.h: Deleted file.
++ * config/i386/cpuid.h (bit_PCOMMIT): Deleted.
++ * config/i386/driver-i386.c (host_detect_local_cpu): Deleted pcommit
++ detection.
++ * config/i386/i386-c.c (ix86_target_macros_internal): Deleted define
++ __PCOMMIT__.
++ * config/i386/i386.c (ix86_target_string): Deleted -mpcommit.
++ (PTA_PCOMMIT, IX86_BUILTIN_PCOMMIT, __builtin_ia32_pcommit): Deleted.
++ (ix86_option_override_internal): Deleted handle of option.
++ (ix86_valid_target_attribute_inner_p): Deleted pcommit.
++ * config/i386/i386.h (TARGET_PCOMMIT, TARGET_PCOMMIT_P): Deleted.
++ * config/i386/i386.md (unspecv): Deleted UNSPECV_PCOMMIT.
++ (pcommit): Deleted instruction.
++ * config/i386/i386.opt: Mention -mpcommit deprecation.
++ * config/i386/x86intrin.h: Deleted inclusion of pcommitintrin.h.
++
++2016-10-13 Tom de Vries <tom at codesourcery.com>
++
++ revert:
++ 2016-10-11 Tom de Vries <tom at codesourcery.com>
++
++ backport from trunk:
++ 2016-10-11 Tom de Vries <tom at codesourcery.com>
++
++ PR middle-end/77558
++ * builtins.c (std_canonical_va_list_type): Remove RECORD_TYPE
++ special-casing.
++
++2016-10-11 Tom de Vries <tom at codesourcery.com>
++
++ backport from trunk:
++ 2016-10-11 Tom de Vries <tom at codesourcery.com>
++
++ PR middle-end/77558
++ * builtins.c (std_canonical_va_list_type): Remove RECORD_TYPE
++ special-casing.
++
++2016-10-10 Georg-Johann Lay <avr at gjlay.de>
++
++ * config/avr/gen-avr-mmcu-texi.c (string.h): Include.
++
+2016-10-06 Uros Bizjak <ubizjak at gmail.com>
+
+ PR target/77874
@@ -3723,7 +4930,7 @@ Index: gcc/ChangeLog
2016-08-22 Release Manager
* GCC 6.2.0 released.
-@@ -205,9 +641,9 @@
+@@ -205,9 +738,9 @@
2016-08-09 Martin Jambor <mjambor at suse.cz>
@@ -3799,6 +5006,149 @@ Index: gcc/testsuite/gcc.target/avr/torture/pr77326.c
+ __builtin_exit (0);
+ return 0;
+}
+Index: gcc/testsuite/gcc.target/sparc/bmaskbshuf.c
+===================================================================
+--- a/src/gcc/testsuite/gcc.target/sparc/bmaskbshuf.c (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/testsuite/gcc.target/sparc/bmaskbshuf.c (.../branches/gcc-6-branch)
+@@ -1,35 +0,0 @@
+-/* { dg-do compile } */
+-/* { dg-options "-O -mvis2" } */
+-
+-typedef long long int64_t;
+-typedef int vec32 __attribute__((vector_size(8)));
+-typedef short vec16 __attribute__((vector_size(8)));
+-typedef unsigned char vec8 __attribute__((vector_size(8)));
+-
+-long test_bmask (long x, long y)
+-{
+- return __builtin_vis_bmask (x, y);
+-}
+-
+-vec16 test_bshufv4hi (vec16 x, vec16 y)
+-{
+- return __builtin_vis_bshufflev4hi (x, y);
+-}
+-
+-vec32 test_bshufv2si (vec32 x, vec32 y)
+-{
+- return __builtin_vis_bshufflev2si (x, y);
+-}
+-
+-vec8 test_bshufv8qi (vec8 x, vec8 y)
+-{
+- return __builtin_vis_bshufflev8qi (x, y);
+-}
+-
+-int64_t test_bshufdi (int64_t x, int64_t y)
+-{
+- return __builtin_vis_bshuffledi (x, y);
+-}
+-
+-/* { dg-final { scan-assembler "bmask\t%" } } */
+-/* { dg-final { scan-assembler "bshuffle\t%" } } */
+Index: gcc/testsuite/gcc.target/sparc/bmaskbshuf-2.c
+===================================================================
+--- a/src/gcc/testsuite/gcc.target/sparc/bmaskbshuf-2.c (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/testsuite/gcc.target/sparc/bmaskbshuf-2.c (.../branches/gcc-6-branch)
+@@ -0,0 +1,42 @@
++/* { dg-do run } */
++/* { dg-require-effective-target ultrasparc_vis2_hw } */
++/* { dg-options "-mcpu=ultrasparc3 -O" } */
++
++typedef unsigned int Vect __attribute__((vector_size(8)));
++
++extern void abort (void);
++
++Vect a, b, c, d;
++
++__attribute__((noinline, noclone)) void test (void)
++{
++ Vect mask = { 2, 2 };
++ int i;
++
++ c = __builtin_shuffle (a, mask);
++ d = __builtin_shuffle (a, b, mask);
++
++ __asm__ ("" : : "r" (&c), "r" (&d) : "memory");
++
++ for (i = 0; i < 2; ++i)
++ if (c[i] != a[mask[i] & 1])
++ abort ();
++ else if (mask[i] & 2)
++ {
++ if (d[i] != b[mask[i] & 1])
++ abort ();
++ }
++}
++
++int main (void)
++{
++ int i;
++ for (i = 0; i < 2; ++i)
++ {
++ a[i] = i + 2;
++ b[i] = 2 + i + 2;
++ }
++
++ test ();
++ return 0;
++}
+Index: gcc/testsuite/gcc.target/sparc/bmaskbshuf-1.c
+===================================================================
+--- a/src/gcc/testsuite/gcc.target/sparc/bmaskbshuf-1.c (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/testsuite/gcc.target/sparc/bmaskbshuf-1.c (.../branches/gcc-6-branch)
+@@ -0,0 +1,35 @@
++/* { dg-do compile } */
++/* { dg-options "-O -mvis2" } */
++
++typedef long long int64_t;
++typedef int vec32 __attribute__((vector_size(8)));
++typedef short vec16 __attribute__((vector_size(8)));
++typedef unsigned char vec8 __attribute__((vector_size(8)));
++
++long test_bmask (long x, long y)
++{
++ return __builtin_vis_bmask (x, y);
++}
++
++vec16 test_bshufv4hi (vec16 x, vec16 y)
++{
++ return __builtin_vis_bshufflev4hi (x, y);
++}
++
++vec32 test_bshufv2si (vec32 x, vec32 y)
++{
++ return __builtin_vis_bshufflev2si (x, y);
++}
++
++vec8 test_bshufv8qi (vec8 x, vec8 y)
++{
++ return __builtin_vis_bshufflev8qi (x, y);
++}
++
++int64_t test_bshufdi (int64_t x, int64_t y)
++{
++ return __builtin_vis_bshuffledi (x, y);
++}
++
++/* { dg-final { scan-assembler "bmask\t%" } } */
++/* { dg-final { scan-assembler "bshuffle\t%" } } */
+Index: gcc/testsuite/gcc.target/i386/pcommit-1.c
+===================================================================
+--- a/src/gcc/testsuite/gcc.target/i386/pcommit-1.c (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/testsuite/gcc.target/i386/pcommit-1.c (.../branches/gcc-6-branch)
+@@ -1,11 +0,0 @@
+-/* { dg-do compile } */
+-/* { dg-options "-O2 -mpcommit" } */
+-/* { dg-final { scan-assembler "pcommit" } } */
+-
+-#include "x86intrin.h"
+-
+-void
+-test_pcommit ()
+-{
+- _mm_pcommit ();
+-}
Index: gcc/testsuite/gcc.target/i386/vect-double-2.c
===================================================================
--- a/src/gcc/testsuite/gcc.target/i386/vect-double-2.c (.../tags/gcc_6_2_0_release)
@@ -3884,6 +5234,17 @@ Index: gcc/testsuite/gcc.target/i386/pr72867.c
+ if (!__builtin_isnan (x[0]))
+ abort ();
+}
+Index: gcc/testsuite/gcc.target/i386/sse-14.c
+===================================================================
+--- a/src/gcc/testsuite/gcc.target/i386/sse-14.c (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/testsuite/gcc.target/i386/sse-14.c (.../branches/gcc-6-branch)
+@@ -1,5 +1,5 @@
+ /* { dg-do compile } */
+-/* { dg-options "-O0 -Werror-implicit-function-declaration -march=k8 -msse4a -m3dnow -mavx -mavx2 -mfma4 -mxop -maes -mpclmul -mpopcnt -mabm -mlzcnt -mbmi -mbmi2 -mtbm -mlwp -mfsgsbase -mrdrnd -mf16c -mfma -mrtm -mrdseed -mprfchw -madx -mfxsr -mxsaveopt -mavx512f -mavx512er -mavx512cd -mavx512pf -msha -mprefetchwt1 -mxsavec -mxsaves -mclflushopt -mavx512dq -mavx512bw -mavx512vl -mavx512ifma -mavx512vbmi -mclwb -mpcommit -mmwaitx -mclzero" } */
++/* { dg-options "-O0 -Werror-implicit-function-declaration -march=k8 -msse4a -m3dnow -mavx -mavx2 -mfma4 -mxop -maes -mpclmul -mpopcnt -mabm -mlzcnt -mbmi -mbmi2 -mtbm -mlwp -mfsgsbase -mrdrnd -mf16c -mfma -mrtm -mrdseed -mprfchw -madx -mfxsr -mxsaveopt -mavx512f -mavx512er -mavx512cd -mavx512pf -msha -mprefetchwt1 -mxsavec -mxsaves -mclflushopt -mavx512dq -mavx512bw -mavx512vl -mavx512ifma -mavx512vbmi -mclwb -mmwaitx -mclzero" } */
+ /* { dg-add-options bind_pic_locally } */
+
+ #include <mm_malloc.h>
Index: gcc/testsuite/gcc.target/i386/pr77756.c
===================================================================
--- a/src/gcc/testsuite/gcc.target/i386/pr77756.c (.../tags/gcc_6_2_0_release)
@@ -3933,6 +5294,19 @@ Index: gcc/testsuite/gcc.target/i386/pr69255-1.c
+
+/* { dg-warning "AVX vector return without AVX enabled changes the ABI" "" { target *-*-* } 13 } */
+/* { dg-warning "AVX vector argument without AVX enabled changes the ABI" "" { target *-*-* } 13 } */
+Index: gcc/testsuite/gcc.target/i386/sse-22.c
+===================================================================
+--- a/src/gcc/testsuite/gcc.target/i386/sse-22.c (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/testsuite/gcc.target/i386/sse-22.c (.../branches/gcc-6-branch)
+@@ -699,7 +699,7 @@
+
+ /* x86intrin.h (FMA4/XOP/LWP/BMI/BMI2/TBM/LZCNT/FMA). */
+ #ifdef DIFFERENT_PRAGMAS
+-#pragma GCC target ("fma4,xop,lwp,bmi,bmi2,tbm,lzcnt,fma,rdseed,prfchw,adx,fxsr,xsaveopt,xsavec,xsaves,clflushopt,clwb,pcommit,pku")
++#pragma GCC target ("fma4,xop,lwp,bmi,bmi2,tbm,lzcnt,fma,rdseed,prfchw,adx,fxsr,xsaveopt,xsavec,xsaves,clflushopt,clwb,pku")
+ #endif
+ #include <x86intrin.h>
+ /* xopintrin.h */
Index: gcc/testsuite/gcc.target/i386/pr77452.c
===================================================================
--- a/src/gcc/testsuite/gcc.target/i386/pr77452.c (.../tags/gcc_6_2_0_release)
@@ -3973,6 +5347,18 @@ Index: gcc/testsuite/gcc.target/i386/pr69255-2.c
+
+/* { dg-warning "AVX vector return without AVX enabled changes the ABI" "" { target *-*-* } 13 } */
+/* { dg-warning "AVX vector argument without AVX enabled changes the ABI" "" { target *-*-* } 13 } */
+Index: gcc/testsuite/gcc.target/i386/sse-23.c
+===================================================================
+--- a/src/gcc/testsuite/gcc.target/i386/sse-23.c (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/testsuite/gcc.target/i386/sse-23.c (.../branches/gcc-6-branch)
+@@ -594,6 +594,6 @@
+ #define __builtin_ia32_extracti64x2_256_mask(A, E, C, D) __builtin_ia32_extracti64x2_256_mask(A, 1, C, D)
+ #define __builtin_ia32_extractf64x2_256_mask(A, E, C, D) __builtin_ia32_extractf64x2_256_mask(A, 1, C, D)
+
+-#pragma GCC target ("sse4a,3dnow,avx,avx2,fma4,xop,aes,pclmul,popcnt,abm,lzcnt,bmi,bmi2,tbm,lwp,fsgsbase,rdrnd,f16c,fma,rtm,rdseed,prfchw,adx,fxsr,xsaveopt,avx512f,avx512er,avx512cd,avx512pf,sha,prefetchwt1,xsavec,xsaves,clflushopt,avx512bw,avx512dq,avx512vl,avx512vbmi,avx512ifma,clwb,pcommit,mwaitx,clzero,pku")
++#pragma GCC target ("sse4a,3dnow,avx,avx2,fma4,xop,aes,pclmul,popcnt,abm,lzcnt,bmi,bmi2,tbm,lwp,fsgsbase,rdrnd,f16c,fma,rtm,rdseed,prfchw,adx,fxsr,xsaveopt,avx512f,avx512er,avx512cd,avx512pf,sha,prefetchwt1,xsavec,xsaves,clflushopt,avx512bw,avx512dq,avx512vl,avx512vbmi,avx512ifma,clwb,mwaitx,clzero,pku")
+
+ #include <x86intrin.h>
Index: gcc/testsuite/gcc.target/i386/pr69255-3.c
===================================================================
--- a/src/gcc/testsuite/gcc.target/i386/pr69255-3.c (.../tags/gcc_6_2_0_release)
@@ -4032,6 +5418,19 @@ Index: gcc/testsuite/gcc.target/i386/pr77621.c
+}
+
+/* { dg-final { scan-tree-dump-not "Vectorized loops: 1" "vect" } } */
+Index: gcc/testsuite/gcc.target/i386/sse-12.c
+===================================================================
+--- a/src/gcc/testsuite/gcc.target/i386/sse-12.c (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/testsuite/gcc.target/i386/sse-12.c (.../branches/gcc-6-branch)
+@@ -3,7 +3,7 @@
+ popcntintrin.h and mm_malloc.h are usable
+ with -O -std=c89 -pedantic-errors. */
+ /* { dg-do compile } */
+-/* { dg-options "-O -std=c89 -pedantic-errors -march=k8 -msse4a -m3dnow -mavx -mavx2 -mfma4 -mxop -maes -mpclmul -mpopcnt -mabm -mlzcnt -mbmi -mbmi2 -mtbm -mlwp -mfsgsbase -mrdrnd -mf16c -mfma -mrtm -mrdseed -mprfchw -madx -mfxsr -mxsaveopt -mavx512f -mavx512er -mavx512cd -mavx512pf -msha -mprefetchwt1 -mxsavec -mxsaves -mclflushopt -mavx512bw -mavx512dq -mavx512vl -mavx512vbmi -mavx512ifma -mclwb -mpcommit -mmwaitx -mclzero -mpku" } */
++/* { dg-options "-O -std=c89 -pedantic-errors -march=k8 -msse4a -m3dnow -mavx -mavx2 -mfma4 -mxop -maes -mpclmul -mpopcnt -mabm -mlzcnt -mbmi -mbmi2 -mtbm -mlwp -mfsgsbase -mrdrnd -mf16c -mfma -mrtm -mrdseed -mprfchw -madx -mfxsr -mxsaveopt -mavx512f -mavx512er -mavx512cd -mavx512pf -msha -mprefetchwt1 -mxsavec -mxsaves -mclflushopt -mavx512bw -mavx512dq -mavx512vl -mavx512vbmi -mavx512ifma -mclwb -mmwaitx -mclzero -mpku" } */
+
+ #include <x86intrin.h>
+
Index: gcc/testsuite/gcc.target/i386/pr77594.c
===================================================================
--- a/src/gcc/testsuite/gcc.target/i386/pr77594.c (.../tags/gcc_6_2_0_release)
@@ -4059,6 +5458,17 @@ Index: gcc/testsuite/gcc.target/i386/pr77377.c
+/* { dg-additional-options "-fpic" { target fpic } } */
+
+#include "../../c-c++-common/pr59037.c"
+Index: gcc/testsuite/gcc.target/i386/sse-13.c
+===================================================================
+--- a/src/gcc/testsuite/gcc.target/i386/sse-13.c (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/testsuite/gcc.target/i386/sse-13.c (.../branches/gcc-6-branch)
+@@ -1,5 +1,5 @@
+ /* { dg-do compile } */
+-/* { dg-options "-O2 -Werror-implicit-function-declaration -march=k8 -msse4a -m3dnow -mavx -mavx2 -mfma4 -mxop -maes -mpclmul -mpopcnt -mabm -mlzcnt -mbmi -mbmi2 -mtbm -mlwp -mfsgsbase -mrdrnd -mf16c -mfma -mrtm -mrdseed -mprfchw -madx -mfxsr -mxsaveopt -mavx512f -mavx512er -mavx512cd -mavx512pf -msha -mprefetchwt1 -mxsavec -mxsaves -mclflushopt -mavx512vl -mavx512dq -mavx512bw -mavx512vbmi -mavx512ifma -mclwb -mpcommit -mmwaitx -mclzero -mpku" } */
++/* { dg-options "-O2 -Werror-implicit-function-declaration -march=k8 -msse4a -m3dnow -mavx -mavx2 -mfma4 -mxop -maes -mpclmul -mpopcnt -mabm -mlzcnt -mbmi -mbmi2 -mtbm -mlwp -mfsgsbase -mrdrnd -mf16c -mfma -mrtm -mrdseed -mprfchw -madx -mfxsr -mxsaveopt -mavx512f -mavx512er -mavx512cd -mavx512pf -msha -mprefetchwt1 -mxsavec -mxsaves -mclflushopt -mavx512vl -mavx512dq -mavx512bw -mavx512vbmi -mavx512ifma -mclwb -mmwaitx -mclzero -mpku" } */
+
+ #include <mm_malloc.h>
+
Index: gcc/testsuite/lib/gcc-dg.exp
===================================================================
--- a/src/gcc/testsuite/lib/gcc-dg.exp (.../tags/gcc_6_2_0_release)
@@ -4357,6 +5767,34 @@ Index: gcc/testsuite/gfortran.dg/c_by_val_1.f
if ((4.0 * u8).ne.v8) call abort ()
stop
+Index: gcc/testsuite/gfortran.dg/pr77978_1.f90
+===================================================================
+--- a/src/gcc/testsuite/gfortran.dg/pr77978_1.f90 (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/testsuite/gfortran.dg/pr77978_1.f90 (.../branches/gcc-6-branch)
+@@ -0,0 +1,23 @@
++! { dg-do compile }
++! { dg-options "-std=f95" }
++subroutine a1
++ integer, parameter :: i = -666
++ stop i ! { dg-error "cannot be negative" }
++end subroutine a1
++
++subroutine a2
++ stop -666 ! { dg-error "cannot be negative" }
++end subroutine a2
++
++subroutine a3
++ integer, parameter :: i = 123456
++ stop i ! { dg-error "too many digits" }
++end subroutine a3
++
++subroutine a4
++ stop 123456 ! { dg-error "too many digits" }
++end subroutine a4
++
++!subroutine a5
++! stop merge(667,668,.true.)
++!end subroutine a5
Index: gcc/testsuite/gfortran.dg/c_assoc_4.f90
===================================================================
--- a/src/gcc/testsuite/gfortran.dg/c_assoc_4.f90 (.../tags/gcc_6_2_0_release)
@@ -4546,6 +5984,25 @@ Index: gcc/testsuite/gfortran.dg/pr77612.f90
+ end subroutine
+
+end program
+Index: gcc/testsuite/gfortran.dg/matmul_11.f90
+===================================================================
+--- a/src/gcc/testsuite/gfortran.dg/matmul_11.f90 (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/testsuite/gfortran.dg/matmul_11.f90 (.../branches/gcc-6-branch)
+@@ -0,0 +1,14 @@
++! { dg-do compile }
++! { dg-options "-ffrontend-optimize -fdump-tree-original" }
++! PR 77915 - ICE of matmul with forall.
++program x
++ integer, parameter :: d = 3
++ real,dimension(d,d,d) :: cube,xcube
++ real, dimension(d,d) :: cmatrix
++ integer :: i,j
++ forall(i=1:d,j=1:d)
++ xcube(i,j,:) = matmul(cmatrix,cube(i,j,:))
++ end forall
++end program x
++
++! { dg-final { scan-tree-dump-times "_gfortran_matmul" 1 "original" } }
Index: gcc/testsuite/gfortran.dg/pr77460.f90
===================================================================
--- a/src/gcc/testsuite/gfortran.dg/pr77460.f90 (.../tags/gcc_6_2_0_release)
@@ -4998,6 +6455,44 @@ Index: gcc/testsuite/gfortran.dg/pr71799.f90
+end do
+
+end subroutine test2
+Index: gcc/testsuite/gfortran.dg/pr77942.f90
+===================================================================
+--- a/src/gcc/testsuite/gfortran.dg/pr77942.f90 (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/testsuite/gfortran.dg/pr77942.f90 (.../branches/gcc-6-branch)
+@@ -0,0 +1,5 @@
++! { dg-do compile }
++program p
++ character, parameter :: c(2) = 'a'
++ print *, cshift(c(2:1), 1)
++end
+Index: gcc/testsuite/gfortran.dg/pr77978_3.f90
+===================================================================
+--- a/src/gcc/testsuite/gfortran.dg/pr77978_3.f90 (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/testsuite/gfortran.dg/pr77978_3.f90 (.../branches/gcc-6-branch)
+@@ -0,0 +1,23 @@
++! { dg-do compile }
++! { dg-options "-std=f2008" }
++subroutine a1
++ integer, parameter :: i = -666
++ stop i
++end subroutine a1
++
++subroutine a2
++ stop -666
++end subroutine a2
++
++subroutine a3
++ integer, parameter :: i = 123456
++ stop i
++end subroutine a3
++
++subroutine a4
++ stop 123456
++end subroutine a4
++
++subroutine a5
++ stop merge(667,668,.true.)
++end subroutine a5
Index: gcc/testsuite/gfortran.dg/pr69514_2.f90
===================================================================
--- a/src/gcc/testsuite/gfortran.dg/pr69514_2.f90 (.../tags/gcc_6_2_0_release)
@@ -5298,6 +6793,16 @@ Index: gcc/testsuite/gfortran.dg/pr69867.f90
+ character(1) :: c(1)=[1] ! { dg-error "convert INTEGER.4. to CHARACTER.1." }
+ end type
+end
+Index: gcc/testsuite/gfortran.dg/pr77978_2.f90
+===================================================================
+--- a/src/gcc/testsuite/gfortran.dg/pr77978_2.f90 (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/testsuite/gfortran.dg/pr77978_2.f90 (.../branches/gcc-6-branch)
+@@ -0,0 +1,5 @@
++! { dg-do compile }
++! { dg-options "-std=f2008" }
++subroutine a1
++ stop666 ! { dg-error "Blank required in STOP" }
++end subroutine a1
Index: gcc/testsuite/gfortran.dg/pr69514_1.f90
===================================================================
--- a/src/gcc/testsuite/gfortran.dg/pr69514_1.f90 (.../tags/gcc_6_2_0_release)
@@ -5486,6 +6991,97 @@ Index: gcc/testsuite/gcc.c-torture/unsorted/dump-noaddr.x
-verbose result
+dump_compare $src $options
return 1
+Index: gcc/testsuite/gnat.dg/biased_subtype.adb
+===================================================================
+--- a/src/gcc/testsuite/gnat.dg/biased_subtype.adb (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/testsuite/gnat.dg/biased_subtype.adb (.../branches/gcc-6-branch)
+@@ -0,0 +1,20 @@
++-- { dg-do run }
++-- { dg-options "-gnatws" }
++
++procedure Biased_Subtype is
++
++ CIM_Max_AA : constant := 9_999_999;
++ CIM_Min_AA : constant := -999_999;
++
++ type TIM_AA is range CIM_Min_AA..CIM_Max_AA + 1;
++ for TIM_AA'Size use 24;
++
++ subtype STIM_AA is TIM_AA range TIM_AA(CIM_Min_AA)..TIM_AA(CIM_Max_AA);
++
++ SAA : STIM_AA := 1;
++
++begin
++ if Integer(SAA) /= 1 then
++ raise Program_Error;
++ 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)
++++ b/src/gcc/testsuite/gnat.dg/inline13_pkg.adb (.../branches/gcc-6-branch)
+@@ -0,0 +1,8 @@
++package body Inline13_Pkg is
++
++ function Padded (Value : T) return Padded_T is
++ begin
++ return Padded_T(Value);
++ end Padded;
++
++end Inline13_Pkg;
+Index: gcc/testsuite/gnat.dg/inline13_pkg.ads
+===================================================================
+--- a/src/gcc/testsuite/gnat.dg/inline13_pkg.ads (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/testsuite/gnat.dg/inline13_pkg.ads (.../branches/gcc-6-branch)
+@@ -0,0 +1,10 @@
++package Inline13_Pkg is
++
++ subtype Padded_T is String (1..8);
++
++ type T is new Padded_T;
++
++ function Padded (Value : T) return Padded_T;
++ pragma Inline_Always (Padded);
++
++end Inline13_Pkg;
+Index: gcc/testsuite/gnat.dg/inline13.adb
+===================================================================
+--- a/src/gcc/testsuite/gnat.dg/inline13.adb (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/testsuite/gnat.dg/inline13.adb (.../branches/gcc-6-branch)
+@@ -0,0 +1,19 @@
++-- { dg-do compile }
++-- { dg-options "-O -gnatn" }
++
++package body Inline13 is
++
++ function F (L : Arr) return String is
++ Local : Arr (1 .. L'Length);
++ Ret : String (1 .. L'Length);
++ Pos : Natural := 1;
++ begin
++ Local (1 .. L'Length) := L;
++ for I in 1 .. Integer (L'Length) loop
++ Ret (Pos .. Pos + 8) := " " & Inline13_Pkg.Padded (Local (I));
++ Pos := Pos + 9;
++ end loop;
++ return Ret;
++ end;
++
++end Inline13;
+Index: gcc/testsuite/gnat.dg/inline13.ads
+===================================================================
+--- a/src/gcc/testsuite/gnat.dg/inline13.ads (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/testsuite/gnat.dg/inline13.ads (.../branches/gcc-6-branch)
+@@ -0,0 +1,9 @@
++with Inline13_Pkg;
++
++package Inline13 is
++
++ type Arr is array (Positive range <>) of Inline13_Pkg.T;
++
++ function F (L : Arr) return String;
++
++end Inline13;
Index: gcc/testsuite/gcc.dg/pr77450.c
===================================================================
--- a/src/gcc/testsuite/gcc.dg/pr77450.c (.../tags/gcc_6_2_0_release)
@@ -5767,6 +7363,49 @@ Index: gcc/testsuite/gcc.dg/torture/pr77436.c
+ __builtin_abort ();
+ return 0;
+}
+Index: gcc/testsuite/gcc.dg/torture/pr77937-1.c
+===================================================================
+--- a/src/gcc/testsuite/gcc.dg/torture/pr77937-1.c (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/testsuite/gcc.dg/torture/pr77937-1.c (.../branches/gcc-6-branch)
+@@ -0,0 +1,15 @@
++/* { dg-do compile } */
++/* { dg-options "-O3" } */
++/* { dg-additional-options "-march=amdfam10" { target i?86-*-* x86_64-*-* } } */
++
++int *a;
++int b, c, d;
++void fn1(char *p1, int p2) {
++ int x;
++ while (1) {
++ x = 0;
++ for (; x < 8; x++)
++ p1[0] = -a[0] * d + p1[0] * c + 1 >> b >> 1;
++ p1 += p2;
++ }
++}
+Index: gcc/testsuite/gcc.dg/torture/pr77937-2.c
+===================================================================
+--- a/src/gcc/testsuite/gcc.dg/torture/pr77937-2.c (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/testsuite/gcc.dg/torture/pr77937-2.c (.../branches/gcc-6-branch)
+@@ -0,0 +1,18 @@
++/* { dg-do compile } */
++/* { dg-options "-O3" } */
++/* { dg-additional-options "-march=amdfam10" { target i?86-*-* x86_64-*-* } } */
++
++extern int fn2(int);
++extern int fn3(int);
++int a, b, c;
++void fn1(long p1) {
++ char *d;
++ for (;; d += p1) {
++ d[0] = fn2(1 >> a);
++ fn3(0);
++ fn3(c >> a);
++ d[1] = fn3(d[1] * b + c >> a);
++ d[4] = fn3(d[4] * b + c >> a);
++ d[5] = fn3(d[5] * b + c >> a);
++ }
++}
Index: gcc/testsuite/gcc.dg/dg-test-1.c
===================================================================
--- a/src/gcc/testsuite/gcc.dg/dg-test-1.c (.../tags/gcc_6_2_0_release)
@@ -6007,7 +7646,84 @@ 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,450 @@
+@@ -1,3 +1,527 @@
++2016-10-17 Steven G. Kargl <kargl at gcc.gnu.org>
++
++ Backported from trunk
++ PR fortran/77978
++ * gfortran.dg/pr77978_1.f90: New test.
++ * gfortran.dg/pr77978_2.f90: Ditto.
++ * gfortran.dg/pr77978_3.f90: Ditto.
++
++
++2016-10-17 Bill Schmidt <wschmidt at linux.vnet.ibm.com>
++
++ Backport from mainline
++ 2016-10-13 Bill Schmidt <wschmidt at linux.vnet.ibm.com>
++
++ PR tree-optimization/77937
++ * gcc.dg/torture/pr77937-1.c: New.
++ * gcc.dg/torture/pr77937-2.c: New.
++
++2016-10-17 Martin Liska <mliska at suse.cz>
++
++ Backported from mainline
++ 2016-10-13 Martin Liska <mliska at suse.cz>
++
++ PR tree-optimization/77943
++ * g++.dg/tree-ssa/pr77943.C: New test.
++
++2016-10-16 Thomas Koenig <tkoenig at gcc.gnu.org>
++
++ Backport from trunk
++ PR fortran/77915
++ * gfortran.dg/matmul_11.f90: New test.
++
++2016-10-15 Eric Botcazou <ebotcazou at adacore.com>
++
++ * gcc.target/sparc/bmaskbshuf.c: Rename to...
++ * gcc.target/sparc/bmaskbshuf-1.c: ...this.
++ * gcc.target/sparc/bmaskbshuf-2.c: New test.
++
++2016-10-14 Martin Sebor <msebor at redhat.com>
++
++ PR c++/71912
++ * g++.dg/ext/flexary4.C: Adjust.
++ * g++.dg/ext/flexary5.C: Same.
++ * g++.dg/ext/flexary9.C: Same.
++ * g++.dg/ext/flexary19.C: New test.
++ * g++.dg/ext/flexary18.C: New test.
++ * g++.dg/torture/pr64312.C: Add a dg-error directive to an ill-formed
++ regression test.
++ * g++.dg/compat/struct-layout-1_generate.c (subfield): Add argument.
++ Avoid generating a flexible array member in an array.
++
++2016-10-13 Andrew Senkevich <andrew.senkevich at intel.com>
++
++ Backport from trunk
++ * testsuite/gcc.target/i386/pcommit-1.c: Deleted test.
++ * testsuite/gcc.target/i386/sse-12.c: Deleted -pcommit option.
++ * testsuite/gcc.target/i386/sse-13.c: Ditto.
++ * testsuite/gcc.target/i386/sse-14.c: Ditto.
++ * testsuite/gcc.target/i386/sse-22.c: Ditto.
++ * testsuite/gcc.target/i386/sse-23.c: Ditto.
++ * testsuite/g++.dg/other/i386-2.C: Ditto.
++ * testsuite/g++.dg/other/i386-3.C: Ditto.
++
++2016-10-11 Steven G. Kargl <kargl at gcc.gnu.org>
++
++ PR fortran/77942
++ * gfortran.dg/pr77942.f90
++
++2016-10-10 Eric Botcazou <ebotcazou at adacore.com>
++
++ * gnat.dg/inline13.ad[sb]: New test.
++ * gnat.dg/inline13_pkg.ad[sb]: New helper.
++
++2016-10-10 Eric Botcazou <ebotcazou at adacore.com>
++
++ * gnat.dg/biased_subtype.adb: New test.
++
+2016-10-07 Steven G. Kargl <kargl at gcc.gnu.org>
+
+ PR fortran/77406
@@ -6458,7 +8174,7 @@ Index: gcc/testsuite/ChangeLog
2016-08-22 Release Manager
* GCC 6.2.0 released.
-@@ -150,8 +597,8 @@
+@@ -150,8 +674,8 @@
2016-08-09 Martin Jambor <mjambor at suse.cz>
@@ -6469,7 +8185,7 @@ Index: gcc/testsuite/ChangeLog
2016-08-09 Richard Biener <rguenther at suse.de>
-@@ -276,8 +723,8 @@
+@@ -276,8 +800,8 @@
2016-07-20 Martin Jambor <mjambor at suse.cz>
@@ -6480,7 +8196,7 @@ Index: gcc/testsuite/ChangeLog
2016-07-19 Jakub Jelinek <jakub at redhat.com>
-@@ -418,7 +865,7 @@
+@@ -418,7 +942,7 @@
2016-07-06 Yuri Rumyantsev <ysrumyan at gmail.com>
PR tree-optimization/71518
@@ -6614,6 +8330,28 @@ Index: gcc/testsuite/g++.dg/cpp0x/pr71979.C
+ B b;
+ b = B (); // { dg-error "use of deleted" }
+}
+Index: gcc/testsuite/g++.dg/torture/pr64312.C
+===================================================================
+--- a/src/gcc/testsuite/g++.dg/torture/pr64312.C (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/testsuite/g++.dg/torture/pr64312.C (.../branches/gcc-6-branch)
+@@ -44,7 +44,7 @@
+ {
+ public:
+ int nelems;
+- int elems[];
++ int elems[]; // { dg-error "not at end" }
+ int *
+ m_fn1 ()
+ {
+@@ -88,7 +88,7 @@
+ m_impl->~any_incrementable_iterator_interface ();
+ }
+ G m_buffer;
+- any_incrementable_iterator_interface *m_impl;
++ any_incrementable_iterator_interface *m_impl; // { dg-message "next member" }
+ };
+ template <class Reference> class K : public I<any_iterator<Reference> >
+ {
Index: gcc/testsuite/g++.dg/ipa/devirt-52.C
===================================================================
--- a/src/gcc/testsuite/g++.dg/ipa/devirt-52.C (.../tags/gcc_6_2_0_release)
@@ -6728,6 +8466,182 @@ Index: gcc/testsuite/g++.dg/cpp1y/constexpr-77553.C
+ if (foo () != 513)
+ __builtin_abort ();
+}
+Index: gcc/testsuite/g++.dg/ext/flexary4.C
+===================================================================
+--- a/src/gcc/testsuite/g++.dg/ext/flexary4.C (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/testsuite/g++.dg/ext/flexary4.C (.../branches/gcc-6-branch)
+@@ -102,31 +102,28 @@
+ int a_0 [0];
+ };
+
+-// Empty structs are a GCC extension that (in C++ only) is treated
+-// as if it had a single member of type char. Therefore, a struct
++// An empty struct is treated as if it had a single member of type
++// char but the member cannot be accessed. Therefore, a struct
+ // containing a flexible array member followed by an empty struct
+ // is diagnosed to prevent the former subobject from sharing space
+ // with the latter.
+ struct Sx18 {
+ int a_x []; // { dg-error "flexible array member" }
+- struct S { };
++ struct { /* empty */ } s;
+ };
+
+-// Anonymous structs and unions are another GCC extension. Since
+-// they cannot be named and thus used to store the size of a flexible
+-// array member, a struct containing both is diagnosed as if
+-// the flexible array member appeared alone.
++// Anonymous structs are a G++ extension. Members of anonymous structs
++// are treated as if they were declared in the enclosing class.
+ struct Sx19 {
+- struct S { };
+- union U { };
+- int a_x []; // { dg-error "in an otherwise empty" }
++ struct { int i; }; // anonymous struct
++ int a_x [];
+ };
+
+-// Unlike in the case above, a named member of an anonymous struct
+-// prevents a subsequent flexible array member from being diagnosed.
++// Unlike in the case above, a named struct is not anonymous and
++// so doesn't contribute its member to that of the enclosing struct.
+ struct Sx20 {
+- struct S { } s;
+- int a_x [];
++ struct S { int i; };
++ int a_x []; // { dg-error "in an otherwise empty" }
+ };
+
+ struct Sx21 {
+@@ -298,6 +295,15 @@
+
+ ASSERT_AT_END (Anon1, good);
+
++struct NotAnon1 {
++ int n;
++ // The following is not an anonymous struct -- the type is unnamed
++ // but the object has a name.
++ struct {
++ int bad[]; // { dg-error "otherwise empty" }
++ } name;
++};
++
+ struct Anon2 {
+ struct {
+ int n;
+@@ -352,7 +358,6 @@
+ int n;
+ };
+
+-
+ struct Six {
+ int i;
+ int a[];
+Index: gcc/testsuite/g++.dg/ext/flexary5.C
+===================================================================
+--- a/src/gcc/testsuite/g++.dg/ext/flexary5.C (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/testsuite/g++.dg/ext/flexary5.C (.../branches/gcc-6-branch)
+@@ -64,19 +64,29 @@
+
+ ASSERT_AT_END (D5, a); // { dg-warning "offsetof within non-standard-layout" }
+
+-struct A2x {
++struct A2x_1 {
+ size_t n;
+- size_t a[]; // { dg-error "not at end of .struct D6.| D7.| D8." }
++ size_t a[]; // { dg-error "not at end of .struct D6." }
+ };
+
++struct A2x_2 {
++ size_t n;
++ size_t a[]; // { dg-error "not at end of .struct D7." }
++};
++
++struct A2x_3 {
++ size_t n;
++ size_t a[]; // { dg-error "not at end of .struct D8." }
++};
++
+ // Verify that the flexible array member in A2x above is diagnosed
+ // for each of the three struct defintions below which also derive
+ // from another struct with a flexible array member.
+-struct D6: A2x, E1, A1x { };
+-struct D7: E1, A2x, E2, A1x { };
+-struct D8: E1, E2, A2x, A1x { };
++struct D6: A2x_1, E1, A1x { };
++struct D7: E1, A2x_2, E2, A1x { };
++struct D8: E1, E2, A2x_3, A1x { };
+
+-struct DA2x: A2x { };
++struct DA2x: A2x_1 { };
+
+ struct D9: DA2x, E1, E2 { };
+
+@@ -194,13 +204,13 @@
+ struct D28: NE1, AA6x { };
+ struct D29: AA6x, NE1 { };
+
+-// Verify that a flexible array member in a virtual base class is not
+-// diagnosed.
+ struct A7x {
+ size_t n;
+- size_t a[];
++ size_t a[]; // { dg-error "flexible array member .A7x::a. not at end of .struct D33." }
+ };
+
++// Verify that a flexible array member in a virtual base class is not
++// diagnosed.
+ struct DA7xV1: virtual A7x { };
+ struct DA7xV2: virtual A7x { };
+
+@@ -207,3 +217,14 @@
+ struct D30: DA7xV1, DA7xV2 { };
+ struct D31: DA7xV1, DA7xV2 { };
+ struct D32: D30, D31 { };
++
++// Verify the diagnostic when the flexible array is in an anonymous struct.
++struct A8x {
++ struct { // { dg-message "next member .A8x::<anonymous struct> A8x::<anonymous>. declared here" }
++ size_t n;
++ size_t a[];
++ };
++};
++
++struct D33: // { dg-message "in the definition of .struct D33." }
++ A7x, A8x { };
+Index: gcc/testsuite/g++.dg/ext/flexary9.C
+===================================================================
+--- a/src/gcc/testsuite/g++.dg/ext/flexary9.C (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/testsuite/g++.dg/ext/flexary9.C (.../branches/gcc-6-branch)
+@@ -281,8 +281,8 @@
+
+ struct Anon1 {
+ int n;
+- struct {
+- int good[0]; // { dg-warning "zero-size array" }
++ struct { // { dg-warning "invalid use \[^\n\r\]* with a zero-size array" }
++ int good[0]; // { dg-warning "forbids zero-size array" }
+ }; // { dg-warning "anonymous struct" }
+ };
+
+@@ -289,7 +289,7 @@
+ ASSERT_AT_END (Anon1, good);
+
+ struct Anon2 {
+- struct {
++ struct { // { dg-warning "invalid use" }
+ int n;
+ struct {
+ int good[0]; // { dg-warning "zero-size array" }
+@@ -300,7 +300,7 @@
+ ASSERT_AT_END (Anon2, good);
+
+ struct Anon3 {
+- struct {
++ struct { // { dg-warning "invalid use" }
+ struct {
+ int n;
+ int good[0]; // { dg-warning "zero-size array" }
Index: gcc/testsuite/g++.dg/gomp/pr71910.C
===================================================================
--- a/src/gcc/testsuite/g++.dg/gomp/pr71910.C (.../tags/gcc_6_2_0_release)
@@ -6746,6 +8660,17 @@ Index: gcc/testsuite/g++.dg/gomp/pr71910.C
+#pragma omp parallel
+ __builtin_exit (0);
+}
+Index: gcc/testsuite/g++.dg/other/i386-2.C
+===================================================================
+--- a/src/gcc/testsuite/g++.dg/other/i386-2.C (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/testsuite/g++.dg/other/i386-2.C (.../branches/gcc-6-branch)
+@@ -1,5 +1,5 @@
+ /* { dg-do compile { target i?86-*-* x86_64-*-* } } */
+-/* { dg-options "-O -pedantic-errors -march=k8 -msse4a -m3dnow -mavx -mavx2 -mfma4 -mxop -maes -mpclmul -mpopcnt -mabm -mlzcnt -mbmi -mbmi2 -mtbm -mlwp -mfsgsbase -mrdrnd -mf16c -mfma -mrtm -mrdseed -mprfchw -madx -mfxsr -mxsaveopt -mavx512f -mavx512er -mavx512cd -mavx512pf -msha -mprefetchwt1 -mxsavec -mxsaves -mclflushopt -mavx512dq -mavx512bw -mavx512vl -mavx512ifma -mavx512vbmi -mclwb -mpcommit -mmwaitx -mclzero -mpku" } */
++/* { dg-options "-O -pedantic-errors -march=k8 -msse4a -m3dnow -mavx -mavx2 -mfma4 -mxop -maes -mpclmul -mpopcnt -mabm -mlzcnt -mbmi -mbmi2 -mtbm -mlwp -mfsgsbase -mrdrnd -mf16c -mfma -mrtm -mrdseed -mprfchw -madx -mfxsr -mxsaveopt -mavx512f -mavx512er -mavx512cd -mavx512pf -msha -mprefetchwt1 -mxsavec -mxsaves -mclflushopt -mavx512dq -mavx512bw -mavx512vl -mavx512ifma -mavx512vbmi -mclwb -mmwaitx -mclzero -mpku" } */
+
+ /* Test that {,x,e,p,t,s,w,a,b,i}mmintrin.h, mm3dnow.h, fma4intrin.h,
+ xopintrin.h, abmintrin.h, bmiintrin.h, tbmintrin.h, lwpintrin.h,
Index: gcc/testsuite/g++.dg/other/pr77759.C
===================================================================
--- a/src/gcc/testsuite/g++.dg/other/pr77759.C (.../tags/gcc_6_2_0_release)
@@ -6772,6 +8697,47 @@ Index: gcc/testsuite/g++.dg/other/pr77759.C
+ struct pair_empty pair;
+ foo (0, 0, 0, 0, 0, 0, pair);
+}
+Index: gcc/testsuite/g++.dg/other/i386-3.C
+===================================================================
+--- a/src/gcc/testsuite/g++.dg/other/i386-3.C (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/testsuite/g++.dg/other/i386-3.C (.../branches/gcc-6-branch)
+@@ -1,5 +1,5 @@
+ /* { dg-do compile { target i?86-*-* x86_64-*-* } } */
+-/* { dg-options "-O -fkeep-inline-functions -march=k8 -msse4a -m3dnow -mavx -mavx2 -mfma4 -mxop -maes -mpclmul -mpopcnt -mabm -mlzcnt -mbmi -mbmi2 -mtbm -mlwp -mfsgsbase -mrdrnd -mf16c -mfma -mrtm -mrdseed -mprfchw -madx -mfxsr -mxsaveopt -mavx512f -mavx512er -mavx512cd -mavx512pf -msha -mprefetchwt1 -mxsavec -mxsaves -mclflushopt -mavx512dq -mavx512bw -mavx512vl -mavx512ifma -mavx512vbmi -mclwb -mpcommit -mmwaitx -mclzero -mpku" } */
++/* { dg-options "-O -fkeep-inline-functions -march=k8 -msse4a -m3dnow -mavx -mavx2 -mfma4 -mxop -maes -mpclmul -mpopcnt -mabm -mlzcnt -mbmi -mbmi2 -mtbm -mlwp -mfsgsbase -mrdrnd -mf16c -mfma -mrtm -mrdseed -mprfchw -madx -mfxsr -mxsaveopt -mavx512f -mavx512er -mavx512cd -mavx512pf -msha -mprefetchwt1 -mxsavec -mxsaves -mclflushopt -mavx512dq -mavx512bw -mavx512vl -mavx512ifma -mavx512vbmi -mclwb -mmwaitx -mclzero -mpku" } */
+
+ /* Test that {,x,e,p,t,s,w,a,b,i}mmintrin.h, mm3dnow.h, fma4intrin.h,
+ xopintrin.h, abmintrin.h, bmiintrin.h, tbmintrin.h, lwpintrin.h,
+Index: gcc/testsuite/g++.dg/tree-ssa/pr77943.C
+===================================================================
+--- a/src/gcc/testsuite/g++.dg/tree-ssa/pr77943.C (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/testsuite/g++.dg/tree-ssa/pr77943.C (.../branches/gcc-6-branch)
+@@ -0,0 +1,25 @@
++/* { dg-do run } */
++/* { dg-options "-O2 -std=c++11" } */
++
++void thrower[[gnu::noinline]]() {
++ throw 1;
++}
++
++inline void fatal() noexcept {thrower();}
++inline void notFatal() {thrower();}
++
++void func(bool callFatal) {
++ if (callFatal) {
++ fatal();
++ } else {
++ notFatal();
++ }
++}
++
++int main(int argc, const char* argv[]) {
++ try {
++ bool callFatal = argc > 1;
++ func(callFatal);
++ } catch (...) {
++ }
++}
Index: gcc/testsuite/g++.dg/warn/Wplacement-new-size-4.C
===================================================================
--- a/src/gcc/testsuite/g++.dg/warn/Wplacement-new-size-4.C (.../tags/gcc_6_2_0_release)
@@ -6825,6 +8791,95 @@ Index: gcc/testsuite/g++.dg/asan/pr77396.C
+{
+ return 0;
+}
+Index: gcc/testsuite/g++.dg/compat/struct-layout-1_generate.c
+===================================================================
+--- a/src/gcc/testsuite/g++.dg/compat/struct-layout-1_generate.c (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/testsuite/g++.dg/compat/struct-layout-1_generate.c (.../branches/gcc-6-branch)
+@@ -495,7 +495,16 @@
+ #define HASH_SIZE 32749
+ static struct entry *hash_table[HASH_SIZE];
+
+-static int idx, limidx, output_one, short_enums;
++/* The index of the current type being output. */
++static int idx;
++
++/* The maximum index of the type(s) to output. */
++static int limidx;
++
++/* Set to non-zero to output a single type in response to the -i option
++ (which sets LIMIDX to the index of the type to output. */
++static int output_one;
++static int short_enums;
+ static const char *destdir;
+ static const char *srcdir;
+ static const char *srcdir_safe;
+@@ -535,6 +544,7 @@
+ fputs ("failed to create test files\n", stderr);
+ exit (1);
+ }
++
+ for (i = 0; i < NDG_OPTIONS; i++)
+ fprintf (outfile, dg_options[i], "", srcdir_safe);
+ fprintf (outfile, "\n\
+@@ -607,9 +617,14 @@
+
+ /* Generate a subfield. The object pointed to by FLEX is set to a non-zero
+ value when the generated field is a flexible array member. When set, it
+- prevents subsequent fields from being generated (a flexible array mem*/
++ prevents subsequent fields from being generated (a flexible array member
++ must be the last member of the struct it's defined in). ARRAY is non-
++ zero when the enclosing structure is part of an array. In that case,
++ avoid generating a flexible array member as a subfield (such a member
++ would be invalid). */
++
+ int
+-subfield (struct entry *e, char *letter, int *flex)
++subfield (struct entry *e, char *letter, int *flex, int array)
+ {
+ int i, type;
+ char buf[20];
+@@ -664,7 +679,14 @@
+ }
+
+ for (i = 1; !*flex && i <= e[0].len; )
+- i += subfield (e + i, letter, flex);
++ {
++ /* Avoid generating flexible array members if the enclosing
++ type is an array. */
++ int array
++ = (e[0].etype == ETYPE_STRUCT_ARRAY
++ || e[0].etype == ETYPE_UNION_ARRAY);
++ i += subfield (e + i, letter, flex, array);
++ }
+
+ switch (type)
+ {
+@@ -685,7 +707,7 @@
+ case ETYPE_ARRAY:
+ if (e[0].etype == ETYPE_ARRAY)
+ {
+- if (e[0].arr_len == 255)
++ if (!array && e[0].arr_len == 255)
+ {
+ *flex = 1;
+ snprintf (buf, 20, "%c[]", *letter);
+@@ -1141,6 +1163,7 @@
+ hash_table[hval % HASH_SIZE] = e;
+ }
+
++/* Output a single type. */
+ void
+ output (struct entry *e)
+ {
+@@ -1169,7 +1192,7 @@
+
+ int flex = 0;
+ for (i = 1; i <= e[0].len; )
+- i += subfield (e + i, &c, &flex);
++ i += subfield (e + i, &c, &flex, 0);
+
+ fputs (",", outfile);
+ c = 'a';
Index: gcc/testsuite/g++.dg/pr77427.C
===================================================================
--- a/src/gcc/testsuite/g++.dg/pr77427.C (.../tags/gcc_6_2_0_release)
@@ -6938,7 +8993,23 @@ Index: gcc/cp/class.c
===================================================================
--- a/src/gcc/cp/class.c (.../tags/gcc_6_2_0_release)
+++ b/src/gcc/cp/class.c (.../branches/gcc-6-branch)
-@@ -296,12 +296,13 @@
+@@ -147,11 +147,12 @@
+ static void remove_zero_width_bit_fields (tree);
+ static bool accessible_nvdtor_p (tree);
+
+-/* Used by find_flexarrays and related. */
++/* Used by find_flexarrays and related functions. */
+ struct flexmems_t;
+-static void find_flexarrays (tree, flexmems_t *);
+ static void diagnose_flexarrays (tree, const flexmems_t *);
+-static void check_flexarrays (tree, flexmems_t * = NULL);
++static void find_flexarrays (tree, flexmems_t *, bool = false,
++ tree = NULL_TREE, tree = NULL_TREE);
++static void check_flexarrays (tree, flexmems_t * = NULL, bool = false);
+ static void check_bases (tree, int *, int *);
+ static void check_bases_and_members (tree);
+ static tree create_vtable_ptr (tree, tree *);
+@@ -296,12 +297,13 @@
/* This can happen when adjust_result_of_qualified_name_lookup can't
find a unique base binfo in a call to a member function. We
couldn't give the diagnostic then since we might have been calling
@@ -6954,6 +9025,423 @@ Index: gcc/cp/class.c
}
return error_mark_node;
}
+@@ -6686,53 +6688,148 @@
+ return false;
+ }
+
+-/* Used by find_flexarrays and related. */
+-struct flexmems_t {
++/* Used by find_flexarrays and related functions. */
++
++struct flexmems_t
++{
+ /* The first flexible array member or non-zero array member found
+- in order of layout. */
++ in the order of layout. */
+ tree array;
+ /* First non-static non-empty data member in the class or its bases. */
+ tree first;
+- /* First non-static non-empty data member following either the flexible
+- array member, if found, or the zero-length array member. */
+- tree after;
++ /* The first non-static non-empty data member following either
++ the flexible array member, if found, or the zero-length array member
++ otherwise. AFTER[1] refers to the first such data member of a union
++ of which the struct containing the flexible array member or zero-length
++ array is a member, or NULL when no such union exists. This element is
++ only used during searching, not for diagnosing problems. AFTER[0]
++ refers to the first such data member that is not a member of such
++ a union. */
++ tree after[2];
++
++ /* Refers to a struct (not union) in which the struct of which the flexible
++ array is member is defined. Used to diagnose strictly (according to C)
++ invalid uses of the latter structs. */
++ tree enclosing;
+ };
+
+ /* Find either the first flexible array member or the first zero-length
+- array, in that order or preference, among members of class T (but not
+- its base classes), and set members of FMEM accordingly. */
++ array, in that order of preference, among members of class T (but not
++ its base classes), and set members of FMEM accordingly.
++ BASE_P is true if T is a base class of another class.
++ PUN is set to the outermost union in which the flexible array member
++ (or zero-length array) is defined if one such union exists, otherwise
++ to NULL.
++ Similarly, PSTR is set to a data member of the outermost struct of
++ which the flexible array is a member if one such struct exists,
++ otherwise to NULL. */
+
+ static void
+-find_flexarrays (tree t, flexmems_t *fmem)
++find_flexarrays (tree t, flexmems_t *fmem, bool base_p,
++ tree pun /* = NULL_TREE */,
++ tree pstr /* = NULL_TREE */)
+ {
+- for (tree fld = TYPE_FIELDS (t), next; fld; fld = next)
++ /* Set the "pointer" to the outermost enclosing union if not set
++ yet and maintain it for the remainder of the recursion. */
++ if (!pun && TREE_CODE (t) == UNION_TYPE)
++ pun = t;
++
++ for (tree fld = TYPE_FIELDS (t); fld; fld = DECL_CHAIN (fld))
+ {
+- /* Find the next non-static data member if it exists. */
+- for (next = fld;
+- (next = DECL_CHAIN (next))
+- && TREE_CODE (next) != FIELD_DECL; );
++ if (fld == error_mark_node)
++ return;
+
+- tree fldtype = TREE_TYPE (fld);
+- if (TREE_CODE (fld) != TYPE_DECL
+- && RECORD_OR_UNION_TYPE_P (fldtype)
+- && TYPE_ANONYMOUS_P (fldtype))
++ /* Is FLD a typedef for an anonymous struct? */
++
++ /* FIXME: Note that typedefs (as well as arrays) need to be fully
++ handled elsewhere so that errors like the following are detected
++ as well:
++ typedef struct { int i, a[], j; } S; // bug c++/72753
++ S s [2]; // bug c++/68489
++ */
++ if (TREE_CODE (fld) == TYPE_DECL
++ && DECL_IMPLICIT_TYPEDEF_P (fld)
++ && CLASS_TYPE_P (TREE_TYPE (fld))
++ && anon_aggrname_p (DECL_NAME (fld)))
+ {
+- /* Members of anonymous structs and unions are treated as if
+- they were members of the containing class. Descend into
+- the anonymous struct or union and find a flexible array
+- member or zero-length array among its fields. */
+- find_flexarrays (fldtype, fmem);
++ /* Check the nested unnamed type referenced via a typedef
++ independently of FMEM (since it's not a data member of
++ the enclosing class). */
++ check_flexarrays (TREE_TYPE (fld));
+ continue;
+ }
+
+- /* Skip anything that's not a (non-static) data member. */
+- if (TREE_CODE (fld) != FIELD_DECL)
++ /* Skip anything that's GCC-generated or not a (non-static) data
++ member. */
++ if (DECL_ARTIFICIAL (fld) || TREE_CODE (fld) != FIELD_DECL)
+ continue;
+
+- /* Skip virtual table pointers. */
+- if (DECL_ARTIFICIAL (fld))
+- continue;
++ /* Type of the member. */
++ tree fldtype = TREE_TYPE (fld);
++ if (fldtype == error_mark_node)
++ return;
+
++ /* Determine the type of the array element or object referenced
++ by the member so that it can be checked for flexible array
++ members if it hasn't been yet. */
++ tree eltype = fldtype;
++ while (TREE_CODE (eltype) == ARRAY_TYPE
++ || TREE_CODE (eltype) == POINTER_TYPE
++ || TREE_CODE (eltype) == REFERENCE_TYPE)
++ eltype = TREE_TYPE (eltype);
++
++ if (RECORD_OR_UNION_TYPE_P (eltype))
++ {
++ if (fmem->array && !fmem->after[bool (pun)])
++ {
++ /* Once the member after the flexible array has been found
++ we're done. */
++ fmem->after[bool (pun)] = fld;
++ break;
++ }
++
++ if (eltype == fldtype || TYPE_ANONYMOUS_P (eltype))
++ {
++ /* Descend into the non-static member struct or union and try
++ to find a flexible array member or zero-length array among
++ its members. This is only necessary for anonymous types
++ and types in whose context the current type T has not been
++ defined (the latter must not be checked again because they
++ are already in the process of being checked by one of the
++ recursive calls). */
++
++ tree first = fmem->first;
++ tree array = fmem->array;
++
++ /* If this member isn't anonymous and a prior non-flexible array
++ member has been seen in one of the enclosing structs, clear
++ the FIRST member since it doesn't contribute to the flexible
++ array struct's members. */
++ if (first && !array && !ANON_AGGR_TYPE_P (eltype))
++ fmem->first = NULL_TREE;
++
++ find_flexarrays (eltype, fmem, false, pun,
++ !pstr && TREE_CODE (t) == RECORD_TYPE ? fld : pstr);
++
++ if (fmem->array != array)
++ continue;
++
++ if (first && !array && !ANON_AGGR_TYPE_P (eltype))
++ {
++ /* Restore the FIRST member reset above if no flexible
++ array member has been found in this member's struct. */
++ fmem->first = first;
++ }
++
++ /* If the member struct contains the first flexible array
++ member, or if this member is a base class, continue to
++ the next member and avoid setting the FMEM->NEXT pointer
++ to point to it. */
++ if (base_p)
++ continue;
++ }
++ }
++
+ if (field_nonempty_p (fld))
+ {
+ /* Remember the first non-static data member. */
+@@ -6742,8 +6839,8 @@
+ /* Remember the first non-static data member after the flexible
+ array member, if one has been found, or the zero-length array
+ if it has been found. */
+- if (!fmem->after && fmem->array)
+- fmem->after = fld;
++ if (fmem->array && !fmem->after[bool (pun)])
++ fmem->after[bool (pun)] = fld;
+ }
+
+ /* Skip non-arrays. */
+@@ -6759,13 +6856,16 @@
+ such field or a flexible array member has been seen to
+ handle the pathological and unlikely case of multiple
+ such members. */
+- if (!fmem->after)
+- fmem->after = fld;
++ if (!fmem->after[bool (pun)])
++ fmem->after[bool (pun)] = fld;
+ }
+ else if (integer_all_onesp (TYPE_MAX_VALUE (TYPE_DOMAIN (fldtype))))
+- /* Remember the first zero-length array unless a flexible array
+- member has already been seen. */
+- fmem->array = fld;
++ {
++ /* Remember the first zero-length array unless a flexible array
++ member has already been seen. */
++ fmem->array = fld;
++ fmem->enclosing = pstr;
++ }
+ }
+ else
+ {
+@@ -6776,16 +6876,39 @@
+ reset the after pointer. */
+ if (TYPE_DOMAIN (TREE_TYPE (fmem->array)))
+ {
++ fmem->after[bool (pun)] = NULL_TREE;
+ fmem->array = fld;
+- fmem->after = NULL_TREE;
++ fmem->enclosing = pstr;
+ }
+ }
+ else
+- fmem->array = fld;
++ {
++ fmem->array = fld;
++ fmem->enclosing = pstr;
++ }
+ }
+ }
+ }
+
++/* Diagnose a strictly (by the C standard) invalid use of a struct with
++ a flexible array member (or the zero-length array extension). */
++
++static void
++diagnose_invalid_flexarray (const flexmems_t *fmem)
++{
++ if (fmem->array && fmem->enclosing
++ && pedwarn (location_of (fmem->enclosing), OPT_Wpedantic,
++ TYPE_DOMAIN (TREE_TYPE (fmem->array))
++ ? G_("invalid use of %q#T with a zero-size array "
++ "in %q#D")
++ : G_("invalid use of %q#T with a flexible array member "
++ "in %q#T"),
++ DECL_CONTEXT (fmem->array),
++ DECL_CONTEXT (fmem->enclosing)))
++ inform (DECL_SOURCE_LOCATION (fmem->array),
++ "array member %q#D declared here", fmem->array);
++}
++
+ /* Issue diagnostics for invalid flexible array members or zero-length
+ arrays that are not the last elements of the containing class or its
+ base classes or that are its sole members. */
+@@ -6793,28 +6916,41 @@
+ static void
+ diagnose_flexarrays (tree t, const flexmems_t *fmem)
+ {
+- /* Members of anonymous structs and unions are considered to be members
+- of the containing struct or union. */
+- if (TYPE_ANONYMOUS_P (t) || !fmem->array)
++ if (!fmem->array)
+ return;
+
++ if (fmem->first && !fmem->after[0])
++ {
++ diagnose_invalid_flexarray (fmem);
++ return;
++ }
++
++ /* Has a diagnostic been issued? */
++ bool diagd = false;
++
+ const char *msg = 0;
+
+ if (TYPE_DOMAIN (TREE_TYPE (fmem->array)))
+ {
+- if (fmem->after)
++ if (fmem->after[0])
+ msg = G_("zero-size array member %qD not at end of %q#T");
+ else if (!fmem->first)
+ msg = G_("zero-size array member %qD in an otherwise empty %q#T");
+
+- if (msg && pedwarn (DECL_SOURCE_LOCATION (fmem->array),
+- OPT_Wpedantic, msg, fmem->array, t))
++ if (msg)
++ {
++ location_t loc = DECL_SOURCE_LOCATION (fmem->array);
+
+- inform (location_of (t), "in the definition of %q#T", t);
++ if (pedwarn (loc, OPT_Wpedantic, msg, fmem->array, t))
++ {
++ inform (location_of (t), "in the definition of %q#T", t);
++ diagd = true;
++ }
++ }
+ }
+ else
+ {
+- if (fmem->after)
++ if (fmem->after[0])
+ msg = G_("flexible array member %qD not at end of %q#T");
+ else if (!fmem->first)
+ msg = G_("flexible array member %qD in an otherwise empty %q#T");
+@@ -6821,21 +6957,29 @@
+
+ if (msg)
+ {
+- error_at (DECL_SOURCE_LOCATION (fmem->array), msg,
+- fmem->array, t);
++ location_t loc = DECL_SOURCE_LOCATION (fmem->array);
++ diagd = true;
+
++ error_at (loc, msg, fmem->array, t);
++
+ /* In the unlikely event that the member following the flexible
+- array member is declared in a different class, point to it.
++ array member is declared in a different class, or the member
++ overlaps another member of a common union, point to it.
+ Otherwise it should be obvious. */
+- if (fmem->after
+- && (DECL_CONTEXT (fmem->after) != DECL_CONTEXT (fmem->array)))
+- inform (DECL_SOURCE_LOCATION (fmem->after),
++ if (fmem->after[0]
++ && ((DECL_CONTEXT (fmem->after[0])
++ != DECL_CONTEXT (fmem->array))))
++ {
++ inform (DECL_SOURCE_LOCATION (fmem->after[0]),
+ "next member %q#D declared here",
+- fmem->after);
+-
+- inform (location_of (t), "in the definition of %q#T", t);
++ fmem->after[0]);
++ inform (location_of (t), "in the definition of %q#T", t);
++ }
+ }
+ }
++
++ if (!diagd && fmem->array && fmem->enclosing)
++ diagnose_invalid_flexarray (fmem);
+ }
+
+
+@@ -6848,7 +6992,8 @@
+ that fails the checks. */
+
+ static void
+-check_flexarrays (tree t, flexmems_t *fmem /* = NULL */)
++check_flexarrays (tree t, flexmems_t *fmem /* = NULL */,
++ bool base_p /* = false */)
+ {
+ /* Initialize the result of a search for flexible array and zero-length
+ array members. Avoid doing any work if the most interesting FMEM data
+@@ -6856,18 +7001,20 @@
+ flexmems_t flexmems = flexmems_t ();
+ if (!fmem)
+ fmem = &flexmems;
+- else if (fmem->array && fmem->first && fmem->after)
++ else if (fmem->array && fmem->first && fmem->after[0])
+ return;
+
++ tree fam = fmem->array;
++
+ /* Recursively check the primary base class first. */
+ if (CLASSTYPE_HAS_PRIMARY_BASE_P (t))
+ {
+ tree basetype = BINFO_TYPE (CLASSTYPE_PRIMARY_BINFO (t));
+- check_flexarrays (basetype, fmem);
++ check_flexarrays (basetype, fmem, true);
+ }
+
+ /* Recursively check the base classes. */
+- int nbases = BINFO_N_BASE_BINFOS (TYPE_BINFO (t));
++ int nbases = TYPE_BINFO (t) ? BINFO_N_BASE_BINFOS (TYPE_BINFO (t)) : 0;
+ for (int i = 0; i < nbases; ++i)
+ {
+ tree base_binfo = BINFO_BASE_BINFO (TYPE_BINFO (t), i);
+@@ -6881,7 +7028,7 @@
+ continue;
+
+ /* Check the base class. */
+- check_flexarrays (BINFO_TYPE (base_binfo), fmem);
++ check_flexarrays (BINFO_TYPE (base_binfo), fmem, /*base_p=*/true);
+ }
+
+ if (fmem == &flexmems)
+@@ -6898,17 +7045,26 @@
+ /* Check the virtual base class. */
+ tree basetype = TREE_TYPE (base_binfo);
+
+- check_flexarrays (basetype, fmem);
++ check_flexarrays (basetype, fmem, /*base_p=*/true);
+ }
+ }
+
+- /* Search the members of the current (derived) class. */
+- find_flexarrays (t, fmem);
++ /* Is the type unnamed (and therefore a member of it potentially
++ an anonymous struct or union)? */
++ bool maybe_anon_p = TYPE_ANONYMOUS_P (t);
+
+- if (fmem == &flexmems)
++ /* Search the members of the current (possibly derived) class, skipping
++ unnamed structs and unions since those could be anonymous. */
++ if (fmem != &flexmems || !maybe_anon_p)
++ find_flexarrays (t, fmem, base_p || fam != fmem->array);
++
++ if (fmem == &flexmems && !maybe_anon_p)
+ {
+- /* Issue diagnostics for invalid flexible and zero-length array members
+- found in base classes or among the members of the current class. */
++ /* Issue diagnostics for invalid flexible and zero-length array
++ members found in base classes or among the members of the current
++ class. Ignore anonymous structs and unions whose members are
++ considered to be members of the enclosing class and thus will
++ be diagnosed when checking it. */
+ diagnose_flexarrays (t, fmem);
+ }
+ }
Index: gcc/cp/constexpr.c
===================================================================
--- a/src/gcc/cp/constexpr.c (.../tags/gcc_6_2_0_release)
@@ -7172,7 +9660,17 @@ Index: gcc/cp/ChangeLog
===================================================================
--- a/src/gcc/cp/ChangeLog (.../tags/gcc_6_2_0_release)
+++ b/src/gcc/cp/ChangeLog (.../branches/gcc-6-branch)
-@@ -1,3 +1,34 @@
+@@ -1,3 +1,44 @@
++2016-10-14 Martin Sebor <msebor at redhat.com>
++
++ PR c++/71912
++ * class.c (struct flexmems_t): Add members.
++ (find_flexarrays): Add arguments. Correct handling of anonymous
++ structs.
++ (diagnose_flexarrays): Adjust to issue warnings in addition to errors.
++ (check_flexarrays): Add argument.
++ (diagnose_invalid_flexarray): New functions.
++
+2016-10-04 Martin Sebor <msebor at redhat.com>
+
+ PR c++/77804
@@ -7730,6 +10228,841 @@ Index: gcc/expr.c
}
if (BYTES_BIG_ENDIAN)
+Index: gcc/ada/system-linux-ppc64.ads
+===================================================================
+--- a/src/gcc/ada/system-linux-ppc64.ads (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/ada/system-linux-ppc64.ads (.../branches/gcc-6-branch)
+@@ -1,156 +0,0 @@
+-------------------------------------------------------------------------------
+--- --
+--- GNAT RUN-TIME COMPONENTS --
+--- --
+--- S Y S T E M --
+--- --
+--- S p e c --
+--- (GNU-Linux/PPC64 Version) --
+--- --
+--- Copyright (C) 1992-2016, Free Software Foundation, Inc. --
+--- --
+--- This specification is derived from the Ada Reference Manual for use with --
+--- GNAT. The copyright notice above, and the license provisions that follow --
+--- apply solely to the contents of the part following the private keyword. --
+--- --
+--- GNAT is free software; you can redistribute it and/or modify it under --
+--- terms of the GNU General Public License as published by the Free Soft- --
+--- ware Foundation; either version 3, or (at your option) any later ver- --
+--- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
+--- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
+--- or FITNESS FOR A PARTICULAR PURPOSE. --
+--- --
+--- As a special exception under Section 7 of GPL version 3, you are granted --
+--- additional permissions described in the GCC Runtime Library Exception, --
+--- version 3.1, as published by the Free Software Foundation. --
+--- --
+--- You should have received a copy of the GNU General Public License and --
+--- a copy of the GCC Runtime Library Exception along with this program; --
+--- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
+--- <http://www.gnu.org/licenses/>. --
+--- --
+--- GNAT was originally developed by the GNAT team at New York University. --
+--- Extensive contributions were provided by Ada Core Technologies Inc. --
+--- --
+-------------------------------------------------------------------------------
+-
+-package System is
+- pragma Pure;
+- -- Note that we take advantage of the implementation permission to make
+- -- this unit Pure instead of Preelaborable; see RM 13.7.1(15). In Ada
+- -- 2005, this is Pure in any case (AI-362).
+-
+- pragma No_Elaboration_Code_All;
+- -- Allow the use of that restriction in units that WITH this unit
+-
+- type Name is (SYSTEM_NAME_GNAT);
+- System_Name : constant Name := SYSTEM_NAME_GNAT;
+-
+- -- System-Dependent Named Numbers
+-
+- Min_Int : constant := Long_Long_Integer'First;
+- Max_Int : constant := Long_Long_Integer'Last;
+-
+- Max_Binary_Modulus : constant := 2 ** Long_Long_Integer'Size;
+- Max_Nonbinary_Modulus : constant := 2 ** Integer'Size - 1;
+-
+- Max_Base_Digits : constant := Long_Long_Float'Digits;
+- Max_Digits : constant := Long_Long_Float'Digits;
+-
+- Max_Mantissa : constant := 63;
+- Fine_Delta : constant := 2.0 ** (-Max_Mantissa);
+-
+- Tick : constant := 0.000_001;
+-
+- -- Storage-related Declarations
+-
+- type Address is private;
+- pragma Preelaborable_Initialization (Address);
+- Null_Address : constant Address;
+-
+- Storage_Unit : constant := 8;
+- Word_Size : constant := 64;
+- Memory_Size : constant := 2 ** 64;
+-
+- -- Address comparison
+-
+- function "<" (Left, Right : Address) return Boolean;
+- function "<=" (Left, Right : Address) return Boolean;
+- function ">" (Left, Right : Address) return Boolean;
+- function ">=" (Left, Right : Address) return Boolean;
+- function "=" (Left, Right : Address) return Boolean;
+-
+- pragma Import (Intrinsic, "<");
+- pragma Import (Intrinsic, "<=");
+- pragma Import (Intrinsic, ">");
+- pragma Import (Intrinsic, ">=");
+- pragma Import (Intrinsic, "=");
+-
+- -- Other System-Dependent Declarations
+-
+- type Bit_Order is (High_Order_First, Low_Order_First);
+- Default_Bit_Order : constant Bit_Order := High_Order_First;
+- pragma Warnings (Off, Default_Bit_Order); -- kill constant condition warning
+-
+- -- Priority-related Declarations (RM D.1)
+-
+- -- 0 .. 98 corresponds to the system priority range 1 .. 99.
+- --
+- -- If the scheduling policy is SCHED_FIFO or SCHED_RR the runtime makes use
+- -- of the entire range provided by the system.
+- --
+- -- If the scheduling policy is SCHED_OTHER the only valid system priority
+- -- is 1 and other values are simply ignored.
+-
+- Max_Priority : constant Positive := 97;
+- Max_Interrupt_Priority : constant Positive := 98;
+-
+- subtype Any_Priority is Integer range 0 .. 98;
+- subtype Priority is Any_Priority range 0 .. 97;
+- subtype Interrupt_Priority is Any_Priority range 98 .. 98;
+-
+- Default_Priority : constant Priority := 48;
+-
+-private
+-
+- type Address is mod Memory_Size;
+- Null_Address : constant Address := 0;
+-
+- --------------------------------------
+- -- System Implementation Parameters --
+- --------------------------------------
+-
+- -- These parameters provide information about the target that is used
+- -- by the compiler. They are in the private part of System, where they
+- -- can be accessed using the special circuitry in the Targparm unit
+- -- whose source should be consulted for more detailed descriptions
+- -- of the individual switch values.
+-
+- Backend_Divide_Checks : constant Boolean := False;
+- Backend_Overflow_Checks : constant Boolean := False;
+- Command_Line_Args : constant Boolean := True;
+- Configurable_Run_Time : constant Boolean := False;
+- Denorm : constant Boolean := True;
+- Duration_32_Bits : constant Boolean := False;
+- Exit_Status_Supported : constant Boolean := True;
+- Fractional_Fixed_Ops : constant Boolean := False;
+- Frontend_Layout : constant Boolean := False;
+- Machine_Overflows : constant Boolean := False;
+- Machine_Rounds : constant Boolean := True;
+- Preallocated_Stacks : constant Boolean := False;
+- Signed_Zeros : constant Boolean := True;
+- Stack_Check_Default : constant Boolean := False;
+- Stack_Check_Probes : constant Boolean := True;
+- Stack_Check_Limits : constant Boolean := False;
+- Support_64_Bit_Divides : constant Boolean := True;
+- Support_Aggregates : constant Boolean := True;
+- Support_Composite_Assign : constant Boolean := True;
+- Support_Composite_Compare : constant Boolean := True;
+- Support_Long_Shifts : constant Boolean := True;
+- Always_Compatible_Rep : constant Boolean := False;
+- Suppress_Standard_Library : constant Boolean := False;
+- Use_Ada_Main_Program_Name : constant Boolean := False;
+- Frontend_Exceptions : constant Boolean := False;
+- ZCX_By_Default : constant Boolean := True;
+-
+-end System;
+Index: gcc/ada/system-linux-s390x.ads
+===================================================================
+--- a/src/gcc/ada/system-linux-s390x.ads (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/ada/system-linux-s390x.ads (.../branches/gcc-6-branch)
+@@ -7,7 +7,7 @@
+ -- S p e c --
+ -- (GNU-Linux/s390x Version) --
+ -- --
+--- Copyright (C) 1992-2015, Free Software Foundation, Inc. --
++-- Copyright (C) 1992-2016, Free Software Foundation, Inc. --
+ -- --
+ -- This specification is derived from the Ada Reference Manual for use with --
+ -- GNAT. The copyright notice above, and the license provisions that follow --
+@@ -138,7 +138,7 @@
+ Support_Composite_Assign : constant Boolean := True;
+ Support_Composite_Compare : constant Boolean := True;
+ Support_Long_Shifts : constant Boolean := True;
+- Always_Compatible_Rep : constant Boolean := True;
++ Always_Compatible_Rep : constant Boolean := False;
+ Suppress_Standard_Library : constant Boolean := False;
+ Use_Ada_Main_Program_Name : constant Boolean := False;
+ Frontend_Exceptions : constant Boolean := False;
+Index: gcc/ada/system-linux-alpha.ads
+===================================================================
+--- a/src/gcc/ada/system-linux-alpha.ads (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/ada/system-linux-alpha.ads (.../branches/gcc-6-branch)
+@@ -7,7 +7,7 @@
+ -- S p e c --
+ -- (GNU-Linux/alpha Version) --
+ -- --
+--- Copyright (C) 1992-2015, Free Software Foundation, Inc. --
++-- Copyright (C) 1992-2016, Free Software Foundation, Inc. --
+ -- --
+ -- This specification is derived from the Ada Reference Manual for use with --
+ -- GNAT. The copyright notice above, and the license provisions that follow --
+@@ -138,7 +138,7 @@
+ Support_Composite_Assign : constant Boolean := True;
+ Support_Composite_Compare : constant Boolean := True;
+ Support_Long_Shifts : constant Boolean := True;
+- Always_Compatible_Rep : constant Boolean := True;
++ Always_Compatible_Rep : constant Boolean := False;
+ Suppress_Standard_Library : constant Boolean := False;
+ Use_Ada_Main_Program_Name : constant Boolean := False;
+ Frontend_Exceptions : constant Boolean := False;
+Index: gcc/ada/system-linux-hppa.ads
+===================================================================
+--- a/src/gcc/ada/system-linux-hppa.ads (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/ada/system-linux-hppa.ads (.../branches/gcc-6-branch)
+@@ -7,7 +7,7 @@
+ -- S p e c --
+ -- (GNU/Linux-HPPA Version) --
+ -- --
+--- Copyright (C) 1992-2015, Free Software Foundation, Inc. --
++-- Copyright (C) 1992-2016, Free Software Foundation, Inc. --
+ -- --
+ -- This specification is derived from the Ada Reference Manual for use with --
+ -- GNAT. The copyright notice above, and the license provisions that follow --
+@@ -138,7 +138,7 @@
+ Support_Composite_Assign : constant Boolean := True;
+ Support_Composite_Compare : constant Boolean := True;
+ Support_Long_Shifts : constant Boolean := True;
+- Always_Compatible_Rep : constant Boolean := True;
++ Always_Compatible_Rep : constant Boolean := False;
+ Suppress_Standard_Library : constant Boolean := False;
+ Use_Ada_Main_Program_Name : constant Boolean := False;
+ Frontend_Exceptions : constant Boolean := False;
+Index: gcc/ada/system-linux-s390.ads
+===================================================================
+--- a/src/gcc/ada/system-linux-s390.ads (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/ada/system-linux-s390.ads (.../branches/gcc-6-branch)
+@@ -7,7 +7,7 @@
+ -- S p e c --
+ -- (GNU-Linux/s390 Version) --
+ -- --
+--- Copyright (C) 1992-2015, Free Software Foundation, Inc. --
++-- Copyright (C) 1992-2016, Free Software Foundation, Inc. --
+ -- --
+ -- This specification is derived from the Ada Reference Manual for use with --
+ -- GNAT. The copyright notice above, and the license provisions that follow --
+@@ -138,7 +138,7 @@
+ Support_Composite_Assign : constant Boolean := True;
+ Support_Composite_Compare : constant Boolean := True;
+ Support_Long_Shifts : constant Boolean := True;
+- Always_Compatible_Rep : constant Boolean := True;
++ Always_Compatible_Rep : constant Boolean := False;
+ Suppress_Standard_Library : constant Boolean := False;
+ Use_Ada_Main_Program_Name : constant Boolean := False;
+ Frontend_Exceptions : constant Boolean := False;
+Index: gcc/ada/system-darwin-ppc64.ads
+===================================================================
+--- a/src/gcc/ada/system-darwin-ppc64.ads (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/ada/system-darwin-ppc64.ads (.../branches/gcc-6-branch)
+@@ -138,7 +138,6 @@
+ Stack_Check_Default : constant Boolean := False;
+ Stack_Check_Probes : constant Boolean := False;
+ Stack_Check_Limits : constant Boolean := False;
+- Support_64_Bit_Divides : constant Boolean := True;
+ Support_Aggregates : constant Boolean := True;
+ Support_Atomic_Primitives : constant Boolean := True;
+ Support_Composite_Assign : constant Boolean := True;
+Index: gcc/ada/system-linux-ia64.ads
+===================================================================
+--- a/src/gcc/ada/system-linux-ia64.ads (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/ada/system-linux-ia64.ads (.../branches/gcc-6-branch)
+@@ -7,7 +7,7 @@
+ -- S p e c --
+ -- (GNU-Linux/ia64 Version) --
+ -- --
+--- Copyright (C) 1992-2015, Free Software Foundation, Inc. --
++-- Copyright (C) 1992-2016, Free Software Foundation, Inc. --
+ -- --
+ -- This specification is derived from the Ada Reference Manual for use with --
+ -- GNAT. The copyright notice above, and the license provisions that follow --
+@@ -147,7 +147,7 @@
+ Support_Composite_Assign : constant Boolean := True;
+ Support_Composite_Compare : constant Boolean := True;
+ Support_Long_Shifts : constant Boolean := True;
+- Always_Compatible_Rep : constant Boolean := True;
++ Always_Compatible_Rep : constant Boolean := False;
+ Suppress_Standard_Library : constant Boolean := False;
+ Use_Ada_Main_Program_Name : constant Boolean := False;
+ Frontend_Exceptions : constant Boolean := False;
+Index: gcc/ada/system-linux-armeb.ads
+===================================================================
+--- a/src/gcc/ada/system-linux-armeb.ads (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/ada/system-linux-armeb.ads (.../branches/gcc-6-branch)
+@@ -7,7 +7,7 @@
+ -- S p e c --
+ -- (GNU-Linux/ARMEB Version) --
+ -- --
+--- Copyright (C) 1992-2015, Free Software Foundation, Inc. --
++-- Copyright (C) 1992-2016, Free Software Foundation, Inc. --
+ -- --
+ -- This specification is derived from the Ada Reference Manual for use with --
+ -- GNAT. The copyright notice above, and the license provisions that follow --
+@@ -127,7 +127,7 @@
+ -- of the individual switch values.
+
+ Backend_Divide_Checks : constant Boolean := False;
+- Backend_Overflow_Checks : constant Boolean := False;
++ Backend_Overflow_Checks : constant Boolean := True;
+ Command_Line_Args : constant Boolean := True;
+ Configurable_Run_Time : constant Boolean := False;
+ Denorm : constant Boolean := True;
+@@ -142,7 +142,6 @@
+ Stack_Check_Default : constant Boolean := False;
+ Stack_Check_Probes : constant Boolean := True;
+ Stack_Check_Limits : constant Boolean := False;
+- Support_64_Bit_Divides : constant Boolean := True;
+ Support_Aggregates : constant Boolean := True;
+ Support_Composite_Assign : constant Boolean := True;
+ Support_Composite_Compare : constant Boolean := True;
+@@ -150,7 +149,7 @@
+ Always_Compatible_Rep : constant Boolean := False;
+ Suppress_Standard_Library : constant Boolean := False;
+ Use_Ada_Main_Program_Name : constant Boolean := False;
+- Frontend_Exceptions : constant Boolean := True;
+- ZCX_By_Default : constant Boolean := False;
++ Frontend_Exceptions : constant Boolean := False;
++ ZCX_By_Default : constant Boolean := True;
+
+ end System;
+Index: gcc/ada/system-linux-ppc.ads
+===================================================================
+--- a/src/gcc/ada/system-linux-ppc.ads (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/ada/system-linux-ppc.ads (.../branches/gcc-6-branch)
+@@ -7,7 +7,7 @@
+ -- S p e c --
+ -- (GNU-Linux/PPC Version) --
+ -- --
+--- Copyright (C) 1992-2015, Free Software Foundation, Inc. --
++-- Copyright (C) 1992-2016, Free Software Foundation, Inc. --
+ -- --
+ -- This specification is derived from the Ada Reference Manual for use with --
+ -- GNAT. The copyright notice above, and the license provisions that follow --
+@@ -69,8 +69,8 @@
+ Null_Address : constant Address;
+
+ Storage_Unit : constant := 8;
+- Word_Size : constant := 32;
+- Memory_Size : constant := 2 ** 32;
++ Word_Size : constant := Standard'Word_Size;
++ Memory_Size : constant := 2 ** Word_Size;
+
+ -- Address comparison
+
+Index: gcc/ada/system-linux-sparcv9.ads
+===================================================================
+--- a/src/gcc/ada/system-linux-sparcv9.ads (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/ada/system-linux-sparcv9.ads (.../branches/gcc-6-branch)
+@@ -119,7 +119,7 @@
+ -- of the individual switch values.
+
+ Backend_Divide_Checks : constant Boolean := False;
+- Backend_Overflow_Checks : constant Boolean := False;
++ Backend_Overflow_Checks : constant Boolean := True;
+ Command_Line_Args : constant Boolean := True;
+ Configurable_Run_Time : constant Boolean := False;
+ Denorm : constant Boolean := True;
+@@ -134,12 +134,11 @@
+ Stack_Check_Default : constant Boolean := False;
+ Stack_Check_Probes : constant Boolean := True;
+ Stack_Check_Limits : constant Boolean := False;
+- Support_64_Bit_Divides : constant Boolean := True;
+ Support_Aggregates : constant Boolean := True;
+ Support_Composite_Assign : constant Boolean := True;
+ Support_Composite_Compare : constant Boolean := True;
+ Support_Long_Shifts : constant Boolean := True;
+- Always_Compatible_Rep : constant Boolean := True;
++ Always_Compatible_Rep : constant Boolean := False;
+ Suppress_Standard_Library : constant Boolean := False;
+ Use_Ada_Main_Program_Name : constant Boolean := False;
+ Frontend_Exceptions : constant Boolean := False;
+Index: gcc/ada/system-aix64.ads
+===================================================================
+--- a/src/gcc/ada/system-aix64.ads (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/ada/system-aix64.ads (.../branches/gcc-6-branch)
+@@ -7,7 +7,7 @@
+ -- S p e c --
+ -- (PPC/AIX64 Version) --
+ -- --
+--- Copyright (C) 2009-2015, Free Software Foundation, Inc. --
++-- Copyright (C) 2009-2016, Free Software Foundation, Inc. --
+ -- --
+ -- This specification is derived from the Ada Reference Manual for use with --
+ -- GNAT. The copyright notice above, and the license provisions that follow --
+@@ -148,7 +148,7 @@
+ Support_Composite_Assign : constant Boolean := True;
+ Support_Composite_Compare : constant Boolean := True;
+ Support_Long_Shifts : constant Boolean := True;
+- Always_Compatible_Rep : constant Boolean := True;
++ Always_Compatible_Rep : constant Boolean := False;
+ Suppress_Standard_Library : constant Boolean := False;
+ Use_Ada_Main_Program_Name : constant Boolean := False;
+ Frontend_Exceptions : constant Boolean := False;
+Index: gcc/ada/system-linux-sh4.ads
+===================================================================
+--- a/src/gcc/ada/system-linux-sh4.ads (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/ada/system-linux-sh4.ads (.../branches/gcc-6-branch)
+@@ -7,7 +7,7 @@
+ -- S p e c --
+ -- (GNU-Linux/sh4 Version) --
+ -- --
+--- Copyright (C) 1992-2015, Free Software Foundation, Inc. --
++-- Copyright (C) 1992-2016, Free Software Foundation, Inc. --
+ -- --
+ -- This specification is derived from the Ada Reference Manual for use with --
+ -- GNAT. The copyright notice above, and the license provisions that follow --
+@@ -146,7 +146,7 @@
+ Support_Composite_Assign : constant Boolean := True;
+ Support_Composite_Compare : constant Boolean := True;
+ Support_Long_Shifts : constant Boolean := True;
+- Always_Compatible_Rep : constant Boolean := True;
++ Always_Compatible_Rep : constant Boolean := False;
+ Suppress_Standard_Library : constant Boolean := False;
+ Use_Ada_Main_Program_Name : constant Boolean := False;
+ Frontend_Exceptions : constant Boolean := False;
+Index: gcc/ada/ChangeLog
+===================================================================
+--- a/src/gcc/ada/ChangeLog (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/ada/ChangeLog (.../branches/gcc-6-branch)
+@@ -1,3 +1,62 @@
++2016-10-17 Eric Botcazou <ebotcazou at adacore.com>
++
++ * system-darwin-ppc64.ads (Support_64_Bit_Divides): Delete.
++ * system-linux-armeb.ads (Support_64_Bit_Divides): Likewise.
++ * system-linux-mips.ads (Support_64_Bit_Divides): Likewise.
++ * system-linux-mips64el.ads (Support_64_Bit_Divides): Likewise.
++ * system-linux-mipsel.ads (Support_64_Bit_Divides): Likewise.
++ * system-linux-sparcv9.ads (Support_64_Bit_Divides): Likewise.
++ * system-rtems.ads (Support_64_Bit_Divides): Likewise.
++
++2016-10-16 Eric Botcazou <ebotcazou at adacore.com>
++
++ * system-aix.ads (Always_Compatible_Rep): Change to False.
++ * system-aix64.ads (Always_Compatible_Rep): Likewise.
++ * system-hpux-ia64.ads (Always_Compatible_Rep): Likewise.
++ * system-hpux.ads (Always_Compatible_Rep): Likewise.
++ * system-linux-alpha.ads (Always_Compatible_Rep): Likewise.
++ * system-linux-hppa.ads (Always_Compatible_Rep): Likewise.
++ * system-linux-ia64.ads (Always_Compatible_Rep): Likewise.
++ * system-linux-mips.ads (Always_Compatible_Rep): Likewise.
++ * system-linux-mips64el.ads (Always_Compatible_Rep): Likewise.
++ * system-linux-mipsel.ads (Always_Compatible_Rep): Likewise.
++ * system-linux-s390.ads (Always_Compatible_Rep): Likewise.
++ * system-linux-s390x.ads (Always_Compatible_Rep): Likewise.
++ * system-linux-sh4.ads (Always_Compatible_Rep): Likewise.
++ * system-linux-sparc.ads (Always_Compatible_Rep): Likewise.
++ * system-linux-sparcv9.ads (Always_Compatible_Rep): Likewise.
++ * system-rtems.ads (Always_Compatible_Rep): Likewise.
++
++2016-10-11 Eric Botcazou <ebotcazou at adacore.com>
++
++ Backport from mainline
++ 2016-10-11 Eric Botcazou <ebotcazou at adacore.com>
++
++ * system-linux-armeb.ads (Backend_Overflow_Checks): Change to True.
++ * system-linux-mips.ads (Backend_Overflow_Checks): Likewise.
++ * system-linux-mips64el.ads (Backend_Overflow_Checks): Likewise.
++ * system-linux-mipsel.ads (Backend_Overflow_Checks): Likewise.
++ * system-linux-sparcv9.ads (Backend_Overflow_Checks): Likewise.
++ * system-rtems.ads (Always_Compatible_Rep): Likewise.
++
++ 2016-10-11 Eric Botcazou <ebotcazou at adacore.com>
++ Tristan Gingold <gingold at adacore.com>
++
++ * system-linux-ppc64.ads: Delete.
++ * system-linux-ppc.ads: Make 32-bit/64-bit neutral.
++ * gcc-interface/Makefile.in (PowerPC/Linux): Simplify.
++
++2016-10-10 Eric Botcazou <ebotcazou at adacore.com>
++
++ * gcc-interface/utils2.c (find_common_type): Do not return the LHS type
++ if it's an array with non-constant lower bound and the RHS type is an
++ array with a constant one.
++
++2016-10-10 Eric Botcazou <ebotcazou at adacore.com>
++
++ * gcc-interface/utils.c (convert): For a biased input type, convert the
++ bias itself to the base type before adding it.
++
+ 2016-08-22 Release Manager
+
+ * GCC 6.2.0 released.
+Index: gcc/ada/system-linux-mipsel.ads
+===================================================================
+--- a/src/gcc/ada/system-linux-mipsel.ads (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/ada/system-linux-mipsel.ads (.../branches/gcc-6-branch)
+@@ -119,7 +119,7 @@
+ -- of the individual switch values.
+
+ Backend_Divide_Checks : constant Boolean := False;
+- Backend_Overflow_Checks : constant Boolean := False;
++ Backend_Overflow_Checks : constant Boolean := True;
+ Command_Line_Args : constant Boolean := True;
+ Configurable_Run_Time : constant Boolean := False;
+ Denorm : constant Boolean := True;
+@@ -134,12 +134,11 @@
+ Stack_Check_Default : constant Boolean := False;
+ Stack_Check_Probes : constant Boolean := True;
+ Stack_Check_Limits : constant Boolean := False;
+- Support_64_Bit_Divides : constant Boolean := True;
+ Support_Aggregates : constant Boolean := True;
+ Support_Composite_Assign : constant Boolean := True;
+ Support_Composite_Compare : constant Boolean := True;
+ Support_Long_Shifts : constant Boolean := True;
+- Always_Compatible_Rep : constant Boolean := True;
++ Always_Compatible_Rep : constant Boolean := False;
+ Suppress_Standard_Library : constant Boolean := False;
+ Use_Ada_Main_Program_Name : constant Boolean := False;
+ Frontend_Exceptions : constant Boolean := False;
+Index: gcc/ada/system-linux-mips.ads
+===================================================================
+--- a/src/gcc/ada/system-linux-mips.ads (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/ada/system-linux-mips.ads (.../branches/gcc-6-branch)
+@@ -119,7 +119,7 @@
+ -- of the individual switch values.
+
+ Backend_Divide_Checks : constant Boolean := False;
+- Backend_Overflow_Checks : constant Boolean := False;
++ Backend_Overflow_Checks : constant Boolean := True;
+ Command_Line_Args : constant Boolean := True;
+ Configurable_Run_Time : constant Boolean := False;
+ Denorm : constant Boolean := True;
+@@ -134,12 +134,11 @@
+ Stack_Check_Default : constant Boolean := False;
+ Stack_Check_Probes : constant Boolean := True;
+ Stack_Check_Limits : constant Boolean := False;
+- Support_64_Bit_Divides : constant Boolean := True;
+ Support_Aggregates : constant Boolean := True;
+ Support_Composite_Assign : constant Boolean := True;
+ Support_Composite_Compare : constant Boolean := True;
+ Support_Long_Shifts : constant Boolean := True;
+- Always_Compatible_Rep : constant Boolean := True;
++ Always_Compatible_Rep : constant Boolean := False;
+ Suppress_Standard_Library : constant Boolean := False;
+ Use_Ada_Main_Program_Name : constant Boolean := False;
+ Frontend_Exceptions : constant Boolean := False;
+Index: gcc/ada/system-hpux.ads
+===================================================================
+--- a/src/gcc/ada/system-hpux.ads (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/ada/system-hpux.ads (.../branches/gcc-6-branch)
+@@ -7,7 +7,7 @@
+ -- S p e c --
+ -- (HP-UX Version) --
+ -- --
+--- Copyright (C) 1992-2015, Free Software Foundation, Inc. --
++-- Copyright (C) 1992-2016, Free Software Foundation, Inc. --
+ -- --
+ -- This specification is derived from the Ada Reference Manual for use with --
+ -- GNAT. The copyright notice above, and the license provisions that follow --
+@@ -138,7 +138,7 @@
+ Support_Composite_Assign : constant Boolean := True;
+ Support_Composite_Compare : constant Boolean := True;
+ Support_Long_Shifts : constant Boolean := True;
+- Always_Compatible_Rep : constant Boolean := True;
++ Always_Compatible_Rep : constant Boolean := False;
+ Suppress_Standard_Library : constant Boolean := False;
+ Use_Ada_Main_Program_Name : constant Boolean := False;
+ Frontend_Exceptions : constant Boolean := False;
+Index: gcc/ada/system-linux-mips64el.ads
+===================================================================
+--- a/src/gcc/ada/system-linux-mips64el.ads (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/ada/system-linux-mips64el.ads (.../branches/gcc-6-branch)
+@@ -119,7 +119,7 @@
+ -- of the individual switch values.
+
+ Backend_Divide_Checks : constant Boolean := False;
+- Backend_Overflow_Checks : constant Boolean := False;
++ Backend_Overflow_Checks : constant Boolean := True;
+ Command_Line_Args : constant Boolean := True;
+ Configurable_Run_Time : constant Boolean := False;
+ Denorm : constant Boolean := True;
+@@ -134,12 +134,11 @@
+ Stack_Check_Default : constant Boolean := False;
+ Stack_Check_Probes : constant Boolean := True;
+ Stack_Check_Limits : constant Boolean := False;
+- Support_64_Bit_Divides : constant Boolean := True;
+ Support_Aggregates : constant Boolean := True;
+ Support_Composite_Assign : constant Boolean := True;
+ Support_Composite_Compare : constant Boolean := True;
+ Support_Long_Shifts : constant Boolean := True;
+- Always_Compatible_Rep : constant Boolean := True;
++ Always_Compatible_Rep : constant Boolean := False;
+ Suppress_Standard_Library : constant Boolean := False;
+ Use_Ada_Main_Program_Name : constant Boolean := False;
+ Frontend_Exceptions : constant Boolean := False;
+Index: gcc/ada/system-hpux-ia64.ads
+===================================================================
+--- a/src/gcc/ada/system-hpux-ia64.ads (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/ada/system-hpux-ia64.ads (.../branches/gcc-6-branch)
+@@ -7,7 +7,7 @@
+ -- S p e c --
+ -- (HP-UX/ia64 Version) --
+ -- --
+--- Copyright (C) 1992-2015, Free Software Foundation, Inc. --
++-- Copyright (C) 1992-2016, Free Software Foundation, Inc. --
+ -- --
+ -- This specification is derived from the Ada Reference Manual for use with --
+ -- GNAT. The copyright notice above, and the license provisions that follow --
+@@ -139,7 +139,7 @@
+ Support_Composite_Assign : constant Boolean := True;
+ Support_Composite_Compare : constant Boolean := True;
+ Support_Long_Shifts : constant Boolean := True;
+- Always_Compatible_Rep : constant Boolean := True;
++ Always_Compatible_Rep : constant Boolean := False;
+ Suppress_Standard_Library : constant Boolean := False;
+ Use_Ada_Main_Program_Name : constant Boolean := False;
+ Frontend_Exceptions : constant Boolean := False;
+Index: gcc/ada/gcc-interface/utils.c
+===================================================================
+--- a/src/gcc/ada/gcc-interface/utils.c (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/ada/gcc-interface/utils.c (.../branches/gcc-6-branch)
+@@ -4210,12 +4210,15 @@
+ return convert (type, unpadded);
+ }
+
+- /* If the input is a biased type, adjust first. */
++ /* If the input is a biased type, convert first to the base type and add
++ the bias. Note that the bias must go through a full conversion to the
++ base type, lest it is itself a biased value; this happens for subtypes
++ of biased types. */
+ if (ecode == INTEGER_TYPE && TYPE_BIASED_REPRESENTATION_P (etype))
+ return convert (type, fold_build2 (PLUS_EXPR, TREE_TYPE (etype),
+ fold_convert (TREE_TYPE (etype), expr),
+- fold_convert (TREE_TYPE (etype),
+- TYPE_MIN_VALUE (etype))));
++ convert (TREE_TYPE (etype),
++ TYPE_MIN_VALUE (etype))));
+
+ /* If the input is a justified modular type, we need to extract the actual
+ object before converting it to any other type with the exceptions of an
+@@ -4518,7 +4521,12 @@
+ && (ecode == ARRAY_TYPE || ecode == UNCONSTRAINED_ARRAY_TYPE
+ || (ecode == RECORD_TYPE && TYPE_CONTAINS_TEMPLATE_P (etype))))
+ return unchecked_convert (type, expr, false);
+- else if (TYPE_BIASED_REPRESENTATION_P (type))
++
++ /* If the output is a biased type, convert first to the base type and
++ subtract the bias. Note that the bias itself must go through a full
++ conversion to the base type, lest it is a biased value; this happens
++ for subtypes of biased types. */
++ if (TYPE_BIASED_REPRESENTATION_P (type))
+ return fold_convert (type,
+ fold_build2 (MINUS_EXPR, TREE_TYPE (type),
+ convert (TREE_TYPE (type), expr),
+Index: gcc/ada/gcc-interface/Makefile.in
+===================================================================
+--- a/src/gcc/ada/gcc-interface/Makefile.in (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/ada/gcc-interface/Makefile.in (.../branches/gcc-6-branch)
+@@ -1908,41 +1908,26 @@
+ s-tpopsp.adb<s-tpopsp-tls.adb \
+ g-sercom.adb<g-sercom-linux.adb \
+ $(ATOMICS_TARGET_PAIRS) \
+- $(ATOMICS_BUILTINS_TARGET_PAIRS)
++ $(ATOMICS_BUILTINS_TARGET_PAIRS) \
++ system.ads<system-linux-ppc.ads
+
+ ifeq ($(strip $(filter-out xenomai,$(THREAD_KIND))),)
+ LIBGNAT_TARGET_PAIRS = \
+- $(LIBGNAT_TARGET_PAIRS_COMMON)
+-
+- LIBGNAT_TARGET_PAIRS += \
+- s-osinte.ads<s-osinte-linux-xenomai.ads \
+- s-osprim.adb<s-osprim-linux-xenomai.adb \
+- s-taprop.adb<s-taprop-linux-xenomai.adb \
+- s-taspri.ads<s-taspri-linux-xenomai.ads \
+- system.ads<system-linux-ppc.ads
++ $(LIBGNAT_TARGET_PAIRS_COMMON) \
++ s-osinte.ads<s-osinte-linux-xenomai.ads \
++ s-osprim.adb<s-osprim-linux-xenomai.adb \
++ s-taprop.adb<s-taprop-linux-xenomai.adb \
++ s-taspri.ads<s-taspri-linux-xenomai.ads
+ else
+- LIBGNAT_TARGET_PAIRS_32 = \
+- system.ads<system-linux-ppc.ads
+-
+- LIBGNAT_TARGET_PAIRS_64 = \
+- system.ads<system-linux-ppc64.ads
+-
+- ifneq (,$(or $(filter powerpc64%, $(shell $(GCC_FOR_TARGET) $(GNATLIBCFLAGS) -print-multiarch)), $(filter ../lib64, $(shell $(GCC_FOR_TARGET) $(GNATLIBCFLAGS) -print-multi-os-directory))))
+- LIBGNAT_TARGET_PAIRS = \
+- $(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_64)
+- else
+- LIBGNAT_TARGET_PAIRS = \
+- $(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_32)
+- endif
+-
+- LIBGNAT_TARGET_PAIRS += \
+- s-mudido.adb<s-mudido-affinity.adb \
+- s-osinte.ads<s-osinte-linux.ads \
+- s-osprim.adb<s-osprim-posix.adb \
+- s-taprop.adb<s-taprop-linux.adb \
+- s-tasinf.ads<s-tasinf-linux.ads \
+- s-tasinf.adb<s-tasinf-linux.adb \
+- s-taspri.ads<s-taspri-posix-noaltstack.ads
++ LIBGNAT_TARGET_PAIRS = \
++ $(LIBGNAT_TARGET_PAIRS_COMMON) \
++ s-mudido.adb<s-mudido-affinity.adb \
++ s-osinte.ads<s-osinte-linux.ads \
++ s-osprim.adb<s-osprim-posix.adb \
++ s-taprop.adb<s-taprop-linux.adb \
++ s-tasinf.ads<s-tasinf-linux.ads \
++ s-tasinf.adb<s-tasinf-linux.adb \
++ s-taspri.ads<s-taspri-posix-noaltstack.ads
+ endif
+
+ TOOLS_TARGET_PAIRS = \
+Index: gcc/ada/gcc-interface/utils2.c
+===================================================================
+--- a/src/gcc/ada/gcc-interface/utils2.c (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/ada/gcc-interface/utils2.c (.../branches/gcc-6-branch)
+@@ -210,27 +210,40 @@
+ calling into build_binary_op), some others are really expected and we
+ have to be careful. */
+
++ const bool variable_record_on_lhs
++ = (TREE_CODE (t1) == RECORD_TYPE
++ && TREE_CODE (t2) == RECORD_TYPE
++ && get_variant_part (t1)
++ && !get_variant_part (t2));
++
++ const bool variable_array_on_lhs
++ = (TREE_CODE (t1) == ARRAY_TYPE
++ && TREE_CODE (t2) == ARRAY_TYPE
++ && !TREE_CONSTANT (TYPE_MIN_VALUE (TYPE_DOMAIN (t1)))
++ && TREE_CONSTANT (TYPE_MIN_VALUE (TYPE_DOMAIN (t2))));
++
+ /* We must avoid writing more than what the target can hold if this is for
+ an assignment and the case of tagged types is handled in build_binary_op
+ so we use the lhs type if it is known to be smaller or of constant size
+ and the rhs type is not, whatever the modes. We also force t1 in case of
+ constant size equality to minimize occurrences of view conversions on the
+- lhs of an assignment, except for the case of record types with a variant
+- part on the lhs but not on the rhs to make the conversion simpler. */
++ lhs of an assignment, except for the case of types with a variable part
++ on the lhs but not on the rhs to make the conversion simpler. */
+ if (TREE_CONSTANT (TYPE_SIZE (t1))
+ && (!TREE_CONSTANT (TYPE_SIZE (t2))
+ || tree_int_cst_lt (TYPE_SIZE (t1), TYPE_SIZE (t2))
+ || (TYPE_SIZE (t1) == TYPE_SIZE (t2)
+- && !(TREE_CODE (t1) == RECORD_TYPE
+- && TREE_CODE (t2) == RECORD_TYPE
+- && get_variant_part (t1)
+- && !get_variant_part (t2)))))
++ && !variable_record_on_lhs
++ && !variable_array_on_lhs)))
+ return t1;
+
+- /* Otherwise, if the lhs type is non-BLKmode, use it. Note that we know
+- that we will not have any alignment problems since, if we did, the
+- non-BLKmode type could not have been used. */
+- if (TYPE_MODE (t1) != BLKmode)
++ /* Otherwise, if the lhs type is non-BLKmode, use it, except for the case of
++ a non-BLKmode rhs and array types with a variable part on the lhs but not
++ on the rhs to make sure the conversion is preserved during gimplification.
++ Note that we know that we will not have any alignment problems since, if
++ we did, the non-BLKmode type could not have been used. */
++ if (TYPE_MODE (t1) != BLKmode
++ && (TYPE_MODE (t2) == BLKmode || !variable_array_on_lhs))
+ return t1;
+
+ /* If the rhs type is of constant size, use it whatever the modes. At
+Index: gcc/ada/system-linux-sparc.ads
+===================================================================
+--- a/src/gcc/ada/system-linux-sparc.ads (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/ada/system-linux-sparc.ads (.../branches/gcc-6-branch)
+@@ -7,7 +7,7 @@
+ -- S p e c --
+ -- (GNU/Linux-SPARC Version) --
+ -- --
+--- Copyright (C) 1992-2015, Free Software Foundation, Inc. --
++-- Copyright (C) 1992-2016, Free Software Foundation, Inc. --
+ -- --
+ -- This specification is derived from the Ada Reference Manual for use with --
+ -- GNAT. The copyright notice above, and the license provisions that follow --
+@@ -138,7 +138,7 @@
+ Support_Composite_Assign : constant Boolean := True;
+ Support_Composite_Compare : constant Boolean := True;
+ Support_Long_Shifts : constant Boolean := True;
+- Always_Compatible_Rep : constant Boolean := True;
++ Always_Compatible_Rep : constant Boolean := False;
+ Suppress_Standard_Library : constant Boolean := False;
+ Use_Ada_Main_Program_Name : constant Boolean := False;
+ Frontend_Exceptions : constant Boolean := False;
+Index: gcc/ada/system-rtems.ads
+===================================================================
+--- a/src/gcc/ada/system-rtems.ads (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/ada/system-rtems.ads (.../branches/gcc-6-branch)
+@@ -138,7 +138,7 @@
+ -- of the individual switch values.
+
+ Backend_Divide_Checks : constant Boolean := False;
+- Backend_Overflow_Checks : constant Boolean := False;
++ Backend_Overflow_Checks : constant Boolean := True;
+ Command_Line_Args : constant Boolean := True;
+ Configurable_Run_Time : constant Boolean := False;
+ Denorm : constant Boolean := True;
+@@ -153,12 +153,11 @@
+ Stack_Check_Default : constant Boolean := False;
+ Stack_Check_Probes : constant Boolean := False;
+ Stack_Check_Limits : constant Boolean := False;
+- Support_64_Bit_Divides : constant Boolean := True;
+ Support_Aggregates : constant Boolean := True;
+ Support_Composite_Assign : constant Boolean := True;
+ Support_Composite_Compare : constant Boolean := True;
+ Support_Long_Shifts : constant Boolean := True;
+- Always_Compatible_Rep : constant Boolean := True;
++ Always_Compatible_Rep : constant Boolean := False;
+ Suppress_Standard_Library : constant Boolean := False;
+ Use_Ada_Main_Program_Name : constant Boolean := False;
+ Frontend_Exceptions : constant Boolean := True;
+Index: gcc/ada/system-aix.ads
+===================================================================
+--- a/src/gcc/ada/system-aix.ads (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/ada/system-aix.ads (.../branches/gcc-6-branch)
+@@ -7,7 +7,7 @@
+ -- S p e c --
+ -- (AIX/PPC Version) --
+ -- --
+--- Copyright (C) 1992-2015, Free Software Foundation, Inc. --
++-- Copyright (C) 1992-2016, Free Software Foundation, Inc. --
+ -- --
+ -- This specification is derived from the Ada Reference Manual for use with --
+ -- GNAT. The copyright notice above, and the license provisions that follow --
+@@ -148,7 +148,7 @@
+ Support_Composite_Assign : constant Boolean := True;
+ Support_Composite_Compare : constant Boolean := True;
+ Support_Long_Shifts : constant Boolean := True;
+- Always_Compatible_Rep : constant Boolean := True;
++ Always_Compatible_Rep : constant Boolean := False;
+ Suppress_Standard_Library : constant Boolean := False;
+ Use_Ada_Main_Program_Name : constant Boolean := False;
+ Frontend_Exceptions : constant Boolean := False;
Index: gcc/tsan.c
===================================================================
--- a/src/gcc/tsan.c (.../tags/gcc_6_2_0_release)
@@ -7834,6 +11167,66 @@ Index: gcc/tsan.c
default:
continue;
}
+Index: gcc/common/config/i386/i386-common.c
+===================================================================
+--- a/src/gcc/common/config/i386/i386-common.c (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/common/config/i386/i386-common.c (.../branches/gcc-6-branch)
+@@ -86,7 +86,6 @@
+ #define OPTION_MASK_ISA_XSAVEC_SET \
+ (OPTION_MASK_ISA_XSAVEC | OPTION_MASK_ISA_XSAVE)
+ #define OPTION_MASK_ISA_CLWB_SET OPTION_MASK_ISA_CLWB
+-#define OPTION_MASK_ISA_PCOMMIT_SET OPTION_MASK_ISA_PCOMMIT
+
+ /* SSE4 includes both SSE4.1 and SSE4.2. -msse4 should be the same
+ as -msse4.2. */
+@@ -187,7 +186,6 @@
+ #define OPTION_MASK_ISA_CLFLUSHOPT_UNSET OPTION_MASK_ISA_CLFLUSHOPT
+ #define OPTION_MASK_ISA_XSAVEC_UNSET OPTION_MASK_ISA_XSAVEC
+ #define OPTION_MASK_ISA_XSAVES_UNSET OPTION_MASK_ISA_XSAVES
+-#define OPTION_MASK_ISA_PCOMMIT_UNSET OPTION_MASK_ISA_PCOMMIT
+ #define OPTION_MASK_ISA_CLWB_UNSET OPTION_MASK_ISA_CLWB
+ #define OPTION_MASK_ISA_MWAITX_UNSET OPTION_MASK_ISA_MWAITX
+ #define OPTION_MASK_ISA_CLZERO_UNSET OPTION_MASK_ISA_CLZERO
+@@ -912,19 +910,6 @@
+ }
+ return true;
+
+- case OPT_mpcommit:
+- if (value)
+- {
+- opts->x_ix86_isa_flags |= OPTION_MASK_ISA_PCOMMIT_SET;
+- opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_PCOMMIT_SET;
+- }
+- else
+- {
+- opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_PCOMMIT_UNSET;
+- opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_PCOMMIT_UNSET;
+- }
+- return true;
+-
+ case OPT_mclwb:
+ if (value)
+ {
+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 @@
+ else if (incr == 0
+ || incr == 1
+ || (incr == -1
+- && (gimple_assign_rhs_code (first_dep->cand_stmt)
+- != 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.
Index: gcc/fortran/openmp.c
===================================================================
--- a/src/gcc/fortran/openmp.c (.../tags/gcc_6_2_0_release)
@@ -8254,7 +11647,26 @@ 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,164 @@
+@@ -1,3 +1,183 @@
++2016-10-17 Steven G. Kargl <kargl at gcc.gnu.org>
++
++ Backport from trunk
++ PR fortran/77978
++ * match.c (gfc_match_stopcode): Fix error reporting for several
++ deficiencies in matching stop-codes.
++
++2016-10-16 Thomas Koenig <tkoenig at gcc.gnu.org>
++
++ Backport from trunk
++ PR fortran/77915
++ * frontend-passes.c (inline_matmul_assign): Return early if
++ inside a FORALL statement.
++
++2016-10-11 Steven G. Kargl <kargl at gcc.gnu.org>
++
++ PR fortran/77942
++ * simplify.c (gfc_simplify_cshift): Check for zero.
++
+2016-10-07 Steven G. Kargl <kargl at gcc.gnu.org>
+
+ PR fortran/77406
@@ -8465,6 +11877,18 @@ Index: gcc/fortran/frontend-passes.c
if (op1->expr_type == EXPR_ARRAY && op2->rank == 0)
scalar_first = false;
else if (op2->expr_type == EXPR_ARRAY && op1->rank == 0)
+@@ -2835,6 +2843,11 @@
+ if (in_where)
+ return 0;
+
++ /* The BLOCKS generated for the temporary variables and FORALL don't
++ mix. */
++ if (forall_level > 0)
++ return 0;
++
+ /* For now don't do anything in OpenMP workshare, it confuses
+ its translation, which expects only the allowed statements in there.
+ We should figure out how to parallelize this eventually. */
Index: gcc/fortran/resolve.c
===================================================================
--- a/src/gcc/fortran/resolve.c (.../tags/gcc_6_2_0_release)
@@ -8744,6 +12168,160 @@ Index: gcc/fortran/target-memory.c
&chk[len], length - len);
}
break;
+Index: gcc/fortran/match.c
+===================================================================
+--- a/src/gcc/fortran/match.c (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/fortran/match.c (.../branches/gcc-6-branch)
+@@ -2725,20 +2725,92 @@
+ }
+
+
+-/* Match a number or character constant after an (ERROR) STOP or PAUSE
+- statement. */
++/* Match a stop-code after an (ERROR) STOP or PAUSE statement. The
++ requirements for a stop-code differ in the standards.
+
++Fortran 95 has
++
++ R840 stop-stmt is STOP [ stop-code ]
++ R841 stop-code is scalar-char-constant
++ or digit [ digit [ digit [ digit [ digit ] ] ] ]
++
++Fortran 2003 matches Fortran 95 except R840 and R841 are now R849 and R850.
++Fortran 2008 has
++
++ R855 stop-stmt is STOP [ stop-code ]
++ R856 allstop-stmt is ALL STOP [ stop-code ]
++ R857 stop-code is scalar-default-char-constant-expr
++ or scalar-int-constant-expr
++
++For free-form source code, all standards contain a statement of the form:
++
++ A blank shall be used to separate names, constants, or labels from
++ adjacent keywords, names, constants, or labels.
++
++A stop-code is not a name, constant, or label. So, under Fortran 95 and 2003,
++
++ STOP123
++
++is valid, but it is invalid Fortran 2008. */
++
+ static match
+ gfc_match_stopcode (gfc_statement st)
+ {
+- gfc_expr *e;
++ gfc_expr *e = NULL;
+ match m;
++ bool f95, f03;
+
+- e = NULL;
++ /* Set f95 for -std=f95. */
++ f95 = gfc_option.allow_std == (GFC_STD_F95_OBS | GFC_STD_F95 | GFC_STD_F77
++ | GFC_STD_F2008_OBS);
+
++ /* Set f03 for -std=f2003. */
++ f03 = gfc_option.allow_std == (GFC_STD_F95_OBS | GFC_STD_F95 | GFC_STD_F77
++ | GFC_STD_F2008_OBS | GFC_STD_F2003);
++
++ /* Look for a blank between STOP and the stop-code for F2008 or later. */
++ if (gfc_current_form != FORM_FIXED && !(f95 || f03))
++ {
++ char c = gfc_peek_ascii_char ();
++
++ /* Look for end-of-statement. There is no stop-code. */
++ if (c == '\n' || c == '!' || c == ';')
++ goto done;
++
++ if (c != ' ')
++ {
++ gfc_error ("Blank required in %s statement near %C",
++ gfc_ascii_statement (st));
++ return MATCH_ERROR;
++ }
++ }
++
+ if (gfc_match_eos () != MATCH_YES)
+ {
+- m = gfc_match_init_expr (&e);
++ int stopcode;
++ locus old_locus;
++
++ /* First look for the F95 or F2003 digit [...] construct. */
++ old_locus = gfc_current_locus;
++ m = gfc_match_small_int (&stopcode);
++ if (m == MATCH_YES && (f95 || f03))
++ {
++ if (stopcode < 0)
++ {
++ gfc_error ("STOP code at %C cannot be negative");
++ return MATCH_ERROR;
++ }
++
++ if (stopcode > 99999)
++ {
++ gfc_error ("STOP code at %C contains too many digits");
++ return MATCH_ERROR;
++ }
++ }
++
++ /* Reset the locus and now load gfc_expr. */
++ gfc_current_locus = old_locus;
++ m = gfc_match_expr (&e);
+ if (m == MATCH_ERROR)
+ goto cleanup;
+ if (m == MATCH_NO)
+@@ -2779,6 +2851,22 @@
+
+ if (e != NULL)
+ {
++ gfc_simplify_expr (e, 0);
++
++ /* Test for F95 and F2003 style STOP stop-code. */
++ if (e->expr_type != EXPR_CONSTANT && (f95 || f03))
++ {
++ gfc_error ("STOP code at %L must be a scalar CHARACTER constant or "
++ "digit[digit[digit[digit[digit]]]]", &e->where);
++ goto cleanup;
++ }
++
++ /* Use the machinery for an initialization expression to reduce the
++ stop-code to a constant. */
++ gfc_init_expr_flag = true;
++ gfc_reduce_init_expr (e);
++ gfc_init_expr_flag = false;
++
+ if (!(e->ts.type == BT_CHARACTER || e->ts.type == BT_INTEGER))
+ {
+ gfc_error ("STOP code at %L must be either INTEGER or CHARACTER type",
+@@ -2788,8 +2876,7 @@
+
+ if (e->rank != 0)
+ {
+- gfc_error ("STOP code at %L must be scalar",
+- &e->where);
++ gfc_error ("STOP code at %L must be scalar", &e->where);
+ goto cleanup;
+ }
+
+@@ -2801,8 +2888,7 @@
+ goto cleanup;
+ }
+
+- if (e->ts.type == BT_INTEGER
+- && e->ts.kind != gfc_default_integer_kind)
++ if (e->ts.type == BT_INTEGER && e->ts.kind != gfc_default_integer_kind)
+ {
+ gfc_error ("STOP code at %L must be default integer KIND=%d",
+ &e->where, (int) gfc_default_integer_kind);
+@@ -2810,6 +2896,8 @@
+ }
+ }
+
++done:
++
+ switch (st)
+ {
+ case ST_STOP:
Index: gcc/fortran/target-memory.h
===================================================================
--- a/src/gcc/fortran/target-memory.h (.../tags/gcc_6_2_0_release)
@@ -8865,6 +12443,15 @@ Index: gcc/fortran/simplify.c
}
return result;
+@@ -1840,7 +1842,7 @@
+ shft = shft < 0 ? 1 - shft : shft;
+
+ /* Special case: Shift to the original order! */
+- if (shft % sz == 0)
++ if (sz == 0 || shft % sz == 0)
+ return a;
+
+ result = gfc_copy_expr (a);
@@ -7043,10 +7045,18 @@
gfc_expr *
simplify_ieee_selected_real_kind (gfc_expr *expr)
@@ -128352,7 +131939,11 @@ Index: gcc/po/ChangeLog
===================================================================
--- a/src/gcc/po/ChangeLog (.../tags/gcc_6_2_0_release)
+++ b/src/gcc/po/ChangeLog (.../branches/gcc-6-branch)
-@@ -1,3 +1,13 @@
+@@ -1,3 +1,17 @@
++2016-10-10 Joseph Myers <joseph at codesourcery.com>
++
++ * sv.po: Update.
++
+2016-09-05 Joseph Myers <joseph at codesourcery.com>
+
+ * sv.po: Update.
@@ -338082,7 +341673,7 @@ Index: gcc/po/sv.po
-"POT-Creation-Date: 2016-04-21 15:24+0000\n"
-"PO-Revision-Date: 2016-07-15 19:05+0200\n"
+"POT-Creation-Date: 2016-08-19 21:03+0000\n"
-+"PO-Revision-Date: 2016-09-03 11:38+0200\n"
++"PO-Revision-Date: 2016-10-10 21:39+0200\n"
"Last-Translator: Göran Uddeborg <goeran at uddeborg.se>\n"
"Language-Team: Swedish <tp-sv at listor.tp-sv.se>\n"
"Language: sv\n"
@@ -344107,7 +347698,7 @@ Index: gcc/po/sv.po
-msgid "-mpower9-vector requires -mpower8-vector"
-msgstr "-mpower9-vector behöver -mpower8-vector"
+msgid "-mvsx-timode might need -mlra"
-+msgstr "-mvsx-timode behöver -mlra"
++msgstr "-mvsx-timode kan behöva -mlra"
-#: config/rs6000/rs6000.c:4232
+#: config/rs6000/rs6000.c:4316
@@ -350322,7 +353913,7 @@ Index: gcc/po/sv.po
+#: cp/decl.c:6645
#, gcc-internal-format
+msgid "initializer for %<decltype(auto) %D%> has function type (did you forget the %<()%> ?)"
-+msgstr "initieraren för %<decltype(auto) %qD%> har funktionstyp (glömde du %<()%> ?)"
++msgstr "initieraren för %<decltype(auto) %D%> har funktionstyp (glömde du %<()%> ?)"
+
+#: cp/decl.c:6746
+#, gcc-internal-format
@@ -361539,7 +365130,7 @@ Index: gcc/po/sv.po
+#: fortran/openmp.c:457
+#, gcc-internal-format
+msgid "Unexpected OpenACC parallelism."
-+msgstr "Oväntad OpenACC-parallellism"
++msgstr "Oväntad OpenACC-parallellism."
+
+#: fortran/openmp.c:489
#, gcc-internal-format, gfc-internal-format
@@ -363211,7 +366802,7 @@ Index: gcc/po/sv.po
-msgid "Unexpected %<%%%> for nonderived-type variable %qs at %C"
-msgstr "Oväntat %<%%%> för variabel med icke härled typ %qs vid %C"
+msgid "Unexpected %<%c%> for nonderived-type variable %qs at %C"
-+msgstr "Oväntat %<%c%> för variabel med icke härled typ %qs vid %C"
++msgstr "Oväntat %<%c%> för variabel med icke härledd typ %qs vid %C"
-#: fortran/primary.c:2005
+#: fortran/primary.c:2012
@@ -574602,6 +578193,28 @@ Index: gcc/config.gcc
===================================================================
--- a/src/gcc/config.gcc (.../tags/gcc_6_2_0_release)
+++ b/src/gcc/config.gcc (.../branches/gcc-6-branch)
+@@ -378,8 +378,8 @@
+ xsavesintrin.h avx512dqintrin.h avx512bwintrin.h
+ avx512vlintrin.h avx512vlbwintrin.h avx512vldqintrin.h
+ avx512ifmaintrin.h avx512ifmavlintrin.h avx512vbmiintrin.h
+- avx512vbmivlintrin.h clwbintrin.h pcommitintrin.h
+- mwaitxintrin.h clzerointrin.h pkuintrin.h"
++ avx512vbmivlintrin.h clwbintrin.h mwaitxintrin.h
++ clzerointrin.h pkuintrin.h"
+ ;;
+ x86_64-*-*)
+ cpu_type=i386
+@@ -400,8 +400,8 @@
+ xsavesintrin.h avx512dqintrin.h avx512bwintrin.h
+ avx512vlintrin.h avx512vlbwintrin.h avx512vldqintrin.h
+ avx512ifmaintrin.h avx512ifmavlintrin.h avx512vbmiintrin.h
+- avx512vbmivlintrin.h clwbintrin.h pcommitintrin.h
+- mwaitxintrin.h clzerointrin.h pkuintrin.h"
++ avx512vbmivlintrin.h clwbintrin.h mwaitxintrin.h
++ clzerointrin.h pkuintrin.h"
+ ;;
+ ia64-*-*)
+ extra_headers=ia64intrin.h
@@ -815,6 +815,11 @@
;;
esac
@@ -574726,6 +578339,28 @@ Index: gcc/config/phoenix.h
+/* This will prevent selecting 'unsigned long int' instead of 'unsigned int' as 'uint32_t' in stdint-newlib.h. */
+#undef STDINT_LONG32
+#define STDINT_LONG32 0
+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 @@
+ (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)))]
+- "TARGET_VIS2"
++ "TARGET_VIS2 && TARGET_ARCH64"
+ "bmask\t%r1, %r2, %0"
+ [(set_attr "type" "array")
+ (set_attr "v3pipe" "true")])
+@@ -8513,7 +8513,7 @@
+ mask |= (INTVAL (XVECEXP (sel, 0, i)) & 0xf) << (28 - i*4);
+ sel = force_reg (SImode, gen_int_mode (mask, SImode));
+
+- emit_insn (gen_bmasksi_vis (gen_rtx_REG (SImode, 0), sel, const0_rtx));
++ emit_insn (gen_bmasksi_vis (gen_reg_rtx (SImode), sel, const0_rtx));
+ emit_insn (gen_bshufflev8qi_vis (operands[0], operands[1], operands[2]));
+ DONE;
+ })
Index: gcc/config/sparc/sparc.c
===================================================================
--- a/src/gcc/config/sparc/sparc.c (.../tags/gcc_6_2_0_release)
@@ -574787,11 +578422,123 @@ Index: gcc/config/sparc/sparc.c
}
/* PREGNO isn't set since both int and FP regs can be used. */
+@@ -11949,7 +11948,7 @@
+ }
+
+ /* Always perform the final addition/merge within the bmask insn. */
+- emit_insn (gen_bmasksi_vis (gen_rtx_REG (SImode, 0), sel, t_1));
++ emit_insn (gen_bmasksi_vis (gen_reg_rtx (SImode), sel, t_1));
+ }
+
+ /* Implement TARGET_FRAME_POINTER_REQUIRED. */
+@@ -12215,7 +12214,7 @@
+ }
+
+ sel = force_reg (SImode, GEN_INT (bmask));
+- emit_insn (gen_bmasksi_vis (gen_rtx_REG (SImode, 0), sel, const0_rtx));
++ emit_insn (gen_bmasksi_vis (gen_reg_rtx (SImode), sel, const0_rtx));
+ emit_insn (final_insn);
+ }
+
+@@ -12271,14 +12270,13 @@
+ const machine_mode inner_mode = GET_MODE_INNER (mode);
+ const int n_elts = GET_MODE_NUNITS (mode);
+ int i, n_var = 0;
+- bool all_same;
++ bool all_same = true;
+ rtx mem;
+
+- all_same = true;
+ for (i = 0; i < n_elts; i++)
+ {
+ rtx x = XVECEXP (vals, 0, i);
+- if (!CONSTANT_P (x))
++ if (!(CONST_SCALAR_INT_P (x) || CONST_DOUBLE_P (x) || CONST_FIXED_P (x)))
+ n_var++;
+
+ if (i > 0 && !rtx_equal_p (x, XVECEXP (vals, 0, 0)))
+Index: gcc/config/i386/pcommitintrin.h
+===================================================================
+--- a/src/gcc/config/i386/pcommitintrin.h (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/config/i386/pcommitintrin.h (.../branches/gcc-6-branch)
+@@ -1,49 +0,0 @@
+-/* Copyright (C) 2013-2016 Free Software Foundation, Inc.
+-
+- This file is part of GCC.
+-
+- GCC 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.
+-
+- GCC 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.
+-
+- Under Section 7 of GPL version 3, you are granted additional
+- permissions described in the GCC Runtime Library Exception, version
+- 3.1, as published by the Free Software Foundation.
+-
+- You should have received a copy of the GNU General Public License and
+- a copy of the GCC Runtime Library Exception along with this program;
+- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+- <http://www.gnu.org/licenses/>. */
+-
+-#if !defined _X86INTRIN_H_INCLUDED
+-# error "Never use <pcommitintrin.h> directly; include <x86intrin.h> instead."
+-#endif
+-
+-#ifndef _PCOMMITINTRIN_H_INCLUDED
+-#define _PCOMMITINTRIN_H_INCLUDED
+-
+-#ifndef __PCOMMIT__
+-#pragma GCC push_options
+-#pragma GCC target("pcommit")
+-#define __DISABLE_PCOMMIT__
+-#endif /* __PCOMMIT__ */
+-
+-extern __inline void
+-__attribute__((__gnu_inline__, __always_inline__, __artificial__))
+-_mm_pcommit (void)
+-{
+- __builtin_ia32_pcommit ();
+-}
+-
+-#ifdef __DISABLE_PCOMMIT__
+-#undef __DISABLE_PCOMMIT__
+-#pragma GCC pop_options
+-#endif /* __DISABLE_PCOMMIT__ */
+-
+-#endif /* _PCOMMITINTRIN_H_INCLUDED */
+Index: gcc/config/i386/i386.h
+===================================================================
+--- a/src/gcc/config/i386/i386.h (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/config/i386/i386.h (.../branches/gcc-6-branch)
+@@ -152,8 +152,6 @@
+ #define TARGET_PREFETCHWT1_P(x) TARGET_ISA_PREFETCHWT1_P(x)
+ #define TARGET_MPX TARGET_ISA_MPX
+ #define TARGET_MPX_P(x) TARGET_ISA_MPX_P(x)
+-#define TARGET_PCOMMIT TARGET_ISA_PCOMMIT
+-#define TARGET_PCOMMIT_P(x) TARGET_ISA_PCOMMIT_P(x)
+ #define TARGET_CLWB TARGET_ISA_CLWB
+ #define TARGET_CLWB_P(x) TARGET_ISA_CLWB_P(x)
+ #define TARGET_MWAITX TARGET_ISA_MWAITX
Index: gcc/config/i386/i386.md
===================================================================
--- a/src/gcc/config/i386/i386.md (.../tags/gcc_6_2_0_release)
+++ b/src/gcc/config/i386/i386.md (.../branches/gcc-6-branch)
-@@ -886,6 +886,14 @@
+@@ -255,9 +255,6 @@
+ ;; For CLWB support
+ UNSPECV_CLWB
+
+- ;; For PCOMMIT support
+- UNSPECV_PCOMMIT
+-
+ ;; For CLFLUSHOPT support
+ UNSPECV_CLFLUSHOPT
+
+@@ -886,6 +883,14 @@
(umax "maxu") (umin "minu")])
(define_code_attr maxmin_float [(smax "max") (smin "min")])
@@ -574806,7 +578553,7 @@ Index: gcc/config/i386/i386.md
;; Mapping of logic operators
(define_code_iterator any_logic [and ior xor])
(define_code_iterator any_or [ior xor])
-@@ -17383,14 +17391,6 @@
+@@ -17383,14 +17388,6 @@
;; Their operands are not commutative, and thus they may be used in the
;; presence of -0.0 and NaN.
@@ -574821,7 +578568,7 @@ Index: gcc/config/i386/i386.md
(define_insn "*ieee_s<ieee_maxmin><mode>3"
[(set (match_operand:MODEF 0 "register_operand" "=x,v")
(unspec:MODEF
-@@ -18530,7 +18530,7 @@
+@@ -18530,7 +18527,7 @@
[(prefetch (match_operand 0 "address_operand")
(match_operand:SI 1 "const_int_operand")
(match_operand:SI 2 "const_int_operand"))]
@@ -574830,7 +578577,7 @@ Index: gcc/config/i386/i386.md
{
bool write = INTVAL (operands[1]) != 0;
int locality = INTVAL (operands[2]);
-@@ -18538,15 +18538,36 @@
+@@ -18538,15 +18535,36 @@
gcc_assert (IN_RANGE (locality, 0, 3));
/* Use 3dNOW prefetch in case we are asking for write prefetch not
@@ -574875,7 +578622,7 @@ Index: gcc/config/i386/i386.md
})
(define_insn "*prefetch_sse"
-@@ -18574,7 +18595,7 @@
+@@ -18574,7 +18592,7 @@
[(prefetch (match_operand 0 "address_operand" "p")
(match_operand:SI 1 "const_int_operand" "n")
(const_int 3))]
@@ -574884,6 +578631,20 @@ Index: gcc/config/i386/i386.md
{
if (INTVAL (operands[1]) == 0)
return "prefetch\t%a0";
+@@ -19231,13 +19249,6 @@
+ [(set_attr "type" "other")
+ (set_attr "length" "3")])
+
+-(define_insn "pcommit"
+- [(unspec_volatile [(const_int 0)] UNSPECV_PCOMMIT)]
+- "TARGET_PCOMMIT"
+- "pcommit"
+- [(set_attr "type" "other")
+- (set_attr "length" "4")])
+-
+ (define_insn "clwb"
+ [(unspec_volatile [(match_operand 0 "address_operand" "p")]
+ UNSPECV_CLWB)]
Index: gcc/config/i386/mmx.md
===================================================================
--- a/src/gcc/config/i386/mmx.md (.../tags/gcc_6_2_0_release)
@@ -574962,7 +578723,15 @@ Index: gcc/config/i386/cpuid.h
===================================================================
--- a/src/gcc/config/i386/cpuid.h (.../tags/gcc_6_2_0_release)
+++ b/src/gcc/config/i386/cpuid.h (.../branches/gcc-6-branch)
-@@ -229,21 +229,37 @@
+@@ -82,7 +82,6 @@
+ #define bit_RDSEED (1 << 18)
+ #define bit_ADX (1 << 19)
+ #define bit_AVX512IFMA (1 << 21)
+-#define bit_PCOMMIT (1 << 22)
+ #define bit_CLFLUSHOPT (1 << 23)
+ #define bit_CLWB (1 << 24)
+ #define bit_AVX512PF (1 << 26)
+@@ -229,21 +228,37 @@
return __eax;
}
@@ -575006,6 +578775,19 @@ Index: gcc/config/i386/cpuid.h
+ __cpuid_count (__leaf, __subleaf, *__eax, *__ebx, *__ecx, *__edx);
+ return 1;
+}
+Index: gcc/config/i386/x86intrin.h
+===================================================================
+--- a/src/gcc/config/i386/x86intrin.h (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/config/i386/x86intrin.h (.../branches/gcc-6-branch)
+@@ -83,8 +83,6 @@
+
+ #include <clwbintrin.h>
+
+-#include <pcommitintrin.h>
+-
+ #include <clflushoptintrin.h>
+
+ #include <xsavesintrin.h>
Index: gcc/config/i386/sse.md
===================================================================
--- a/src/gcc/config/i386/sse.md (.../tags/gcc_6_2_0_release)
@@ -575185,6 +578967,34 @@ Index: gcc/config/i386/sse.md
[(set_attr "type" "sselog")
(set_attr "length_immediate" "1")
(set_attr "prefix" "evex")
+Index: gcc/config/i386/i386-c.c
+===================================================================
+--- a/src/gcc/config/i386/i386-c.c (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/config/i386/i386-c.c (.../branches/gcc-6-branch)
+@@ -433,8 +433,6 @@
+ def_or_undef (parse_in, "__XSAVES__");
+ if (isa_flag & OPTION_MASK_ISA_MPX)
+ def_or_undef (parse_in, "__MPX__");
+- if (isa_flag & OPTION_MASK_ISA_PCOMMIT)
+- def_or_undef (parse_in, "__PCOMMIT__");
+ if (isa_flag & OPTION_MASK_ISA_CLWB)
+ def_or_undef (parse_in, "__CLWB__");
+ if (isa_flag & OPTION_MASK_ISA_MWAITX)
+Index: gcc/config/i386/i386.opt
+===================================================================
+--- a/src/gcc/config/i386/i386.opt (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/config/i386/i386.opt (.../branches/gcc-6-branch)
+@@ -756,8 +756,8 @@
+ Support CLWB instruction.
+
+ mpcommit
+-Target Report Mask(ISA_PCOMMIT) Var(ix86_isa_flags) Save
+-Support PCOMMIT instruction.
++Target Undocumented Warn(%<-mpcommit%> was deprecated)
++;; Deprecated
+
+ mfxsr
+ Target Report Mask(ISA_FXSR) Var(ix86_isa_flags) Save
Index: gcc/config/i386/t-i386
===================================================================
--- a/src/gcc/config/i386/t-i386 (.../tags/gcc_6_2_0_release)
@@ -575219,7 +579029,25 @@ Index: gcc/config/i386/driver-i386.c
===================================================================
--- a/src/gcc/config/i386/driver-i386.c (.../tags/gcc_6_2_0_release)
+++ b/src/gcc/config/i386/driver-i386.c (.../branches/gcc-6-branch)
-@@ -517,7 +517,7 @@
+@@ -413,8 +413,7 @@
+ unsigned int has_clflushopt = 0, has_xsavec = 0, has_xsaves = 0;
+ unsigned int has_avx512dq = 0, has_avx512bw = 0, has_avx512vl = 0;
+ unsigned int has_avx512vbmi = 0, has_avx512ifma = 0, has_clwb = 0;
+- unsigned int has_pcommit = 0, has_mwaitx = 0;
+- unsigned int has_clzero = 0, has_pku = 0;
++ unsigned int has_mwaitx = 0, has_clzero = 0, has_pku = 0;
+
+ bool arch;
+
+@@ -492,7 +491,6 @@
+ has_avx512pf = ebx & bit_AVX512PF;
+ has_avx512cd = ebx & bit_AVX512CD;
+ has_sha = ebx & bit_SHA;
+- has_pcommit = ebx & bit_PCOMMIT;
+ has_clflushopt = ebx & bit_CLFLUSHOPT;
+ has_clwb = ebx & bit_CLWB;
+ has_avx512dq = ebx & bit_AVX512DQ;
+@@ -517,7 +515,7 @@
/* Check cpuid level of extended features. */
__cpuid (0x80000000, ext_level, ebx, ecx, edx);
@@ -575228,7 +579056,7 @@ Index: gcc/config/i386/driver-i386.c
{
__cpuid (0x80000001, eax, ebx, ecx, edx);
-@@ -535,7 +535,10 @@
+@@ -535,7 +533,10 @@
has_3dnowp = edx & bit_3DNOWP;
has_3dnow = edx & bit_3DNOW;
has_mwaitx = ecx & bit_MWAITX;
@@ -575239,7 +579067,7 @@ Index: gcc/config/i386/driver-i386.c
__cpuid (0x80000008, eax, ebx, ecx, edx);
has_clzero = ebx & bit_CLZERO;
}
-@@ -603,7 +606,7 @@
+@@ -603,7 +604,7 @@
unsigned int name;
/* Detect geode processor by its processor signature. */
@@ -575248,11 +579076,54 @@ Index: gcc/config/i386/driver-i386.c
__cpuid (0x80000002, name, ebx, ecx, edx);
else
name = 0;
+@@ -984,7 +985,6 @@
+ const char *avx512ifma = has_avx512ifma ? " -mavx512ifma" : " -mno-avx512ifma";
+ const char *avx512vbmi = has_avx512vbmi ? " -mavx512vbmi" : " -mno-avx512vbmi";
+ const char *clwb = has_clwb ? " -mclwb" : " -mno-clwb";
+- const char *pcommit = has_pcommit ? " -mpcommit" : " -mno-pcommit";
+ const char *mwaitx = has_mwaitx ? " -mmwaitx" : " -mno-mwaitx";
+ const char *clzero = has_clzero ? " -mclzero" : " -mno-clzero";
+ const char *pku = has_pku ? " -mpku" : " -mno-pku";
+@@ -996,8 +996,8 @@
+ fxsr, xsave, xsaveopt, avx512f, avx512er,
+ avx512cd, avx512pf, prefetchwt1, clflushopt,
+ xsavec, xsaves, avx512dq, avx512bw, avx512vl,
+- avx512ifma, avx512vbmi, clwb, pcommit, mwaitx,
+- clzero, pku, NULL);
++ avx512ifma, avx512vbmi, clwb, mwaitx, clzero,
++ pku, NULL);
+ }
+
+ done:
Index: gcc/config/i386/i386.c
===================================================================
--- a/src/gcc/config/i386/i386.c (.../tags/gcc_6_2_0_release)
+++ b/src/gcc/config/i386/i386.c (.../branches/gcc-6-branch)
-@@ -4391,8 +4391,8 @@
+@@ -3784,7 +3784,6 @@
+ { "-mxsaves", OPTION_MASK_ISA_XSAVES },
+ { "-mmpx", OPTION_MASK_ISA_MPX },
+ { "-mclwb", OPTION_MASK_ISA_CLWB },
+- { "-mpcommit", OPTION_MASK_ISA_PCOMMIT },
+ { "-mmwaitx", OPTION_MASK_ISA_MWAITX },
+ { "-mclzero", OPTION_MASK_ISA_CLZERO },
+ { "-mpku", OPTION_MASK_ISA_PKU },
+@@ -4339,11 +4338,10 @@
+ #define PTA_AVX512IFMA (HOST_WIDE_INT_1 << 53)
+ #define PTA_AVX512VBMI (HOST_WIDE_INT_1 << 54)
+ #define PTA_CLWB (HOST_WIDE_INT_1 << 55)
+-#define PTA_PCOMMIT (HOST_WIDE_INT_1 << 56)
+-#define PTA_MWAITX (HOST_WIDE_INT_1 << 57)
+-#define PTA_CLZERO (HOST_WIDE_INT_1 << 58)
+-#define PTA_NO_80387 (HOST_WIDE_INT_1 << 59)
+-#define PTA_PKU (HOST_WIDE_INT_1 << 60)
++#define PTA_MWAITX (HOST_WIDE_INT_1 << 56)
++#define PTA_CLZERO (HOST_WIDE_INT_1 << 57)
++#define PTA_NO_80387 (HOST_WIDE_INT_1 << 58)
++#define PTA_PKU (HOST_WIDE_INT_1 << 59)
+
+ #define PTA_CORE2 \
+ (PTA_64BIT | PTA_MMX | PTA_SSE | PTA_SSE2 | PTA_SSE3 | PTA_SSSE3 \
+@@ -4391,8 +4389,8 @@
{"lakemont", PROCESSOR_LAKEMONT, CPU_PENTIUM, PTA_NO_80387},
{"pentium-mmx", PROCESSOR_PENTIUM, CPU_PENTIUM, PTA_MMX},
{"winchip-c6", PROCESSOR_I486, CPU_NONE, PTA_MMX},
@@ -575263,7 +579134,7 @@ Index: gcc/config/i386/i386.c
{"c3-2", PROCESSOR_PENTIUMPRO, CPU_PENTIUMPRO,
PTA_MMX | PTA_SSE | PTA_FXSR},
{"i686", PROCESSOR_PENTIUMPRO, CPU_PENTIUMPRO, 0},
-@@ -4437,43 +4437,43 @@
+@@ -4437,43 +4435,43 @@
{"knl", PROCESSOR_KNL, CPU_SLM, PTA_KNL},
{"intel", PROCESSOR_INTEL, CPU_SLM, PTA_NEHALEM},
{"geode", PROCESSOR_GEODE, CPU_GEODE,
@@ -575322,7 +579193,17 @@ Index: gcc/config/i386/i386.c
{"amdfam10", PROCESSOR_AMDFAM10, CPU_AMDFAM10,
PTA_64BIT | PTA_MMX | PTA_3DNOW | PTA_3DNOW_A | PTA_SSE | PTA_SSE2
| PTA_SSE3 | PTA_SSE4A | PTA_CX16 | PTA_ABM | PTA_PRFCHW | PTA_FXSR},
-@@ -5183,15 +5183,11 @@
+@@ -4927,9 +4925,6 @@
+ if (processor_alias_table[i].flags & PTA_PREFETCHWT1
+ && !(opts->x_ix86_isa_flags_explicit & OPTION_MASK_ISA_PREFETCHWT1))
+ opts->x_ix86_isa_flags |= OPTION_MASK_ISA_PREFETCHWT1;
+- if (processor_alias_table[i].flags & PTA_PCOMMIT
+- && !(opts->x_ix86_isa_flags_explicit & OPTION_MASK_ISA_PCOMMIT))
+- opts->x_ix86_isa_flags |= OPTION_MASK_ISA_PCOMMIT;
+ if (processor_alias_table[i].flags & PTA_CLWB
+ && !(opts->x_ix86_isa_flags_explicit & OPTION_MASK_ISA_CLWB))
+ opts->x_ix86_isa_flags |= OPTION_MASK_ISA_CLWB;
+@@ -5183,15 +5178,11 @@
/* Enable SSE prefetch. */
if (TARGET_SSE_P (opts->x_ix86_isa_flags)
@@ -575341,7 +579222,7 @@ Index: gcc/config/i386/i386.c
/* Enable popcnt instruction for -msse4.2 or -mabm. */
if (TARGET_SSE4_2_P (opts->x_ix86_isa_flags)
|| TARGET_ABM_P (opts->x_ix86_isa_flags))
-@@ -5476,11 +5472,12 @@
+@@ -5476,11 +5467,12 @@
if (!(opts_set->x_target_flags & MASK_STV))
opts->x_target_flags |= MASK_STV;
/* Disable STV if -mpreferred-stack-boundary={2,3} or
@@ -575356,7 +579237,15 @@ Index: gcc/config/i386/i386.c
opts->x_target_flags &= ~MASK_STV;
if (!ix86_tune_features[X86_TUNE_AVX256_UNALIGNED_LOAD_OPTIMAL]
&& !(opts_set->x_target_flags & MASK_AVX256_SPLIT_UNALIGNED_LOAD))
-@@ -9916,6 +9913,9 @@
+@@ -5978,7 +5970,6 @@
+ IX86_ATTR_ISA ("avx512vbmi", OPT_mavx512vbmi),
+ IX86_ATTR_ISA ("avx512ifma", OPT_mavx512ifma),
+ IX86_ATTR_ISA ("clwb", OPT_mclwb),
+- IX86_ATTR_ISA ("pcommit", OPT_mpcommit),
+ IX86_ATTR_ISA ("mwaitx", OPT_mmwaitx),
+ IX86_ATTR_ISA ("clzero", OPT_mclzero),
+ IX86_ATTR_ISA ("pku", OPT_mpku),
+@@ -9916,6 +9907,9 @@
layout_type (record);
@@ -575366,7 +579255,7 @@ Index: gcc/config/i386/i386.c
/* The correct type is an array type of one element. */
return build_array_type (record, build_index_type (size_zero_node));
}
-@@ -9928,17 +9928,36 @@
+@@ -9928,17 +9922,36 @@
{
if (TARGET_64BIT)
{
@@ -575410,7 +579299,7 @@ Index: gcc/config/i386/i386.c
}
else
{
-@@ -22671,7 +22690,7 @@
+@@ -22671,7 +22684,7 @@
/* We want to check HONOR_NANS and HONOR_SIGNED_ZEROS here,
but MODE may be a vector mode and thus not appropriate. */
@@ -575419,7 +579308,27 @@ Index: gcc/config/i386/i386.c
{
int u = is_min ? UNSPEC_IEEE_MIN : UNSPEC_IEEE_MAX;
rtvec v;
-@@ -40361,7 +40380,7 @@
+@@ -32141,9 +32154,6 @@
+ /* CLWB instructions. */
+ IX86_BUILTIN_CLWB,
+
+- /* PCOMMIT instructions. */
+- IX86_BUILTIN_PCOMMIT,
+-
+ /* CLFLUSHOPT instructions. */
+ IX86_BUILTIN_CLFLUSHOPT,
+
+@@ -32947,9 +32957,6 @@
+ { OPTION_MASK_ISA_AVX512VL, CODE_FOR_avx512vl_us_truncatev8siv8hi2_mask_store, "__builtin_ia32_pmovusdw256mem_mask", IX86_BUILTIN_PMOVUSDW256_MEM, UNKNOWN, (int) VOID_FTYPE_PV8HI_V8SI_UQI },
+ { OPTION_MASK_ISA_AVX512VL, CODE_FOR_avx512vl_us_truncatev4siv4hi2_mask_store, "__builtin_ia32_pmovusdw128mem_mask", IX86_BUILTIN_PMOVUSDW128_MEM, UNKNOWN, (int) VOID_FTYPE_PV8HI_V4SI_UQI },
+
+- /* PCOMMIT. */
+- { OPTION_MASK_ISA_PCOMMIT, CODE_FOR_pcommit, "__builtin_ia32_pcommit", IX86_BUILTIN_PCOMMIT, UNKNOWN, (int) VOID_FTYPE_VOID },
+-
+ /* RDPKRU and WRPKRU. */
+ { OPTION_MASK_ISA_PKU, CODE_FOR_rdpkru, "__builtin_ia32_rdpkru", IX86_BUILTIN_RDPKRU, UNKNOWN, (int) UNSIGNED_FTYPE_VOID },
+ { OPTION_MASK_ISA_PKU, CODE_FOR_wrpkru, "__builtin_ia32_wrpkru", IX86_BUILTIN_WRPKRU, UNKNOWN, (int) VOID_FTYPE_UNSIGNED }
+@@ -40361,7 +40368,7 @@
error ("%qE needs isa option %s", fndecl, opts);
free (opts);
}
@@ -575428,7 +579337,7 @@ Index: gcc/config/i386/i386.c
}
switch (fcode)
-@@ -48848,6 +48867,8 @@
+@@ -48848,6 +48855,8 @@
/* ms_abi and sysv_abi calling convention function attributes. */
{ "ms_abi", 0, 0, false, true, true, ix86_handle_abi_attribute, true },
{ "sysv_abi", 0, 0, false, true, true, ix86_handle_abi_attribute, true },
@@ -575437,7 +579346,7 @@ Index: gcc/config/i386/i386.c
{ "ms_hook_prologue", 0, 0, true, false, false, ix86_handle_fndecl_attribute,
false },
{ "callee_pop_aggregate_return", 1, 1, false, true, true,
-@@ -52690,8 +52711,6 @@
+@@ -52690,8 +52699,6 @@
static tree
ix86_canonical_va_list_type (tree type)
{
@@ -575446,7 +579355,7 @@ Index: gcc/config/i386/i386.c
/* Resolve references and pointers to va_list type. */
if (TREE_CODE (type) == MEM_REF)
type = TREE_TYPE (type);
-@@ -52700,64 +52719,25 @@
+@@ -52700,64 +52707,25 @@
else if (POINTER_TYPE_P (type) && TREE_CODE (TREE_TYPE (type)) == ARRAY_TYPE)
type = TREE_TYPE (type);
@@ -575525,7 +579434,7 @@ Index: gcc/config/i386/i386.c
return std_canonical_va_list_type (type);
}
-@@ -53662,9 +53642,7 @@
+@@ -53662,9 +53630,7 @@
return V4SFmode;
case DFmode:
@@ -575536,7 +579445,7 @@ Index: gcc/config/i386/i386.c
return V8DFmode;
else if (TARGET_AVX && !TARGET_PREFER_AVX128)
return V4DFmode;
-@@ -53749,9 +53727,14 @@
+@@ -53749,9 +53715,14 @@
tree vectype = stmt_info ? stmt_vectype (stmt_info) : NULL_TREE;
int stmt_cost = ix86_builtin_vectorization_cost (kind, vectype, misalign);
@@ -575552,6 +579461,18 @@ Index: gcc/config/i386/i386.c
if (where == vect_body && stmt_info && stmt_in_inner_loop_p (stmt_info))
count *= 50; /* FIXME. */
+Index: gcc/config/avr/gen-avr-mmcu-texi.c
+===================================================================
+--- a/src/gcc/config/avr/gen-avr-mmcu-texi.c (.../tags/gcc_6_2_0_release)
++++ b/src/gcc/config/avr/gen-avr-mmcu-texi.c (.../branches/gcc-6-branch)
+@@ -19,6 +19,7 @@
+
+ #include <stdlib.h>
+ #include <stdio.h>
++#include <string.h>
+
+ #define IN_GEN_AVR_MMCU_TEXI
+
Index: gcc/config/avr/avr.c
===================================================================
--- a/src/gcc/config/avr/avr.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