Red Hat Training

A Red Hat training course is available for Red Hat Developer Toolset

A.2. Changes in GCC

Red Hat Developer Toolset 4.0 is distributed with GCC 5.2.1, which provides a number of bug fixes and new features over the version included in Red Hat Enterprise Linux and the previous version of Red Hat Developer Toolset.

A.2.1. Changes Since Red Hat Developer Toolset 3.1

The following features have been added since the release of GCC in Red Hat Developer Toolset 3.1:
  • Various inter-procedural optimization improvements, including:
    • A new Identical Code Folding feature has been added, which tries to merge identical functions in order to save space.
    • Devirtualization optimization has been significantly improved.
    • Better optimization of dead code for C++ inline functions and virtual tables.
    • Better optimization of write-only variables.
  • Various link-time optimization improvements, including:
    • GCC now utilizes One Definition Rule-based merging of C++ types, which allows better devirtualization and alias analysis.
    • GCC now features lesser memory usage and faster linking speed.
  • Various register-allocation improvements, including:
    • A new control-flow sensitive global register rematerialization optimization has been added, which improves performance.
    • The generation of PIC (Position-Independent Code) has been improved by reusing the PIC hard register.
    • A new inter-procedural register allocator has been added, which brings better performance.
  • The Undefined Behavior Sanitizer (ubsan) gained a few new sanitization options. It is now able to, for instance, detect out-of-bounds accesses and detect various misaligned objects. It is also capable of virtual-pointer checking for C++ code.
  • Offloading features of the OpenMP 4.0 specification are now supported by the C, C++, and Fortran compilers.
  • Several new warnings options have been added, including:
    • -Wswitch-bool, which warns whenever a switch statement has an index of a boolean type.
    • -Wlogical-not-parentheses, which warns about logical not used on the left-hand side operand of a comparison.
    • -Wsizeof-array-argument, which warns when the sizeof operator is applied to a parameter that has been declared as an array in a function definition.
    • -Wbool-compare, which warns about boolean expressions compared with an integer value different from true or false.
  • The preprocessor gained support for the __has_include and __has_include_next macros, which can be used to test the availability of headers, as well as the __has_attribute macro used to determine whether a specified attribute exists.
  • A new set of built-in functions for arithmetics with overflow checking has been added: __builtin_add_overflow, __builtin_sub_overflow, and __builtin_mul_overflow.
  • The default mode for C is now -std=gnu11 instead of -std=gnu89.
  • The C++ compiler now supports many C++14 features, for instance: variable templates, aggregates with non-static data member initializers, the extended constexpr specifier, sized deallocation functions, and others. The C++ compiler also supports several new warnings, for example, to help developers annotate programs with final specifiers.
  • The Runtime Library (libstdc++) has been greatly improved. Note that unlike the upstream GCC 5.x, the Red Hat Developer Toolset 4.1 version of GCC does not use the new ABI.
    • libstdc++ now has full support for the C++11 standard with the exception of the new implementations of the std::string and std::list classes because the Red Hat Developer Toolset 4.1 version of GCC uses the old ABI.
      Other notable features include, for example, movable and swappable iostream classes, support for the std::align function and the std::aligned_union class template, locale facets for Unicode conversion, and atomic operations for the std::shared_ptr class template.
    • libstdc++ now has full experimental support for the C++14 standard. This includes, for example, the std::is_final type trait.
    • The experimental support for the TS Library Fundamentals has been improved.
  • GCC now contains the libgccjit library, which allows users to build GCC as a shared library for embedding in other processes, suitable for Just-In-Time (JIT) compilation to machine code.
  • GCC now contains support for new ISA (Instruction Set Architecture) extensions, including AVX512-VL (Vector Length Extensions), AVX512-BW (Byte and Word Instructions), and AVX512-DQ (Doubleword and Quadword Instructions) extensions on top of the already existing AVX-512 extensions.
  • Pointer Bounds Checker has been added to GCC, which serves as a bounds violation detector. This tool only works on 32-bit a 64-bit Intel Linux targets with the new ISA extension Intel MPX support.
  • The Intel Memory Protection Extensions (MPX) support has been added to GCC in Red Hat Developer Toolset 4.0 for use with future releases of Red Hat Enterprise Linux 7 (beyond Red Hat Enterprise Linux 7.2) when the kernel enablement is complete. This feature will provide a set of extensions to the x86 Instruction Set Architecture (ISA), which can be used for bounds checking when performing pointer accesses. Note that this feature will not be supported on Red Hat Enterprise Linux 6.