File: //usr/share/doc/libtsan0/NEWS.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>GCC 11 Release Series — Changes, New Features, and Fixes</title>
<link rel="stylesheet" type="text/css" href="gcc.css" />
</head>
<!-- GCC maintainers, please do not hesitate to contribute/update
entries concerning those part of GCC you maintain!
-->
<body>
<h1>GCC 11 Release Series<br/>Changes, New Features, and Fixes</h1>
<p>
This page is a "brief" summary of some of the huge number of improvements
in GCC 11.
You may also want to check out our
<a href="porting_to.html">Porting to GCC 11</a> page and the
<a href="../onlinedocs/index.html#current">full GCC documentation</a>.
</p>
<!-- .................................................................. -->
<h2>Caveats</h2>
<ul>
<li>The default mode for C++ is now <code>-std=gnu++17</code> instead of
<code>-std=gnu++14</code>. Note
that <a href="https://wg21.link/p0522r0">C++17 changes to template
template parameter matching</a> can be disabled independently of other
features with <code>-fno-new-ttp-matching</code>.
</li>
<li>When building GCC itself, the host compiler must now support C++11,
rather than C++98. In particular bootstrapping GCC 11 using an older
version of GCC requires a binary of GCC 4.8 or later, rather than of
GCC 3.4 or later as was the case for bootstrapping GCC 10.</li>
<li>Naming and location of auxiliary and dump output files changed.
If you compile multiple input files in a single command, if you
enable Link Time Optimization, or if you use <code>-dumpbase</code>,
<code>-dumpdir</code>, <code>-save-temps=*</code>, and you expect
any file other than the
primary output file(s) to be created as a side effect, watch out
for improvements and a few surprises.
See <a href="https://gcc.gnu.org/pipermail/gcc-patches/2020-May/546494.html">the
patch</a>, particularly its textual description, for more
details about the changes.</li>
<li><code>-gsplit-dwarf</code> no longer enables debug info generation
on its own but requires a separate <code>-g</code> for this.</li>
<li>The libstdc++ configure option <code>--enable-cheaders=c_std</code>
is deprecated and will be removed in a future release. It should be
possible to use <code>--enable-cheaders=c_global</code> (the default)
with no change in behaviour. </li>
<li>The front end for compiling BRIG format of Heterogeneous System
Architecture Intermediate Language (HSAIL) has been deprecated
and will likely be removed in a future release.</li>
<li>Some short options of the <code>gcov</code> tool have been renamed: <code>-i</code> to <code>-j</code>
and <code>-j</code> to <code>-H</code>.</li>
</ul>
<!-- .................................................................. -->
<h2 id="general">General Improvements</h2>
<ul>
<li>
<a href="https://github.com/google/sanitizers/wiki/ThreadSanitizerCppManual">
ThreadSanitizer</a> improvements to support alternative runtimes and
environments. The <a href="https://www.kernel.org/doc/html/latest/dev-tools/kcsan.html">
Linux Kernel Concurrency Sanitizer (KCSAN)</a> is now supported.
<ul>
<li>Add <code>--param tsan-distinguish-volatile</code> to optionally emit
instrumentation distinguishing volatile accesses.</li>
<li>Add <code>--param tsan-instrument-func-entry-exit</code> to optionally
control if function entries and exits should be instrumented.</li>
</ul>
</li>
<li>
<p>
In previous releases of GCC, the "column numbers" emitted in diagnostics
were actually a count of bytes from the start of the source line. This
could be problematic, both because of:
</p>
<ul>
<li>multibyte characters (requiring more than one byte to encode), and</li>
<li>multicolumn characters (requiring more than one column to display in a monospace font)</li>
</ul>
<p>
For example, the character π ("GREEK SMALL LETTER PI (U+03C0)")
occupies one column, and its UTF-8 encoding requires two bytes; the
character 🙂 ("SLIGHTLY SMILING FACE (U+1F642)") occupies two
columns, and its UTF-8 encoding requires four bytes.
</p>
<p>
In GCC 11 the column numbers default to being column numbers, respecting
multi-column characters. The old behavior can be restored using a new
option
<a href="https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Diagnostic-Message-Formatting-Options.html#index-fdiagnostics-column-unit"><code>-fdiagnostics-column-unit=byte</code></a>.
There is also a new option
<a href="https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Diagnostic-Message-Formatting-Options.html#index-fdiagnostics-column-origin"><code>-fdiagnostics-column-origin=</code></a>,
allowing the pre-existing default of the left-hand column being column
1 to be overridden if desired (e.g. for 0-based columns). The output
of
<a href="https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Diagnostic-Message-Formatting-Options.html#index-fdiagnostics-format"><code>-fdiagnostics-format=json</code></a>
has been extended to supply both byte counts and column numbers for all source locations.
</p>
<p>
Additionally, in previous releases of GCC, tab characters in the source
would be emitted verbatim when quoting source code, but be prefixed
with whitespace or line number information, leading to misalignments
in the resulting output when compared with the actual source. Tab
characters are now printed as an appropriate number of spaces, using the
<a href="https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Preprocessor-Options.html#index-ftabstop"><code>-ftabstop</code></a>
option (which defaults to 8 spaces per tab stop).
</p>
</li>
<li>
<p>
Introduce <a href="https://clang.llvm.org/docs/HardwareAssistedAddressSanitizerDesign.html">
Hardware-assisted AddressSanitizer</a> support. This sanitizer currently
only works for the AArch64 target. It helps debug address problems
similarly to
<a href="https://github.com/google/sanitizers/wiki/AddressSanitizer">
AddressSanitizer</a> but is based on partial hardware assistance and
provides probabilistic protection to use less RAM at run time.
<a href="https://clang.llvm.org/docs/HardwareAssistedAddressSanitizerDesign.html">
Hardware-assisted AddressSanitizer</a> is not production-ready for user
space, and is provided mainly for use compiling the Linux Kernel.
</p>
To use this sanitizer the command line arguments are:
<ul>
<li><code>-fsanitize=hwaddress</code> to instrument userspace code.</li>
<li><code>-fsanitize=kernel-hwaddress</code> to instrument kernel code.</li>
</ul>
</li>
<li>
<p>
For targets that produce DWARF debugging information GCC now
defaults to <a href="http://dwarfstd.org/doc/DWARF5.pdf">DWARF
version 5</a> (with the exception of VxWorks and Darwin/Mac OS X
which default to version 2 and AIX which defaults to version 4).
This can produce up to 25% more compact debug information
compared to earlier versions.
<p>
To take full advantage of DWARF version 5 GCC needs to be build
against binutils version 2.35.2 or higher. When GCC is build
against earlier versions of binutils GCC will still emit DWARF
version 5 for most debuginfo data, but will generate version 4
debug line tables (even when explicitly given <code>-gdwarf-5</code>).
<p>
The following debug information consumers can process DWARF version 5:
<ul>
<li>GDB 8.0, or higher
<li>valgrind 3.17.0
<li>elfutils 0.172, or higher (for use with systemtap,
dwarves/pahole, perf and libabigail)
<li>dwz 0.14
</ul>
<p>
Programs embedding libbacktrace are urged to upgrade to the version
shipping with GCC 11.
<p>
To make GCC 11 generate an older DWARF version
use <code>-g</code> together with <code>-gdwarf-2</code>,
<code>-gdwarf-3</code> or <code>-gdwarf-4</code>.
</li>
<li>
Vectorizer improvements:
<ul>
<li>The straight-line code vectorizer now considers the whole function
when vectorizing and can handle opportunities crossing CFG merges
and backedges.
</li>
</ul>
</li>
<li>A series of conditional expressions that compare the same variable can be transformed into a switch statement
if each of them contains a comparison expression. Example:
<pre>
int IsHTMLWhitespace(int aChar) {
return aChar == 0x0009 || aChar == 0x000A ||
aChar == 0x000C || aChar == 0x000D ||
aChar == 0x0020;
}
</pre>
This statement can be transformed into a switch statement and then expanded into a bit-test.
</li>
<li>
New command-line options:
<ul>
<li><a href="https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Code-Gen-Options.html#index-fno-bit-tests"><code>-fbit-tests</code></a>, enabled by default, can be used to enable or disable switch expansion using bit-tests.</li>
</ul>
</li>
<li>
Inter-procedural optimization improvements:
<ul>
<li>A new IPA-modref pass was added to track side effects of function calls
and improve precision of points-to-analysis. The pass can be controlled
by the <a href="https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Optimize-Options.html#index-fipa-modref"><code>-fipa-modref</code></a> option.
</li>
<li>The identical code folding pass (controlled by <a href="https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Optimize-Options.html#index-fipa-ocf"><code>-fipa-icf</code></a>)
was significantly improved to increase the number of
unified functions and to reduce compile-time memory use.</li>
<li>IPA-CP (Interprocedural constant propagation)
heuristics improved its estimation of potential usefulness of
known loop bounds and strides by taking the estimated frequency of
these loops into account.</li>
</ul>
</li>
<li>
Link-time optimization improvements:
<ul>
<li>The LTO bytecode format was optimized for smaller object files and
faster streaming.</li>
<li>Memory allocation of the linking stage was improved to reduce peak
memory use.</li>
</ul>
</li>
<li>
Profile driven optimization improvements:
<ul>
<li>
Using <a href="https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Optimize-Options.html#index-fprofile-values"><code>-fprofile-values</code></a>,
was improved by tracking more target values for e.g. indirect calls.
</li>
<li>GCOV data file format outputs smaller files by representing zero counters in a more compact way.</li>
</ul>
</li>
</ul>
<!-- .................................................................. -->
<h2 id="languages">New Languages and Language specific improvements</h2>
<ul>
<li>GCC 11 adds support for non-rectangular loop nests in OpenMP
constructs and the allocator routines of
<a href="https://www.openmp.org/specifications/">OpenMP 5.0</a>,
including initial <code>allocate</code> clause support in C/C++.
The <code>OMP_TARGET_OFFLOAD</code> environment variable and the
active-levels routines are now supported.
For C/C++, the <code>declare variant</code> and <code>map</code>
support has been extended.
For Fortran, OpenMP 4.5 is now fully supported and OpenMP 5.0
support has been extended, including the following features which were
before only available in C and C++: <code>order(concurrent)</code>,
<code>device_type</code>, memorder-clauses for <code>flush</code>,
<code>lastprivate</code> with <code>conditional</code> modifier,
<code>atomic</code> construct and <code>reduction</code> clause
extensions of OpenMP 5.0,
<code>if</code> clause with <code>simd</code> and <code>cancel</code>
modifiers, <code>target data</code> without <code>map</code> clause,
and limited support for the <code>requires</code> construct.
</li>
<li>
Version 2.6 of the <a href="https://www.openacc.org/">OpenACC</a>
specification continues to be maintained and improved in the C, C++ and
Fortran compilers.
See the <a href="https://gcc.gnu.org/wiki/OpenACC/Implementation%20Status#status-11">implementation
status</a> section on the OpenACC wiki page and the
<a href="https://gcc.gnu.org/onlinedocs/gcc-11.1.0/libgomp/Enabling-OpenACC.html">
run-time library documentation</a> for further information.
</li>
</ul>
<!-- <h3 id="ada">Ada</h3> -->
<!-- <h3 id="brig">BRIG (HSAIL)</h3> -->
<h3 id="c-family">C family</h3>
<ul>
<li>New attributes:
<ul>
<li>The <a href="https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Common-Function-Attributes.html#index-no_005fstack_005fprotector-function-attribute"><code>no_stack_protector</code></a>
attribute has been added to mark functions which should not be instrumented
with stack protection (<code>-fstack-protector</code>).</li>
<li>The existing
<a href="https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Common-Function-Attributes.html#index-malloc-function-attribute"><code>malloc</code></a>
attribute has been extended so that it can be used to identify
allocator/deallocator API pairs. A pair of new
<a href="https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Warning-Options.html#index-Wmismatched-dealloc"><code>-Wmismatched-dealloc</code></a> and <a href="https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/C_002b_002b-Dialect-Options.html#index-Wmismatched-new-delete"><code>-Wmismatched-new-delete</code></a> warnings will complain
about mismatched calls, and <a href="https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Warning-Options.html#index-Wfree-nonheap-object"><code>-Wfree-nonheap-object</code></a> about deallocation calls with pointers not obtained from allocation
functions. Additionally, the static analyzer will use these
attributes when checking for leaks, double-frees, use-after-frees,
and similar issues.
</li>
</ul>
<li>New warnings:
<ul>
<li><a href="https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Warning-Options.html#index-Wmismatched-dealloc"><code>-Wmismatched-dealloc</code></a>,
enabled by default, warns about calls to deallocation functions
with pointers returned from mismatched allocation functions.
</li>
<li><a href="https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Warning-Options.html#index-Wsizeof-array-div"><code>-Wsizeof-array-div</code></a>,
enabled by <code>-Wall</code>, warns
about divisions of two sizeof operators when the first one is applied
to an array and the divisor does not equal the size of the array
element.
</li>
<li><a href="https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Warning-Options.html#index-Wstringop-overread"><code>-Wstringop-overread</code></a>,
enabled by default, warns about calls to string functions reading
past the end of the arrays passed to them as arguments. In prior
GCC releases most instances of his warning are diagnosed by
<code>-Wstringop-overflow</code>.
</li>
<li><a href="https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Warning-Options.html#index-Wtsan"><code>-Wtsan</code></a>,
enabled by default, warns about unsupported features in ThreadSanitizer
(currently <code>std::atomic_thread_fence</code>).
</li>
</ul>
</li>
<li>Enhancements to existing warnings:
<ul>
<li><a href="https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Warning-Options.html#index-Wfree-nonheap-object"><code>-Wfree-nonheap-object</code></a>
detects many more instances of calls to deallocation functions with
pointers not returned from a dynamic memory allocation function.
</li>
<li><a href="https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Warning-Options.html#index-Wmaybe-uninitialized"><code>-Wmaybe-uninitialized</code></a>
diagnoses passing pointers or references to uninitialized memory
to functions taking <code>const</code>-qualified arguments.
</li>
<li><a href="https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Warning-Options.html#index-Wuninitialized"><code>-Wuninitialized</code></a>
detects reads from uninitialized dynamically allocated memory.
</li>
</ul>
</li>
<li>
<p>
For ELF targets that support the GNU or FreeBSD OSABIs, the
<code>used</code> attribute will now save the symbol declaration it is
applied to from linker garbage collection.
</p>
<p>
To support this behavior, <code>used</code> symbols that have not
been placed in specific sections (e.g. with the <code>section</code>
attribute, or the <code>-f{function,data}-sections</code> options) will
be placed in new, unique sections.
</p>
<p>
This functionality requires Binutils version 2.36 or later.
</p>
</li>
</ul>
<h3 id="c">C</h3>
<ul>
<li>Several new features from the upcoming C2X revision of the ISO C
standard are supported with <code>-std=c2x</code>
and <code>-std=gnu2x</code>. Some of these features are also
supported as extensions when compiling for older language versions.
In addition to the features listed, some features previously
supported as extensions and now added to the C standard are enabled
by default in C2X mode and not diagnosed with <code>-std=c2x
-Wpedantic</code>.
<ul>
<li>The <code>BOOL_MAX</code> and <code>BOOL_WIDTH</code> macros
are provided in <code><limits.h></code>.</li>
<li>As in C++, function definitions no longer need to give names
for unused function parameters.</li>
<li>The expansions of the <code>true</code> and <code>false</code>
macros in <code><stdbool.h></code> have changed so that they
have type <code>bool</code>.</li>
<li>The <code>[[nodiscard]]</code> standard attribute is now
supported.</li>
<li>The <code>__has_c_attribute</code> preprocessor operator is
now supported.</li>
<li>Macros <code>INFINITY</code>, <code>NAN</code>, <code>FLT_SNAN</code>,
<code>DBL_SNAN</code>, <code>LDBL_SNAN</code>, <code>DEC_INFINITY</code>,
<code>DEC_NAN</code>, and corresponding signaling NaN macros for
<code>_Float<i>N</i></code>, <code>_Float<i>N</i>x</code>
and <code>_Decimal<i>N</i></code> types, are provided
in <code><float.h></code>. There are also corresponding
built-in functions <code>__builtin_nansd<i>N</i></code> for
decimal signaling NaNs.</li>
<li>Macros <code>FLT_IS_IEC_60559</code>, <code>DBL_IS_IEC_60559</code>
and <code>LDBL_IS_IEC_60559</code> are provided
in <code><float.h></code>.</li>
<li>The feature test
macro <code>__STDC_WANT_IEC_60559_EXT__</code> is supported
by <code><float.h></code>.</li>
<li>Labels may appear before declarations and at the end of a
compound statement.</li>
</ul></li>
<li>New warnings:
<ul>
<li><a href="https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Warning-Options.html#index-Warray-parameter"><code>-Warray-parameter</code></a>,
enabled by <code>-Wall</code>, warns about redeclarations of functions
with ordinary array arguments declared using inconsistent forms.
The warning also enables the detection of the likely out of bounds
accesses in calls to such functions with smaller arrays.
</li>
<li><a href="https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Warning-Options.html#index-Wvla-parameter"><code>-Wvla-parameter</code></a>,
enabled by <code>-Wall</code>, warns redeclarations of functions
with variable length array arguments declared using inconsistent
forms or with mismatched bounds. The warning also enables
the detection of the likely out of bounds accesses in calls to
such functions with smaller arrays.
</li>
</ul>
</ul>
<h3 id="cxx">C++</h3>
<ul>
<li>The default mode has been changed to <code>-std=gnu++17</code>.</li>
<li>Several C++20 features have been implemented:
<ul>
<li>the compiler now supports <code>consteval virtual</code>
functions</li>
<li>P2082R1, Fixing CTAD for aggregates</li>
<li>P0593R6, Pseudo-destructors end object lifetimes</li>
<li>P1907R1, Inconsistencies with non-type template parameters (complete
implementation)</li>
<li>P1975R0, Fixing the wording of parenthesized aggregate-initialization</li>
<li>P1009R2, Array size deduction in <i>new-expression</i>s</li>
<li>P1099R5, <code>using enum</code></li>
<li>Modules, Requires <code>-fmodules-ts</code> and some aspects
are incomplete. Refer
to <a href="../projects/cxx-status.html#cxx20">C++ 20 Status</a>
</ul>
</li>
<li>
The C++ front end has experimental support for some of the upcoming C++23
draft features with the <code>-std=c++23</code>, <code>-std=gnu++23</code>,
<code>-std=c++2b</code> or <code>-std=gnu++2b</code> flags,
including
<ul>
<li>P0330R8, Literal Suffix for (signed) size_t.</li>
</ul>
For a full list of new features,
see <a href="../projects/cxx-status.html#cxx23">the C++
status page</a>.
</li>
<li>Several C++ Defect Reports have been resolved, e.g.:
<ul>
<li>DR 625, Use of <code>auto</code> as a <em>template-argument</em></li>
<li>DR 1512, Pointer comparison vs qualification conversions</li>
<li>DR 1722, Should lambda to function pointer conversion function be
<code>noexcept</code>?</li>
<li>DR 1914, Duplicate standard attributes</li>
<li>DR 2032, Default <i>template-arguments</i> of variable templates</li>
<li>DR 2289, Uniqueness of decomposition declaration names</li>
<li>DR 2237, Can a <i>template-id</i> name a constructor?</li>
<li>DR 2303, Partial ordering and recursive variadic inheritance</li>
<li>DR 2369, Ordering between constraints and substitution</li>
<li>DR 2450, <i>braced-init-list</i> as a <i>template-argument</i></li>
</ul>
</li>
<li>G++ now performs better access checking in templates
(<a href="https://gcc.gnu.org/PR41437">PR41437</a>).</li>
<li><code>reinterpret_cast</code>s in constexpr evaluation are now checked
more completely (<a href="https://gcc.gnu.org/PR95307">PR95307</a>).</li>
<li>The diagnostic for <code>static_assert</code> has been improved: the
compiler now shows the expression including its template arguments (if
there were any), and can point to the failing clause if the condition
comprised of any logical AND operators
(<a href="https://gcc.gnu.org/PR97518">PR97518</a>).</li>
<li>New warnings:
<ul>
<li><a href="https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/C_002b_002b-Dialect-Options.html#index-Wctad-maybe-unsupported"><code>-Wctad-maybe-unsupported</code></a>,
disabled by default, warns
about performing class template argument deduction on a type with no
deduction guides.
</li>
<li><a href="https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/C_002b_002b-Dialect-Options.html#index-Wrange-loop-construct"><code>-Wrange-loop-construct</code></a>,
enabled by <code>-Wall</code>,
warns when a range-based for-loop is creating unnecessary and
expensive copies.
</li>
<li><a href="https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/C_002b_002b-Dialect-Options.html#index-Wdeprecated-enum-enum-conversion"><code>-Wdeprecated-enum-enum-conversion</code></a>,
enabled by default in
C++20, warns about deprecated arithmetic conversions on operands of
enumeration types, as outlined in <em>[depr.arith.conv.enum]</em>.
</li>
<li><a href="https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/C_002b_002b-Dialect-Options.html#index-Wdeprecated-enum-float-conversion"><code>-Wdeprecated-enum-float-conversion</code></a>,
enabled by default in
C++20, warns about deprecated arithmetic conversions on operands where
one is of enumeration type and the other is of a floating-point type,
as outlined in <em>[depr.arith.conv.enum]</em>.
</li>
<li><a href="https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/C_002b_002b-Dialect-Options.html#index-Wmismatched-new-delete"><code>-Wmismatched-new-delete</code></a>,
enabled by <code>-Wall</code>, warns about calls to C++
<code>operator delete</code> with pointers returned from mismatched
forms of <code>operator new</code> or from other mismatched allocation
functions.
</li>
<li><a href="https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/C_002b_002b-Dialect-Options.html#index-Wvexing-parse"><code>-Wvexing-parse</code></a>,
enabled by default, warns about the most
vexing parse rule: the cases when a declaration looks like a variable
definition, but the C++ language requires it to be interpreted as a
function declaration.
</li>
</ul>
<li>Enhancements to existing warnings:
<ul>
<li><a href="https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Warning-Options.html#index-Wnonnull"><code>-Wnonnull</code></a>
considers the implicit <code>this</code> argument of every C++
nonstatic member function to have been implicitly declared with
attribute <code>nonnull</code> and triggers warnings for calls where
the pointer is null.
</li>
</ul>
</li>
</ul>
<h4 id="libstdcxx">Runtime Library (libstdc++)</h4>
<ul>
<li>Improved C++17 support, including:
<ul>
<li><code>std::from_chars</code> and <code>std::to_chars</code>
for floating-point types.</li>
</ul>
</li>
<li>Improved experimental C++20 support, including:
<ul>
<li>Calendar additions to <code><chrono></code>.
Thanks to Cassio Neri for optimizations.
</li>
<li><code>std::bit_cast</code></li>
<li><code>std::source_location</code></li>
<li>Atomic wait and notify operations.</li>
<li><code><barrier></code>, <code><latch></code>,
and <code><semaphore></code></li>
<li><code><syncstream></code></li>
<li>Efficient access to <code>basic_stringbuf</code>'s buffer.</li>
</ul>
</li>
<li>Experimental C++23 support, including:
<ul>
<li><code>contains</code> member functions for strings,
thanks to Paul Fee.
</li>
<li><code>std::to_underlying</code>, <code>std::is_scoped_enum</code></li>
</ul>
</li>
<li>Experimental support for Data-Parallel Types (<code>simd</code>)
from the Parallelism 2 TS, thanks to Matthias Kretz.
</li>
<li>Faster <code>std::uniform_int_distribution</code>,
thanks to Daniel Lemire.
</li>
</ul>
<h3 id="fortran">Fortran</h3>
<ul>
<li>Added <code>DEPRECATED</code> to <code>!GCC$</code>'s
<code>attributes</code> directive.
</li>
</ul>
<!-- <h3 id="go">Go</h3> -->
<!-- .................................................................. -->
<h2 id="jit">libgccjit</h2>
<ul>
<li>libgccjit was marked as merely "Alpha" quality when
<a href="../gcc-5/changes.html#jit">originally added in GCC 5</a>.
Given that we have maintained
<a href="https://gcc.gnu.org/onlinedocs/gcc-11.1.0/jit/topics/compatibility.html">API and ABI compatibility</a>
since then and it is in use by various projects, we have removed that
caveat.</li>
<li>libgccjit can now be built for MinGW</li>
<li>
The libgccjit API gained 10 new entry points:
<ul>
<li>
<a href="https://gcc.gnu.org/onlinedocs/gcc-11.1.0/jit/topics/expressions.html#c.gcc_jit_global_set_initializer"><code>gcc_jit_global_set_initializer</code></a>
</li>
<li>9 entrypoints for <a href="https://gcc.gnu.org/onlinedocs/gcc-11.1.0/jit/topics/asm.html">directly embedding asm statements into a compile</a>, analogous to inline <code>asm</code> in the C front end</li>
</ul>
</li>
</ul>
<!-- .................................................................. -->
<h2 id="targets">New Targets and Target Specific Improvements</h2>
<h3 id="arm-targets">AArch64 & arm</h3>
<ul>
<li>A number of new CPUs are supported through arguments to the
<code>-mcpu</code> and <code>-mtune</code> options in both
the arm and aarch64 backends (GCC identifiers in parentheses):
<ul>
<li>Arm Cortex-A78 (<code>cortex-a78</code>).</li>
<li>Arm Cortex-A78AE (<code>cortex-a78ae</code>).</li>
<li>Arm Cortex-A78C (<code>cortex-a78c</code>).</li>
<li>Arm Cortex-X1 (<code>cortex-x1</code>).</li>
<li>Arm Neoverse V1 (<code>neoverse-v1</code>).</li>
<li>Arm Neoverse N2 (<code>neoverse-n2</code>).</li>
</ul>
</li>
<li>GCC can now auto-vectorize operations performing
addition, subtraction, multiplication and the accumulate/subtract variants
on complex numbers, taking advantage of the Advanced SIMD instructions in
the Armv8.3-a (AArch64/AArch32), SVE (AArch64), SVE2 (AArch64) and MVE
(AArch32 M-profile) instruction sets.</li>
</ul>
<h3 id="aarch64">AArch64</h3>
<ul>
<li> In addition to the above, the following AArch64-only
CPUs are now supported:
<ul>
<li>Fujitsu A64FX (<code>a64fx</code>).</li>
<li>Arm Cortex-R82 (<code>cortex-r82</code>).</li>
</ul>
</li>
<li>The AArch64 Armv8-R architecture is now supported through the
<code>-march=armv8-r</code> option.</li>
<li>Mitigation against the
<a href="https://developer.arm.com/support/arm-security-updates/speculative-processor-vulnerability/downloads/straight-line-speculation">Straight-line Speculation vulnerability</a>
is supported with the <code>-mharden-sls=</code> option. Please refer to the
documentation for usage instructions.</li>
<li>The availability of Advanced SIMD intrinsics available through the
<code>arm_neon.h</code> header is improved and GCC 11 supports the full
set of intrinsics defined by ACLE Q3 2020.</li>
</ul>
<h3 id="amdgcn">AMD Radeon (GCN)</h3>
<ul>
<li>Initial support for <code>gfx908</code> GPUs has been added.</li>
</ul>
<!-- <h3 id="arc">ARC</h3> -->
<h3 id="arm">arm</h3>
<ul>
<li>Initial auto-vectorization is now available when targeting the MVE
instruction set.</li>
<li>GCC can now make use of the Low Overhead Branch instruction in Armv8.1-M
to optimize loop counters and checks.</li>
<li>The <code>-mcpu=cortex-m55</code> option now supports the extensions
<code>+nomve</code> and <code>+nomve.fp</code> to control generation of
MVE and MVE floating-point instructions.</li>
</ul>
<!-- <h3 id="avr">AVR</h3> -->
<!-- <h3 id="hsa">Heterogeneous Systems Architecture</h3> -->
<h3 id="x86">IA-32/x86-64</h3>
<ul>
<li>New ISA extension support for Intel TSXLDTRK was added to GCC.
TSXLDTRK intrinsics are available via the <code>-mtsxldtrk</code>
compiler switch.
</li>
<li>New ISA extension support for Intel SERIALIZE was added to GCC.
SERIALIZE intrinsics are available via the <code>-mserialize</code>
compiler switch.
</li>
<li>New ISA extension support for Intel HRESET was added to GCC.
HRESET intrinsics are available via the <code>-mhreset</code>
compiler switch.
</li>
<li>New ISA extension support for Intel UINTR was added to GCC.
UINTR intrinsics are available via the <code>-muintr</code>
compiler switch.
</li>
<li>New ISA extension support for Intel KEYLOCKER was added to GCC.
KEYLOCKER intrinsics are available via the <code>-mkeylocker</code>
compiler switch.
</li>
<li>New ISA extension support for Intel AMX-TILE, AMX-INT8, AMX-BF16 was
added to GCC. AMX-TILE, AMX-INT8, AMX-BF16 intrinsics are available
via the <code>-mamx-tile, -mamx-int8, -mamx-bf16</code> compiler
switches.
</li>
<li>New ISA extension support for Intel AVX-VNNI was added to GCC.
AVX-VNNI intrinsics are available via the <code>-mavxvnni</code>
compiler switch.
</li>
<li>GCC now supports the Intel CPU named Sapphire Rapids through
<code>-march=sapphirerapids</code>.
The switch enables the MOVDIRI, MOVDIR64B, AVX512VP2INTERSECT, ENQCMD,
CLDEMOTE, SERIALIZE, PTWRITE, WAITPKG, TSXLDTRK, AMT-TILE, AMX-INT8,
AMX-BF16, and AVX-VNNI ISA extensions.
</li>
<li>GCC now supports the Intel CPU named Alderlake through
<code>-march=alderlake</code>.
The switch enables the CLDEMOTE, PTWRITE, WAITPKG, SERIALIZE, KEYLOCKER,
AVX-VNNI, and HRESET ISA extensions.
</li>
<li>GCC now supports the Intel CPU named Rocketlake through
<code>-march=rocketlake</code>.
Rocket Lake is based on Icelake client and minus SGX.
</li>
<li>GCC now supports AMD CPUs based on the <code>znver3</code> core
via <code>-march=znver3</code>.
</li>
<li>GCC now supports micro-architecture levels defined in the x86-64 psABI
via <code>-march=x86-64-v2</code>, <code>-march=x86-64-v3</code> and
<code>-march=x86-64-v4</code>.
</li>
</ul>
<!-- <h3 id="mips">MIPS</h3> -->
<!-- <h3 id="mep">MeP</h3> -->
<!-- <h3 id="msp430">MSP430</h3> -->
<!-- <h3 id="nds32">NDS32</h3> -->
<h3 id="nios2">Nios II</h3>
<ul>
<li>The options <code>-mcustom-insn=N</code> no longer produce compiler
warnings if the custom instruction is not generated due to missing
optimization options such as <code>-fno-math-errno</code>,
<code>-ffinite-math-only</code>, or
<code>-funsafe-math-optimizations</code>. These warnings were not
consistently emitted for all custom instructions.
</li>
<li>The <code>-mcustom-fpu-cfg=fph2</code> option has been added to enable
the custom instructions supported by the <em>Nios II Floating Point
Hardware 2 Component</em>.
</li>
</ul>
<h3 id="nvptx">NVPTX</h3>
<ul>
<li>The <code>-misa</code> default has changed from <code>sm_30</code>
to <code>sm_35</code>.
</li>
<li>The <code>-m32</code> compiler switch has been removed.
</li>
<li>The <code>-msoft-stack-reserve-local</code> format has been fixed.
Previously, it accepted <code>-msoft-stack-reserve-local<n></code>.
It now accepts <code>-msoft-stack-reserve-local=<n></code>.
</li>
</ul>
<!-- <h3 id="hppa">PA-RISC</h3> -->
<!-- <h3 id="powerpc">PowerPC / PowerPC64 / RS6000</h3> -->
<h3 id="s390">S/390, System z, IBM Z Systems</h3>
<ul>
<li>The behavior when compiling with <code>-fexcess-precision=standard</code>
(e.g., implied by <code>-std=c99</code>) on s390(x) targets can now be
controlled at configure time with the flag
<code>--enable-s390-excess-float-precision</code>. When enabled, GCC will
maintain previous behavior and evaluate float expressions in double
precision, which aligns with the definition of <code>float_t</code> as
<code>double</code>. With the flag disabled, GCC will always evaluate
float expressions in single precision. In native builds and cross compiles
that have target libc headers, GCC will by default match the definition of
<code>float_t</code> in the installed glibc.
</li>
</ul>
<h3 id="riscv">RISC-V</h3>
<ul>
<li>Support address sanitizer for RISC-V.</li>
<li>Support big-endian for RISC-V, thanks to Marcus Comstedt.</li>
<li>Implement new style of architecture extension test macros,
each architecture extension has corresponding feature test macro, which
could use to test its existence and version information.
</li>
<li>Legacy architecture extension test macro like <code>__riscv_atomic</code>,
are deprecated, but it will still supported for at least 2 release cycles.
</li>
<li>Support IFUNC for <code>riscv*-*-linux*</code>.</li>
<li>Add new option -misa-spec=* to control ISA spec version, default is 2.2,
this option could control the default version of each extensions.</li>
<li>Introduce <code>--with-multilib-generator</code> to configure time option,
this option could flexible config multi-lib settings, syntax is same as
RISC-V's <code>multilib-generator</code>.
</li>
<li>Extend the sytax for <code>multilib-generator</code>, support expansion
operator <code>*</code> to reduce the complexity of complicated multi-lib
re-use rule.
</li>
<li>Support <code>-mcpu=*</code> option, the behavior is aligned to RISC-V
clang/LLVM, it will set pipeline model and architecture extension, like
<code>-mtune=*</code> plus <code>-march=*</code>.
</li>
<li>Support for TLS stack protector canary access, thanks to Cooper Qu.
</li>
<li>Support <code>__builtin_thread_pointer</code> for RISC-V.</li>
<li>Introduce <code>shorten_memrefs</code> optimization, which could reduce the
code size for memory access, thanks to Craig Blackmore.
</li>
</ul>
<!-- <h3 id="rx">RX</h3> -->
<!-- <h3 id="sh">SH</h3> -->
<!-- <h3 id="sparc">SPARC</h3> -->
<!-- <h3 id="Tile">Tile</h3> -->
<!-- .................................................................. -->
<h2 id="os">Operating Systems</h2>
<!-- <h3 id="aix">AIX</h3> -->
<h3 id="aix">AIX</h3>
<ul>
<li>GCC for AIX can be built as a 64 bit application and the runtime
is built as FAT libraries containing both 32 bit and 64 bit objects.</li>
<li>Support AIX Vector Extended ABI with -mabi=vec-extabi.</li>
<li>Thread-Local uninitiated data placed in local common section.</li>
<li>Use thread-safe access in ctype.</li>
<li>Link with libc128.a when long-double-128 enabled.</li>
</ul>
<!-- <h3 id="fuchsia">Fuchsia</h3> -->
<!-- <h3 id="dragonfly">DragonFly BSD</h3> -->
<!-- <h3 id="freebsd">FreeBSD</h3> -->
<!-- <h3 id="gnulinux">GNU/Linux</h3> -->
<!-- <h3 id="rtems">RTEMS</h3> -->
<!-- <h3 id="solaris">Solaris</h3> -->
<!-- <h3 id="vxmils">VxWorks MILS</h3> -->
<!-- <h3 id="windows">Windows</h3> -->
<!-- .................................................................. -->
<!-- <h2>Documentation improvements</h2> -->
<!-- .................................................................. -->
<h2 id="analyzer">Improvements to Static Analyzer</h2>
<ul>
<li>The implementation of how program state is tracked within
<a href="https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Static-Analyzer-Options.html">-fanalyzer</a>
has been completely rewritten for GCC 11, fixing numerous bugs, and
allowing for the analyzer to scale to larger C source files.
</li>
<li>The analysis of allocations and deallocations has been generalized
beyond <code>malloc</code> and <code>free</code>.
<ul>
<li>As preliminary work towards eventually supporting C++, the
<code>malloc</code>/<code>free</code> checking will also
check <code>new</code>/<code>delete</code>
and <code>new[]</code>/<code>delete[]</code>.
However, C++ is not yet properly supported by
<a href="https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Static-Analyzer-Options.html"><code>-fanalyzer</code></a>
(for example, exception-handling is unimplemented).
</li>
<li>As noted above, the existing
<a href="https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Common-Function-Attributes.html#index-malloc-function-attribute"><code>malloc</code></a>
attribute has been extended so that it can be used to identify
allocator/deallocator API pairs. The analyzer will use these
attributes when checking for leaks, double-frees, use-after-frees, and
similar issues.
</li>
<li>A new
<a href="https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Static-Analyzer-Options.html#index-Wanalyzer-mismatching-deallocation"><code>-Wanalyzer-mismatching-deallocation</code></a>
warning has been added, covering such mismatches as using
scalar <code>delete</code> rather vector <code>delete[]</code>.
</ul>
</li>
<li>The analyzer has gained warnings
<a href="https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Static-Analyzer-Options.html#index-Wanalyzer-shift-count-negative"><code>-Wanalyzer-shift-count-negative</code></a>,
<a href="https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Static-Analyzer-Options.html#index-Wanalyzer-shift-count-overflow"><code>-Wanalyzer-shift-count-overflow</code></a>,
<a href="https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Static-Analyzer-Options.html#index-Wanalyzer-write-to-const"><code>-Wanalyzer-write-to-const</code></a>, and
<a href="https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Static-Analyzer-Options.html#index-Wanalyzer-write-to-string-literal"><code>-Wanalyzer-write-to-string-literal</code></a>,
all enabled by default when
<a href="https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Static-Analyzer-Options.html"><code>-fanalyzer</code></a>
is enabled.
</li>
<li>The analyzer can now be extended by GCC plugins, allowing for
domain-specific path-sensitive warnings. An example of using a
<a href="https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=66dde7bc64b75d4a338266333c9c490b12d49825">GCC plugin to check for misuses of CPython's global interpreter lock</a>
can be seen in the test suite</li>
<li>The analyzer has gained new debugging options
<a href="https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Static-Analyzer-Options.html#index-fdump-analyzer-json"><code>-fdump-analyzer-json</code></a> and
<a href="https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Static-Analyzer-Options.html#index-fno-analyzer-feasibility"><code>-fno-analyzer-feasibility</code></a>.
</li>
</ul>
<!-- .................................................................. -->
<!-- <h2 id="plugins">Improvements for plugin authors</h2> -->
<!-- .................................................................. -->
<h2>Other significant improvements</h2>
<ul>
<li>GCC has gained a new environment variable
<a href="https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Environment-Variables.html#index-GCC_005fEXTRA_005fDIAGNOSTIC_005fOUTPUT"><code>GCC_EXTRA_DIAGNOSTIC_OUTPUT</code></a>
which can be used by IDEs to request machine-readable fix-it hints
without needing to adjust build flags.
</li>
</ul>
<!-- .................................................................. -->
<h2><a name="11.1">GCC 11.1</a></h2>
<p>This is the <a href="https://gcc.gnu.org/bugzilla/buglist.cgi?bug_status=RESOLVED&resolution=FIXED&target_milestone=11.0">list
of problem reports (PRs)</a> from GCC's bug tracking system that are
known to be fixed in the 11.1 release. This list might not be
complete (that is, it is possible that some PRs that have been fixed
are not listed here).</p>
<!-- .................................................................. -->
</body>
</html>