mirror of
https://github.com/autc04/Retro68.git
synced 2024-10-13 18:23:53 +00:00
22770 lines
1.0 MiB
22770 lines
1.0 MiB
This file contains information about GCC releases which has been generated
|
||
automatically from the online release notes. It covers releases of GCC
|
||
(and the former EGCS project) since EGCS 1.0, on the line of development
|
||
that led to GCC 3. For information on GCC 2.8.1 and older releases of GCC 2,
|
||
see ONEWS.
|
||
|
||
======================================================================
|
||
http://gcc.gnu.org/gcc-12/index.html
|
||
|
||
GCC 12 Release Series
|
||
|
||
Aug 19, 2022
|
||
|
||
The GCC developers are pleased to announce the release of GCC 12.2.
|
||
|
||
This release is a bug-fix release, containing fixes for regressions in
|
||
GCC 12.1 relative to previous releases of GCC.
|
||
|
||
Release History
|
||
|
||
GCC 12.2
|
||
Aug 19, 2022 ([1]changes, [2]documentation)
|
||
|
||
GCC 12.1
|
||
May 6, 2022 ([3]changes, [4]documentation)
|
||
|
||
References and Acknowledgements
|
||
|
||
GCC used to stand for the GNU C Compiler, but since the compiler
|
||
supports several other languages aside from C, it now stands for the
|
||
GNU Compiler Collection.
|
||
|
||
A list of [5]successful builds is updated as new information becomes
|
||
available.
|
||
|
||
The GCC developers would like to thank the numerous people that have
|
||
contributed new features, improvements, bug fixes, and other changes as
|
||
well as test results to GCC. This [6]amazing group of volunteers is
|
||
what makes GCC successful.
|
||
|
||
For additional information about GCC please refer to the [7]GCC project
|
||
web site or contact the [8]GCC development mailing list.
|
||
|
||
To obtain GCC please use [9]our mirror sites or [10]our version control
|
||
system.
|
||
|
||
|
||
For questions related to the use of GCC, please consult these web
|
||
pages and the [11]GCC manuals. If that fails, the
|
||
[12]gcc-help@gcc.gnu.org mailing list might help. Comments on these
|
||
web pages and the development of GCC are welcome on our developer
|
||
list at [13]gcc@gcc.gnu.org. All of [14]our lists have public
|
||
archives.
|
||
|
||
Copyright (C) [15]Free Software Foundation, Inc. Verbatim copying and
|
||
distribution of this entire article is permitted in any medium,
|
||
provided this notice is preserved.
|
||
|
||
These pages are [16]maintained by the GCC team. Last modified
|
||
2022-08-19[17].
|
||
|
||
References
|
||
|
||
1. http://gcc.gnu.org/gcc-12/changes.html
|
||
2. http://gcc.gnu.org/onlinedocs/12.2.0/
|
||
3. http://gcc.gnu.org/gcc-12/changes.html
|
||
4. http://gcc.gnu.org/onlinedocs/12.1.0/
|
||
5. http://gcc.gnu.org/gcc-12/buildstat.html
|
||
6. http://gcc.gnu.org/onlinedocs/gcc-12.1.0/gcc/Contributors.html
|
||
7. http://gcc.gnu.org/index.html
|
||
8. mailto:gcc@gcc.gnu.org
|
||
9. http://gcc.gnu.org/mirrors.html
|
||
10. http://gcc.gnu.org/git.html
|
||
11. https://gcc.gnu.org/onlinedocs/
|
||
12. mailto:gcc-help@gcc.gnu.org
|
||
13. mailto:gcc@gcc.gnu.org
|
||
14. https://gcc.gnu.org/lists.html
|
||
15. https://www.fsf.org/
|
||
16. https://gcc.gnu.org/about.html
|
||
17. http://validator.w3.org/check/referer
|
||
======================================================================
|
||
http://gcc.gnu.org/gcc-12/changes.html
|
||
|
||
GCC 12 Release Series
|
||
Changes, New Features, and Fixes
|
||
|
||
This page is a "brief" summary of some of the huge number of
|
||
improvements in GCC 12. You may also want to check out our [1]Porting
|
||
to GCC 12 page and the [2]full GCC documentation.
|
||
|
||
Caveats
|
||
|
||
* An ABI incompatibility between C and C++ when passing or returning
|
||
by value certain aggregates containing zero width bit-fields has
|
||
been discovered on various targets. As mentioned in [3]PR102024,
|
||
since the [4]PR42217 fix in GCC 4.5 the C++ front-end has been
|
||
removing zero width bit-fields from the internal representation of
|
||
the aggregates after the layout of those aggregates, but the C
|
||
front-end kept them, so passing e.g. struct S { float a; int : 0;
|
||
float b; } or struct T { float c; int : 0; } by value could differ
|
||
between C and C++. Starting with GCC 12 the C++ front-end no longer
|
||
removes those bit-fields from the internal representation and per
|
||
clarified psABI some targets have been changed, so that they either
|
||
ignore those bit-fields in the argument passing by value decisions
|
||
in both C and C++, or they always take them into account. x86-64,
|
||
ARM and AArch64 will always ignore them (so there is a C ABI
|
||
incompatibility between GCC 11 and earlier with GCC 12 or later),
|
||
PowerPC64 ELFv2 and S/390 always take them into account (so there
|
||
is a C++ ABI incompatibility, GCC 4.4 and earlier compatible with
|
||
GCC 12 or later, incompatible with GCC 4.5 through GCC 11). RISC-V
|
||
has changed the handling of these already starting with GCC 10. As
|
||
the ABI requires, MIPS takes them into account handling function
|
||
return values so there is a C++ ABI incompatibility with GCC 4.5
|
||
through 11. For function arguments on MIPS, refer to [5]the MIPS
|
||
specific entry. GCC 12 on the above targets will report such
|
||
incompatibilities as warnings or other diagnostics unless
|
||
-Wno-psabi is used.
|
||
* C: Computed gotos require a pointer type now.
|
||
* C++: Two non-standard std::pair constructors have been deprecated.
|
||
These allowed the use of an rvalue and a literal 0 to construct a
|
||
pair containing a move-only type and a pointer. The nullptr keyword
|
||
should be used to initialize the pointer member instead of a
|
||
literal 0, as this is portable to other C++ implementations.
|
||
* The configuration option --enable-libstdcxx-allocator no longer
|
||
supports the bitmap, mt, and pool arguments. Those configurations
|
||
had been broken for some time.
|
||
* Fortran: OpenMP code using the omp_lib.h include file can no longer
|
||
be compiled with -std=f95 but now requires at least -std=f2003.
|
||
Alternatively, use the omp_lib module, which still supports
|
||
-std=f95 and is recommended to be used instead in general.
|
||
* OpenMP offloading to Intel MIC has been deprecated and will be
|
||
removed in a future release.
|
||
* The cr16 target with the cr16-*-* configuration has been obsoleted
|
||
and will be removed in a future release.
|
||
* The hppa[12]*-*-hpux10* and hppa[12]*-*-hpux11* configurations
|
||
targeting 32-bit PA-RISC with HP-UX have been obsoleted and will be
|
||
removed in a future release.
|
||
* The m32c*-*-rtems* configuration has been obsoleted and will be
|
||
removed in a future release.
|
||
* The support for the m32r-*-linux*, m32rle-*-linux*,
|
||
m68k*-*-openbsd* and vax-*-openbsd* configurations has been
|
||
removed.
|
||
* STABS: Support for emitting the STABS debugging format is
|
||
deprecated and will be removed in the next release. All ports now
|
||
default to emit DWARF (version 2 or later) debugging info or are
|
||
obsoleted.
|
||
* The optimization level -Ofast now implies
|
||
-fno-semantic-interposition.
|
||
|
||
General Improvements
|
||
|
||
* Vectorization is enabled at -O2 which is now equivalent to the
|
||
original -O2 -ftree-vectorize -fvect-cost-model=very-cheap. Note
|
||
that default vectorizer cost model has been changed which used to
|
||
behave as -fvect-cost-model=cheap were specified.
|
||
* GCC now supports the [6]ShadowCallStack sanitizer, which can be
|
||
enabled using the command-line option
|
||
[7]-fsanitize=shadow-call-stack. This sanitizer currently only
|
||
works on AArch64 targets and it requires an environment in which
|
||
all code has been compiled with -ffixed-r18. Its primary initial
|
||
user is the Linux kernel.
|
||
|
||
New Languages and Language specific improvements
|
||
|
||
* OpenMP
|
||
+ OpenMP 5.0 support has been extended: The close map modifier
|
||
and the affinity clause are now supported. In addition Fortran
|
||
gained additionally the following features which were
|
||
available in C and C++ before: declare variant is now
|
||
available, depobj, mutexinoutset and iterator can now also be
|
||
used with the depend clause, defaultmap has been updated for
|
||
OpenMP 5.0, and the loop directive and combined directives
|
||
involving the master directive have been added.
|
||
+ The following OpenMP 5.1 features have been added: support for
|
||
expressing OpenMP directives as C++ 11 attributes, the masked
|
||
and scope construct, the nothing and error directives, and
|
||
using primary with the proc_bind clause and OMP_PROC_BIND
|
||
environment variable, the reproducible and unconstrained
|
||
modifiers to the order clause, and, for C/C++ only, the align
|
||
and allocator modifiers to the allocate clause and the atomic
|
||
extensions are now available. The OMP_PLACE environment
|
||
variable supports the OpenMP 5.1 features. In addition the
|
||
OMP_NUM_TEAMS and OMP_TEAMS_THREAD_LIMIT environment variables
|
||
and their associated API routines are now supported as well as
|
||
the memory-allocation routines added for Fortran and extended
|
||
for C/C++ in OpenMP 5.1. In Fortran code, strictly structured
|
||
blocks can be used.
|
||
+ The [8]OpenMP Implementation Status can be found in the
|
||
libgomp manual.
|
||
* Version 2.6 of the [9]OpenACC specification continues to be
|
||
maintained and improved in the C, C++ and Fortran compilers. See
|
||
the [10]implementation status section on the OpenACC wiki page and
|
||
the [11]run-time library documentation for further information. In
|
||
addition to general performance tuning and bug fixing, new features
|
||
include:
|
||
+ OpenACC worker parallelism for [12]AMD GPUs (already for a
|
||
long time supported for [13]Nvidia GPUs).
|
||
+ Data privatization/sharing at the OpenACC gang level.
|
||
+ Considerable improvements for the experimental OpenACC
|
||
'kernels' decomposition ([14]--param
|
||
openacc-kernels=decompose).
|
||
+ A new warning flag [15]-Wopenacc-parallelism to warn about
|
||
potentially suboptimal choices related to OpenACC parallelism.
|
||
* The offload target code generation for OpenMP and OpenACC can now
|
||
be better adjusted using the new [16]-foffload-options= flag and
|
||
the pre-existing but now documented [17]-foffload= flag.
|
||
|
||
Ada
|
||
|
||
* Ada 2022
|
||
+ Added the -gnat2022 flag to indicate strict Ada 2022
|
||
compliance. The old -gnat2020 flag is now deprecated.
|
||
+ Support for Big Numbers (Annex G) has seen continuous
|
||
improvements. It is now considered complete. It is compatible
|
||
with SPARK, i.e. can be used from SPARK code.
|
||
+ Continuous improvements to the Ada 2022 standard since GCC 11.
|
||
+ Greatly improved compile time support. More functions can now
|
||
have the with Static aspect and can be used in more contexts.
|
||
* Ada 2022 extensions. The use of the -gnatX flag is necessary to
|
||
access these features as they are not considered stable or
|
||
standard.
|
||
+ Fixed lower bound for unconstrained arrays.
|
||
o type Matrix is array (Natural range 0 .. <>, Natural
|
||
range 0 .. <>) of Integer; is now valid.
|
||
o Subtypes can also specify a lower bound: subtype String_1
|
||
is String (1 .. <>);. Boundaries from slices will "slide"
|
||
to the correct lower bound of the subtype.
|
||
+ Generalized Object.Operand notation. The follwing code is now
|
||
valid V.Add_Element(42);, with V being a vector, for example.
|
||
+ Additional when constructs. Keywords return, goto and raise
|
||
can now use when in addition to the existing exit when. The
|
||
following expression is therefore now valid raise
|
||
Constraint_Error with "Element is null" when Element = null;
|
||
+ Pattern matching
|
||
o The case statement has been extended to cover records and
|
||
arrays as well as finer grained casing on scalar types.
|
||
In the future it is expected to provide more compile time
|
||
guarantees when accessing discriminated fields. Case
|
||
exhaustion is supported for pattern matching. An example
|
||
would be
|
||
type Sign is (Neg, Zero, Pos);
|
||
|
||
function Multiply (S1, S2 : Sign) return Sign is
|
||
(case (S1, S2) is
|
||
when (Neg, Neg) | (Pos, Pos) => Pos,
|
||
when (Zero, <>) | (<>, Zero) => Zero,
|
||
when (Neg, Pos) | (Pos, Neg) => Neg);
|
||
|
||
* gnatfind and gnatxref, which were already deprecated, have been
|
||
removed.
|
||
* Greatly expanded code covered by contracts. Thanks to this work,
|
||
there are now several Ada standard libraries fully proven in SPARK
|
||
which means they have no runtime nor logical errors. They are
|
||
mostly numeric and string handling libraries.
|
||
* Enable return-slot optimization for Pure functions.
|
||
* General optimizations, improvements and additions to the standard
|
||
library. Performance, correctness and in some cases stability was
|
||
improved. Memory pools have also seen some minor enhancements.
|
||
* Improvements to embedded-RTOS targets such as RTEMS, VxWorks and
|
||
QNX. Older targets were removed or cleaned.
|
||
* Added some [18]hardening features.
|
||
|
||
C family
|
||
|
||
* Support for __builtin_shufflevector compatible with the clang
|
||
language extension was added.
|
||
* Support for attribute unavailable was added.
|
||
* A new built-in function, __builtin_assoc_barrier, was added. It can
|
||
be used to inhibit re-association of floating-point expressions.
|
||
* Support for __builtin_dynamic_object_size compatible with the clang
|
||
language extension was added.
|
||
* New warnings:
|
||
+ [19]-Wbidi-chars warns about potentially misleading UTF-8
|
||
bidirectional control characters. The default is
|
||
-Wbidi-chars=unpaired ([20]PR103026)
|
||
+ [21]-Warray-compare warns about comparisons between two
|
||
operands of array type ([22]PR97573)
|
||
* Enhancements to existing warnings:
|
||
+ [23]-Wattributes has been extended so that it's possible to
|
||
use -Wno-attributes=ns::attr or -Wno-attributes=ns:: to
|
||
suppress warnings about unknown scoped attributes (in C++11
|
||
and C2X). Similarly, #pragma GCC diagnostic ignored_attributes
|
||
"vendor::attr" can be used to achieve the same effect
|
||
([24]PR101940)
|
||
|
||
C
|
||
|
||
* Some new features from the upcoming C2X revision of the ISO C
|
||
standard are supported with -std=c2x and -std=gnu2x. 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
|
||
-std=c2x -Wpedantic.
|
||
+ Digit separators (as in C++) are supported for C2X.
|
||
+ The #elifdef and #elifndef preprocessing directives are now
|
||
supported.
|
||
+ The printf and scanf format checking with [25]-Wformat now
|
||
supports the %b format specified by C2X for binary integers,
|
||
and the %B format recommended by C2X for printf.
|
||
|
||
C++
|
||
|
||
* Several C++23 features have been implemented:
|
||
+ [26]P1938R3, if consteval ([27]PR100974)
|
||
+ [28]P0849R8, auto(x): decay-copy in the language
|
||
([29]PR103049)
|
||
+ [30]P2242R3, Non-literal variables (and labels and gotos) in
|
||
constexpr functions ([31]PR102612)
|
||
+ [32]P2334R1, Support for preprocessing directives elifdef and
|
||
elifndef ([33]PR102616)
|
||
+ [34]P2360R0, Extend init-statement to allow alias-declaration
|
||
([35]PR102617)
|
||
+ [36]P2128R6, Multidimensional subscript operator
|
||
+ [37]DR 2397, auto specifier for pointers and references to
|
||
arrays ([38]PR100975)
|
||
* Several C++ Defect Reports have been resolved, e.g.:
|
||
+ [39]DR 960, Covariant functions and lvalue/rvalue references
|
||
+ [40]DR 1227, Mixing immediate and non-immediate contexts in
|
||
deduction failure
|
||
+ [41]DR 1315, Restrictions on non-type template arguments in
|
||
partial specializations
|
||
+ [42]DR 2082, Referring to parameters in unevaluated operands
|
||
of default arguments
|
||
+ [43]DR 2351, void{}
|
||
+ [44]DR 2374, Overly permissive specification of enum
|
||
direct-list-initialization
|
||
+ [45]DR 2397, auto specifier for pointers and references to
|
||
arrays
|
||
+ [46]DR 2446, Questionable type-dependency of concept-ids
|
||
* New command-line option -fimplicit-constexpr can be used to make
|
||
inline functions implicitly constexpr ([47]git)
|
||
* New command-line option -ffold-simple-inlines can be used to fold
|
||
calls to certain trivial inline functions (currently std::move,
|
||
std::forward, std::addressof and std::as_const). In contrast to
|
||
inlining such calls, folding means that no intermediate code or
|
||
debug information will be generated for them; this minimizes the
|
||
abstraction penalty incurred for using these functions versus using
|
||
the fundamental operations from which they're defined (e.g.
|
||
std::move versus static_cast). This flag is enabled by default when
|
||
-fno-inline is not active.
|
||
* Deduction guides can be declared at class scope ([48]PR79501)
|
||
* [49]-Wuninitialized warns about using uninitialized variables in
|
||
member initializer lists ([50]PR19808)
|
||
* [51]-Wint-in-bool-context is now disabled when instantiating a
|
||
template ([52]git)
|
||
* Stricter checking of attributes on friend declarations: if a friend
|
||
declaration has an attribute, that declaration must be a
|
||
definition. Moreover, a C++11 attribute cannot appear in the middle
|
||
of the decl-specifier-seq. ([53]PR99032)
|
||
* New warning options for C++ language mismatches:
|
||
-Wc++11-extensions, -Wc++14-extensions, -Wc++17-extensions,
|
||
-Wc++20-extensions, and -Wc++23-extensions. They are enabled by
|
||
default and can be used to control existing pedwarns about
|
||
occurrences of new C++ constructs in code using an old C++ standard
|
||
dialect.
|
||
* New warning [54]-Wmissing-requires warns about missing requires
|
||
([55]git)
|
||
* The existing std::is_constant_evaluated in if warning was extended
|
||
to warn in more cases ([56]PR100995)
|
||
* [57]-Waddress has been enhanced so that it now warns about, for
|
||
instance, comparing the address of a nonstatic member function to
|
||
null ([58]PR102103)
|
||
* Errors about narrowing are no longer hidden if they occur in system
|
||
headers
|
||
* Ordered comparison of null pointers is now rejected ([59]PR99701)
|
||
* Anonymous structs with bases are now rejected ([60]git)
|
||
* The compiler rejects taking the address of an immediate member
|
||
function ([61]PR102753)
|
||
* The compiler has support for C++20
|
||
__cpp_lib_is_pointer_interconvertible and
|
||
__cpp_lib_is_layout_compatible to help the C++ library implement
|
||
[62]P0466, Layout-compatibility and Pointer-interconvertibility
|
||
Traits ([63]PR101539)
|
||
* Memory usage of constraint subsumption has been improved
|
||
([64]PR100828)
|
||
* constinit thread_local variables are optimized better
|
||
([65]PR101786)
|
||
* Support for C++17 std::hardware_destructive_interference_size was
|
||
added, along with the [66]-Winterference-size warning ([67]git)
|
||
* Many bugs in the CTAD handling have been fixed ([68]PR101344,
|
||
[69]PR101883, [70]PR89062, [71]PR101233, [72]PR88252, [73]PR86439,
|
||
[74]PR98832, [75]PR102933 ...)
|
||
* Two-stage name lookup for dependent operator expressions has been
|
||
corrected ([76]PR51577)
|
||
* Several issues with constrained variable templates have been fixed
|
||
([77]PR98486)
|
||
* The compiler performs less instantiating when doing speculative
|
||
constant evaluation ([78]git)
|
||
* Various diagnostic improvements; e.g., a more precise caret
|
||
location for pointer-to-member expressions
|
||
* The new -fconstexpr-fp-except flag allows IEC559 floating point
|
||
exceptions in constant-expressions.
|
||
|
||
Runtime Library (libstdc++)
|
||
|
||
* Improved experimental C++20 support, including:
|
||
+ std::vector, std::basic_string, std::optional, and
|
||
std::variant can be used in constexpr functions.
|
||
+ std::make_shared for arrays with default initialization, and
|
||
std::atomic<std::shared_ptr<T>>.
|
||
+ Layout-compatibility and pointer-interconvertibility traits.
|
||
* Improved experimental C++23 support, including:
|
||
+ Monadic operations for std::optional.
|
||
+ std::move_only_function
|
||
+ <spanstream>
|
||
+ std::basic_string::resize_and_overwrite
|
||
+ std::unique_ptr can be used in constexpr functions.
|
||
+ <stacktrace> (not built by default, requires linking to an
|
||
extra library).
|
||
+ <stdatomic.h>
|
||
+ std::invoke_r
|
||
+ constexpr std::type_info::operator==
|
||
|
||
Fortran
|
||
|
||
* WG5/N1942, "TS 29113 Further Interoperability of Fortran with C",
|
||
is now fully supported. In addition to implementing previously
|
||
missing functionality, such as support for character arguments of
|
||
length greater than one in functions marked bind(c) and gaps in the
|
||
handling for assumed-rank arrays, numerous other bugs have been
|
||
fixed, and an extensive set of new conformance test cases has been
|
||
added.
|
||
* GCC 12 now uses OPERATION as the name of the function to the
|
||
CO_REDUCE intrinsic for the pairwise reduction, thus conforming to
|
||
the Fortran 2018 standard. Previous versions used OPERATOR which
|
||
conforms to TS 18508.
|
||
* On POWER systems which support it, the -mabi=ieeelongdouble option
|
||
now selects the IEEE 128-bit floating point format for
|
||
REAL(KIND=16). R16_IBM and R16_IEEE have been added to the
|
||
-fconvert option, the CONVERT specifyer of the OPEN statement and
|
||
the GFORTRAN_CONVERT_UNIT environment variable.
|
||
|
||
libgccjit
|
||
|
||
* The libgccjit API gained 30 new entry points:
|
||
+ 17 new "reflection" entrypoints for querying functions and
|
||
types ([79]LIBGCCJIT_ABI_16)
|
||
+ [80]gcc_jit_lvalue_set_tls_model for supporting thread-local
|
||
variables ([81]LIBGCCJIT_ABI_17)
|
||
+ [82]gcc_jit_lvalue_set_link_section for setting the link
|
||
section of global variables, analogous to
|
||
[83]__attribute__((section(".section")))
|
||
([84]LIBGCCJIT_ABI_18)
|
||
+ 4 new entrypoints for initializing global variables and
|
||
creating constructors for rvalues ([85]LIBGCCJIT_ABI_19)
|
||
+ Support for sized integer types, including 128-bit integers
|
||
and helper functions for such types ([86]LIBGCCJIT_ABI_20)
|
||
+ [87]gcc_jit_context_new_bitcast for reinterpreting the bits of
|
||
an rvalue as a different type ([88]LIBGCCJIT_ABI_21)
|
||
+ [89]gcc_jit_lvalue_set_register_name for setting a specific
|
||
register for a variable ([90]LIBGCCJIT_ABI_22)
|
||
+ [91]gcc_jit_context_set_bool_print_errors_to_stderr
|
||
([92]LIBGCCJIT_ABI_23)
|
||
+ 2 new entrypoints for setting the alignment of a variable
|
||
([93]LIBGCCJIT_ABI_24)
|
||
* libgccjit has gained support for the use of various atomic builtins
|
||
([94]PR96066, [95]PR96067)
|
||
* [96]gcc_jit_context_new_cast is now able to handle truncation and
|
||
extension between different integer types ([97]PR95498)
|
||
|
||
New Targets and Target Specific Improvements
|
||
|
||
AArch64 & arm
|
||
|
||
* Newer revisions of the Arm Architecture are supported as arguments
|
||
to the -march option: armv8.7-a, armv8.8-a, armv9-a.
|
||
* The Arm Cortex-A510 CPU is now supported through the cortex-a510
|
||
argument to the -mcpu and -mtune options.
|
||
* GCC can now auto-vectorize operations performing sign-differing
|
||
dot-product operations, taking advantage of instructions in the
|
||
Advanced SIMD (AArch64/AArch32) and SVE (AArch64) instruction sets.
|
||
|
||
AArch64
|
||
|
||
* A number of new CPUs are supported through the -mcpu and -mtune
|
||
options (GCC identifiers in parentheses).
|
||
+ Ampere-1 (ampere1).
|
||
+ Arm Cortex-A710 (cortex-a710).
|
||
+ Arm Cortex-X2 (cortex-x2).
|
||
* The 64-byte atomic load/store intrinsics to accelerator memory from
|
||
the [98]2020 Arm Architecture extensions are supported through the
|
||
+ls64 option extension.
|
||
* Initial code generation support is supported for hardware
|
||
instructions used to accelerate the memcpy,memmove and memset
|
||
standard functions. These instructions can be generated when
|
||
compiling with the +mopsoption extension.
|
||
* The ACLE Advanced SIMD intrinsics accessible through the arm_neon.h
|
||
header have been significantly reimplemented and generate
|
||
higher-performing code than previous GCC versions.
|
||
* The option -mtune=neoverse-512tvb is added to tune for Arm Neoverse
|
||
cores that have a total vector bandwidth of 512 bits. Please refer
|
||
to the documentation for more details.
|
||
|
||
AMD Radeon (GCN)
|
||
|
||
* Debug experience with ROCGDB has been improved.
|
||
* Support for the type __int128_t/integer(kind=16) was added.
|
||
* For offloading, the limitation of using only one wavefront per
|
||
compute unit (CU) has been lifted. Up to 40 workgroups per CU and
|
||
16 wavefronts per workgroup are supported (up to a limit of 40
|
||
wavefronts in total, per CU). Additionally, the number of used
|
||
wavefronts and workgroups was tuned for performance.
|
||
|
||
arm
|
||
|
||
* Support is added for accessing the stack canary value via the TLS
|
||
register through the -fstack-protector-guard=tls and
|
||
-mstack-protector-guard-offset= options. This intended for use in
|
||
Linux kernel development. Please refer to the documentation for
|
||
more details.
|
||
|
||
BPF
|
||
|
||
* Support for CO-RE (compile-once, run-everywhere) has been added to
|
||
the BPF backend. CO-RE allows to compile portable BPF programs that
|
||
are able to run among different versions of the Linux kernel.
|
||
|
||
IA-32/x86-64
|
||
|
||
* New ISA extension support for Intel AVX512-FP16 was added.
|
||
AVX512FP16 intrinsics are available via the -mavx512fp16 compiler
|
||
switch.
|
||
* For both C and C++ the _Float16 type is supported on x86 systems
|
||
with SSE2 enabled. Without {-mavx512fp16}, all operations will be
|
||
emulated in software and float instructions.
|
||
* Mitigation against straight line speculation (SLS) for function
|
||
return and indirect jump is supported via
|
||
-mharden-sls=[none|all|return|indirect-jmp].
|
||
* Add CS prefix to call and jmp to indirect thunk with branch target
|
||
in r8-r15 registers via -mindirect-branch-cs-prefix.
|
||
* Always use global offset table (GOT) to access external data and
|
||
function symbols when the new -mno-direct-extern-access
|
||
command-line option is specified.
|
||
|
||
LoongArch
|
||
|
||
* Support for the LoongArch architecture instruction set has been
|
||
added.
|
||
* The Loongson CPU codename LA464 and LoongArch 64-bit generic CPU
|
||
codename loongarch64 are supported through the -march= and -mtune=
|
||
options (GCC identifiers in parentheses).
|
||
+ Loongson LA464 core (la464).
|
||
+ LoongArch 64-bit generic core (loongarch64).
|
||
|
||
MIPS
|
||
|
||
* The ABI passing arguments containing zero-width fields (for
|
||
example, C/C++ zero-width bit-fields, GNU C/C++ zero-length arrays,
|
||
and GNU C empty structs) has changed. Now a zero-width field will
|
||
not prevent an aligned 64-bit floating-point field next to it from
|
||
being passed through FPR. This is compatible with LLVM, but
|
||
incompatible with previous GCC releases. GCC 12 on MIPS will report
|
||
such incompatibilities as an inform unless -Wno-psabi is used.
|
||
* The ABI returning values containing C++17 empty bases has changed.
|
||
Now an empty base will not prevent an aggregate containing only one
|
||
or two floating-point fields from being returned through FPR. This
|
||
is compatible with GCC 6 and earlier, but incompatible with GCC 7
|
||
through 11. GCC 12 on MIPS will report such incompatibilities as an
|
||
inform unless -Wno-psabi is used.
|
||
|
||
NVPTX
|
||
|
||
* The -march flag has been added. The -misa flag is now considered an
|
||
alias of the -march flag.
|
||
* Support for PTX ISA target architectures sm_53, sm_70, sm_75 and
|
||
sm_80 has been added. These can be specified using the -march flag.
|
||
* The default PTX ISA target architecture has been set back to sm_30,
|
||
to fix support for sm_30 boards.
|
||
* The -march-map flag has been added. The -march-map value will be
|
||
mapped to an valid -march flag value. For instance,
|
||
-march-map=sm_50 maps to -march=sm_35. This can be used to specify
|
||
that generated code is to be executed on a board with at least some
|
||
specific compute capability, without having to know the valid
|
||
values for the -march flag.
|
||
* The -mptx flag has been added to specify the PTX ISA version for
|
||
the generated code; permitted values are 3.1 (matches previous GCC
|
||
versions), 6.0, 6.3, and 7.0. If not specified, the used version is
|
||
the minimal version required for -march but at least 6.0.
|
||
* An mptx-3.1 multilib was added. This allows using older drivers
|
||
which do not support PTX ISA version 6.0.
|
||
* The new __PTX_SM__ predefined macro allows code to check the PTX
|
||
ISA target architecture being targeted by the compiler.
|
||
* The new __PTX_ISA_VERSION_MAJOR__ and __PTX_ISA_VERSION_MINOR__
|
||
predefined macros allows code to check the PTX ISA version being
|
||
targeted by the compiler.
|
||
|
||
PowerPC / PowerPC64 / RS6000
|
||
|
||
* The internal implementation of Power's target-specific built-in
|
||
functions has been rewritten to be easier and less error-prone to
|
||
maintain. Every attempt has been made to ensure that the new
|
||
behavior matches the old behavior, but inevitably some bugs can be
|
||
expected. Please report any problems via [99]GCC Bugzilla.
|
||
* The built-in functions __builtin_get_texasr, __builtin_get_texasru,
|
||
__builtin_get_tfhar, __builtin_get_tfiar, __builtin_set_texasr,
|
||
__builtin_set_texasru, __builtin_set_tfhar, and __builtin_set_tfiar
|
||
now behave as documented in all supported configurations. On prior
|
||
releases, the arguments and return values of these functions were
|
||
treated as unsigned long long instead of as unsigned long, when the
|
||
options -m32 -mpowerpc64 were in effect.
|
||
* The overloaded built-in functions vec_cntlz_lsbb and vec_cnttz_lsbb
|
||
now behave as documented. On prior releases, these built-in
|
||
functions had incorrect semantics on little-endian targets.
|
||
|
||
PRU
|
||
|
||
* The [100]__regio_symbol variable qualifier has been added. It
|
||
allows easier access in C programs to the __R30 and __R31 CPU I/O
|
||
registers.
|
||
|
||
RISC-V
|
||
|
||
* Default ISA spec version was bump to 20191213, more detail see this
|
||
[101]announcement
|
||
* New ISA extension support for zba, zbb, zbc, zbs was added.
|
||
* New ISA extension support for vector and scalar crypto was added,
|
||
only support architecture testing marco and -march= parsing.
|
||
* The option -mtune=thead-c906 is added to tune for T-HEAD c906
|
||
cores.
|
||
* libstdc++ no longer attempts to detect built-in atomics.
|
||
Distributions that have out-of-tree workarounds for -latomic should
|
||
check their ABIs again.
|
||
|
||
Operating Systems
|
||
|
||
Improvements to Static Analyzer
|
||
|
||
* The analyzer has gained a
|
||
[102]-Wanalyzer-use-of-uninitialized-value warning, similar to
|
||
[103]-Wuninitialized and [104]-Wmaybe-uninitialized, but based on
|
||
an interprocedural path-sensitive analysis ([105]PR95006).
|
||
Such warnings are not disabled by the new
|
||
[106]-ftrivial-auto-var-init (see below), as the latter is
|
||
considered a mitigation option.
|
||
* [107]-Wanalyzer-write-to-const and
|
||
[108]-Wanalyzer-write-to-string-literal will now check for
|
||
[109]__attribute__ ((access, ....)) on calls to externally-defined
|
||
functions, and complain about read-only regions pointed to by
|
||
arguments marked with a write_only or read_write attribute
|
||
([110]PR104793).
|
||
* The analyzer's "taint" mode, activated by
|
||
[111]-fanalyzer-checker=taint (in addition to [112]-fanalyzer), has
|
||
gained four new taint-based warnings:
|
||
+ [113]-Wanalyzer-tainted-allocation-size for e.g.
|
||
attacker-controlled malloc and alloca,
|
||
+ [114]-Wanalyzer-tainted-divisor for detecting where an
|
||
attacker can inject a divide-by-zero,
|
||
+ [115]-Wanalyzer-tainted-offset for attacker-controlled pointer
|
||
offsets,
|
||
+ [116]-Wanalyzer-tainted-size for attacker-controlled values
|
||
being used as a size parameter to calls to memset or to
|
||
functions marked with [117]__attribute__ ((access, ....)).
|
||
The existing [118]-Wanalyzer-tainted-array-index has been reworded
|
||
to talk about "attacker-controlled" rather than "tainted" values,
|
||
for consistency with the new warnings.
|
||
A new [119]__attribute__ ((tainted_args)) has been added to the C
|
||
and C++ frontends, usable on functions, and on function pointer
|
||
callback fields in structs. The analyzer's taint mode will treat
|
||
all parameters and buffers pointed to by parameters of such
|
||
functions as being attacked-controlled, such as for annotating
|
||
system calls in an operating system kernel as being an "attack
|
||
surface".
|
||
* The analyzer now respects [120]__attribute__((const)): it will
|
||
treat such functions as returning the same value when given the
|
||
same inputs ([121]PR104434), and as having no side effects
|
||
([122]PR104576).
|
||
* The analyzer is now able to split its analysis into multiple
|
||
execution paths in places where there isn't a split in the control
|
||
flow graph. For example, it now handles realloc calls by splitting
|
||
the execution path into three possible outcomes for the call:
|
||
+ failure, returning NULL
|
||
+ success, growing the buffer in-place without moving it
|
||
+ success, allocating a new buffer, copying the content of the
|
||
old buffer to it, and freeing the old buffer
|
||
* The analyzer's interprocedural path exploration logic is now able
|
||
to track calls through function pointers.
|
||
* The analyzer now makes the assumption that if we know PTR is
|
||
non-NULL, then (PTR + OFFSET) is also non-NULL. This isn't strictly
|
||
true, but eliminates false positives in practice ([123]PR101962).
|
||
* The analyzer has gained some initial support for inline assembler
|
||
code. This is extremely limited, and is purely to help suppress
|
||
false positives when analyzing the Linux kernel, which makes heavy
|
||
use of inline assembler ([124]PR101570).
|
||
* The way the analyzer tracks the state of memory along an execution
|
||
path has been improved in various ways for GCC 12:
|
||
+ An optimization for representing bulk updates to memory (e.g.
|
||
zero fills) has been removed as it never worked well. In GCC
|
||
12 it has been replaced with a simpler and more accurate
|
||
approach, eliminating many false positives ([125]PR95006).
|
||
+ Various optimizations have been added, speeding up the
|
||
analysis on a particularly problematic source file from 4
|
||
minutes down to 17 seconds ([126]PR104943, [127]PR104954, and
|
||
[128]PR104955).
|
||
+ The analyzer now tracks the sizes of dynamically-allocated
|
||
regions, both on the heap (via malloc etc) and stack (via
|
||
alloca), though none of the analyzer warnings make use of this
|
||
yet in GCC 12.
|
||
* The analyzer's handling of switch statements has been rewritten,
|
||
fixing various bugs.
|
||
|
||
Other significant improvements
|
||
|
||
Eliminating uninitialized variables
|
||
|
||
* GCC can now [129]initialize all stack variables implicitly,
|
||
including padding. This is intended to eliminate all classes of
|
||
uninitialized stack variable flaws. Lack of explicit initialization
|
||
will still warn when [130]-Wuninitialized is active. For best
|
||
debugging, use of the new command-line option
|
||
[131]-ftrivial-auto-var-init=pattern can be used to fill variables
|
||
with a repeated 0xFE pattern, which tends to illuminate many bugs
|
||
(e.g. pointers receive invalid addresses, sizes and indices are
|
||
very large). For best production results, the new command-line
|
||
option [132]-ftrivial-auto-var-init=zero can be used to fill
|
||
variables with 0x00, which tends to provide a safer state for bugs
|
||
(e.g. pointers are NULL, strings are NUL filled, and sizes and
|
||
indices are 0).
|
||
|
||
Debugging formats
|
||
|
||
* GCC can now generate debugging information in [133]CTF, a
|
||
lightweight debugging format that provides information about C
|
||
types and the association between functions and data symbols and
|
||
types. This format is designed to be embedded in ELF files and to
|
||
be very compact and simple. A new command-line option -gctf enables
|
||
the generation of CTF.
|
||
* GCC can now generate debugging information in BTF. This is a
|
||
debugging format mainly used in BPF programs and the Linux kernel.
|
||
The compiler can generate BTF for any target, when enabled with the
|
||
command-line option -gbtf
|
||
|
||
GCC 12.1
|
||
|
||
This is the [134]list of problem reports (PRs) from GCC's bug tracking
|
||
system that are known to be fixed in the 12.1 release. This list might
|
||
not be complete (that is, it is possible that some PRs that have been
|
||
fixed are not listed here).
|
||
|
||
GCC 12.2
|
||
|
||
This is the [135]list of problem reports (PRs) from GCC's bug tracking
|
||
system that are known to be fixed in the 12.2 release. This list might
|
||
not be complete (that is, it is possible that some PRs that have been
|
||
fixed are not listed here).
|
||
|
||
Target Specific Changes
|
||
|
||
LoongArch
|
||
|
||
* The default setting of -m[check|no-check]-zero-division is changed
|
||
for optimized code. Now -mno-check-zero-division is the default for
|
||
all optimization levels but -O0 and -Og. The old behavior can be
|
||
obtained by explicitly passing -mcheck-zero-division to GCC.
|
||
|
||
GCC 12.3
|
||
|
||
Note: GCC 12.3 has not been released yet, so this section is a
|
||
work-in-progress.
|
||
|
||
This is the [136]list of problem reports (PRs) from GCC's bug tracking
|
||
system that are known to be fixed in the 12.3 release. This list might
|
||
not be complete (that is, it is possible that some PRs that have been
|
||
fixed are not listed here).
|
||
|
||
|
||
For questions related to the use of GCC, please consult these web
|
||
pages and the [137]GCC manuals. If that fails, the
|
||
[138]gcc-help@gcc.gnu.org mailing list might help. Comments on these
|
||
web pages and the development of GCC are welcome on our developer
|
||
list at [139]gcc@gcc.gnu.org. All of [140]our lists have public
|
||
archives.
|
||
|
||
Copyright (C) [141]Free Software Foundation, Inc. Verbatim copying and
|
||
distribution of this entire article is permitted in any medium,
|
||
provided this notice is preserved.
|
||
|
||
These pages are [142]maintained by the GCC team. Last modified
|
||
2022-08-19[143].
|
||
|
||
References
|
||
|
||
1. http://gcc.gnu.org/gcc-12/porting_to.html
|
||
2. http://gcc.gnu.org/onlinedocs/index.html#current
|
||
3. https://gcc.gnu.org/PR102024
|
||
4. https://gcc.gnu.org/PR42217
|
||
5. http://gcc.gnu.org/gcc-12/changes.html#mips_zero_width_fields
|
||
6. https://clang.llvm.org/docs/ShadowCallStack.html
|
||
7. https://gcc.gnu.org/onlinedocs/gcc-12.1.0/gcc/Instrumentation-Options.html#index-fsanitize_003dshadow-call-stack
|
||
8. https://gcc.gnu.org/onlinedocs/gcc-12.1.0/libgomp/OpenMP-Implementation-Status.html
|
||
9. https://www.openacc.org/
|
||
10. https://gcc.gnu.org/wiki/OpenACC/Implementation%20Status#status-12
|
||
11. https://gcc.gnu.org/onlinedocs/gcc-12.1.0/libgomp/Enabling-OpenACC.html
|
||
12. http://gcc.gnu.org/gcc-12/changes.html#amdgcn
|
||
13. http://gcc.gnu.org/gcc-12/changes.html#nvptx
|
||
14. https://gcc.gnu.org/onlinedocs/gcc-12.1.0/gcc/Optimize-Options.html#index-param
|
||
15. https://gcc.gnu.org/onlinedocs/gcc-12.1.0/gcc/Warning-Options.html#index-Wopenacc-parallelism
|
||
16. https://gcc.gnu.org/onlinedocs/gcc-12.1.0/gcc/C-Dialect-Options.html#index-foffload-options
|
||
17. https://gcc.gnu.org/onlinedocs/gcc-12.1.0/gcc/C-Dialect-Options.html#index-foffload
|
||
18. https://gcc.gnu.org/onlinedocs/gcc-12.1.0/gnat_rm/Security-Hardening-Features.html#Security-Hardening-Features
|
||
19. https://gcc.gnu.org/onlinedocs/gcc-12.1.0/gcc/Warning-Options.html#index-Wbidi-chars
|
||
20. https://gcc.gnu.org/PR103026
|
||
21. https://gcc.gnu.org/onlinedocs/gcc-12.1.0/gcc/Warning-Options.html#index-Warray-compare
|
||
22. https://gcc.gnu.org/PR97573
|
||
23. https://gcc.gnu.org/onlinedocs/gcc-12.1.0/gcc/Warning-Options.html#index-Wattributes
|
||
24. https://gcc.gnu.org/PR101940
|
||
25. https://gcc.gnu.org/onlinedocs/gcc-12.1.0/gcc/Warning-Options.html#index-Wformat
|
||
26. https://wg21.link/p1938
|
||
27. https://gcc.gnu.org/PR100974
|
||
28. https://wg21.link/p0849
|
||
29. https://gcc.gnu.org/PR103049
|
||
30. https://wg21.link/p2242
|
||
31. https://gcc.gnu.org/PR102612
|
||
32. https://wg21.link/p2334
|
||
33. https://gcc.gnu.org/PR102616
|
||
34. https://wg21.link/p2360
|
||
35. https://gcc.gnu.org/PR102617
|
||
36. https://wg21.link/p2128
|
||
37. https://wg21.link/cwg2397
|
||
38. https://gcc.gnu.org/PR100975
|
||
39. https://wg21.link/cwg960
|
||
40. https://wg21.link/cwg1227
|
||
41. https://wg21.link/cwg1315
|
||
42. https://wg21.link/cwg2082
|
||
43. https://wg21.link/cwg2351
|
||
44. https://wg21.link/cwg2374
|
||
45. https://wg21.link/cwg2397
|
||
46. https://wg21.link/cwg2446
|
||
47. https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=87c2080b
|
||
48. https://gcc.gnu.org/PR79501
|
||
49. https://gcc.gnu.org/onlinedocs/gcc-12.1.0/gcc/Warning-Options.html#index-Wuninitialized
|
||
50. https://gcc.gnu.org/PR19808
|
||
51. https://gcc.gnu.org/onlinedocs/gcc-12.1.0/gcc/Warning-Options.html#index-Wint-in-bool-context
|
||
52. https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=3a2b12bc
|
||
53. https://gcc.gnu.org/PR99032
|
||
54. https://gcc.gnu.org/onlinedocs/gcc-12.1.0/gcc/Warning-Options.html#index-Wmissing-requires
|
||
55. https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=e18e56c7
|
||
56. https://gcc.gnu.org/PR100995
|
||
57. https://gcc.gnu.org/onlinedocs/gcc-12.1.0/gcc/Warning-Options.html#index-Waddress
|
||
58. https://gcc.gnu.org/PR102103
|
||
59. https://gcc.gnu.org/PR99701
|
||
60. https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=3ead06c1
|
||
61. https://gcc.gnu.org/PR102753
|
||
62. https://wg21.link/p0466
|
||
63. https://gcc.gnu.org/PR101539
|
||
64. https://gcc.gnu.org/PR100828
|
||
65. https://gcc.gnu.org/PR101786
|
||
66. https://gcc.gnu.org/onlinedocs/gcc-12.1.0/gcc/Warning-Options.html#index-Winterference-size
|
||
67. https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=76b75018
|
||
68. https://gcc.gnu.org/PR101344
|
||
69. https://gcc.gnu.org/PR101883
|
||
70. https://gcc.gnu.org/PR89062
|
||
71. https://gcc.gnu.org/PR101233
|
||
72. https://gcc.gnu.org/PR88252
|
||
73. https://gcc.gnu.org/PR86439
|
||
74. https://gcc.gnu.org/PR98832
|
||
75. https://gcc.gnu.org/PR102933
|
||
76. https://gcc.gnu.org/PR51577
|
||
77. https://gcc.gnu.org/PR98486
|
||
78. https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=1595fe44
|
||
79. https://gcc.gnu.org/onlinedocs/gcc-12.1.0/jit/topics/compatibility.html#libgccjit-abi-16
|
||
80. https://gcc.gnu.org/onlinedocs/gcc-12.1.0/jit/topics/expressions.html#c.gcc_jit_lvalue_set_tls_model
|
||
81. https://gcc.gnu.org/onlinedocs/gcc-12.1.0/jit/topics/compatibility.html#libgccjit-abi-17
|
||
82. https://gcc.gnu.org/onlinedocs/gcc-12.1.0/jit/topics/expressions.html#c.gcc_jit_lvalue_set_link_section
|
||
83. https://gcc.gnu.org/onlinedocs/gcc-12.1.0/gcc/Common-Variable-Attributes.html#index-section-variable-attribute
|
||
84. https://gcc.gnu.org/onlinedocs/gcc-12.1.0/jit/topics/compatibility.html#libgccjit-abi-18
|
||
85. https://gcc.gnu.org/onlinedocs/gcc-12.1.0/jit/topics/compatibility.html#libgccjit-abi-19
|
||
86. https://gcc.gnu.org/onlinedocs/gcc-12.1.0/jit/topics/compatibility.html#libgccjit-abi-20
|
||
87. https://gcc.gnu.org/onlinedocs/gcc-12.1.0/jit/topics/expressions.html#c.gcc_jit_context_new_bitcast
|
||
88. https://gcc.gnu.org/onlinedocs/gcc-12.1.0/jit/topics/compatibility.html#libgccjit-abi-21
|
||
89. https://gcc.gnu.org/onlinedocs/gcc-12.1.0/jit/topics/expressions.html#c.gcc_jit_lvalue_set_register_name
|
||
90. https://gcc.gnu.org/onlinedocs/gcc-12.1.0/jit/topics/compatibility.html#libgccjit-abi-22
|
||
91. https://gcc.gnu.org/onlinedocs/gcc-12.1.0/jit/topics/contexts.html#c.gcc_jit_context_set_bool_print_errors_to_stderr
|
||
92. https://gcc.gnu.org/onlinedocs/gcc-12.1.0/jit/topics/compatibility.html#libgccjit-abi-23
|
||
93. https://gcc.gnu.org/onlinedocs/gcc-12.1.0/jit/topics/compatibility.html#libgccjit-abi-24
|
||
94. https://gcc.gnu.org/PR96066
|
||
95. https://gcc.gnu.org/PR96067
|
||
96. https://gcc.gnu.org/onlinedocs/gcc-12.1.0/jit/topics/expressions.html#c.gcc_jit_context_new_cast
|
||
97. https://gcc.gnu.org/PR95498
|
||
98. https://community.arm.com/arm-community-blogs/b/architectures-and-processors-blog/posts/arm-a-profile-architecture-developments-2020
|
||
99. https://gcc.gnu.org/bugzilla/
|
||
100. https://gcc.gnu.org/onlinedocs/gcc-12.1.0/gcc/Named-Address-Spaces.html#PRU-Named-Address-Spaces
|
||
101. https://groups.google.com/a/groups.riscv.org/g/sw-dev/c/aE1ZeHHCYf4
|
||
102. https://gcc.gnu.org/onlinedocs/gcc-12.1.0/gcc/Static-Analyzer-Options.html#index-Wanalyzer-use-of-uninitialized-value
|
||
103. https://gcc.gnu.org/onlinedocs/gcc-12.1.0/gcc/Warning-Options.html#index-Wuninitialized
|
||
104. https://gcc.gnu.org/onlinedocs/gcc-12.1.0/gcc/Warning-Options.html#index-Wmaybe-uninitialized
|
||
105. https://gcc.gnu.org/PR95006
|
||
106. https://gcc.gnu.org/onlinedocs/gcc-12.1.0/gcc/Optimize-Options.html#index-ftrivial-auto-var-init
|
||
107. https://gcc.gnu.org/onlinedocs/gcc-12.1.0/gcc/Static-Analyzer-Options.html#index-Wanalyzer-write-to-const
|
||
108. https://gcc.gnu.org/onlinedocs/gcc-12.1.0/gcc/Static-Analyzer-Options.html#index-Wanalyzer-write-to-string-literal
|
||
109. https://gcc.gnu.org/onlinedocs/gcc-12.1.0/gcc/Common-Function-Attributes.html
|
||
110. https://gcc.gnu.org/PR104793
|
||
111. https://gcc.gnu.org/onlinedocs/gcc-12.1.0/gcc/Static-Analyzer-Options.html#index-fanalyzer-checker
|
||
112. https://gcc.gnu.org/onlinedocs/gcc-12.1.0/gcc/Static-Analyzer-Options.html#index-fanalyzer
|
||
113. https://gcc.gnu.org/onlinedocs/gcc-12.1.0/gcc/Static-Analyzer-Options.html#index-Wanalyzer-tainted-allocation-size
|
||
114. https://gcc.gnu.org/onlinedocs/gcc-12.1.0/gcc/Static-Analyzer-Options.html#index-Wanalyzer-tainted-divisor
|
||
115. https://gcc.gnu.org/onlinedocs/gcc-12.1.0/gcc/Static-Analyzer-Options.html#index-Wanalyzer-tainted-offset
|
||
116. https://gcc.gnu.org/onlinedocs/gcc-12.1.0/gcc/Static-Analyzer-Options.html#index-Wanalyzer-tainted-size
|
||
117. https://gcc.gnu.org/onlinedocs/gcc-12.1.0/gcc/Common-Function-Attributes.html
|
||
118. https://gcc.gnu.org/onlinedocs/gcc-12.1.0/gcc/Static-Analyzer-Options.html#index-Wanalyzer-tainted-array-index
|
||
119. https://gcc.gnu.org/onlinedocs/gcc-12.1.0/gcc/Common-Function-Attributes.html#index-tainted_005fargs-function-attribute
|
||
120. https://gcc.gnu.org/onlinedocs/gcc-12.1.0/gcc/Common-Function-Attributes.html#index-const-function-attribute
|
||
121. https://gcc.gnu.org/PR104434
|
||
122. https://gcc.gnu.org/PR104576
|
||
123. https://gcc.gnu.org/PR101962
|
||
124. https://gcc.gnu.org/PR101570
|
||
125. https://gcc.gnu.org/PR95006
|
||
126. https://gcc.gnu.org/PR104943
|
||
127. https://gcc.gnu.org/PR104954
|
||
128. https://gcc.gnu.org/PR104955
|
||
129. https://gcc.gnu.org/onlinedocs/gcc-12.1.0/gcc/Optimize-Options.html#index-ftrivial-auto-var-init
|
||
130. https://gcc.gnu.org/onlinedocs/gcc-12.1.0/gcc/Warning-Options.html#index-Wuninitialized
|
||
131. https://gcc.gnu.org/onlinedocs/gcc-12.1.0/gcc/Optimize-Options.html#index-ftrivial-auto-var-init
|
||
132. https://gcc.gnu.org/onlinedocs/gcc-12.1.0/gcc/Optimize-Options.html#index-ftrivial-auto-var-init
|
||
133. https://ctfstd.org/
|
||
134. https://gcc.gnu.org/bugzilla/buglist.cgi?bug_status=RESOLVED&resolution=FIXED&target_milestone=12.0
|
||
135. https://gcc.gnu.org/bugzilla/buglist.cgi?bug_status=RESOLVED&resolution=FIXED&target_milestone=12.2
|
||
136. https://gcc.gnu.org/bugzilla/buglist.cgi?bug_status=RESOLVED&resolution=FIXED&target_milestone=12.3
|
||
137. https://gcc.gnu.org/onlinedocs/
|
||
138. mailto:gcc-help@gcc.gnu.org
|
||
139. mailto:gcc@gcc.gnu.org
|
||
140. https://gcc.gnu.org/lists.html
|
||
141. https://www.fsf.org/
|
||
142. https://gcc.gnu.org/about.html
|
||
143. http://validator.w3.org/check/referer
|
||
======================================================================
|
||
http://gcc.gnu.org/gcc-11/index.html
|
||
|
||
GCC 11 Release Series
|
||
|
||
April 21, 2022
|
||
|
||
The GCC developers are pleased to announce the release of GCC 11.3.
|
||
|
||
This release is a bug-fix release, containing fixes for regressions in
|
||
GCC 11.2 relative to previous releases of GCC.
|
||
|
||
Release History
|
||
|
||
GCC 11.3
|
||
April 21, 2022 ([1]changes, [2]documentation)
|
||
|
||
GCC 11.2
|
||
July 28, 2021 ([3]changes, [4]documentation)
|
||
|
||
GCC 11.1
|
||
April 27, 2021 ([5]changes, [6]documentation)
|
||
|
||
References and Acknowledgements
|
||
|
||
GCC used to stand for the GNU C Compiler, but since the compiler
|
||
supports several other languages aside from C, it now stands for the
|
||
GNU Compiler Collection.
|
||
|
||
A list of [7]successful builds is updated as new information becomes
|
||
available.
|
||
|
||
The GCC developers would like to thank the numerous people that have
|
||
contributed new features, improvements, bug fixes, and other changes as
|
||
well as test results to GCC. This [8]amazing group of volunteers is
|
||
what makes GCC successful.
|
||
|
||
For additional information about GCC please refer to the [9]GCC project
|
||
web site or contact the [10]GCC development mailing list.
|
||
|
||
To obtain GCC please use [11]our mirror sites or [12]our version
|
||
control system.
|
||
|
||
|
||
For questions related to the use of GCC, please consult these web
|
||
pages and the [13]GCC manuals. If that fails, the
|
||
[14]gcc-help@gcc.gnu.org mailing list might help. Comments on these
|
||
web pages and the development of GCC are welcome on our developer
|
||
list at [15]gcc@gcc.gnu.org. All of [16]our lists have public
|
||
archives.
|
||
|
||
Copyright (C) [17]Free Software Foundation, Inc. Verbatim copying and
|
||
distribution of this entire article is permitted in any medium,
|
||
provided this notice is preserved.
|
||
|
||
These pages are [18]maintained by the GCC team. Last modified
|
||
2022-04-21[19].
|
||
|
||
References
|
||
|
||
1. http://gcc.gnu.org/gcc-11/changes.html
|
||
2. http://gcc.gnu.org/onlinedocs/11.3.0/
|
||
3. http://gcc.gnu.org/gcc-11/changes.html
|
||
4. http://gcc.gnu.org/onlinedocs/11.2.0/
|
||
5. http://gcc.gnu.org/gcc-11/changes.html
|
||
6. http://gcc.gnu.org/onlinedocs/11.1.0/
|
||
7. http://gcc.gnu.org/gcc-11/buildstat.html
|
||
8. http://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Contributors.html
|
||
9. http://gcc.gnu.org/index.html
|
||
10. mailto:gcc@gcc.gnu.org
|
||
11. http://gcc.gnu.org/mirrors.html
|
||
12. http://gcc.gnu.org/git.html
|
||
13. https://gcc.gnu.org/onlinedocs/
|
||
14. mailto:gcc-help@gcc.gnu.org
|
||
15. mailto:gcc@gcc.gnu.org
|
||
16. https://gcc.gnu.org/lists.html
|
||
17. https://www.fsf.org/
|
||
18. https://gcc.gnu.org/about.html
|
||
19. http://validator.w3.org/check/referer
|
||
======================================================================
|
||
http://gcc.gnu.org/gcc-11/changes.html
|
||
|
||
GCC 11 Release Series
|
||
Changes, New Features, and Fixes
|
||
|
||
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 [1]Porting
|
||
to GCC 11 page and the [2]full GCC documentation.
|
||
|
||
Caveats
|
||
|
||
* The default mode for C++ is now -std=gnu++17 instead of
|
||
-std=gnu++14. Note that [3]C++17 changes to template template
|
||
parameter matching can be disabled independently of other features
|
||
with -fno-new-ttp-matching.
|
||
* 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.
|
||
* 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 -dumpbase, -dumpdir,
|
||
-save-temps=*, 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 [4]the patch, particularly
|
||
its textual description, for more details about the changes.
|
||
* -gsplit-dwarf no longer enables debug info generation on its own
|
||
but requires a separate -g for this.
|
||
* The libstdc++ configure option --enable-cheaders=c_std is
|
||
deprecated and will be removed in a future release. It should be
|
||
possible to use --enable-cheaders=c_global (the default) with no
|
||
change in behaviour.
|
||
* 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.
|
||
* Some short options of the gcov tool have been renamed: -i to -j and
|
||
-j to -H.
|
||
|
||
General Improvements
|
||
|
||
* [5]ThreadSanitizer improvements to support alternative runtimes and
|
||
environments. The [6]Linux Kernel Concurrency Sanitizer (KCSAN) is
|
||
now supported.
|
||
+ Add --param tsan-distinguish-volatile to optionally emit
|
||
instrumentation distinguishing volatile accesses.
|
||
+ Add --param tsan-instrument-func-entry-exit to optionally
|
||
control if function entries and exits should be instrumented.
|
||
* 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:
|
||
+ multibyte characters (requiring more than one byte to encode),
|
||
and
|
||
+ multicolumn characters (requiring more than one column to
|
||
display in a monospace font)
|
||
For example, the character p ("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.
|
||
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 [7]-fdiagnostics-column-unit=byte.
|
||
There is also a new option [8]-fdiagnostics-column-origin=,
|
||
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 [9]-fdiagnostics-format=json has been extended to
|
||
supply both byte counts and column numbers for all source
|
||
locations.
|
||
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 [10]-ftabstop option (which defaults to 8 spaces
|
||
per tab stop).
|
||
* Introduce [11]Hardware-assisted AddressSanitizer support. This
|
||
sanitizer currently only works for the AArch64 target. It helps
|
||
debug address problems similarly to [12]AddressSanitizer but is
|
||
based on partial hardware assistance and provides probabilistic
|
||
protection to use less RAM at run time. [13]Hardware-assisted
|
||
AddressSanitizer is not production-ready for user space, and is
|
||
provided mainly for use compiling the Linux Kernel.
|
||
To use this sanitizer the command line arguments are:
|
||
+ -fsanitize=hwaddress to instrument userspace code.
|
||
+ -fsanitize=kernel-hwaddress to instrument kernel code.
|
||
* For targets that produce DWARF debugging information GCC now
|
||
defaults to [14]DWARF version 5 (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.
|
||
To take full advantage of DWARF version 5 GCC needs to be built
|
||
against binutils version 2.35.2 or higher. When GCC is built
|
||
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 -gdwarf-5).
|
||
The following debug information consumers can process DWARF version
|
||
5:
|
||
+ GDB 8.0, or higher
|
||
+ valgrind 3.17.0
|
||
+ elfutils 0.172, or higher (for use with systemtap,
|
||
dwarves/pahole, perf and libabigail)
|
||
+ dwz 0.14
|
||
Programs embedding libbacktrace are urged to upgrade to the version
|
||
shipping with GCC 11.
|
||
To make GCC 11 generate an older DWARF version use -g together with
|
||
-gdwarf-2, -gdwarf-3 or -gdwarf-4.
|
||
* Vectorizer improvements:
|
||
+ The straight-line code vectorizer now considers the whole
|
||
function when vectorizing and can handle opportunities
|
||
crossing CFG merges and backedges.
|
||
* 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:
|
||
int IsHTMLWhitespace(int aChar) {
|
||
return aChar == 0x0009 || aChar == 0x000A ||
|
||
aChar == 0x000C || aChar == 0x000D ||
|
||
aChar == 0x0020;
|
||
}
|
||
|
||
This statement can be transformed into a switch statement and then
|
||
expanded into a bit-test.
|
||
* New command-line options:
|
||
+ [15]-fbit-tests, enabled by default, can be used to enable or
|
||
disable switch expansion using bit-tests.
|
||
* Inter-procedural optimization improvements:
|
||
+ 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 [16]-fipa-modref option.
|
||
+ The identical code folding pass (controlled by [17]-fipa-icf)
|
||
was significantly improved to increase the number of unified
|
||
functions and to reduce compile-time memory use.
|
||
+ 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.
|
||
* Link-time optimization improvements:
|
||
+ The LTO bytecode format was optimized for smaller object files
|
||
and faster streaming.
|
||
+ Memory allocation of the linking stage was improved to reduce
|
||
peak memory use.
|
||
* Profile driven optimization improvements:
|
||
+ Using [18]-fprofile-values, was improved by tracking more
|
||
target values for e.g. indirect calls.
|
||
+ GCOV data file format outputs smaller files by representing
|
||
zero counters in a more compact way.
|
||
|
||
New Languages and Language specific improvements
|
||
|
||
* GCC 11 adds support for non-rectangular loop nests in OpenMP
|
||
constructs and the allocator routines of [19]OpenMP 5.0, including
|
||
initial allocate clause support in C/C++. The OMP_TARGET_OFFLOAD
|
||
environment variable and the active-levels routines are now
|
||
supported. For C/C++, the declare variant and map 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++: order(concurrent),
|
||
device_type, memorder-clauses for flush, lastprivate with
|
||
conditional modifier, atomic construct and reduction clause
|
||
extensions of OpenMP 5.0, if clause with simd and cancel modifiers,
|
||
target data without map clause, and limited support for the
|
||
requires construct.
|
||
* Version 2.6 of the [20]OpenACC specification continues to be
|
||
maintained and improved in the C, C++ and Fortran compilers. See
|
||
the [21]implementation status section on the OpenACC wiki page and
|
||
the [22]run-time library documentation for further information.
|
||
|
||
C family
|
||
|
||
* New attributes:
|
||
+ The [23]no_stack_protector attribute has been added to mark
|
||
functions which should not be instrumented with stack
|
||
protection (-fstack-protector).
|
||
+ The existing [24]malloc attribute has been extended so that it
|
||
can be used to identify allocator/deallocator API pairs. A
|
||
pair of new [25]-Wmismatched-dealloc and
|
||
[26]-Wmismatched-new-delete warnings will complain about
|
||
mismatched calls, and [27]-Wfree-nonheap-object 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.
|
||
* New warnings:
|
||
+ [28]-Wmismatched-dealloc, enabled by default, warns about
|
||
calls to deallocation functions with pointers returned from
|
||
mismatched allocation functions.
|
||
+ [29]-Wsizeof-array-div, enabled by -Wall, 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.
|
||
+ [30]-Wstringop-overread, 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 -Wstringop-overflow.
|
||
+ [31]-Wtsan, enabled by default, warns about unsupported
|
||
features in ThreadSanitizer (currently
|
||
std::atomic_thread_fence).
|
||
* Enhancements to existing warnings:
|
||
+ [32]-Wfree-nonheap-object detects many more instances of calls
|
||
to deallocation functions with pointers not returned from a
|
||
dynamic memory allocation function.
|
||
+ [33]-Wmaybe-uninitialized diagnoses passing pointers or
|
||
references to uninitialized memory to functions taking
|
||
const-qualified arguments.
|
||
+ [34]-Wuninitialized detects reads from uninitialized
|
||
dynamically allocated memory.
|
||
* For ELF targets that support the GNU or FreeBSD OSABIs, the used
|
||
attribute will now save the symbol declaration it is applied to
|
||
from linker garbage collection.
|
||
To support this behavior, used symbols that have not been placed in
|
||
specific sections (e.g. with the section attribute, or the
|
||
-f{function,data}-sections options) will be placed in new, unique
|
||
sections.
|
||
This functionality requires Binutils version 2.36 or later.
|
||
|
||
C
|
||
|
||
* Several new features from the upcoming C2X revision of the ISO C
|
||
standard are supported with -std=c2x and -std=gnu2x. 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
|
||
-std=c2x -Wpedantic.
|
||
+ The BOOL_MAX and BOOL_WIDTH macros are provided in <limits.h>.
|
||
+ As in C++, function definitions no longer need to give names
|
||
for unused function parameters.
|
||
+ The expansions of the true and false macros in <stdbool.h>
|
||
have changed so that they have type bool.
|
||
+ The [[nodiscard]] standard attribute is now supported.
|
||
+ The __has_c_attribute preprocessor operator is now supported.
|
||
+ Macros INFINITY, NAN, FLT_SNAN, DBL_SNAN, LDBL_SNAN,
|
||
DEC_INFINITY, DEC_NAN, and corresponding signaling NaN macros
|
||
for _FloatN, _FloatNx and _DecimalN types, are provided in
|
||
<float.h>. There are also corresponding built-in functions
|
||
__builtin_nansdN for decimal signaling NaNs.
|
||
+ Macros FLT_IS_IEC_60559, DBL_IS_IEC_60559 and
|
||
LDBL_IS_IEC_60559 are provided in <float.h>.
|
||
+ The feature test macro __STDC_WANT_IEC_60559_EXT__ is
|
||
supported by <float.h>.
|
||
+ Labels may appear before declarations and at the end of a
|
||
compound statement.
|
||
* New warnings:
|
||
+ [35]-Warray-parameter, enabled by -Wall, 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.
|
||
+ [36]-Wvla-parameter, enabled by -Wall, 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.
|
||
|
||
C++
|
||
|
||
* The default mode has been changed to -std=gnu++17.
|
||
* Several C++20 features have been implemented:
|
||
+ the compiler now supports consteval virtual functions
|
||
+ P2082R1, Fixing CTAD for aggregates
|
||
+ P0593R6, Pseudo-destructors end object lifetimes
|
||
+ P1907R1, Inconsistencies with non-type template parameters
|
||
(complete implementation)
|
||
+ P1975R0, Fixing the wording of parenthesized
|
||
aggregate-initialization
|
||
+ P1009R2, Array size deduction in new-expressions
|
||
+ P1099R5, using enum
|
||
+ Modules, Requires -fmodules-ts and some aspects are
|
||
incomplete. Refer to [37]C++ 20 Status
|
||
* The C++ front end has experimental support for some of the upcoming
|
||
C++23 draft features with the -std=c++23, -std=gnu++23, -std=c++2b
|
||
or -std=gnu++2b flags, including
|
||
+ P0330R8, Literal Suffix for (signed) size_t.
|
||
For a full list of new features, see [38]the C++ status page.
|
||
* Several C++ Defect Reports have been resolved, e.g.:
|
||
+ DR 625, Use of auto as a template-argument
|
||
+ DR 1512, Pointer comparison vs qualification conversions
|
||
+ DR 1722, Should lambda to function pointer conversion function
|
||
be noexcept?
|
||
+ DR 1914, Duplicate standard attributes
|
||
+ DR 2032, Default template-arguments of variable templates
|
||
+ DR 2289, Uniqueness of decomposition declaration names
|
||
+ DR 2237, Can a template-id name a constructor?
|
||
+ DR 2303, Partial ordering and recursive variadic inheritance
|
||
+ DR 2369, Ordering between constraints and substitution
|
||
+ DR 2450, braced-init-list as a template-argument
|
||
* G++ now performs better access checking in templates ([39]PR41437).
|
||
* reinterpret_casts in constexpr evaluation are now checked more
|
||
completely ([40]PR95307).
|
||
* The diagnostic for static_assert 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 ([41]PR97518).
|
||
* New warnings:
|
||
+ [42]-Wctad-maybe-unsupported, disabled by default, warns about
|
||
performing class template argument deduction on a type with no
|
||
deduction guides.
|
||
+ [43]-Wrange-loop-construct, enabled by -Wall, warns when a
|
||
range-based for-loop is creating unnecessary and expensive
|
||
copies.
|
||
+ [44]-Wdeprecated-enum-enum-conversion, enabled by default in
|
||
C++20, warns about deprecated arithmetic conversions on
|
||
operands of enumeration types, as outlined in
|
||
[depr.arith.conv.enum].
|
||
+ [45]-Wdeprecated-enum-float-conversion, 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 [depr.arith.conv.enum].
|
||
+ [46]-Wmismatched-new-delete, enabled by -Wall, warns about
|
||
calls to C++ operator delete with pointers returned from
|
||
mismatched forms of operator new or from other mismatched
|
||
allocation functions.
|
||
+ [47]-Wvexing-parse, 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.
|
||
* Enhancements to existing warnings:
|
||
+ [48]-Wnonnull considers the implicit this argument of every
|
||
C++ nonstatic member function to have been implicitly declared
|
||
with attribute nonnull and triggers warnings for calls where
|
||
the pointer is null.
|
||
|
||
Runtime Library (libstdc++)
|
||
|
||
* Improved C++17 support, including:
|
||
+ std::from_chars and std::to_chars for floating-point types.
|
||
* Improved experimental C++20 support, including:
|
||
+ Calendar additions to <chrono>. Thanks to Cassio Neri for
|
||
optimizations.
|
||
+ std::bit_cast
|
||
+ std::source_location
|
||
+ Atomic wait and notify operations.
|
||
+ <barrier>, <latch>, and <semaphore>
|
||
+ <syncstream>
|
||
+ Efficient access to basic_stringbuf's buffer.
|
||
+ Heterogeneous lookup in unordered containers.
|
||
* Experimental C++23 support, including:
|
||
+ contains member functions for strings, thanks to Paul Fee.
|
||
+ std::to_underlying, std::is_scoped_enum
|
||
* Experimental support for Data-Parallel Types (simd) from the
|
||
Parallelism 2 TS, thanks to Matthias Kretz.
|
||
* Faster std::uniform_int_distribution, thanks to Daniel Lemire.
|
||
|
||
D
|
||
|
||
* New features:
|
||
+ A new bottom type typeof(*null) has been added to represent
|
||
run-time errors and non-terminating functions. This also
|
||
introduces a new standard alias for the type named noreturn,
|
||
and is implicitly imported into every module.
|
||
+ Printf-like and scanf-like functions are now detected by
|
||
prefixing them with pragma(printf) for printf-like functions
|
||
or pragma(scanf) for scanf-like functions.
|
||
+ The __traits() expression now supports the extensions
|
||
isDeprecated, isDisabled, isFuture, isModule, isPackage,
|
||
child, isReturnOnStack, isZeroInit, getTargetInfo,
|
||
getLocation, hasPostblit, isCopyable, getVisibility, and
|
||
totype.
|
||
+ An expression-based contract syntax has been added to the
|
||
language.
|
||
+ Function literals can now return a value by reference with the
|
||
ref keyword.
|
||
+ A new syntax is available to declare aliases to function types
|
||
using the alias syntax based on the assignment operator.
|
||
+ New types __c_complex_float, __c_complex_double,
|
||
__c_complex_real, and __c_wchar_t have been added for
|
||
interfacing with C and C++ code, and are available from the
|
||
core.stdc.config module.
|
||
+ User-defined attributes can now be used to annotate enum
|
||
members, alias declarations, and function parameters.
|
||
+ Templates alias parameters can now be instantiated with basic
|
||
types such as int or void function().
|
||
+ The mixin construct can now be used as types in the form
|
||
mixin(string) var.
|
||
+ The mixin construct can now take an argument list, same as
|
||
pragma(msg).
|
||
* New intrinsics:
|
||
+ Bitwise rotate intrinsics core.bitop.rol and core.bitop.ror
|
||
have been added.
|
||
+ Byte swap intrinsic core.bitop.byteswap for swapping bytes in
|
||
a 2-byte ushort has been added.
|
||
+ Math intrinsics available from core.math now have overloads
|
||
for float and double types.
|
||
+ Volatile intrinsics core.volatile.volatileLoad and
|
||
core.volatile.volatileStore have been moved from the
|
||
core.bitop module.
|
||
* New attributes:
|
||
+ The following GCC attributes are now recognized and available
|
||
from the gcc.attributes module with short-hand aliases for
|
||
convenience:
|
||
o @attribute("alloc_size", arguments) or
|
||
@alloc_size(arguments).
|
||
o @attribute("always_inline") or @always_inline.
|
||
o @attribute("used") or @used.
|
||
o @attribute("optimize", arguments) or
|
||
@optimize(arguments).
|
||
o @attribute("cold") or @cold.
|
||
o @attribute("noplt") or @noplt.
|
||
o @attribute("target_clones", arguments) or
|
||
@target_clones(arguments).
|
||
o @attribute("no_icf") or @no_icf.
|
||
o @attribute("noipa") or @noipa.
|
||
o @attribute("symver", arguments) or @symver(arguments).
|
||
+ New aliases have been added to gcc.attributes for
|
||
compatibility with ldc.attributes.
|
||
o The @allocSize(arguments) attribute is the same as
|
||
@alloc_size(arguments), but uses a 0-based index for
|
||
function arguments.
|
||
o The @assumeUsed attribute is an alias for
|
||
@attribute("used").
|
||
o The @fastmath attribute is an alias for
|
||
@optimize("Ofast").
|
||
o The @naked attribute is an alias for @attribute("naked").
|
||
This attribute may not be available on all targets.
|
||
o The @restrict attribute has been added to specify that a
|
||
function parameter is to be restrict-qualified in the C99
|
||
sense of the term.
|
||
o The @optStrategy(strategy) attribute is an alias for
|
||
@optimize("O0") when the strategy is "none", otherwise
|
||
@optimize("Os") for the "optsize" and "minsize"
|
||
strategies.
|
||
o The @polly attribute is an alias for
|
||
@optimize("loop-parallelize-all").
|
||
o The @section(name) attribute is an alias for
|
||
@attribute("section", name).
|
||
o The @target(arguments) attribute is an alias for
|
||
attribute("target", arguments).
|
||
o The @weak attribute is an alias for @attribute("weak").
|
||
* New language options:
|
||
+ -fweak-templates, added to control whether declarations that
|
||
can be defined in multiple objects should be emitted as weak
|
||
symbols. The default is to emit all symbols with extern
|
||
linkage as weak, unless the target lacks support for weak
|
||
symbols.
|
||
+ -Wdeprecated, this option is now enabled by default.
|
||
+ -Wextra, this option now turns on all warnings that are not
|
||
part of the core D language front-end - -Waddress,
|
||
-Wcast-result, -Wunknown-pragmas.
|
||
+ -Wvarargs, added to turn on warnings about questionable usage
|
||
of the va_start intrinsic.
|
||
* Deprecated and removed features:
|
||
+ Compiler-recognized attributes are now made available from the
|
||
gcc.attributes module, the former module gcc.attribute has
|
||
been deprecated and will be removed in a future release.
|
||
+ The @attribute("alias") attribute has been removed, as it had
|
||
been superseded by pragma(mangle).
|
||
+ The @attribute("forceinline") attribute has been removed and
|
||
renamed to @always_inline.
|
||
+ __vector types that are not supported in hardware are now
|
||
rejected at compile-time. Previously all vector types were
|
||
accepted by the compiler and emulated when target support was
|
||
absent.
|
||
+ The extern(Pascal) linkage attribute has been removed.
|
||
+ The deprecation phase for -ftransition=import and
|
||
-ftransition=checkimports is finished. These switches no
|
||
longer have an effect and are now removed. Symbols that are
|
||
not visible in a particular scope will no longer be found by
|
||
the compiler.
|
||
+ It is now an error to use private variables selectively
|
||
imported from other modules. Due to a bug, some imported
|
||
private members were visible from other modules, violating the
|
||
specification.
|
||
+ The -fweak compiler switch has been removed, as it existed
|
||
only for testing.
|
||
|
||
Fortran
|
||
|
||
* Added DEPRECATED to !GCC$'s attributes directive.
|
||
|
||
Go
|
||
|
||
* GCC 11 provides a complete implementation of the Go 1.16.3 user
|
||
packages.
|
||
|
||
libgccjit
|
||
|
||
* libgccjit was marked as merely "Alpha" quality when [49]originally
|
||
added in GCC 5. Given that we have maintained [50]API and ABI
|
||
compatibility since then and it is in use by various projects, we
|
||
have removed that caveat.
|
||
* libgccjit can now be built for MinGW
|
||
* The libgccjit API gained 10 new entry points:
|
||
+ [51]gcc_jit_global_set_initializer
|
||
+ 9 entrypoints for [52]directly embedding asm statements into a
|
||
compile, analogous to inline asm in the C front end
|
||
|
||
New Targets and Target Specific Improvements
|
||
|
||
AArch64 & arm
|
||
|
||
* A number of new CPUs are supported through arguments to the -mcpu
|
||
and -mtune options in both the arm and aarch64 backends (GCC
|
||
identifiers in parentheses):
|
||
+ Arm Cortex-A78 (cortex-a78).
|
||
+ Arm Cortex-A78AE (cortex-a78ae).
|
||
+ Arm Cortex-A78C (cortex-a78c).
|
||
+ Arm Cortex-X1 (cortex-x1).
|
||
+ Arm Neoverse V1 (neoverse-v1).
|
||
+ Arm Neoverse N2 (neoverse-n2).
|
||
* 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.
|
||
|
||
AArch64
|
||
|
||
* In addition to the above, the following AArch64-only CPUs are now
|
||
supported:
|
||
+ Fujitsu A64FX (a64fx).
|
||
+ Arm Cortex-R82 (cortex-r82).
|
||
* The AArch64 Armv8-R architecture is now supported through the
|
||
-march=armv8-r option.
|
||
* Mitigation against the [53]Straight-line Speculation vulnerability
|
||
is supported with the -mharden-sls= option. Please refer to the
|
||
documentation for usage instructions.
|
||
* The availability of Advanced SIMD intrinsics available through the
|
||
arm_neon.h header is improved and GCC 11 supports the full set of
|
||
intrinsics defined by ACLE Q3 2020.
|
||
|
||
AMD Radeon (GCN)
|
||
|
||
* Initial support for gfx908 GPUs has been added.
|
||
|
||
arm
|
||
|
||
* Initial auto-vectorization is now available when targeting the MVE
|
||
instruction set.
|
||
* GCC can now make use of the Low Overhead Branch instruction in
|
||
Armv8.1-M to optimize loop counters and checks.
|
||
* The -mcpu=cortex-m55 option now supports the extensions +nomve and
|
||
+nomve.fp to control generation of MVE and MVE floating-point
|
||
instructions.
|
||
|
||
IA-32/x86-64
|
||
|
||
* New ISA extension support for Intel TSXLDTRK was added to GCC.
|
||
TSXLDTRK intrinsics are available via the -mtsxldtrk compiler
|
||
switch.
|
||
* New ISA extension support for Intel SERIALIZE was added to GCC.
|
||
SERIALIZE intrinsics are available via the -mserialize compiler
|
||
switch.
|
||
* New ISA extension support for Intel HRESET was added to GCC. HRESET
|
||
intrinsics are available via the -mhreset compiler switch.
|
||
* New ISA extension support for Intel UINTR was added to GCC. UINTR
|
||
intrinsics are available via the -muintr compiler switch.
|
||
* New ISA extension support for Intel KEYLOCKER was added to GCC.
|
||
KEYLOCKER intrinsics are available via the -mkeylocker compiler
|
||
switch.
|
||
* 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 -mamx-tile, -mamx-int8, -mamx-bf16 compiler
|
||
switches.
|
||
* New ISA extension support for Intel AVX-VNNI was added to GCC.
|
||
AVX-VNNI intrinsics are available via the -mavxvnni compiler
|
||
switch.
|
||
* GCC now supports the Intel CPU named Sapphire Rapids through
|
||
-march=sapphirerapids. The switch enables the MOVDIRI, MOVDIR64B,
|
||
AVX512VP2INTERSECT, ENQCMD, CLDEMOTE, SERIALIZE, PTWRITE, WAITPKG,
|
||
TSXLDTRK, AMT-TILE, AMX-INT8, AMX-BF16, and AVX-VNNI ISA
|
||
extensions.
|
||
* GCC now supports the Intel CPU named Alderlake through
|
||
-march=alderlake. The switch enables the CLDEMOTE, PTWRITE,
|
||
WAITPKG, SERIALIZE, KEYLOCKER, AVX-VNNI, and HRESET ISA extensions.
|
||
* GCC now supports the Intel CPU named Rocketlake through
|
||
-march=rocketlake. Rocket Lake is based on Icelake client and minus
|
||
SGX.
|
||
* GCC now supports AMD CPUs based on the znver3 core via
|
||
-march=znver3.
|
||
* GCC now supports micro-architecture levels defined in the x86-64
|
||
psABI via -march=x86-64-v2, -march=x86-64-v3 and -march=x86-64-v4.
|
||
|
||
Nios II
|
||
|
||
* The options -mcustom-insn=N no longer produce compiler warnings if
|
||
the custom instruction is not generated due to missing optimization
|
||
options such as -fno-math-errno, -ffinite-math-only, or
|
||
-funsafe-math-optimizations. These warnings were not consistently
|
||
emitted for all custom instructions.
|
||
* The -mcustom-fpu-cfg=fph2 option has been added to enable the
|
||
custom instructions supported by the Nios II Floating Point
|
||
Hardware 2 Component.
|
||
|
||
NVPTX
|
||
|
||
* The -misa default has changed from sm_30 to sm_35.
|
||
* The -m32 compiler switch has been removed.
|
||
* The -msoft-stack-reserve-local format has been fixed. Previously,
|
||
it accepted -msoft-stack-reserve-local<n>. It now accepts
|
||
-msoft-stack-reserve-local=<n>.
|
||
|
||
S/390, System z, IBM Z Systems
|
||
|
||
* The behavior when compiling with -fexcess-precision=standard (e.g.,
|
||
implied by -std=c99) on s390(x) targets can now be controlled at
|
||
configure time with the flag --enable-s390-excess-float-precision.
|
||
When enabled, GCC will maintain previous behavior and evaluate
|
||
float expressions in double precision, which aligns with the
|
||
definition of float_t as double. 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 float_t in the installed glibc.
|
||
|
||
RISC-V
|
||
|
||
* Support address sanitizer for RISC-V.
|
||
* Support big-endian for RISC-V, thanks to Marcus Comstedt.
|
||
* Implement new style of architecture extension test macros: each
|
||
architecture extension has a corresponding feature test macro,
|
||
which can be used to test its existence and version information.
|
||
* Legacy architecture extension test macros like __riscv_atomic are
|
||
deprecated, but will still be supported for at least 2 release
|
||
cycles.
|
||
* Support IFUNC for riscv*-*-linux*.
|
||
* Add new option -misa-spec=* to control ISA spec version. This
|
||
controls the default version of each extensions. It defaults to
|
||
2.2.
|
||
* Introduce the --with-multilib-generator configure time option. This
|
||
allows for flexible config multi-lib settings. Its syntax is the
|
||
same as RISC-V's multilib-generator.
|
||
* Extend the sytax for multilib-generator, support expansion operator
|
||
* to reduce the complexity of complicated multi-lib re-use rules.
|
||
* Support -mcpu=* option aligned with RISC-V clang/LLVM. It sets the
|
||
pipeline model and architecture extensions, like -mtune=* plus
|
||
-march=*.
|
||
* Support for TLS stack protector canary access, thanks to Cooper Qu.
|
||
* Support __builtin_thread_pointer for RISC-V.
|
||
* Introduce shorten_memrefs optimization, which reduces the code size
|
||
for memory access, thanks to Craig Blackmore.
|
||
|
||
Operating Systems
|
||
|
||
AIX
|
||
|
||
* 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.
|
||
* Support AIX Vector Extended ABI with -mabi=vec-extabi.
|
||
* Thread-Local uninitiated data placed in local common section.
|
||
* Use thread-safe access in ctype.
|
||
* Link with libc128.a when long-double-128 enabled.
|
||
|
||
Improvements to Static Analyzer
|
||
|
||
* The implementation of how program state is tracked within
|
||
[54]-fanalyzer has been completely rewritten for GCC 11, fixing
|
||
numerous bugs, and allowing for the analyzer to scale to larger C
|
||
source files.
|
||
* The analysis of allocations and deallocations has been generalized
|
||
beyond malloc and free.
|
||
+ As preliminary work towards eventually supporting C++, the
|
||
malloc/free checking will also check new/delete and
|
||
new[]/delete[]. However, C++ is not yet properly supported by
|
||
[55]-fanalyzer (for example, exception-handling is
|
||
unimplemented).
|
||
+ As noted above, the existing [56]malloc 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.
|
||
+ A new [57]-Wanalyzer-mismatching-deallocation warning has been
|
||
added, covering such mismatches as using scalar delete rather
|
||
vector delete[].
|
||
* The analyzer has gained warnings
|
||
[58]-Wanalyzer-shift-count-negative,
|
||
[59]-Wanalyzer-shift-count-overflow, [60]-Wanalyzer-write-to-const,
|
||
and [61]-Wanalyzer-write-to-string-literal, all enabled by default
|
||
when [62]-fanalyzer is enabled.
|
||
* The analyzer can now be extended by GCC plugins, allowing for
|
||
domain-specific path-sensitive warnings. An example of using a
|
||
[63]GCC plugin to check for misuses of CPython's global interpreter
|
||
lock can be seen in the test suite
|
||
* The analyzer has gained new debugging options
|
||
[64]-fdump-analyzer-json and [65]-fno-analyzer-feasibility.
|
||
|
||
Other significant improvements
|
||
|
||
* GCC has gained a new environment variable
|
||
[66]GCC_EXTRA_DIAGNOSTIC_OUTPUT which can be used by IDEs to
|
||
request machine-readable fix-it hints without needing to adjust
|
||
build flags.
|
||
|
||
GCC 11.1
|
||
|
||
This is the [67]list of problem reports (PRs) 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).
|
||
|
||
GCC 11.2
|
||
|
||
This is the [68]list of problem reports (PRs) from GCC's bug tracking
|
||
system that are known to be fixed in the 11.2 release. This list might
|
||
not be complete (that is, it is possible that some PRs that have been
|
||
fixed are not listed here).
|
||
|
||
GCC 11.3
|
||
|
||
This is the [69]list of problem reports (PRs) from GCC's bug tracking
|
||
system that are known to be fixed in the 11.3 release. This list might
|
||
not be complete (that is, it is possible that some PRs that have been
|
||
fixed are not listed here).
|
||
|
||
Target Specific Changes
|
||
|
||
x86-64
|
||
|
||
* The x86-64 ABI of passing and returning structure with a 64-bit
|
||
single precision vector changed in GCC 11.1 when 3DNOW is disabled.
|
||
Disabling 3DNOW no longer changes how they are passed nor returned.
|
||
This ABI change is now diagnosed with -Wpsabi.
|
||
* Mitigation against straight line speculation (SLS) for function
|
||
return and indirect jump is supported via
|
||
-mharden-sls=[none|all|return|indirect-jmp].
|
||
* Add CS prefix to call and jmp to indirect thunk with branch target
|
||
in r8-r15 registers via -mindirect-branch-cs-prefix.
|
||
|
||
|
||
For questions related to the use of GCC, please consult these web
|
||
pages and the [70]GCC manuals. If that fails, the
|
||
[71]gcc-help@gcc.gnu.org mailing list might help. Comments on these
|
||
web pages and the development of GCC are welcome on our developer
|
||
list at [72]gcc@gcc.gnu.org. All of [73]our lists have public
|
||
archives.
|
||
|
||
Copyright (C) [74]Free Software Foundation, Inc. Verbatim copying and
|
||
distribution of this entire article is permitted in any medium,
|
||
provided this notice is preserved.
|
||
|
||
These pages are [75]maintained by the GCC team. Last modified
|
||
2022-04-21[76].
|
||
|
||
References
|
||
|
||
1. http://gcc.gnu.org/gcc-11/porting_to.html
|
||
2. http://gcc.gnu.org/onlinedocs/index.html#current
|
||
3. https://wg21.link/p0522r0
|
||
4. https://gcc.gnu.org/pipermail/gcc-patches/2020-May/546494.html
|
||
5. https://github.com/google/sanitizers/wiki/ThreadSanitizerCppManual
|
||
6. https://www.kernel.org/doc/html/latest/dev-tools/kcsan.html
|
||
7. https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Diagnostic-Message-Formatting-Options.html#index-fdiagnostics-column-unit
|
||
8. https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Diagnostic-Message-Formatting-Options.html#index-fdiagnostics-column-origin
|
||
9. https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Diagnostic-Message-Formatting-Options.html#index-fdiagnostics-format
|
||
10. https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Preprocessor-Options.html#index-ftabstop
|
||
11. https://clang.llvm.org/docs/HardwareAssistedAddressSanitizerDesign.html
|
||
12. https://github.com/google/sanitizers/wiki/AddressSanitizer
|
||
13. https://clang.llvm.org/docs/HardwareAssistedAddressSanitizerDesign.html
|
||
14. https://dwarfstd.org/doc/DWARF5.pdf
|
||
15. https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Code-Gen-Options.html#index-fno-bit-tests
|
||
16. https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Optimize-Options.html#index-fipa-modref
|
||
17. https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Optimize-Options.html#index-fipa-ocf
|
||
18. https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Optimize-Options.html#index-fprofile-values
|
||
19. https://www.openmp.org/specifications/
|
||
20. https://www.openacc.org/
|
||
21. https://gcc.gnu.org/wiki/OpenACC/Implementation%20Status#status-11
|
||
22. https://gcc.gnu.org/onlinedocs/gcc-11.1.0/libgomp/Enabling-OpenACC.html
|
||
23. https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Common-Function-Attributes.html#index-no_005fstack_005fprotector-function-attribute
|
||
24. https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Common-Function-Attributes.html#index-malloc-function-attribute
|
||
25. https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Warning-Options.html#index-Wmismatched-dealloc
|
||
26. https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/C_002b_002b-Dialect-Options.html#index-Wmismatched-new-delete
|
||
27. https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Warning-Options.html#index-Wfree-nonheap-object
|
||
28. https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Warning-Options.html#index-Wmismatched-dealloc
|
||
29. https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Warning-Options.html#index-Wsizeof-array-div
|
||
30. https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Warning-Options.html#index-Wstringop-overread
|
||
31. https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Warning-Options.html#index-Wtsan
|
||
32. https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Warning-Options.html#index-Wfree-nonheap-object
|
||
33. https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Warning-Options.html#index-Wmaybe-uninitialized
|
||
34. https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Warning-Options.html#index-Wuninitialized
|
||
35. https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Warning-Options.html#index-Warray-parameter
|
||
36. https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Warning-Options.html#index-Wvla-parameter
|
||
37. http://gcc.gnu.org/projects/cxx-status.html#cxx20
|
||
38. http://gcc.gnu.org/projects/cxx-status.html#cxx23
|
||
39. https://gcc.gnu.org/PR41437
|
||
40. https://gcc.gnu.org/PR95307
|
||
41. https://gcc.gnu.org/PR97518
|
||
42. https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/C_002b_002b-Dialect-Options.html#index-Wctad-maybe-unsupported
|
||
43. https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/C_002b_002b-Dialect-Options.html#index-Wrange-loop-construct
|
||
44. https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/C_002b_002b-Dialect-Options.html#index-Wdeprecated-enum-enum-conversion
|
||
45. https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/C_002b_002b-Dialect-Options.html#index-Wdeprecated-enum-float-conversion
|
||
46. https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/C_002b_002b-Dialect-Options.html#index-Wmismatched-new-delete
|
||
47. https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/C_002b_002b-Dialect-Options.html#index-Wvexing-parse
|
||
48. https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Warning-Options.html#index-Wnonnull
|
||
49. http://gcc.gnu.org/gcc-5/changes.html#jit
|
||
50. https://gcc.gnu.org/onlinedocs/gcc-11.1.0/jit/topics/compatibility.html
|
||
51. https://gcc.gnu.org/onlinedocs/gcc-11.1.0/jit/topics/expressions.html#c.gcc_jit_global_set_initializer
|
||
52. https://gcc.gnu.org/onlinedocs/gcc-11.1.0/jit/topics/asm.html
|
||
53. https://developer.arm.com/support/arm-security-updates/speculative-processor-vulnerability/downloads/straight-line-speculation
|
||
54. https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Static-Analyzer-Options.html
|
||
55. https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Static-Analyzer-Options.html
|
||
56. https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Common-Function-Attributes.html#index-malloc-function-attribute
|
||
57. https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Static-Analyzer-Options.html#index-Wanalyzer-mismatching-deallocation
|
||
58. https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Static-Analyzer-Options.html#index-Wanalyzer-shift-count-negative
|
||
59. https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Static-Analyzer-Options.html#index-Wanalyzer-shift-count-overflow
|
||
60. https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Static-Analyzer-Options.html#index-Wanalyzer-write-to-const
|
||
61. https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Static-Analyzer-Options.html#index-Wanalyzer-write-to-string-literal
|
||
62. https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Static-Analyzer-Options.html
|
||
63. https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=66dde7bc64b75d4a338266333c9c490b12d49825
|
||
64. https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Static-Analyzer-Options.html#index-fdump-analyzer-json
|
||
65. https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Static-Analyzer-Options.html#index-fno-analyzer-feasibility
|
||
66. https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Environment-Variables.html#index-GCC_005fEXTRA_005fDIAGNOSTIC_005fOUTPUT
|
||
67. https://gcc.gnu.org/bugzilla/buglist.cgi?bug_status=RESOLVED&resolution=FIXED&target_milestone=11.0
|
||
68. https://gcc.gnu.org/bugzilla/buglist.cgi?bug_status=RESOLVED&resolution=FIXED&target_milestone=11.2
|
||
69. https://gcc.gnu.org/bugzilla/buglist.cgi?bug_status=RESOLVED&resolution=FIXED&target_milestone=11.3
|
||
70. https://gcc.gnu.org/onlinedocs/
|
||
71. mailto:gcc-help@gcc.gnu.org
|
||
72. mailto:gcc@gcc.gnu.org
|
||
73. https://gcc.gnu.org/lists.html
|
||
74. https://www.fsf.org/
|
||
75. https://gcc.gnu.org/about.html
|
||
76. http://validator.w3.org/check/referer
|
||
======================================================================
|
||
http://gcc.gnu.org/gcc-10/index.html
|
||
|
||
GCC 10 Release Series
|
||
|
||
June 28, 2022
|
||
|
||
The [1]GNU project and the GCC developers are pleased to announce the
|
||
release of GCC 10.4.
|
||
|
||
This release is a bug-fix release, containing fixes for regressions in
|
||
GCC 10.3 relative to previous releases of GCC.
|
||
|
||
Release History
|
||
|
||
GCC 10.4
|
||
June 28, 2022 ([2]changes, [3]documentation)
|
||
|
||
GCC 10.3
|
||
April 8, 2021 ([4]changes, [5]documentation)
|
||
|
||
GCC 10.2
|
||
July 23, 2020 ([6]changes, [7]documentation)
|
||
|
||
GCC 10.1
|
||
May 7, 2020 ([8]changes, [9]documentation)
|
||
|
||
References and Acknowledgements
|
||
|
||
GCC used to stand for the GNU C Compiler, but since the compiler
|
||
supports several other languages aside from C, it now stands for the
|
||
GNU Compiler Collection.
|
||
|
||
A list of [10]successful builds is updated as new information becomes
|
||
available.
|
||
|
||
The GCC developers would like to thank the numerous people that have
|
||
contributed new features, improvements, bug fixes, and other changes as
|
||
well as test results to GCC. This [11]amazing group of volunteers is
|
||
what makes GCC successful.
|
||
|
||
For additional information about GCC please refer to the [12]GCC
|
||
project web site or contact the [13]GCC development mailing list.
|
||
|
||
To obtain GCC please use [14]our mirror sites or [15]our version
|
||
control system.
|
||
|
||
|
||
For questions related to the use of GCC, please consult these web
|
||
pages and the [16]GCC manuals. If that fails, the
|
||
[17]gcc-help@gcc.gnu.org mailing list might help. Comments on these
|
||
web pages and the development of GCC are welcome on our developer
|
||
list at [18]gcc@gcc.gnu.org. All of [19]our lists have public
|
||
archives.
|
||
|
||
Copyright (C) [20]Free Software Foundation, Inc. Verbatim copying and
|
||
distribution of this entire article is permitted in any medium,
|
||
provided this notice is preserved.
|
||
|
||
These pages are [21]maintained by the GCC team. Last modified
|
||
2022-06-28[22].
|
||
|
||
References
|
||
|
||
1. http://www.gnu.org/
|
||
2. http://gcc.gnu.org/gcc-10/changes.html
|
||
3. http://gcc.gnu.org/onlinedocs/10.4.0/
|
||
4. http://gcc.gnu.org/gcc-10/changes.html
|
||
5. http://gcc.gnu.org/onlinedocs/10.3.0/
|
||
6. http://gcc.gnu.org/gcc-10/changes.html
|
||
7. http://gcc.gnu.org/onlinedocs/10.2.0/
|
||
8. http://gcc.gnu.org/gcc-10/changes.html
|
||
9. http://gcc.gnu.org/onlinedocs/10.1.0/
|
||
10. http://gcc.gnu.org/gcc-10/buildstat.html
|
||
11. http://gcc.gnu.org/onlinedocs/gcc-10.1.0/gcc/Contributors.html
|
||
12. http://gcc.gnu.org/index.html
|
||
13. mailto:gcc@gcc.gnu.org
|
||
14. http://gcc.gnu.org/mirrors.html
|
||
15. http://gcc.gnu.org/git.html
|
||
16. https://gcc.gnu.org/onlinedocs/
|
||
17. mailto:gcc-help@gcc.gnu.org
|
||
18. mailto:gcc@gcc.gnu.org
|
||
19. https://gcc.gnu.org/lists.html
|
||
20. https://www.fsf.org/
|
||
21. https://gcc.gnu.org/about.html
|
||
22. http://validator.w3.org/check/referer
|
||
======================================================================
|
||
http://gcc.gnu.org/gcc-10/changes.html
|
||
|
||
GCC 10 Release Series
|
||
Changes, New Features, and Fixes
|
||
|
||
This page is a "brief" summary of some of the huge number of
|
||
improvements in GCC 10. You may also want to check out our [1]Porting
|
||
to GCC 10 page and the [2]full GCC documentation.
|
||
|
||
Caveats
|
||
|
||
* An ABI incompatibility between C++14 and C++17 has been fixed. On
|
||
some targets a class with a zero-sized subobject would be passed
|
||
incorrectly when compiled as C++17 or C++20. See the [3]C++ notes
|
||
below for more details.
|
||
* The deprecated Profile Mode and array_allocator extensions have
|
||
been removed from libstdc++.
|
||
* The non-standard std::__is_nullptr_t type trait is deprecated and
|
||
will be removed from libstdc++ in a future release. The standard
|
||
trait std::is_null_pointer should be instead.
|
||
* The minimum version of the [4]MPFR library required for building
|
||
GCC has been increased to version 3.1.0 (released 2011-10-03).
|
||
* The automatic template instantiation at link time (-frepo) has been
|
||
removed.
|
||
* The --param allow-store-data-races internal parameter has been
|
||
removed in favor of a new official option -fallow-store-data-races.
|
||
While default behavior is unchanged and the new option allows to
|
||
correctly maintain a per compilation unit setting across link-time
|
||
optimization, alteration of the default via --param
|
||
allow-store-data-races will now be diagnosed and build systems have
|
||
to be adjusted accordingly.
|
||
* Offloading to Heterogeneous System Architecture Intermediate
|
||
Language (HSAIL) has been deprecated and will likely be removed in
|
||
a future release.
|
||
* The type of the std::iterator base class of
|
||
std::istreambuf_iterator was changed in C++98 mode to be consistent
|
||
with C++11 and later standards. See the [5]libstdc++ notes below
|
||
for more details.
|
||
|
||
General Improvements
|
||
|
||
* New built-in functions:
|
||
+ The [6]__has_builtin built-in preprocessor operator can be
|
||
used to query support for built-in functions provided by GCC
|
||
and other compilers that support it.
|
||
+ __builtin_roundeven for the corresponding function from
|
||
ISO/IEC TS 18661.
|
||
* New command-line options:
|
||
+ [7]-fallocation-dce removes unneeded pairs of new and delete
|
||
operators.
|
||
+ [8]-fprofile-partial-training can now be used to inform the
|
||
compiler that code paths not covered by the training run
|
||
should not be optimized for size.
|
||
+ [9]-fprofile-reproducible controls level of reproducibility of
|
||
profile gathered by [10]-fprofile-generate. This makes it
|
||
possible to rebuild program with same outcome which is useful,
|
||
for example, for distribution packages.
|
||
+ [11]-fprofile-prefix-path can be used in combination with
|
||
-fprofile-generate=profile_dir and -fprofile-use=profile_dir
|
||
to inform GCC where the base directory of build source tree is
|
||
in case it differs between instrumentation and optimized
|
||
builds.
|
||
+ [12]-fanalyzer enables a new static analysis pass and
|
||
associated warnings. This pass performs a time-consuming
|
||
exploration of paths through the code in the hope of detecting
|
||
various common errors, such as double-free bugs. This option
|
||
should be regarded as experimental in this release. In
|
||
particular, analysis of non-C code is unlikely to work.
|
||
* Inter-procedural optimization improvements:
|
||
+ The inter-procedural scalar replacement of aggregates
|
||
(IPA-SRA) pass was re-implemented to work at link-time and can
|
||
now also remove computing and returning unused return values.
|
||
+ [13]-finline-functions is now enabled at -O2 and was retuned
|
||
for better code size versus runtime performance trade-offs.
|
||
Inliner heuristics was also significantly sped up to avoid
|
||
negative impact to -flto -O2 compile times.
|
||
+ Inliner heuristics and function cloning can now use
|
||
value-range information to predict effectivity of individual
|
||
transformations.
|
||
+ During link-time optimization the C++ One Definition Rule is
|
||
used to increase precision of type based alias analysis.
|
||
* Link-time optimization improvements:
|
||
+ A new binary [14]lto-dump has been added. It dumps various
|
||
information about LTO bytecode object files.
|
||
+ The parallel phase of the LTO can automatically detect a
|
||
running make's jobserver or fall back to number of available
|
||
cores.
|
||
+ The LTO bytecode can be compressed with the [15]zstd
|
||
algorithm. The configure script automatically detects zstd
|
||
support.
|
||
+ Most --param values can now be specified at translation unit
|
||
granularity. This includes all parameters controlling the
|
||
inliner and other inter-procedural optimizations. Unlike
|
||
earlier releases, GCC 10 will ignore parameters controlling
|
||
optimizations specified at link-time and apply parameters
|
||
specified at compile-time in the same manner as done for
|
||
optimization flags.
|
||
* Profile driven optimization improvements:
|
||
+ Profile maintenance during compilation and hot/cold code
|
||
partitioning have been improved.
|
||
+ Using [16]-fprofile-values, an instrumented binary can track
|
||
multiple values (up to 4) for e.g. indirect calls and provide
|
||
more precise profile information.
|
||
|
||
New Languages and Language-Specific Improvements
|
||
|
||
* Version 2.6 of the [17]OpenACC specification is now supported in
|
||
the C, C++ and Fortran compilers. See the [18]implementation status
|
||
section on the OpenACC wiki page and the [19]run-time library
|
||
documentation for further information.
|
||
* GCC 10 adds a number of newly implemented [20]OpenMP 5.0 features
|
||
on top of the GCC 9 release such as conditional lastprivate clause,
|
||
scan and loop directives, order(concurrent) and use_device_addr
|
||
clauses support, if clause on simd construct or partial support for
|
||
the declare variant directive, getting closer to full support of
|
||
the OpenMP 5.0 standard.
|
||
* OpenMP and OpenACC now support [21]offloading to AMD Radeon (GCN)
|
||
GPUs; supported are the third-generation Fiji (fiji) and the
|
||
fifth-generation VEGA 10/VEGA 20 (gfx900 or gfx906).
|
||
|
||
C family
|
||
|
||
* New attributes:
|
||
+ The access function and type attribute has been added to
|
||
describe how a function accesses objects passed to it by
|
||
pointer or reference, and to associate such arguments with
|
||
integer arguments denoting the objects' sizes. The attribute
|
||
is used to enable the detection of invalid accesses by
|
||
user-defined functions, such as those diagnosed by
|
||
-Wstringop-overflow.
|
||
+ The symver attribute can be used to bind symbols to specific
|
||
version nodes on ELF platforms. This is preferred to using
|
||
inline assembly with GNU as symver directive because the
|
||
latter is not compatible with link-time optimizations.
|
||
* New warnings:
|
||
+ [22]-Wstring-compare, enabled by -Wextra, warns about equality
|
||
and inequality expressions between zero and the result of a
|
||
call to either strcmp and strncmp that evaluate to a constant
|
||
as a result of the length of one argument being greater than
|
||
the size of the array pointed to by the other.
|
||
+ [23]-Wzero-length-bounds, enabled by -Warray-bounds, warns
|
||
about accesses to elements of zero-length arrays that might
|
||
overlap other members of the same object.
|
||
* Enhancements to existing warnings:
|
||
+ [24]-Warray-bounds detects more out-of-bounds accesses to
|
||
member arrays as well as accesses to elements of zero-length
|
||
arrays.
|
||
+ [25]-Wformat-overflow makes full use of string length
|
||
information computed by the strlen optimization pass.
|
||
+ [26]-Wrestrict detects overlapping accesses to dynamically
|
||
allocated objects.
|
||
+ [27]-Wreturn-local-addr diagnoses more instances of return
|
||
statements returning addresses of automatic variables.
|
||
+ [28]-Wstringop-overflow detects more out-of-bounds stores to
|
||
member arrays including zero-length arrays, dynamically
|
||
allocated objects and variable length arrays, as well as more
|
||
instances of reads of unterminated character arrays by string
|
||
built-in functions. The warning also detects out-of-bounds
|
||
accesses by calls to user-defined functions declared with the
|
||
new attribute access.
|
||
+ [29]-Warith-conversion re-enables warnings from -Wconversion,
|
||
-Wfloat-conversion, and -Wsign-conversion that are now off by
|
||
default for an expression where the result of an arithmetic
|
||
operation will not fit in the target type due to promotion,
|
||
but the operands of the expression do fit in the target type.
|
||
* Extended characters in identifiers may now be specified directly in
|
||
the input encoding (UTF-8, by default), in addition to the UCN
|
||
syntax (\uNNNN or \UNNNNNNNN) that is already supported:
|
||
|
||
static const int p = 3;
|
||
int get_na<6E>ve_pi() {
|
||
return p;
|
||
}
|
||
|
||
C
|
||
|
||
* Several new features from the upcoming C2X revision of the ISO C
|
||
standard are supported with -std=c2x and -std=gnu2x. 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
|
||
-std=c2x -Wpedantic.
|
||
+ The [[]] attribute syntax is supported, as in C++. Existing
|
||
attributes can be used with this syntax in forms such as
|
||
[[gnu::const]]. The standard attributes [[deprecated]],
|
||
[[fallthrough]] and [[maybe_unused]] are supported.
|
||
+ UTF-8 character constants using the u8'' syntax are supported.
|
||
+ <float.h> defines macros FLT_NORM_MAX, DBL_NORM_MAX and
|
||
LDBL_NORM_MAX.
|
||
+ When decimal floating-point arithmetic is supported, <float.h>
|
||
defines macros DEC32_TRUE_MIN, DEC64_TRUE_MIN and
|
||
DEC128_TRUE_MIN, in addition to the macros that were
|
||
previously only defined if __STDC_WANT_DEC_FP__ was defined
|
||
before including <float.h>.
|
||
+ In C2X mode, empty parentheses in a function definition give
|
||
that function a type with a prototype for subsequent calls;
|
||
other old-style function definitions are diagnosed by default
|
||
in C2X mode.
|
||
+ The strftime format checking supports the %OB and %Ob formats.
|
||
+ In C2X mode, -fno-fp-int-builtin-inexact is enabled by
|
||
default.
|
||
* GCC now defaults to -fno-common. As a result, global variable
|
||
accesses are more efficient on various targets. In C, global
|
||
variables with multiple tentative definitions now result in linker
|
||
errors. With -fcommon such definitions are silently merged during
|
||
linking.
|
||
|
||
C++
|
||
|
||
* Several C++20 features have been implemented:
|
||
+ Concepts, including P0734R0, P0857R0, P1084R2, P1141R2,
|
||
P0848R3, P1616R1, P1452R2
|
||
+ P1668R1, Permitting Unevaluated inline-assembly in constexpr
|
||
Functions
|
||
+ P1161R3, Deprecate a[b,c]
|
||
+ P0848R3, Conditionally Trivial Special Member Functions
|
||
+ P1091R3, Extending structured bindings
|
||
+ P1143R2, Adding the constinit keyword
|
||
+ P1152R4, Deprecating volatile
|
||
+ P0388R4, Permit conversions to arrays of unknown bound
|
||
+ P0784R7, constexpr new
|
||
+ P1301R4, [[nodiscard("with reason")]]
|
||
+ P1814R0, class template argument deduction for alias templates
|
||
+ P1816R0, class template argument deduction for aggregates
|
||
+ P0960R3, Parenthesized initialization of aggregates
|
||
+ P1331R2, Allow trivial default initialization in constexpr
|
||
contexts
|
||
+ P1327R1, Allowing dynamic_cast and polymorphic typeid in
|
||
constexpr contexts
|
||
+ P0912R5, Coroutines (requires -fcoroutines)
|
||
* Several C++ Defect Reports have been resolved, e.g.:
|
||
+ DR 1560, lvalue-to-rvalue conversion in ?:
|
||
+ DR 1813, __is_standard_layout for a class with repeated bases
|
||
+ DR 2094, volatile scalars are trivially copyable,
|
||
+ DR 2096, constraints on literal unions
|
||
+ DR 2413, typename in conversion-function-ids
|
||
+ DR 2352, Similar types and reference binding
|
||
+ DR 1601, Promotion of enumeration with fixed underlying type
|
||
+ DR 330, Qualification conversions and pointers to arrays of
|
||
pointers
|
||
+ DR 1307, Overload resolution based on size of array
|
||
initializer-list
|
||
+ DR 1710, Missing template keyword in class-or-decltype
|
||
* New warnings:
|
||
+ [30]-Wmismatched-tags, disabled by default, warns about
|
||
declarations of structs, classes, and class templates and
|
||
their specializations with a class-key that does not match
|
||
either the definition or the first declaration if no
|
||
definition is provided. The option is provided to ease
|
||
portability to Windows-based compilers.
|
||
+ [31]-Wredundant-tags, disabled by default, warns about
|
||
redundant class-key and enum-key in contexts where the key can
|
||
be eliminated without causing an syntactic ambiguity.
|
||
* G++ can now detect modifying constant objects in constexpr
|
||
evaluation (which is undefined behavior).
|
||
* G++ no longer emits bogus -Wsign-conversion warnings with explicit
|
||
casts.
|
||
* Narrowing is now detected in more contexts (e.g., case values).
|
||
* Memory consumption of the compiler has been reduced in constexpr
|
||
evaluation.
|
||
* The noexcept-specifier is now properly treated as a complete-class
|
||
context as per [class.mem].
|
||
* The attribute deprecated can now be used on namespaces too.
|
||
* The ABI of passing and returning certain C++ classes by value
|
||
changed on several targets in GCC 10, including [32]AArch64,
|
||
[33]ARM, [34]PowerPC ELFv2, [35]S/390 and [36]Itanium. These
|
||
changes affect classes with a zero-sized subobject (an empty base
|
||
class, or data member with the [[no_unique_address]] attribute)
|
||
where all other non-static data members have the same type (this is
|
||
called a "homogeneous aggregate" in some ABI specifications, or if
|
||
there is only one such member, a "single element"). In -std=c++17
|
||
and -std=c++20 modes, classes with an empty base class were not
|
||
considered to have a single element or to be a homogeneous
|
||
aggregate, and so could be passed differently (in the wrong
|
||
registers or at the wrong stack address). This could make code
|
||
compiled with -std=c++17 and -std=c++14 ABI incompatible. This has
|
||
been corrected and the empty bases are ignored in those ABI
|
||
decisions, so functions compiled with -std=c++14 and -std=c++17 are
|
||
now ABI compatible again. Example: struct empty {}; struct S :
|
||
empty { float f; }; void f(S);. Similarly, in classes containing
|
||
non-static data members with empty class types using the C++20
|
||
[[no_unique_address]] attribute, those members weren't ignored in
|
||
the ABI argument passing decisions as they should be. Both of these
|
||
ABI changes are now diagnosed with -Wpsabi.
|
||
|
||
Runtime Library (libstdc++)
|
||
|
||
* Improved experimental C++2a support, including:
|
||
+ Library concepts in <concepts> and <iterator>.
|
||
+ Constrained algorithms in <ranges>, <algorithm>, and <memory>
|
||
(thanks to Patrick Palka).
|
||
+ New algorithms shift_left and shift_right (thanks to Patrick
|
||
Palka).
|
||
+ std::span (thanks to JeanHeyd Meneide).
|
||
+ Three-way comparisons in <compare> and throughout the library.
|
||
+ Constexpr support in <algorithm> and elsewhere (thanks to
|
||
Edward Smith-Rowland).
|
||
+ <stop_token> and std::jthread (thanks to Thomas Rodgers).
|
||
+ std::atomic_ref and std::atomic<floating point>.
|
||
+ Integer comparison functions (cmp_equal, cmp_less etc.).
|
||
+ std::ssize, std::to_array.
|
||
+ std::construct_at, std::destroy, constexpr std::allocator.
|
||
+ Mathematical constants in <numbers>.
|
||
* Support for RDSEED in std::random_device.
|
||
* Reduced header dependencies, leading to faster compilation for some
|
||
code.
|
||
* The std::iterator base class of std::istreambuf_iterator was
|
||
changed in C++98 mode to be consistent with C++11 and later
|
||
standards. This is expected to have no noticeable effect except in
|
||
the unlikely case of a class which has potentially overlapping
|
||
subobjects of type std::istreambuf_iterator<C> and another iterator
|
||
type with a std::iterator<input_iterator_tag, C, ...> base class.
|
||
The layout of such a type might change when compiled as C++98.
|
||
[37]Bug 92285 has more details and concrete examples.
|
||
|
||
D
|
||
|
||
* Support for static foreach has been implemented.
|
||
* Aliases can now be created directly from any __traits that return
|
||
symbols or tuples. Previously, an AliasSeq was necessary in order
|
||
to alias their return.
|
||
* It is now possible to detect the language ABI specified for a
|
||
struct, class, or interface using __traits(getLinkage, ...).
|
||
* Support for core.math.toPrec intrinsics has been added. These
|
||
intrinsics guarantee the rounding to specific floating-point
|
||
precisions at specified points in the code.
|
||
* Support for pragma(inline) has been implemented. Previously the
|
||
pragma was recognized, but had no effect on the compilation.
|
||
* Optional parentheses in asm operands are deprecated and will be
|
||
removed in a future release.
|
||
* All content imported files are now included in the make dependency
|
||
list when compiling with -M.
|
||
* Compiler recognized attributes provided by the gcc.attribute module
|
||
will now take effect when applied to function prototypes as well as
|
||
when applied to full function declarations.
|
||
* Added a --enable-libphobos-checking configure option to control
|
||
whether run-time checks are compiled into the D runtime library.
|
||
* Added a --with-libphobos-druntime-only configure option to indicate
|
||
whether to build only the core D runtime library, or both the core
|
||
and standard libraries into libphobos.
|
||
|
||
Fortran
|
||
|
||
* use_device_addr of version 5.0 of the [38]OpenMP specification is
|
||
now supported. Note that otherwise OpenMP 4.5 is partially
|
||
supported in the Fortran compiler; the largest missing item is
|
||
structure element mapping.
|
||
* The default buffer size for I/O using unformatted files has been
|
||
increased to 1048576. The buffer size for can now be set at runtime
|
||
via the environment variables GFORTRAN_FORMATTED_BUFFER_SIZE and
|
||
GFORTRAN_UNFORMATTED_BUFFER_SIZE for formatted and unformatted
|
||
files, respectively.
|
||
* Mismatches between actual and dummy argument lists in a single file
|
||
are now rejected with an error. Use the new option
|
||
-fallow-argument-mismatch to turn these errors into warnings; this
|
||
option is implied with -std=legacy. -Wargument-mismatch has been
|
||
removed.
|
||
* The handling of a BOZ literal constant has been reworked to provide
|
||
better conformance to the Fortran 2008 and 2018 standards. In these
|
||
Fortran standards, a BOZ literal constant is a typeless and
|
||
kindless entity. As a part of the rework, documented and
|
||
undocumented extensions to the Fortran standard now emit errors
|
||
during compilation. Some of these extensions are permitted with the
|
||
-fallow-invalid-boz option, which degrades the error to a warning
|
||
and the code is compiled as with older gfortran.
|
||
* At any optimization level except-Os, gfortran now uses inline
|
||
packing for arguments instead of calling a library routine. If the
|
||
source contains a large number of arguments that need to be
|
||
repacked, code size or time for compilation can become excessive.
|
||
If that is the case, -fno-inline-arg-packing can be used to disable
|
||
inline argument packing.
|
||
* Legacy extensions:
|
||
+ For formatted input/output, if the explicit widths after the
|
||
data-edit descriptors I, F and G have been omitted, default
|
||
widths are used.
|
||
+ A blank format item at the end of a format specification, i.e.
|
||
nothing following the final comma, is allowed. Use the option
|
||
-fdec-blank-format-item; this option is implied with -fdec.
|
||
+ The existing support for AUTOMATIC and STATIC attributes has
|
||
been extended to allow variables with the AUTOMATIC attribute
|
||
to be used in EQUIVALENCE statements. Use -fdec-static; this
|
||
option is implied by -fdec.
|
||
+ Allow character literals in assignments and DATA statements
|
||
for numeric (INTEGER, REAL, or COMPLEX) or LOGICAL variables.
|
||
Use the option -fdec-char-conversions; this option is implied
|
||
with -fdec.
|
||
+ DEC comparisons, i.e. allow Hollerith constants to be used in
|
||
comparisons with INTEGER, REAL, COMPLEX and CHARACTER
|
||
expressions. Use the option -fdec.
|
||
* Character type names in errors and warnings now include len in
|
||
addition to kind; * is used for assumed length. The kind is omitted
|
||
if it is the default kind. Examples: CHARACTER(12), CHARACTER(6,4).
|
||
* CO_BROADCAST now supports derived type variables including objects
|
||
with allocatable components. In this case, the optional arguments
|
||
STAT= and ERRMSG= are currently ignored.
|
||
* The handling of module and submodule names has been reworked to
|
||
allow the full 63-character length mandated by the standard.
|
||
Previously symbol names were truncated if the combined length of
|
||
module, submodule, and function name exceeded 126 characters. This
|
||
change therefore breaks the ABI, but only for cases where this 126
|
||
character limit was exceeded.
|
||
|
||
Go
|
||
|
||
* GCC 10 provides a complete implementation of the Go 1.14.6 user
|
||
packages.
|
||
|
||
libgccjit
|
||
|
||
* The libgccjit API gained four new entry points:
|
||
+ [39]gcc_jit_version_major, [40]gcc_jit_version_minor, and
|
||
[41]gcc_jit_version_patchlevel for programmatically checking
|
||
the libgccjit version from client code, and
|
||
+ [42]gcc_jit_context_new_bitfield
|
||
|
||
New Targets and Target Specific Improvements
|
||
|
||
AArch64 & arm
|
||
|
||
* The AArch64 and arm ports now support condition flag output
|
||
constraints in inline assembly, as indicated by the
|
||
__GCC_ASM_FLAG_OUTPUTS__. On arm this feature is only available for
|
||
A32 and T32 targets. Please refer to the documentation for more
|
||
details.
|
||
|
||
AArch64
|
||
|
||
* There have been several improvements related to the Scalable Vector
|
||
Extension (SVE):
|
||
+ The SVE ACLE types and intrinsics are now supported. They can
|
||
be accessed using the header file arm_sve.h.
|
||
+ It is now possible to create fixed-length SVE types using the
|
||
arm_sve_vector_bits attribute. For example:
|
||
#if __ARM_FEATURE_SVE_BITS==512
|
||
typedef svint32_t vec512 __attribute__((arm_sve_vector_bits(512)));
|
||
typedef svbool_t pred512 __attribute__((arm_sve_vector_bits(512)));
|
||
#endif
|
||
+ -mlow-precision-div, -mlow-precision-sqrt and
|
||
-mlow-precision-recip-sqrt now work for SVE.
|
||
+ -msve-vector-bits=128 now generates vector-length-specific
|
||
code for little-endian targets. It continues to generate
|
||
vector-length-agnostic code for big-endian targets, just as
|
||
previous releases did for all targets.
|
||
+ The vectorizer is now able to use extending loads and
|
||
truncating stores, including gather loads and scatter stores.
|
||
+ The vectorizer now compares the cost of vectorizing with SVE
|
||
and vectorizing with Advanced SIMD and tries to pick the best
|
||
one. Previously it would always use SVE if possible.
|
||
+ If a vector loop uses Advanced SIMD rather than SVE, the
|
||
vectorizer now considers using SVE to vectorize the left-over
|
||
elements (the "scalar tail" or "epilog").
|
||
+ Besides these specific points, there have been many general
|
||
improvements to the way that the vectorizer uses SVE.
|
||
* The -mbranch-protection=pac-ret option now accepts the optional
|
||
argument +b-key extension to perform return address signing with
|
||
the B-key instead of the A-key.
|
||
* The option -moutline-atomics has been added to aid deployment of
|
||
the Large System Extensions (LSE) on GNU/Linux systems built with a
|
||
baseline architecture targeting Armv8-A. When the option is
|
||
specified code is emitted to detect the presence of LSE
|
||
instructions at runtime and use them for standard atomic
|
||
operations. For more information please refer to the documentation.
|
||
* The Transactional Memory Extension is now supported through ACLE
|
||
intrinsics. It can be enabled through the +tme option extension
|
||
(for example, -march=armv8.5-a+tme).
|
||
* A number of features from Armv8.5-A are now supported through ACLE
|
||
intrinsics. These include:
|
||
+ The random number instructions that can be enabled through the
|
||
(already present in GCC 9.1) +rng option extension.
|
||
+ Floating-point intrinsics to round to integer instructions
|
||
from Armv8.5-A when targeting -march=armv8.5-a or later.
|
||
+ Memory Tagging Extension intrinsics enabled through the
|
||
+memtag option extension.
|
||
* Similarly, the following Armv8.6-A features are now supported
|
||
through ACLE intrinsics:
|
||
+ The bfloat16 extension. This extension is enabled
|
||
automatically when Armv8.6-A is selected (such as by
|
||
-march=armv8.6-a). It can also be enabled for Armv8.2-A and
|
||
later using the +bf16 option extension.
|
||
+ The Matrix Multiply extension. This extension is split into
|
||
three parts, one for each supported data type:
|
||
o Support for 8-bit integer matrix multiply instructions.
|
||
This extension is enabled automatically when Armv8.6-A is
|
||
selected. It can also be enabled for Armv8.2-A and later
|
||
using the +i8mm option extension.
|
||
o Support for 32-bit floating-point matrix multiply
|
||
instructions. This extension can be enabled using the
|
||
+f32mm option extension, which also has the effect of
|
||
enabling SVE.
|
||
o Support for 64-bit floating-point matrix multiply
|
||
instructions. This extension can be enabled using the
|
||
+f64mm option extension, which likewise has the effect of
|
||
enabling SVE.
|
||
* SVE2 is now supported through ACLE intrinsics and (to a limited
|
||
extent) through autovectorization. It can be enabled through the
|
||
+sve2 option extension (for example, -march=armv8.5-a+sve2).
|
||
Additional extensions can be enabled through +sve2-sm4, +sve2-aes,
|
||
+sve2-sha3 and +sve2-bitperm.
|
||
* Support has been added for the following processors (GCC
|
||
identifiers in parentheses):
|
||
+ Arm Cortex-A77 (cortex-a77).
|
||
+ Arm Cortex-A76AE (cortex-a76ae).
|
||
+ Arm Cortex-A65 (cortex-a65).
|
||
+ Arm Cortex-A65AE (cortex-a65ae).
|
||
+ Arm Cortex-A34 (cortex-a34).
|
||
+ Marvell ThunderX3 (thunderx3t110).
|
||
The GCC identifiers can be used as arguments to the -mcpu or -mtune
|
||
options, for example: -mcpu=cortex-a77 or -mtune=cortex-a65ae or as
|
||
arguments to the equivalent target attributes and pragmas.
|
||
|
||
arm
|
||
|
||
* Support for the FDPIC ABI has been added. It uses 64-bit function
|
||
descriptors to represent pointers to functions, and enables code
|
||
sharing on MMU-less systems. The corresponding target triple is
|
||
arm-uclinuxfdpiceabi, and the C library is uclibc-ng.
|
||
* Support has been added for the Arm EABI on NetBSD through the
|
||
arm*-*-netbsdelf-*eabi* triplet.
|
||
* The handling of 64-bit integer operations has been significantly
|
||
reworked and improved leading to improved performance and reduced
|
||
stack usage when using 64-bit integral data types. The option
|
||
-mneon-for-64bits is now deprecated and will be removed in a future
|
||
release.
|
||
* Support has been added for the following processors (GCC
|
||
identifiers in parentheses):
|
||
+ Arm Cortex-A77 (cortex-a77).
|
||
+ Arm Cortex-A76AE (cortex-a76ae).
|
||
+ Arm Cortex-M35P (cortex-m35p).
|
||
+ Arm Cortex-M55 (cortex-m55).
|
||
The GCC identifiers can be used as arguments to the -mcpu or -mtune
|
||
options, for example: -mcpu=cortex-a77 or -mtune=cortex-m35p.
|
||
* Support has been extended for the ACLE [43]data-processing
|
||
intrinsics to include 32-bit SIMD, saturating arithmetic, 16-bit
|
||
multiplication and other related intrinsics aimed at DSP algorithm
|
||
optimization.
|
||
* Support for -mpure-code in Thumb-1 (v6m) has been added: this
|
||
M-profile feature is no longer restricted to targets with MOVT. For
|
||
example, -mcpu=cortex-m0 now supports this option.
|
||
* Support for the [44]Armv8.1-M Mainline Architecture has been added.
|
||
+ Armv8.1-M Mainline can be enabled by using the
|
||
-march=armv8.1-m.main command-line option.
|
||
* Support for the [45]MVE beta ACLE intrinsics has been added. These
|
||
intrinsics can be enabled by including the arm_mve.h header file
|
||
and passing the +mve or +mve.fp option extensions (for example:
|
||
-march=armv8.1-m.main+mve).
|
||
* Support for the Custom Datapath Extension beta ACLE [46]intrinsics
|
||
has been added.
|
||
* Support for Armv8.1-M Mainline Security Extensions architecture has
|
||
been added. The -mcmse option, when used in combination with an
|
||
Armv8.1-M Mainline architecture (for example: -march=armv8.1-m.main
|
||
-mcmse), now leads to the generation of improved code sequences
|
||
when changing security states.
|
||
|
||
AMD Radeon (GCN)
|
||
|
||
* The code generation and in particular the vectorization support has
|
||
been much improved.
|
||
|
||
ARC
|
||
|
||
* The interrupt service routine functions save all used registers,
|
||
including extension registers and auxiliary registers used by Zero
|
||
Overhead Loops.
|
||
* Improve code size by using multiple short instructions instead of a
|
||
single long mov or ior instruction when its long immediate constant
|
||
is known.
|
||
* Fix usage of the accumulator register for ARC600.
|
||
* Fix issues with uncached attribute.
|
||
* Remove -mq-class option.
|
||
* Improve 64-bit integer addition and subtraction operations.
|
||
|
||
AVR
|
||
|
||
* Support for the XMEGA-like devices
|
||
|
||
ATtiny202, ATtiny204, ATtiny402, ATtiny404, ATtiny406, ATtiny804,
|
||
ATtiny806, ATtiny807, ATtiny1604, ATtiny1606, ATtiny1607, ATmega808,
|
||
ATmega809, ATmega1608, ATmega1609, ATmega3208, ATmega3209,
|
||
ATmega4808, ATmega4809
|
||
has been added.
|
||
* A new command-line option -nodevicespecs has been added. It allows
|
||
to provide a custom device-specs file by means of
|
||
|
||
avr-gcc -nodevicespecs -specs=my-spec-file <options>
|
||
and without the need to provide options -B and -mmcu=. See [47]AVR
|
||
command-line options for details. This feature is also available in
|
||
GCC 9.3+ and GCC 8.4+.
|
||
* New command-line options -mdouble=[32,64] and -mlong-double=[32,64]
|
||
have been added. They allow to choose the size (in bits) of the
|
||
double and long double types, respectively. Whether or not the
|
||
mentioned layouts are available, whether the options act as a
|
||
multilib option, and the default for either option are controlled
|
||
by the new [48]AVR configure options --with-double= and
|
||
--with-long-double=.
|
||
* A new configure option --with-libf7= has been added. It controls to
|
||
which level avr-libgcc provides 64-bit floating point support by
|
||
means of [49]Libf7.
|
||
* A new configure option --with-double-comparison= has been added.
|
||
It's unlikely you need to set this option by hand.
|
||
|
||
IA-32/x86-64
|
||
|
||
* Support to expand __builtin_roundeven into the appropriate SSE 4.1
|
||
instruction has been added.
|
||
* New ISA extension support for Intel ENQCMD was added to GCC. ENQCMD
|
||
intrinsics are available via the -menqcmd compiler switch.
|
||
* GCC now supports the Intel CPU named Cooperlake through
|
||
-march=cooperlake. The switch enables the AVX512BF16 ISA
|
||
extensions.
|
||
* GCC now supports the Intel CPU named Tigerlake through
|
||
-march=tigerlake. The switch enables the MOVDIRI MOVDIR64B
|
||
AVX512VP2INTERSECT ISA extensions.
|
||
|
||
MIPS
|
||
|
||
* The mips*-*-linux* targets now mark object files with appropriate
|
||
GNU-stack note, facilitating use of non-executable stack hardening
|
||
on GNU/Linux. The soft-float targets have this feature enabled by
|
||
default, while for hard-float targets it is required for GCC to be
|
||
configured with --with-glibc-version=2.31 against glibc 2.31 or
|
||
later.
|
||
|
||
PowerPC / PowerPC64 / RS6000
|
||
|
||
* Many vector builtins have been listed as deprecated in the
|
||
[50]64-Bit ELF V2 ABI Specification for quite a number of years.
|
||
The vector builtins listed in Tables A.8 through A.10 are now
|
||
deprecated for GCC 10, and will likely be removed from support in
|
||
GCC 11. Note that this does not result in any loss of function.
|
||
These deprecated builtins generally provide somewhat nonsensical
|
||
argument lists (for example, mixing signed, unsigned, and bool
|
||
vector arguments arbitrarily), or are duplicate builtins that are
|
||
inconsistent with the expected naming scheme. We expect that this
|
||
will be unlikely to affect much if any code, and any required code
|
||
changes will be trivial.
|
||
|
||
PRU
|
||
|
||
* A new back end targeting TI PRU I/O processors has been contributed
|
||
to GCC.
|
||
|
||
RISC-V
|
||
|
||
* The riscv*-*-* targets now require GNU binutils version 2.30 or
|
||
later, to support new assembly instructions produced by GCC.
|
||
|
||
V850
|
||
|
||
* The ABI for V850 nested functions has been changed. Previously the
|
||
V850 port used %r20 for the static chain pointer, now the port uses
|
||
%r19. This corrects a long standing latent bug in the v850 port
|
||
where a call to a nested function would unexpectedly change the
|
||
value in %r20.
|
||
|
||
Operating Systems
|
||
|
||
Improvements for plugin authors
|
||
|
||
* GCC diagnostics can now have a chain of events associated with
|
||
them, describing a path through the code that triggers the problem.
|
||
These can be printed by the diagnostics subsystem in various ways,
|
||
controlled by the [51]-fdiagnostics-path-format option, or captured
|
||
in JSON form via [52]-fdiagnostics-format=json.
|
||
* GCC diagnostics can now be associated with [53]CWE weakness
|
||
identifiers, which will appear on the standard error stream, and in
|
||
the JSON output from [54]-fdiagnostics-format=json.
|
||
|
||
Other significant improvements
|
||
|
||
* To allow inline expansion of both memcpy and memmove, the existing
|
||
movmem instruction patterns used for non-overlapping memory copies
|
||
have been renamed to cpymem. The movmem name is now used for
|
||
overlapping memory moves, consistent with the library functions
|
||
memcpy and memmove.
|
||
* For many releases, when GCC emits a warning it prints the option
|
||
controlling that warning. As of GCC 10, that option text is now a
|
||
clickable hyperlink for the documentation of that option (assuming
|
||
a [55]sufficiently capable terminal). This behavior can be
|
||
controlled via a new [56]-fdiagnostics-urls option (along with
|
||
various environment variables and heuristics documented with that
|
||
option).
|
||
|
||
GCC 10.1
|
||
|
||
This is the [57]list of problem reports (PRs) from GCC's bug tracking
|
||
system that are known to be fixed in the 10.1 release. This list might
|
||
not be complete (that is, it is possible that some PRs that have been
|
||
fixed are not listed here).
|
||
|
||
GCC 10.2
|
||
|
||
This is the [58]list of problem reports (PRs) from GCC's bug tracking
|
||
system that are known to be fixed in the 10.2 release. This list might
|
||
not be complete (that is, it is possible that some PRs that have been
|
||
fixed are not listed here).
|
||
|
||
GCC 10.3
|
||
|
||
This is the [59]list of problem reports (PRs) from GCC's bug tracking
|
||
system that are known to be fixed in the 10.3 release. This list might
|
||
not be complete (that is, it is possible that some PRs that have been
|
||
fixed are not listed here).
|
||
|
||
Target Specific Changes
|
||
|
||
AArch64
|
||
|
||
* A bug with the Random Number intrinsics in the arm_acle.h header
|
||
that resulted in an incorrect status result being returned has been
|
||
fixed.
|
||
* GCC now supports the Fujitsu A64FX. The associated -mcpu and -mtune
|
||
options are -mcpu=a64fx and -mtune=a64fx respectively. In
|
||
particular, -mcpu=a64fx generates code for Armv8.2-A with SVE and
|
||
tunes the code for the A64FX. This includes tuning the SVE code,
|
||
although by default the code is still length-agnostic and so works
|
||
for all SVE implementations. Adding -msve-vector-bits=512 makes the
|
||
code specific to 512-bit SVE.
|
||
|
||
x86-64
|
||
|
||
* GCC 10.3 supports AMD CPUs based on the znver3 core via
|
||
-march=znver3.
|
||
|
||
GCC 10.4
|
||
|
||
This is the [60]list of problem reports (PRs) from GCC's bug tracking
|
||
system that are known to be fixed in the 10.4 release. This list might
|
||
not be complete (that is, it is possible that some PRs that have been
|
||
fixed are not listed here).
|
||
|
||
Target Specific Changes
|
||
|
||
x86-64
|
||
|
||
* The x86-64 ABI of passing and returning structures with a 64-bit
|
||
integer vector changed in GCC 10.1 when MMX is disabled. Disabling
|
||
MMX no longer changes how they are passed nor returned. This ABI
|
||
change is now diagnosed with -Wpsabi.
|
||
|
||
|
||
For questions related to the use of GCC, please consult these web
|
||
pages and the [61]GCC manuals. If that fails, the
|
||
[62]gcc-help@gcc.gnu.org mailing list might help. Comments on these
|
||
web pages and the development of GCC are welcome on our developer
|
||
list at [63]gcc@gcc.gnu.org. All of [64]our lists have public
|
||
archives.
|
||
|
||
Copyright (C) [65]Free Software Foundation, Inc. Verbatim copying and
|
||
distribution of this entire article is permitted in any medium,
|
||
provided this notice is preserved.
|
||
|
||
These pages are [66]maintained by the GCC team. Last modified
|
||
2022-06-28[67].
|
||
|
||
References
|
||
|
||
1. http://gcc.gnu.org/gcc-10/porting_to.html
|
||
2. http://gcc.gnu.org/onlinedocs/index.html#current
|
||
3. http://gcc.gnu.org/gcc-10/changes.html#empty_base
|
||
4. https://www.mpfr.org/
|
||
5. http://gcc.gnu.org/gcc-10/changes.html#iterator_base
|
||
6. https://gcc.gnu.org/onlinedocs/gcc-10.1.0/cpp/_005f_005fhas_005fbuiltin.html#g_t_005f_005fhas_005fbuiltin
|
||
7. https://gcc.gnu.org/onlinedocs/gcc-10.1.0/gcc/Optimize-Options.html#index-fno-allocation-dce
|
||
8. https://gcc.gnu.org/onlinedocs/gcc-10.1.0/gcc/Optimize-Options.html#index-fprofile-partial-training
|
||
9. https://gcc.gnu.org/onlinedocs/gcc-10.1.0/gcc/Instrumentation-Options.html#index-fprofile-reproducible
|
||
10. https://gcc.gnu.org/onlinedocs/gcc-10.1.0/gcc/Instrumentation-Options.html#index-fprofile-generate
|
||
11. https://gcc.gnu.org/onlinedocs/gcc-10.1.0/gcc/Instrumentation-Options.html#index-fprofile-prefix-path
|
||
12. https://gcc.gnu.org/onlinedocs/gcc-10.1.0/gcc/Static-Analyzer-Options.html
|
||
13. https://gcc.gnu.org/onlinedocs/gcc-10.1.0/gcc/Optimize-Options.html#index-finline-functions
|
||
14. https://gcc.gnu.org/onlinedocs/gcc-10.1.0/gcc/lto-dump.html
|
||
15. https://facebook.github.io/zstd/
|
||
16. https://gcc.gnu.org/onlinedocs/gcc-10.1.0/gcc/Optimize-Options.html#index-fprofile-values
|
||
17. https://www.openacc.org/
|
||
18. https://gcc.gnu.org/wiki/OpenACC/Implementation%20Status#status-10
|
||
19. https://gcc.gnu.org/onlinedocs/gcc-10.1.0/libgomp/#toc-Enabling-OpenACC-1
|
||
20. https://www.openmp.org/specifications/
|
||
21. https://gcc.gnu.org/wiki/Offloading
|
||
22. https://gcc.gnu.org/onlinedocs/gcc-10.1.0/gcc/Warning-Options.html#index-Wstring-compare
|
||
23. https://gcc.gnu.org/onlinedocs/gcc-10.1.0/gcc/Warning-Options.html#index-Wzero-length-bounds
|
||
24. https://gcc.gnu.org/onlinedocs/gcc-10.1.0/gcc/Warning-Options.html#index-Warray-bounds
|
||
25. https://gcc.gnu.org/onlinedocs/gcc-10.1.0/gcc/Warning-Options.html#index-Wformat-overflow
|
||
26. https://gcc.gnu.org/onlinedocs/gcc-10.1.0/gcc/Warning-Options.html#index-Wrestrict
|
||
27. https://gcc.gnu.org/onlinedocs/gcc-10.1.0/gcc/Warning-Options.html#index-Wreturn-local-addr
|
||
28. https://gcc.gnu.org/onlinedocs/gcc-10.1.0/gcc/Warning-Options.html#index-Wstringop-overflow
|
||
29. https://gcc.gnu.org/onlinedocs/gcc-10.1.0/gcc/Warning-Options.html#index-Warith-conversion
|
||
30. https://gcc.gnu.org/onlinedocs/gcc-10.1.0/gcc/C_002b_002b-Dialect-Options.html#index-Wmismatched-tags
|
||
31. https://gcc.gnu.org/onlinedocs/gcc-10.1.0/gcc/C_002b_002b-Dialect-Options.html#index-Wredundant-tags
|
||
32. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94383
|
||
33. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94711
|
||
34. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94707
|
||
35. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94704
|
||
36. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94706
|
||
37. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92285
|
||
38. https://www.openmp.org/specifications/
|
||
39. https://gcc.gnu.org/onlinedocs/jit/topics/compatibility.html#c.gcc_jit_version_major
|
||
40. https://gcc.gnu.org/onlinedocs/jit/topics/compatibility.html#c.gcc_jit_version_minor
|
||
41. https://gcc.gnu.org/onlinedocs/jit/topics/compatibility.html#c.gcc_jit_version_patchlevel
|
||
42. https://gcc.gnu.org/onlinedocs/jit/topics/types.html#c.gcc_jit_context_new_bitfield
|
||
43. https://developer.arm.com/documentation/101028/0009/Data-processing-intrinsics
|
||
44. https://developer.arm.com/architectures/cpu-architecture/m-profile
|
||
45. https://developer.arm.com/architectures/instruction-sets/simd-isas/helium/helium-intrinsics
|
||
46. https://developer.arm.com/documentation/101028/0010/Custom-Datapath-Extension
|
||
47. https://gcc.gnu.org/onlinedocs/gcc-10.1.0/gcc/AVR-Options.html#index-nodevicespecs
|
||
48. https://gcc.gnu.org/install/configure.html#avr
|
||
49. https://gcc.gnu.org/wiki/avr-gcc#Libf7
|
||
50. https://openpowerfoundation.org/?resource_lib=64-bit-elf-v2-abi-specification-power-architecture
|
||
51. https://gcc.gnu.org/onlinedocs/gcc-10.1.0/gcc/Diagnostic-Message-Formatting-Options.html#index-fdiagnostics-path-format
|
||
52. https://gcc.gnu.org/onlinedocs/gcc-10.1.0/gcc/Diagnostic-Message-Formatting-Options.html#index-fdiagnostics-format
|
||
53. https://cwe.mitre.org/
|
||
54. https://gcc.gnu.org/onlinedocs/gcc-10.1.0/gcc/Diagnostic-Message-Formatting-Options.html#index-fdiagnostics-format
|
||
55. https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda
|
||
56. https://gcc.gnu.org/onlinedocs/gcc-10.1.0/gcc/Diagnostic-Message-Formatting-Options.html#index-fdiagnostics-urls
|
||
57. https://gcc.gnu.org/bugzilla/buglist.cgi?bug_status=RESOLVED&resolution=FIXED&target_milestone=10.0
|
||
58. https://gcc.gnu.org/bugzilla/buglist.cgi?bug_status=RESOLVED&resolution=FIXED&target_milestone=10.2
|
||
59. https://gcc.gnu.org/bugzilla/buglist.cgi?bug_status=RESOLVED&resolution=FIXED&target_milestone=10.3
|
||
60. https://gcc.gnu.org/bugzilla/buglist.cgi?bug_status=RESOLVED&resolution=FIXED&target_milestone=10.4
|
||
61. https://gcc.gnu.org/onlinedocs/
|
||
62. mailto:gcc-help@gcc.gnu.org
|
||
63. mailto:gcc@gcc.gnu.org
|
||
64. https://gcc.gnu.org/lists.html
|
||
65. https://www.fsf.org/
|
||
66. https://gcc.gnu.org/about.html
|
||
67. http://validator.w3.org/check/referer
|
||
======================================================================
|
||
http://gcc.gnu.org/gcc-9/index.html
|
||
|
||
GCC 9 Release Series
|
||
|
||
May 27, 2022
|
||
|
||
The [1]GNU project and the GCC developers are pleased to announce the
|
||
release of GCC 9.5.
|
||
|
||
This release is a bug-fix release, containing fixes for regressions in
|
||
GCC 9.4 relative to previous releases of GCC.
|
||
|
||
Release History
|
||
|
||
GCC 9.5
|
||
May 27, 2022 ([2]changes, [3]documentation)
|
||
|
||
GCC 9.4
|
||
June 1, 2021 ([4]changes, [5]documentation)
|
||
|
||
GCC 9.3
|
||
Mar 12, 2020 ([6]changes, [7]documentation)
|
||
|
||
GCC 9.2
|
||
Aug 12, 2019 ([8]changes, [9]documentation)
|
||
|
||
GCC 9.1
|
||
May 3, 2019 ([10]changes, [11]documentation)
|
||
|
||
References and Acknowledgements
|
||
|
||
GCC used to stand for the GNU C Compiler, but since the compiler
|
||
supports several other languages aside from C, it now stands for the
|
||
GNU Compiler Collection.
|
||
|
||
A list of [12]successful builds is updated as new information becomes
|
||
available.
|
||
|
||
The GCC developers would like to thank the numerous people that have
|
||
contributed new features, improvements, bug fixes, and other changes as
|
||
well as test results to GCC. This [13]amazing group of volunteers is
|
||
what makes GCC successful.
|
||
|
||
For additional information about GCC please refer to the [14]GCC
|
||
project web site or contact the [15]GCC development mailing list.
|
||
|
||
To obtain GCC please use [16]our mirror sites or [17]our version
|
||
control system.
|
||
|
||
|
||
For questions related to the use of GCC, please consult these web
|
||
pages and the [18]GCC manuals. If that fails, the
|
||
[19]gcc-help@gcc.gnu.org mailing list might help. Comments on these
|
||
web pages and the development of GCC are welcome on our developer
|
||
list at [20]gcc@gcc.gnu.org. All of [21]our lists have public
|
||
archives.
|
||
|
||
Copyright (C) [22]Free Software Foundation, Inc. Verbatim copying and
|
||
distribution of this entire article is permitted in any medium,
|
||
provided this notice is preserved.
|
||
|
||
These pages are [23]maintained by the GCC team. Last modified
|
||
2022-05-27[24].
|
||
|
||
References
|
||
|
||
1. http://www.gnu.org/
|
||
2. http://gcc.gnu.org/gcc-9/changes.html
|
||
3. http://gcc.gnu.org/onlinedocs/9.5.0/
|
||
4. http://gcc.gnu.org/gcc-9/changes.html
|
||
5. http://gcc.gnu.org/onlinedocs/9.4.0/
|
||
6. http://gcc.gnu.org/gcc-9/changes.html
|
||
7. http://gcc.gnu.org/onlinedocs/9.3.0/
|
||
8. http://gcc.gnu.org/gcc-9/changes.html
|
||
9. http://gcc.gnu.org/onlinedocs/9.2.0/
|
||
10. http://gcc.gnu.org/gcc-9/changes.html
|
||
11. http://gcc.gnu.org/onlinedocs/9.1.0/
|
||
12. http://gcc.gnu.org/gcc-9/buildstat.html
|
||
13. http://gcc.gnu.org/onlinedocs/gcc-9.1.0/gcc/Contributors.html
|
||
14. http://gcc.gnu.org/index.html
|
||
15. mailto:gcc@gcc.gnu.org
|
||
16. http://gcc.gnu.org/mirrors.html
|
||
17. http://gcc.gnu.org/git.html
|
||
18. https://gcc.gnu.org/onlinedocs/
|
||
19. mailto:gcc-help@gcc.gnu.org
|
||
20. mailto:gcc@gcc.gnu.org
|
||
21. https://gcc.gnu.org/lists.html
|
||
22. https://www.fsf.org/
|
||
23. https://gcc.gnu.org/about.html
|
||
24. http://validator.w3.org/check/referer
|
||
======================================================================
|
||
http://gcc.gnu.org/gcc-9/changes.html
|
||
|
||
GCC 9 Release Series
|
||
Changes, New Features, and Fixes
|
||
|
||
This page is a "brief" summary of some of the huge number of
|
||
improvements in GCC 9. You may also want to check out our [1]Porting to
|
||
GCC 9 page and the [2]full GCC documentation.
|
||
|
||
Caveats
|
||
|
||
* On Arm targets (arm*-*-*), [3]a bug in the implementation of the
|
||
procedure call standard (AAPCS) in the GCC 6, 7 and 8 releases has
|
||
been fixed: a structure containing a bit-field based on a 64-bit
|
||
integral type and where no other element in a structure required
|
||
64-bit alignment could be passed incorrectly to functions. This is
|
||
an ABI change. If the option -Wpsabi is enabled (on by default) the
|
||
compiler will emit a diagnostic note for code that might be
|
||
affected.
|
||
* Support for a number of older systems and recently unmaintained or
|
||
untested target ports of GCC has been declared obsolete in GCC 9.
|
||
Unless there is activity to revive them, the next release of GCC
|
||
will have their sources permanently removed.
|
||
The following ports for individual systems on particular
|
||
architectures have been obsoleted:
|
||
+ Solaris 10 (*-*-solaris2.10). Details can be found in the
|
||
[4]announcement.
|
||
+ Cell Broadband Engine SPU (spu*-*-*). Details can be found in
|
||
the [5]announcement.
|
||
* A change to the C++ std::rotate algorithm in GCC 9.1.0 can cause
|
||
ABI incompatibilities with object files compiled with other
|
||
versions of GCC. If the std::rotate algorithm is called with an
|
||
empty range then it might cause a divide-by-zero error (as a SIGFPE
|
||
signal) and crash. The change has been reverted for GCC 9.2.0 and
|
||
future releases. For more details see [6]Bug 90920. The problem can
|
||
be avoided by recompiling any objects that might call std::rotate
|
||
with an empty range, so that the GCC 9.1.0 definition of
|
||
std::rotate is not used.
|
||
* The automatic template instantiation at link time ([7]-frepo) has
|
||
been deprecated and will be removed in a future release.
|
||
* The --with-default-libstdcxx-abi=gcc4-compatible configure option
|
||
is broken in the 9.1 and 9.2 releases, producing a shared library
|
||
with missing symbols (see [8]Bug 90361). As a workaround, configure
|
||
without that option and build GCC as normal, then edit the
|
||
installed <bits/c++config.h> headers to define the
|
||
_GLIBCXX_USE_CXX11_ABI macro to 0.
|
||
|
||
General Improvements
|
||
|
||
The following GCC command line options have been introduced or
|
||
improved.
|
||
* All command line options that take a byte-size argument accept
|
||
64-bit integers as well as standard SI and IEC suffixes such as kb
|
||
and KiB, MB and MiB, or GB and GiB denoting the corresponding
|
||
multiples of bytes. See [9]Invoking GCC for more.
|
||
* A new option,
|
||
[10]-flive-patching=[inline-only-static|inline-clone], has been
|
||
introduced to provide a safe compilation for live-patching. At the
|
||
same time, provides multiple-level control on the enabled IPA
|
||
optimizations. See the user guide for more details about the
|
||
option.
|
||
* A new option, --completion, has been added to provide more fine
|
||
option completion in a shell. It is intended to be used by
|
||
Bash-completion.
|
||
* GCC's diagnostics now print source code with a left margin showing
|
||
line numbers, configurable with
|
||
[11]-fno-diagnostics-show-line-numbers.
|
||
GCC's diagnostics can also now label regions of the source code to
|
||
show pertinent information, such as the types within an expression.
|
||
$ g++ t.cc
|
||
t.cc: In function 'int test(const shape&, const shape&)':
|
||
t.cc:15:4: error: no match for 'operator+' (operand types are 'boxed_value<doubl
|
||
e>' and 'boxed_value<double>')
|
||
14 | return (width(s1) * height(s1)
|
||
| ~~~~~~~~~~~~~~~~~~~~~~
|
||
| |
|
||
| boxed_value<[...]>
|
||
15 | + width(s2) * height(s2));
|
||
| ^ ~~~~~~~~~~~~~~~~~~~~~~
|
||
| |
|
||
| boxed_value<[...]>
|
||
|
||
These labels can be disabled via [12]-fno-diagnostics-show-labels.
|
||
* A new option [13]-fdiagnostics-format=json has been introduced for
|
||
emitting diagnostics in a machine-readable format.
|
||
* The alignment-related options [14]-falign-functions,
|
||
[15]-falign-labels, [16]-falign-loops, and [17]-falign-jumps
|
||
received support for a secondary alignment (e.g.
|
||
-falign-loops=n:m:n2:m2).
|
||
* New pair of profiling options ([18]-fprofile-filter-files and
|
||
[19]-fprofile-exclude-files) has been added. The options help to
|
||
filter which source files are instrumented.
|
||
* AddressSanitizer generates more compact redzones for automatic
|
||
variables. That helps to reduce memory footprint of a sanitized
|
||
binary.
|
||
* Numerous improvements have been made to the output of
|
||
[20]-fopt-info.
|
||
Messages are now prefixed with optimized, missed, or note, rather
|
||
than the old behavior of all being prefixed with note.
|
||
The output from -fopt-info can now contain information on inlining
|
||
decisions:
|
||
$ g++ -c inline.cc -O2 -fopt-info-inline-all
|
||
inline.cc:24:11: note: Considering inline candidate void foreach(T, T, void (*)(
|
||
E)) [with T = char**; E = char*]/2.
|
||
inline.cc:24:11: optimized: Inlining void foreach(T, T, void (*)(E)) [with T =
|
||
char**; E = char*]/2 into int main(int, char**)/1.
|
||
inline.cc:19:12: missed: not inlinable: void inline_me(char*)/0 -> int std::pu
|
||
ts(const char*)/3, function body not available
|
||
inline.cc:13:8: optimized: Inlined void inline_me(char*)/4 into int main(int, c
|
||
har**)/1 which now has time 127.363637 and size 11, net change of +0.
|
||
Unit growth for small function inlining: 16->16 (0%)
|
||
|
||
Inlined 2 calls, eliminated 1 functions
|
||
|
||
|
||
The output from the vectorizer has been rationalized so that failed
|
||
attempts to vectorize a loop are displayed in the form
|
||
[LOOP-LOCATION]: couldn't vectorize this loop
|
||
[PROBLEM-LOCATION]: because of [REASON]
|
||
|
||
rather than an exhaustive log of all decisions made by the
|
||
vectorizer. For example:
|
||
$ gcc -c v.c -O3 -fopt-info-all-vec
|
||
v.c:7:3: missed: couldn't vectorize loop
|
||
v.c:10:7: missed: statement clobbers memory: __asm__ __volatile__("" : : : "me
|
||
mory");
|
||
v.c:3:6: note: vectorized 0 loops in function.
|
||
v.c:10:7: missed: statement clobbers memory: __asm__ __volatile__("" : : : "me
|
||
mory");
|
||
|
||
The old behavior can be obtained via a new -internals suboption of
|
||
-fopt-info.
|
||
* A new option, [21]-fsave-optimization-record has been added, which
|
||
writes a SRCFILE.opt-record.json.gz file describing the
|
||
optimization decisions made by GCC. This is similar to the output
|
||
of -fopt-info, but with additional metadata such as the inlining
|
||
chain, and profile information (if available).
|
||
* Inter-procedural propagation of stack alignment can now be
|
||
controlled by [22]-fipa-stack-alignment.
|
||
* Propagation of addressability, readonly and writeonly flags on
|
||
static variables can now be controlled by
|
||
[23]-fipa-reference-addressable.
|
||
|
||
The following built-in functions have been introduced.
|
||
* [24]__builtin_expect_with_probability to provide branch prediction
|
||
probability hints to the optimizer.
|
||
* [25]__builtin_has_attribute determines whether a function, type, or
|
||
variable has been declared with some attribute.
|
||
* [26]__builtin_speculation_safe_value can be used to help mitigate
|
||
against unsafe speculative execution.
|
||
|
||
The following attributes have been introduced.
|
||
* The [27]copy function attribute has been added. The attribute can
|
||
also be applied to type definitions and to variable declarations.
|
||
|
||
A large number of improvements to code generation have been made,
|
||
including but not limited to the following.
|
||
* Switch expansion has been improved by using a different strategy
|
||
(jump table, bit test, decision tree) for a subset of switch cases.
|
||
* A linear function expression defined as a switch statement can be
|
||
transformed by [28]-ftree-switch-conversion. For example:
|
||
|
||
int
|
||
foo (int how)
|
||
{
|
||
switch (how) {
|
||
case 2: how = 205; break;
|
||
case 3: how = 305; break;
|
||
case 4: how = 405; break;
|
||
case 5: how = 505; break;
|
||
case 6: how = 605; break;
|
||
}
|
||
return how;
|
||
}
|
||
|
||
can be transformed into 100 * how + 5 (for values defined in the
|
||
switch statement).
|
||
* Inter-procedural optimization improvements:
|
||
+ Inliner defaults was tuned to better suits modern C++
|
||
codebases especially when built with link time optimizations.
|
||
New parameters max-inline-insns-small, max-inline-insns-size,
|
||
uninlined-function-insns, uninlined-function-time,
|
||
uninlined-thunk-insns, and uninlined-thunk-time were added.
|
||
+ Hot/cold partitioning is now more precise and aggressive.
|
||
+ Improved scalability for very large translation units
|
||
(especially when link-time optimizing large programs).
|
||
* Profile driven optimization improvements:
|
||
+ [29]-fprofile-use now enables [30]-fversion-loops-for-strides,
|
||
[31]-floop-interchange, [32]-floop-unroll-and-jam,
|
||
[33]-ftree-loop-distribution.
|
||
+ Streaming of counter histograms was removed. This reduces the
|
||
size of profile files. Histogram is computed on the fly with
|
||
link-time optimization. Parameter hot-bb-count-ws-permille was
|
||
reduced from 999 to 990 to account for more precise
|
||
histograms.
|
||
* Link-time optimization improvements:
|
||
+ Types are now simplified prior streaming resulting in
|
||
significant reductions of the LTO object files, link-time
|
||
memory use, and improvements of link-time parallelism.
|
||
+ Default number of partitions (--param lto-partitions) was
|
||
increased from 32 to 128 enabling effective use of CPUs with
|
||
more than 32 hyperthreads. --param
|
||
lto-max-streaming-parallelism can now be used to control
|
||
number of streaming processes.
|
||
+ Warnings on C++ One Decl Rule violations (-Wodr) are now more
|
||
informative and produce fewer redundant results.
|
||
Overall compile time of Firefox 66 and LibreOffice 6.2.3 on an
|
||
8-core machine was reduced by about 5% compared to GCC 8.3, and the
|
||
size of LTO object files by 7%. LTO link-time improves by 11% on an
|
||
8-core machine and scales significantly better for more parallel
|
||
build environments. The serial stage of the link-time optimization
|
||
is 28% faster consuming 20% less memory. The parallel stage now
|
||
scales to up to 128 partitions rather than 32 and reduces memory
|
||
use for every worker by 30%.
|
||
|
||
The following improvements to the gcov command-line utility have been
|
||
made.
|
||
* The gcov tool received a new option [34]--use-hotness-colors (-q)
|
||
that can provide perf-like coloring of hot functions.
|
||
* The gcov tool has changed its intermediate format to a new JSON
|
||
format.
|
||
|
||
New Languages and Language specific improvements
|
||
|
||
[35]OpenACC support in C, C++, and Fortran continues to be maintained
|
||
and improved. Most of the OpenACC 2.5 specification is implemented. See
|
||
the [36]implementation status section on the OpenACC wiki page for
|
||
further information.
|
||
|
||
C family
|
||
|
||
* Version 5.0 of the [37]OpenMP specification is now partially
|
||
supported in the C and C++ compilers. For details which features of
|
||
OpenMP 5.0 are and which are not supported in the GCC 9 release see
|
||
[38]this mail.
|
||
* New extensions:
|
||
+ [39]__builtin_convertvector built-in for vector conversions
|
||
has been added.
|
||
* New warnings:
|
||
+ [40]-Waddress-of-packed-member, enabled by default, warns
|
||
about an unaligned pointer value from the address of a packed
|
||
member of a struct or union.
|
||
* Enhancements to existing warnings:
|
||
+ [41]-Warray-bounds detects more instances of out-of-bounds
|
||
indices.
|
||
+ [42]-Wattribute-alias also detects attribute mismatches
|
||
between alias declarations and their targets, in addition to
|
||
mismatches between their types.
|
||
+ [43]-Wformat-overflow and [44]-Wformat-truncation have been
|
||
extended to all formatted input/output functions (where
|
||
applicable) and enhanced to detect a subset of instances of
|
||
reading past the end of unterminated constant character arrays
|
||
in %s directives.
|
||
+ [45]-Wmissing-attributes detects instances of missing function
|
||
attributes on declarations of aliases and weak references.
|
||
+ [46]-Wstringop-truncation also detects a subset of instances
|
||
of reading past the end of unterminated constant character
|
||
arrays,
|
||
* If a macro is used with the wrong argument count, the C and C++
|
||
front ends now show the definition of that macro via a note.
|
||
* The spelling corrector now considers transposed letters, and the
|
||
threshold for similarity has been tightened, to avoid nonsensical
|
||
suggestions.
|
||
|
||
C
|
||
|
||
* There is now experimental support for -std=c2x, to select support
|
||
for the upcoming C2X revision of the ISO C standard. This standard
|
||
is in the early stages of development and the only feature
|
||
supported in GCC 9 is _Static_assert with a single argument
|
||
(support for _Static_assert with two arguments was added in C11 and
|
||
GCC 4.6). There are also new options -std=gnu2x, for C2X with GNU
|
||
extensions, and -Wc11-c2x-compat, to warn for uses of features
|
||
added in C2X (such warnings are also enabled by use of -Wpedantic
|
||
if not using -std=c2x or -std=gnu2x).
|
||
* New warnings:
|
||
+ [47]-Wabsolute-value warns for calls to standard functions
|
||
that compute the absolute value of an argument when a more
|
||
appropriate standard function is available. For example,
|
||
calling abs(3.14) triggers the warning because the appropriate
|
||
function to call to compute the absolute value of a double
|
||
argument is fabs. The option also triggers warnings when the
|
||
argument in a call to such a function has an unsigned type.
|
||
This warning can be suppressed with an explicit type cast and
|
||
it is also enabled by -Wextra.
|
||
|
||
C++
|
||
|
||
* New warnings:
|
||
+ [48]-Wdeprecated-copy, implied by -Wextra, warns about the
|
||
C++11 deprecation of implicitly declared copy constructor and
|
||
assignment operator if one of them is user-provided.
|
||
-Wdeprecated-copy-dtor also warns if the destructor is
|
||
user-provided, as specified in C++11.
|
||
+ [49]-Winit-list-lifetime, on by default, warns about uses of
|
||
std::initializer_list that are likely to result in a dangling
|
||
pointer, such as returning or assigning from a temporary list.
|
||
+ [50]-Wredundant-move, implied by -Wextra, warns about
|
||
redundant calls to std::move.
|
||
+ [51]-Wpessimizing-move, implied by -Wall, warns when a call to
|
||
std::move prevents copy elision.
|
||
+ [52]-Wclass-conversion, on by default, warns when a conversion
|
||
function will never be called due to the type it converts to.
|
||
* The C++ front end has experimental support for some of the upcoming
|
||
C++2a draft features with the -std=c++2a or -std=gnu++2a flags,
|
||
including range-based for statements with initializer, default
|
||
constructible and assignable stateless lambdas, lambdas in
|
||
unevaluated contexts, language support for empty data members,
|
||
allowing pack expansion in lambda init-capture, likely and unlikely
|
||
attributes, class types in non-type template parameters, allowing
|
||
virtual function calls in constant expressions, explicit(bool),
|
||
std::is_constant_evaluated, nested inline namespaces, etc. For a
|
||
full list of new features, see [53]the C++ status page.
|
||
* The C++ front end now preserves source locations for literals,
|
||
id-expression, and mem-initializer for longer. For example it is
|
||
now able to pin-point the pertinent locations for bad
|
||
initializations such as these
|
||
$ g++ -c bad-inits.cc
|
||
bad-inits.cc:10:14: error: cannot convert 'json' to 'int' in initialization
|
||
10 | { 3, json::object },
|
||
| ~~~~~~^~~~~~
|
||
| |
|
||
| json
|
||
bad-inits.cc:14:31: error: initializer-string for array of chars is too long [-f
|
||
permissive]
|
||
14 | char buffers[3][5] = { "red", "green", "blue" };
|
||
| ^~~~~~~
|
||
bad-inits.cc: In constructor 'X::X()':
|
||
bad-inits.cc:17:13: error: invalid conversion from 'int' to 'void*' [-fpermissiv
|
||
e]
|
||
17 | X() : one(42), two(42), three(42)
|
||
| ^~
|
||
| |
|
||
| int
|
||
|
||
rather than emitting the error at the final closing parenthesis or
|
||
brace.
|
||
* Error-reporting of overload resolution has been special-cased to
|
||
make the case of a single failed candidate easier to read. For
|
||
example:
|
||
$ g++ param-type-mismatch.cc
|
||
param-type-mismatch.cc: In function 'int test(int, const char*, float)':
|
||
param-type-mismatch.cc:8:32: error: cannot convert 'const char*' to 'const char*
|
||
*'
|
||
8 | return foo::member_1 (first, second, third);
|
||
| ^~~~~~
|
||
| |
|
||
| const char*
|
||
param-type-mismatch.cc:3:46: note: initializing argument 2 of 'static int foo:
|
||
:member_1(int, const char**, float)'
|