After a year of development has been published release of the free compiler set GCC 16.1, the first significant release in the new GCC 16.x branch. In accordance with the release numbering scheme, version 16.0 was used in the development process, and shortly before the release of GCC 16.1, branch GCC 17.0, which will form the basis for the next significant release, GCC 17.1.
Key changes:
- The default mode for the C++ language has switched to using the standard C++20 (GNU C++20 dialect, -std=gnu++20) instead of the previously suggested C++17. The C++20 implementation in the standard library has been declared stable.
- An experimental frontend has been included ga68 for compiling programs in the Algol 68 programming language.
- The option to output diagnostic information in HTML format has been added. The information on program execution has been expanded and is included in the diagnostic output in the format SARIF, based on JSON (support for «-fdiagnostics-format=json» has been discontinued).
- Optimizations at the linking stage (LTO, Link-Time Optimization) have been expanded. The option «-flto-toplevel-asm-heuristics» has been added, which includes heuristics to improve the optimization of code with assembly inserts. The technique of speculative devirtualization (-fdevirtualize-speculatively) is now not limited to transforming virtual methods and can be applied to converting any indirect function calls, such as calls via pointers, into direct calls.
- Support for loop vectorization, for which the number of iterations is unknown at compile time, has been implemented. The efficiency of handling premature exits from loops (for example, via break) has been improved.
- Experimental support has been added for many the features recently approved standards C++26. For example, the following have been implemented:
- Reflection (Reflection, «-freflection»), which allows tracking and modifying program elements at compile time. New operators «^^ (open-std.org)» have been added to obtain meta-information about grammatical constructs and «[:…:]» for performing reverse transformations. To convert and process the information obtained during inspection, the std::meta library has been proposed, and features such as calculations with constants are available.
- Contract programming (Contracts), allowing to define formal specifications of interfaces using three new operators: pre (precondition), post (postcondition), and contract_assert (assertion check). The 'pre' operator defines the preconditions that must be met before the call (input validation); 'post' defines conditions that must be fulfilled after execution (output requirements); contract_assert defines exception conditions. This feature will be available in GCC 16.
- The operator 'template for' is used for iterating over elements, such as parameter packs, tuple-like objects, and reflection results (meta-objects), at compile time in a style akin to a traditional loop. When executing 'template for', the loop body is expanded for each element, and each iteration is processed in its own scope, where the sequence element that the loop iterates over is a constant for each iteration and can participate in constant expressions (constexpr). In the context of reflection, 'template for' can be applied to traverse class or enumeration properties.
- The std::simd library for parallelizing data operation executions using SIMD instruction sets, such as AVX-512 and NEON, leveraging the standard C++ type system.
- Libraries std::inplace_vector, std::optional, std::copyable_function, std::function_ref, std::indirect, std::polymorphic, and std::owner_equal.
- Features related to the C++23 standard have been implemented, such as explicit object lifetime management, and disabling the tracker blocking specifying character encoding for diagnostic messages.
- Support for the C23 (opennet.ru), for example, the ability to use the attribute 'counted_by' for checking pointer usage correctness.
- Continued implementation of standards OpenMP 5.0, 5.1, 5.2, and 6.0 (Open Multi-Processing), defining APIs and methods for applying parallel programming techniques on multi-core and hybrid (CPU+GPU/DSP) systems with shared memory and SIMD vectorization blocks. color perception disorder simulation. The simulation of protanopia, deuteranopia, and tritanopia implementation of parallel programming specifications OpenACC 3.0, 3.3, and 3.4, defining means for offloading operations to GPUs and specialized processors, such as NVIDIA PTX.
- Support for AMD processors based on the Zen6 microarchitecture (-march=znver6) has been added to the backend for x86 architecture, as well as for Intel Wildcat Lake (-march=wildcatlake) and Nova Lake (-march=novalake) processors.
- The backend code generation for AMD Radeon GPUs (GCN) includes support for AMD Instinct MI300 accelerators (gfx942).
- Support for the type ‘_BitInt (N)’ has been implemented in RISC-V, ARM, S/390, and LoongArch architectures to define integers with a specified number of bits.
Source: linux.org.ru
