Sat. Jul 11th, 2020

GCC 10.1 released: GNU Compiler Collection

3 min read

GCC (GNU Compiler Collection) is a set of programming language compilers developed by GNU. It is a set of free software distributed under the GPL and LGPL licenses. It is also a key part of the GNU project and is a standard compiler for Unix-like and Mac OS X operating systems. GCC (especially the C compiler) is also often considered the de facto standard for cross-platform compilers.

GCC 8.3

GCC was formerly known as GNU C compiler because it can only deal with the original C language. Later, the ability to handle C++ was added and later became available for languages such as Fortran, Pascal, Objective-C, Java, and Ada.

GCC 10.1 was released.

Changelog

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 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 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.

General Improvements

  • New built-in functions:
    • The __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:
    • -fallocation-dce removes unneeded pairs of new and delete operators.
    • -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.
    • -fprofile-reproducible controls level of reproducibility of profile gathered by -fprofile-generate. This makes it possible to rebuild program with same outcome which is useful, for example, for distribution packages.
    • -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.
    • -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.
    • -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 lto-dump has been added. The program can dump various information about a LTO bytecode object file.
    • Parallel phase of the LTO can automatically detect a running make’s jobserver or can fall back to number of available cores.
    • The LTO bytecode can be compressed with zstd algorithm. Configure script can automatically detect the 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 -fprofile-values, an instrumented binary can track multiple values (up to 4) for e.g. indirect calls and provide more precise profile information.

More

Download