Doc Text:
|
.GCC 11.2.1 is available
RHEL 9 is distributed with GCC version 11.2.1. Notable bug fixes and enhancements include:
*General improvements*
* GCC now defaults to the DWARF Version 5 debugging format.
* Column numbers shown in diagnostics represent real column numbers by default and respect multicolumn characters.
* The straight-line code vectorizer considers the whole function when vectorizing.
* 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.
* Interprocedural optimization improvements:
** A new IPA-modref pass, controlled by the `-fipa-modref` option, tracks side effects of function calls and improves the precision of points-to analysis.
** The identical code folding pass, controlled by the `-fipa-icf` option, was significantly improved to increase the number of unified functions and reduce compile-time memory use.
* Link-time optimization improvements:
** Link-time optimization (LTO) enables the compiler to perform various optimizations across all translation units of your program by using its intermediate representation at link time. For more information, see link:https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html-single/developing_c_and_cpp_applications_in_rhel_9/index#ref_link-time-optimization_using-libraries-with-gcc[Link time optimization].
** Memory allocation during linking was improved to reduce peak memory use.
* Using a new `GCC_EXTRA_DIAGNOSTIC_OUTPUT` environment variable in IDEs, you can request machine-readable “fix-it hints” without adjusting build flags.
* The static analyzer, run by the `-fanalyzer` option, is improved significantly with numerous bug fixes and enhancements provided.
*Language-specific improvements*
*C family*
* C and C++ compilers support non-rectangular loop nests in OpenMP constructs and the allocator routines of the OpenMP 5.0 specification.
* Attributes:
** The new `no_stack_protector` attribute marks functions that should not be instrumented with stack protection (`-fstack-protector`).
** The improved `malloc` attribute can be used to identify allocator and deallocator API pairs.
* New warnings:
** `-Wsizeof-array-div`, enabled by the `-Wall` option, 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.
** `-Wstringop-overread`, enabled by default, warns about calls to string functions that try to read past the end of the arrays passed to them as arguments.
* Enhanced warnings:
** `-Wfree-nonheap-object` detects more instances of calls to deallocation functions with pointers not returned from a dynamic memory allocation function.
** `-Wmaybe-uninitialized` diagnoses the passing of pointers and references to uninitialized memory to functions that take `const`-qualified arguments.
** `-Wuninitialized` detects reads from uninitialized dynamically allocated memory.
*C*
* Several new features from the upcoming C2X revision of the ISO C standard are supported with the `-std=c2x` and `-std=gnu2x` options. For example:
** The `[[nodiscard]]` standard attribute is supported.
** The `__has_c_attribute` preprocessor operator is supported.
** Labels may appear before declarations and at the end of a compound statement.
*C++*
* The default mode is changed to `-std=gnu++17`.
* The pass:[C++] library `pass:[libstdc++]` has improved C++17 support now.
* Several new pass:[C++20] features are implemented. Note that pass:[C++20] support is experimental.
+
For more information about the features, see link:https://gcc.gnu.org/projects/cxx-status.html#cxx20[C++20 Language Features].
* The pass:[C++] front end has experimental support for some of the upcoming pass:[C++23] draft features.
* New warnings:
** `-Wctad-maybe-unsupported`, disabled by default, warns about performing class template argument deduction on a type with no deduction guides.
** `-Wrange-loop-construct`, enabled by `-Wall`, warns when a range-based for loop is creating unnecessary and resource inefficient copies.
** `-Wmismatched-new-delete`, enabled by `-Wall`, warns about calls to operator delete with pointers returned from mismatched forms of operator new or from other mismatched allocation functions.
** `-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.
*Architecture-specific improvements*
*The 64-bit ARM architecture*
* The Armv8-R architecture is supported through the `-march=armv8-r` option.
* GCC can autovectorize operations performing addition, subtraction, multiplication, and the accumulate and subtract variants on complex numbers.
*AMD and Intel 64-bit architectures*
//* The following Intel CPUs are recognized: Sapphire Rapids, Alder Lake, and Rocket Lake.
* New ISA extension support for Intel AVX-VNNI is added. The `-mavxvnni` compiler switch controls the AVX-VNNI intrinsics.
* AMD CPUs based on the znver3 core are supported with the new `-march=znver3` option.
* Three microarchitecture levels defined in link:https://gitlab.com/x86-psABIs/x86-64-ABI[the x86-64 psABI supplement] are supported with the new `-march=x86-64-v2`, `-march=x86-64-v3`, and `-march=x86-64-v4` options.
*IBM Z architectures*
* GCC 11.2.1 defaults to the IBM z14 processor.
*IBM Power Systems*
* GCC 11.2.1 defaults to the IBM POWER9 processor.
* The GCC compiler now supports POWER10 instructions with the new `-mcpu=power10` command-line option
|