Release of the GCC 10 compiler suite

After a year of development published release of a free set of compilers GCC 10.1, the first significant release in the new GCC 10.x branch. In accordance with new scheme release numbering, version 10.0 was used during the development process, and shortly before the release of GCC 10.1, the GCC 11.0 branch had already forked, from which the next significant release of GCC 11.1 would form.

GCC 10.1 is notable for implementing many of the C++ language innovations being developed for the C++20 standard, improvements related to the future C language standard (C2x), new compiler backend optimizations, and experimental support. static analysis mode. In addition, during the preparation of a new branch, the project transferred the repository from SVN to Git.

All changes:

  • Added experimental static analysis mode "-fanalyzerβ€œ, which performs resource-intensive inter-procedural analysis of code execution paths and data flows in a program. The mode is capable of detecting such problems at the compilation stage as a double call to the free() function for the same memory area, file descriptor leaks, dereferencing and passing null pointers, accessing freed memory blocks, using uninitialized values, etc. The application of the new mode for the OpenSSL code has already revealed dangerous vulnerability.
  • Improved interprocedural optimizations. The IPA-SRA (Interprocedural Shared Value Scalar Replacing) pass has been redesigned to work at bind time and, among other things, now removes computed and returned unused values. In the "-O2" optimization mode, the "-finline-functions" option is enabled, which is reconfigured in favor of producing more compact code than in favor of execution performance. Accelerated operation of heuristics of inline-deployment of functions. The inline expansion heuristic and function cloning can now use value range information to predict the effectiveness of individual transformations. For C++, the accuracy of parsing aliases based on types has been improved.
  • Link stage optimizations (LTO) have been extended. Added new executable lto-dump to dump information about object files with LTO bytecode. Parallel LTO passes automatically determine the number of make tasks that run simultaneously and, if they cannot be determined, use information about the number of CPU cores as a parallelization factor. Added the ability to compress LTO bytecode using the zstd algorithm.
  • The optimization mechanism based on the results of code profiling (PGO - Profile-guided optimization) has been improved, which generates more optimal code based on the analysis of code execution features. Improved profile maintenance during compilation and hot/cold code splitting. Through the option "-fprofile-valuesΒ» Up to 4 profile values ​​can now be tracked, for example for indirect calls and providing more accurate profile information.
  • Parallel programming specification implemented for C, C++ and Fortran languages OpenACC 2.6, which defines the means for carrying out operations (offloading) on ​​GPUs and specialized processors, such as NVIDIA PTX. Almost completed implementation of the standard Open MP 5.0 (Open Multi-Processing), which defines the API and methods for applying parallel programming methods on multi-core and hybrid (CPU + GPU / DSP) systems with shared memory and vectorization units (SIMD). Added features such as lastprivate conditionals, scan and loop directives, order and use_device_addr expressions. For OpenMP and OpenACC, support for offloading operations on the fourth (Fiji) and fifth generation (VEGA 10/VEGA 20) AMD Radeon (GCN) GPUs has been added.
  • For languages ​​of the C family, the "access" function has been added to describe the access of a function to objects passed by reference or pointer, and to associate such objects with integer arguments containing information about the size of objects. To work together with "access", the "type" attribute is implemented to detect incorrect access from user-defined functions, for example, when writing values ​​to an area outside the array boundaries. Also added "symver" attribute to bind symbols in ELF file to specific version numbers.
  • Added new warnings:
    • "-Wstring-compare" (turned on when "-Wextra") - warns about the presence of expressions in which zero is compared with the result of calling the strcmp and strncmp functions, which is equivalent to a constant due to the fact that the length of one argument is greater than the size of the array in the second argument .
    • "-Wzero-length-bounds" (enabled with "-Warray-bounds") - warns about access to elements of arrays of zero length, which can lead to overwriting other data.
    • The "-Warray-bounds", "-Wformat-overflow", "-Wrestrict", "-Wreturn-local-addr", and "-Wstringop-overflow" warnings have been extended to increase the number of out-of-bounds situations handled.
  • Implemented the ability to directly specify extended characters in identifiers using the current encoding (default UTF-8) rather than UCN notation (\uNNNN or \UNNNNNNNNN). For example:

    static const int Ο€ = 3;
    int get_naΓ―ve_pi() {
    return Ο€;
    }

  • For the C language, a portion of the new features developed within the C2X standard has been implemented (enabled by specifying -std=c2x and -std=gnu2x): support for the "[[]]" syntax for defining attributes as in C++ (for example, [[gnu ::const]], [[deprecated]], [[fallthrough]] and [[maybe_unused]]. Added support for "u8" syntax to define constants with characters in UTF-8.
    Added new macros to . Added "%OB" and "%Ob" substitutions to strftime.

  • By default, C uses the "-fno-common" mode, which allows for more efficient access to global variables on some platforms.
  • About 16 changes and innovations developed in the C++20 standard have been implemented for C++. Including added keyword "constinit"
    and implemented template extension support "concept". Concepts allow you to define a set of template parameter requirements that, at compile time, limit the set of arguments that can be accepted as template parameters. The concepts can be used to avoid logical inconsistencies between the properties of the data types used within the template and the properties of the data types of the input parameters.

  • G++ provides detection of undefined behavior caused by changing constant objects via constexpr. Reduced compiler memory consumption when evaluating constexpr. Added new warnings "-Wmismatched-tags" and "-Wredundant-tags".
  • New command line options have been proposed:
    • "-fallocation-dce" to remove extra pairs of "new" and "delete" operators.
    • "-fprofile-partial-training" to disable size optimization for code that has not been trained.
    • "-fprofile-reproducible" to control the level of profile reproducibility.
    • "-fprofile-prefix-path" to define the base build directory from sources used when generating profiles separately (for "-fprofile-generate=profile_dir" and "-fprofile-use=profile_dir").
  • In the text of warnings for the mentioned options, hyperlinks are provided that allow you to go to the documentation for these options. URL substitution is controlled using the "-fdiagnostics-urls" option.
  • Added preprocessor operator "__has_builtin", which can be used to check for the presence of built-in functions.
  • A new builtin function "__builtin_roundeven" has been added with an implementation of the rounding function defined in the ISO/IEC TS 18661 specification, similar to "round", but the rounding part greater than 0.5 is up (toward a larger value), less than 0.5 is down (to zero), and equal to 0.5 - starting from the parity of the penultimate digit.
  • For the AArch64 architecture, support for the SVE2 extension has been added and support for SVE (Scalable Vector Extension) has been improved, including support for built-in functions and SVE ACLE types, and vectorization has been provided. Extended support for LSE (Large System Extensions) and TME (Transactional Memory Extension). Added new instructions proposed in Armv8.5-A and Armv8.6-A, including instructions for generating random numbers, rounding, memory tags,
    bfloat16 and matrix multiplications. Added support for processors
    Arm Cortex-A77,
    Arm Cortex-A76AE,
    Arm Cortex-A65,
    Arm Cortex-A65AE,
    Arm Cortex-A34 and
    Marvell ThunderX3.

  • Added support for ABI FDPIC (32-bit function pointers) for ARM64. Redesigned and optimized processing of 64-bit integer operations. Added CPU support
    Arm Cortex-A77,
    Arm Cortex-A76AE and
    Arm Cortex-M35P. Extended support for ACLE instructions for data processing, including 32-bit SIMD, 16-bit multiplication, fixed min/max arithmetic, and other tools for optimizing DSP algorithms. Added experimental support for ACLE CDE (Custom Datapath Extension) instructions.

  • Significantly improved code generation and vectorization in the backend for AMD GPUs based on the GCN microarchitecture.
  • Added support for XMEGA-like devices for AVR architecture
    ATtiny202, ATtiny204, ATtiny402, ATtiny404, ATtiny406, ATtiny804, ATtiny806, ATtiny807, ATtiny1604, ATtiny1606, ATtiny1607, ATmega808, ATmega809, ATmega1608, ATmega1609, ATmega3208, ATmega3209, ATmega4808 and ATmega4809.

  • For IA-32/x86-64 architectures, a new Intel command set architecture extension ENQCMD (-menqcmd) has been added. Added support for Intel Cooperlake (-march=cooperlake, enable AVX512BF16 ISA extension) and Tigerlake (-march=tigerlake, enable MOVDIRI, MOVDIR64B and AVX512VP2INTERSECT ISA extensions) CPUs.
  • Deprecated and likely to be removed in a future release is an implementation of the Heterogeneous System Architecture Intermediate Language (HSAIL) for heterogeneous computing systems based on the HSA architecture.

Source: opennet.ru

Add a comment