New and improved in this month's GNU toolchain we have:
* Linker scripts can now use the LOG2CEIL(<expression>) directive to return the binary logarithm of expression rounded towards infinity. This can be helpful when the target needs section sizes to be a power of two (eg the ARM PMSAv7).
* G++ has a new security feature that checks the integrity of vtables. Enabled by the command line option:
It adds runtime code that checks every virtual call made. The code ensures that the vtable pointer through which the call happens is valid for the type of the object, and that it has not been corrupted or overwritten. If an invalid vtable pointer is detected an error is reported and execution of the program is immediately halted.
This feature causes runtime data structures to be built at program start up which are used for verifying the vtable pointers. The options std and preinit control the timing of when these data structures are built. In both cases the data structures are built before execution reaches 'main'. Using std causes these data structure to be built after the shared libraries have been loaded and initialized. Using preinit causes them to be built before the shared libraries have been loaded and initialized.
Specifying -fvtable-verify=none restores the default behaviour of not enabling this feature.
* G++ now also has support for a new type attribute: warn_unused
For C++ types with non-trivial constructors and/or destructors it is impossible for the compiler to determine whether any instances of that type are truly unused if they are not referenced. Applying the warn_unused attribute to the type informs the compiler that any variables of that type should generate a warning if they appear to be unused.
* The x86 backend now supports a command line option to decide when and how the compiler should handle the memcpy function:
This overrides the internal heuristic that decides if memcpy should be inlined and what inline algorithm to be used. The argument strategy is a comma-separated list of <alg>:<max_size>:<dest_align> triplets.
The alg parameter is one of rep_byte, rep_4byte, rep_8byte, loop, unrolled_loop and libcall. These are the same values as supported by the -mstringop-strategy option.
The <max_size> parameter specifies the maximum byte size on which <alg> is allowed to operate. The <max_size> of the triplets in the list must be specified in increasing order, with the last <max_size> value being -1.
There is also a similar, new, command line option for controlling how memset is inlined:
* The MIPS target now supports a command line that controls how the special not-a-number (NaN) value is treated by the ABS and NEG machine instructions:
By default or when the -mabs=legacy option is used the legacy treatment is selected. In this case these instructions are considered arithmetic and avoided where correct operation is required and the input operand might be a NaN. A longer sequence of instructions that manipulate the sign bit of floating-point datum manually is used instead unless the -ffinite-math-only option has also been specified.
The -mabs=2008 option selects the IEEE 754-2008 treatment. In this case the ABS and NEG instructions are considered non-arithmetic and therefore operate correctly in all cases, including the case where the input operand is a NaN. These instructions are therefore always used for their respective operations.
There are also two new options to control the encoding of the special not-a-number (NaN) floating-point value:
The -mnan=legacy option selects the legacy encoding. In this case quiet NaNs (qNaN) are denoted by the first bit of their trailing significand field being 0, whereas signalling NaNs (sNaN) are denoted by the first bit of their trailing significand field being 1.
The -mnan=2008 option selects the IEEE 754-2008 encoding. In this case qNaNs are denoted by the first bit of their trailing significand field being 1, whereas sNaNs are denoted by the first bit of their trailing significand field being 0.
* The PowerPC target has a new command line option:
Which tells gcc to generate code to pass structure parameters with a maximum alignment of 64 bits, for compatibility with older versions of GCC. Older versions of GCC (prior to 4.9.0) incorrectly did not align a structure parameter on a 128-bit boundary when that structure contained a member requiring 128-bit alignment. The -mno-compat-align-parm option is the default.