Appendix A. Sourcery G++ Lite Release Notes

This appendix contains information about changes in this release of Sourcery G++ Lite for ARM SymbianOS. You should read through these notes to learn about new features and bug fixes.

Table of Contents

A.1. Changes in Sourcery G++ Lite for ARM SymbianOS

A.1. Changes in Sourcery G++ Lite for ARM SymbianOS

This section documents Sourcery G++ Lite changes for each released revision.

A.1.1. Changes in Sourcery G++ Lite 2009q3-63

@FILE fix.  A bug has been fixed in the processing of @FILE command-line options by GCC, GDB, and other tools. The bug caused any options in FILE following a blank line to be ignored.

Preprocessor error handling.  The preprocessor now treats failing to find a file referenced via #include as a fatal error.

NEON improvements.  The compiler now generates improved NEON vector code when copying memory or storing constants to memory using the NEON coprocessor. The compiler also generates better code for accessing data arrays that are not known to have 64-bit alignment. In addition, a bug that caused internal compiler errors when compiling for Thumb-2 with NEON enabled has been fixed, as has another bug that caused some vector shift NEON operations to be wrongly rejected.

ELF file corruption with strip A bug that caused strip to corrupt unusual ELF files has been fixed.

Compiler errors with float32_t A bug has been fixed that caused compiler errors when using the float32_t type from arm_neon.h.

Support for ARM Cortex-A5 cores.  Sourcery G++ now includes basic support for ARM Cortex-A5 cores. Use the -mcpu=cortex-a5 command-line option.

Static variables and asm statements bug fix.  A bug in GCC that caused functions containing static variables and asm statements to be miscompiled at -O2 or above has been fixed. The bug also occurred at other optimization levels when the -fremove-local-statics command-line option was used.

Warnings for naked functions.  A compiler bug that resulted in incorrect warnings about missing return statements in non-void functions declared with the naked attribute has been fixed.

Optimizer bug fix.  A bug in GCC that caused functions with complex loop nests to be miscompiled at -O2 or above has been fixed. The bug also occurred at other optimization levels when the -fpromote-loop-indices command-line option was used.

VFPv4 support.  Sourcery G++ now includes support for VFPv4, VFPv4-D16 and NEON-VFPv4 coprocessors. Use the -mfpu=vfpv4, -mfpu=vfpv4-d16 or -mfpu=neon-vfpv4 options, respectively.

GCC internal compiler error.  A bug has been fixed that caused the compiler to crash when optimizing code that casts between structure types and the type of the first field.

ELF Program Headers.  The linker now better diagnoses errors in the usage of FILEHDR and PHDRS keywords in PHDRS command of linker scripts. Refer to the linker manual for more information.

A.1.2. Changes in Sourcery G++ Lite 2009q3-35

Improved optimization for ARM.  GCC now automatically enables loop unrolling and -fpromote-loop-indices when -O2 or -O3 is specified. Loop unrolling is limited at -O2 to control code growth. These changes improve performance by more than 5%.

VFP assembly mnemonics.  The assembler now accepts unified assembly mnemonics for VFP instructions (e.g. VADD.f32 s0, s0) in legacy syntax mode.

VFP half-precision extensions.  Sourcery G++ now includes support for VFP coprocessors with half-precision floating-point extensions. This can be enabled with the -mfpu=vfpv3-d16-fp16 or -mfpu=vfpv3-fp16 command-line options.

Optimizer improvements.  When optimizing for speed, the compiler now uses improved heuristics to limit certain types of optimizations that may adversely affect both code size and speed. This change also makes it possible to produce better code when optimizing for space rather than speed.

Improved optimization for Thumb-2.  GCC now supports instruction scheduling for Thumb-2 code. This optimization is enabled when compiling with -O2, -O3, or -Os, and can improve performance substantially.

ARM VFP assembler bug fix.  The assembler now correctly assembles the vmls, vnmla and vnmls mnemonics. Previously these were incorrectly assembled to different instructions.

New assembler directive .inst The assembler now accepts the new .inst directive to generate an instruction from its integer encoding.

Internal error in assembler.  An assembler bug that caused an internal error when .thumb or .arm appears after an invalid instruction has been fixed.

Improved bit counting operation.  The __builtin_ctz built-in function, which returns the number of trailing zero bits in a value, has been improved to use a shorter instruction sequence for ARMv6T2 and later.

Out-of-range branch errors.  A Thumb-2 code generation defect in the compiler that caused branch out of range errors from the assembler has been eliminated.

Binutils update.  The binutils package has been updated to version 2.19.51.20090709 from the FSF trunk. This update includes numerous bug fixes.

Linker fix.  The linker now correctly processes references to undefined local symbols. Such references are treated the same as references to undefined global symbols. Usually object files contain no such references, as they can never be satisfied.

Assembler validation improvements.  The assembler now issues a warning when a section finishes with an unclosed IT instruction block at the end of the input file. It also now rejects unwinding directives that appear outside of a .fnstart/.fnend pair. Additionally, 32-bit Thumb instructions are now correctly rejected when assembling for cores that do not support these instructions.

Assembler validations fix.  A bug in the assembler that caused some addw and subw instructions with SP or PC as operand to be wrongly rejected has been fixed.

-mauto-it assembler option replaced with -mimplicit-it The -mauto-it command-line option to the assembler has been replaced with a more general -mimplicit-it option to control the behavior of the assembler when conditional instructions appear outside an IT instruction block. If you were previously using -mauto-it, you should now use -mimplicit-it=always. Other -mimplicit-it modes allow you to separately control implicit IT instruction insertion behavior in ARM and Thumb-2 code. For more information, refer to the assembler manual. In addition to renaming the option, a number of bugs in the implicit IT generation have been fixed.

Linker failure with Cortex-A8 erratum fix.  A bug in the --fix-cortex-a8 linker option has been fixed. The bug caused the linker either to produce a bad value error, or to silently generate an incorrect executable.

Debug information for variadic functions.  A compiler bug that resulted in incorrect debug information for functions with variable arguments has been fixed.

Overlay sections.  arm-none-symbianelf-readelf now correctly recognizes section headers for ARM_DEBUGOVERLAY and ARM_OVERLAYSECTION sections.

Code generation improvements.  The compiler has been changed to make better use of VFP registers in mixed integer and floating-point code, resulting in faster code.

Register variable corruption.  A compiler bug has been fixed that caused incorrect code to be generated when the frame pointer or other special-use registers are used as explicit local register variables, introduced via the asm keyword on their declarations.

Assembler fix for mixed Thumb and ARM mode.  A bug in the assembler has been fixed where mapping symbols were sometimes incorrectly placed at section boundaries. This could lead to incorrect disassembly in some cases.

-fremove-local-statics optimization.  The -fremove-local-statics optimization is now enabled by default at -O2 and higher optimization levels.

Elimination of spurious warnings about NULL The C++ compiler no longer issues spurious warnings about comparisons between pointers to members and NULL.

Vectorizer improvements.  The compiler now generates improved code for accesses to static nested array variables (e.g. static int foo[8][8];).

Linker bug fix.  A bug that caused the linker to crash when .ARM.exidx sections were discarded by a linker script has been fixed.

GCC version 4.4.1.  Sourcery G++ Lite for ARM SymbianOS is now based on GCC version 4.4.1. For more information about changes from GCC version 4.3 that was included in previous releases, see http://gcc.gnu.org/gcc-4.4/changes.html.

Linker map address sorting.  The map generated by the linker -Map option now lists symbols sorted by address.

Assembler fix.  The assembler now correctly diagnoses a missing operand to bl and blx instructions. Previously, incorrect code was silently generated.

A.1.3. Changes in Sourcery G++ Lite 2009q1-162

Incorrect placement of linker-generated functions.  A bug that caused some linker-generated functions (including stubs to support interworking from ARM mode to Thumb mode and stubs to avoid processor errata) to be placed in data sections has been fixed.

New option for automatically generating IT blocks.  The assembler now allows use of conditional Thumb-2 instructions without requiring explicit IT instructions. Use the -mauto-it command-line option to enable this automatic generation of IT instructions.

Reduced compilation time.  Compilation and build times when using Sourcery G++ Lite are now slightly faster. This performance improvement is the result of building the compilers and other host tools with a recent version of Sourcery G++, rather than an older GCC version.

Assembler bug fix.  A bug in the assembler that caused duplicate and missing mapping symbols has been fixed. The bug caused incorrect objdump output and incorrect byte-swapping for BE8 configurations.

Stack backtracing and C++ exception handling.  Improvements have been made to the linker in support of C++ runtime exception handling and stack backtracing. A problem that caused crashes during the backtrace of C routines that were not compiled with the -fexceptions option has been fixed. In addition, the linker generates more compact stack unwinding tables which can lead to smaller executables.

Assembler floating-point format.  The assembler now defaults to VFP format for floating-point numbers. It previously defaulted to the legacy FPA format if no -mcpu or -march option was specified, or if a CPU with no floating-point unit was specified. This bug resulted in incorrect behavior of the .double and .dcb.d directives.

Incorrect linker-generated functions.  A bug that caused some linker-generated functions (such as stubs to support interworking from ARM mode to Thumb mode) to contain only nop instructions instead of correct code sequences has been fixed.

Assembler diagnostics for invalid instructions.  The assembler now issues diagnostics for invalid ADR and ADRL instructions. Formerly, these invalid instructions were silently mis-assembled. This assembler bug did not affect correct code.

Disassembler bug fix.  A bug has been fixed that caused incorrect disassembly of some object files with multiple sections whose symbol tables included symbols in the middle of functions. These typically resulted from hand-written assembly.

Linker crash with very large applications.  A linker bug that caused a crash when linking very large applications with the --fix-cortex-a8 command-line option has been fixed.

arm-none-symbianelf-objcopy bug fix.  A bug has been fixed that caused arm-none-symbianelf-objcopy to issue an error when generating output in the Intel HEX format and using --change-section-lma to change section addresses.

Linker script search path.  The bug in the linker has been fixed that caused it not to follow its documented behavior for searching for linker scripts named with the -T option. Now scripts are looked up first in the current directory, then in library directories specified with -L command-line options, and finally in the default system linker script directory.

Cortex-A8 erratum workaround enabled for ARMv7-A.  The workaround for the erratum in Cortex-A8 processors mentioned below is now enabled by default if you are targeting the ARMv7-A architecture profile. The workaround can be disabled by passing the --no-fix-cortex-a8 option to the linker.

Internal compiler error when optimizing.  A bug has been fixed that caused internal compiler error: in build2_stat when compiling.

Erratum workaround for Cortex-A8 processors.  The linker now implements a workaround for an erratum in Cortex-A8 processors. If you are targeting an affected part and wish to use the workaround, pass the --fix-cortex-a8 option to the linker. Please contact ARM for further details of the erratum.

Maximum code alignment increased.  The maximum allowed code alignment has been increased from 32 to 64 bytes. This change affects the .p2align and .align directives in GAS and the -falign-functions GCC option.

Corruption of block-scope variables.  A compiler optimization bug that sometimes caused corruption of stack-allocated variables has been fixed. The bug affected variables declared in a local block scope in functions containing multiple non-overlapping lexical block scopes, a technique commonly used by programmers to reduce stack frame size. In some rare cases, other optimizations performed by the compiler were ignoring the local extent of such block-scope variables.

A.1.4. Changes in Sourcery G++ Lite 2009q1-115

Incorrect code when using -falign-labels A bug that caused the compiler to generate incorrect code for switch statements when the -falign-labels option is used has been fixed.

Loop optimization improvements.  A new option, -fpromote-loop-indices, has been added to the compiler. Specifying this option enables an optimization that improves the performance of loops with index variables of integer types narrower than the target machine word size, such as char or short. This optimization also applies to int on 64-bit targets.

DMB, DSB, and ISB instructions on ARMv6-M.  The assembler now accepts the DMB, DSB, and ISB instructions on ARMv6-M CPUs, including Cortex-M0 and Cortex-M1. These instructions were incorrectly rejected on these CPUs in previous releases.

Extraneous linker error messages.  A linker bug that caused extraneous error messages of the form Dwarf Error: Offset (507) greater than or equal to .debug_str size (421). has been corrected. This bug did not affect the correctness of output binaries.

Assembler marking of data.  Data generated using the assembler directives .ascii, .asciz, .dc.d, .dc.s, .dc.x, .dcb, .dcb.b, .dcb.d, .dcb.l, .dcb.s, .dcb.w, .dcb.x, .ds, .ds.b, .ds.d, .ds.l, .ds.p, .ds.s, .ds.w, .ds.x, .double, .fill, .float, .incbin, .single, .space, .skip, .string, .string8, .string16, .string32, .string64, and .zero is now correctly marked by the assembler as data rather than code. This fixes incorrect byte-swapping of such data when linking for BE8 configurations.

Improved vectorization.  Automatic vectorization for NEON now uses the fused multiply-add (VMLA) and fused multiply-subtract (VMLS) instructions. These fused instructions are faster than the equivalent two-instruction sequence consisting of a multiply followed by an add or subtract.

Out-of-bounds accesses to stack arrays.  A bug has been fixed that caused internal compiler errors when some code involving out-of-bounds accesses to stack-allocated arrays was compiled with the -mthumb option. Such code is not valid C; although it is now accepted by the compiler and no diagnostic is issued, it has undefined behavior if executed.

GCC version 4.3.3.  Sourcery G++ Lite for ARM SymbianOS is now based on GCC version 4.3.3. This is a bug fix update to GCC. For more information about changes from GCC version 4.3.2 that was included in previous releases, see http://gcc.gnu.org/gcc-4.3/changes.html.

Improved NOP generation for Thumb-2 cores.  The assembler now generates Thumb-2/ARMv6K architectural NOP instructions when alignment padding is required in code sections.

Internal compiler error with -O3 or -fpredictive-commoning A bug has been fixed that caused internal compiler errors when compiling some code with -O3 or -fpredictive-commoning.

C++ named operators bug fix.  A bug has been fixed that caused the compiler to crash in some cases when the C++ operators and_eq, bitand, bitor, compl, not_eq, or_eq and xor_eq were used in contexts where the preprocessor converts their names to strings.

Debug information for anonymous structure types.  A GCC bug in the generation of debug information for anonymous structure types in C++ code has been fixed. The bug caused printing the type information for such structures in the debugger (via the ptype command) to fail with an error message.

Linker errors on non-ELF input.  A bug has been fixed that caused internal errors from the linker when linking non-ELF input files (with the -b or --format linker options).

Undefined weak references in shared libraries.  A linker bug has been fixed affecting calls from Thumb code in shared libraries to functions that are undefined weak references when the shared library is linked. Such calls executed as nops whether or not the functions were defined at run time.

Improved code generation.  The compiler has been improved to generate better code for an integer multiplication whose result feeds into an addition.

Installer fails during upgrade.  The Sourcery G++ installer for Microsoft Windows hosts could fail during an upgrade while waiting for the previous version to be uninstalled. This bug has been fixed.

Performance improvements.  Tuning parameters for ARM code generation have been adjusted to improve performance of the generated code.

Uninstaller removed by upgrade.  The uninstaller could be incorrectly deleted during an upgrade on Microsoft Windows hosts. This bug has been fixed.

CMP Thumb-2 instruction.  The assembler no longer issues an error about CMP instructions in which the second argument is the stack pointer (r13), as these are valid instructions. However, use of the stack pointer in this context is deprecated in the current ARM architecture specification and the assembler now warns about the deprecated use.

Thumb half-precision floating point bug fix.  A compiler bug has been fixed that formerly caused incorrect code to be generated in Thumb mode for functions using half-precision floating-point constants. The bug did not affect Thumb-2 code.

Improved code generation.  The compiler has been improved to generate better code for integer multiplication by certain constants.

Thumb-2 switch code generation bug fix.  A bug has been fixed that caused incorrect Thumb-2 code to be generated for some switch statements.

Internal compiler errors when optimizing.  A defect that occasionally caused internal compiler errors when partial redundancy elimination (PRE) optimization was enabled has been corrected.

Install directory pathnames.  Bugs in the install and uninstall scripts for Linux hosts that caused errors or incorrect behavior when the Sourcery G++ install directory pathname contains whitespace characters have been fixed.

Internal compiler error with large NEON types.  A bug has been fixed that caused internal compiler errors when compiling code using NEON types at least 32 bytes wide.

Temporary files on Microsoft Windows.  On Microsoft Windows hosts, Sourcery G++ Lite now uses the standard Windows algorithm to choose the directory in which to place temporary files. This change eliminates a crash that occurred if none of the TEMP, TMP, or TMPDIR variables were set to a suitable directory.

Vectorized shift fix.  A bug has been fixed that caused incorrect code for loops containing a right shift by a constant. The bug affected code compiled with -mfpu=neon and loop vectorization enabled with -O3 or -ftree-vectorize.

Incorrect code for nested functions.  A bug in GCC that caused the compiler to generate incorrect code for nested functions has been fixed. The bug resulted in incorrect stack alignments in the affected functions.

Binutils update.  The binutils package has been updated to version 2.19.51.20090205 from the FSF trunk. This update includes numerous bug fixes.

ARM build attributes conformance improvements.  Several ARM EABI 2.07 conformance issues relating to the handling of build attributes in the assembler and linker have been fixed. All build attribute types are now recognized, and can now be declared by name, in addition to by number. Support for merging attributes in the linker has been improved, and the linking of incompatible objects is now detected and rejected in more cases.

Internal compiler error with -fremove-local-statics An internal compiler error that occurred when using the -fremove-local-statics option has been fixed. The error occurred when compiling code with function-local static array or structure variables.

Linker crash on incompatible input files.  Some third-party compilers, including ARM RealView® 4.0, produce a build attribute marking output files that are not compatible with the ABI for the ARM Architecture. This attribute sometimes caused the linker to crash. The linker now correctly issues an error message.

A.1.5. Changes in Sourcery G++ Lite 2008q3-67

Bug fix for assembly listing.  A bug that caused the assembler to produce corrupted listings (via the -a option) on Windows hosts has been fixed.

Optimizer bug fix.  A bug that caused an unrecognizable insn internal compiler error when compiling at optimization levels above -O0 has been fixed.

VFP compiler fix.  A compiler bug that resulted in internal compiler error: output_operand: invalid expression as operand when generating VFP code has been fixed.

Misaligned NEON memory accesses.  A bug has been fixed that caused the compiler to use aligned NEON load/store instructions to access misaligned data when autovectorizing certain loops. The bug affected code compiled with -mfpu=neon and loop vectorization enabled with -O3 or -ftree-vectorize.

A.1.6. Changes in Sourcery G++ Lite 2008q3-40

Definition of va_list In order to conform to the ABI for the ARM Architecture, the definition of the type of va_list (defined in stdarg.h) has been changed. This change impacts only the mangled names of C++ entities. For example, the mangled name of a C++ function taking an argument of type va_list, or va_list *, or another type involving va_list has changed. Since this is an incompatible change, you must recompile and relink any modules defining or using affected va_list-typed entities.

Thumb-2 assembler fixes.  The Thumb-2 encodings of QADD, QDADD, QSUB, and QDSUB have been corrected. Previous versions of the assembler generated incorrect object files for these instructions. The assembler now accepts the ORN, QASX, QSAX, RRX, SHASX, SHSAX, SSAX, USAX, UHASX, UQSAX, and USAX mnemonics. The assembler now detects and issues errors for invalid uses of register 13 (the stack pointer) and register 15 (the program counter) in many instructions.

Bug fix for objcopy/strip.  An objcopy bug that corrupted COMDAT groups when creating new binaries has been fixed. This bug also affected strip -g.

Binutils support for DWARF Version 3.  The addr2line command now supports binaries containing DWARF 3 debugging information. The ld command can display error messages with source locations for input files containing DWARF 3 debugging information.

NEON improvements.  Several improvements and bug fixes have been made to the NEON Advanced SIMD Extension support in GCC. A problem that caused the autovectorizer to fail in some circumstances has been fixed. Also, many of the intrinsics available via the arm_neon.h header file now have improved error checking for out-of-bounds arguments, and the vget_lane intrinsics that return signed values now produce improved code.

NEON compiler fix.  A compiler bug that resulted in incorrect NEON code being generated has been fixed. Typically the incorrect code occurred when NEON intrinsics were used inside small if statements.

Mixed-case NEON register aliases.  An assembler bug that prevented NEON register aliases from being created with mixed-case names using the .dn and .qn directives has been fixed. Previously only aliases created with all-lowercase or all-uppercase names worked correctly.

Inline functions declared with dllexport The compiler now always emits an out-of-line copy of inline functions declared with the __declspec(dllexport) specifier. This allows such functions to be referenced from outside the DLL, just like non-inline functions.

Janus 2CC support.  GCC now includes a work-around for a hardware bug in Avalent Janus 2CC cores. To compile and link for these cores, use the -mfix-janus-2cc compiler option. If you are using the linker directly use the --fix-janus-2cc linker option.

ARM exception handling bug fix.  A bug in the runtime library has been fixed that formerly caused throwing an unexpected exception in C++ to crash instead of calling the unexpected exception handler. The bug only affected C++ code compiled by non-GNU compilers such as ARM RealView®.

Mangling of NEON type names.  A bug in the algorithm used by the C++ compiler for mangling the names of NEON types, such as int8x16_t, has been fixed. These mangled names are used internally in object files to encode type information in addition to the programmer-visible names of the C++ variables and functions. The new mangled name encoding is more compact and conforms to the ARM C++ ABI.

Half-precision floating point.  Sourcery G++ now includes support for half-precision floating point via the __fp16 type in C and C++. The compiler can generate code using either hardware support or library routines. For more information, see Section 3.5, “Half-Precision Floating Point”.

A.1.7. Changes in Sourcery G++ Lite 2008q3-10

Uppercase operands to IT instructions.  The assembler now accepts both uppercase and lowercase operands for the IT family of instructions.

NEON autovectorizer fix.  A compiler bug that caused generation of bad VLD1 instructions has been fixed. The bug affected code compiled with -mfpu=neon -ftree-vectorize.

Output files removed on error.  When GCC encounters an error, it now consistently removes any incomplete output files that it may have created.

ARMv7 offset out of range errors.  An assembler bug that resulted in offset out of range errors when compiling for ARMv7 processors has been fixed.

Symbian binary relocation.  The linker now correctly generates relocations for writable data as data-relative rather than text-relative. The former behavior caused runtime failures accessing writable data.

Thumb-2 MUL encoding.  In Thumb-2 mode, the assembler now encodes MUL as a 16-bit instruction (rather than as a 32-bit instruction) when possible. This fix results in smaller code, with no loss of performance.

ARM C++ ABI utility functions.  Vector utility functions required by the ARM C++ ABI no longer crash when passed null pointers. The affected functions are __aeabi_vec_dtor_cookie, __aeabi_vec_delete, __aeabi_vec_delete3, and __aeabi_vec_delete3_nodtor. These functions are not intended for use by application programmers; they are only called by compiler-generated code. They are not presently used by the GNU C++ compiler, but are used by some other compilers, including ARM's RealView® compiler.

GCC version 4.3.2.  Sourcery G++ Lite for ARM SymbianOS is now based on GCC version 4.3.2. For more information about changes from GCC version 4.2 that was included in previous releases, see http://gcc.gnu.org/gcc-4.3/changes.html.

Smaller Thumb-2 code.  When optimizing for size (i.e., when -Os is in use), GCC now generates the 16-bit MULS Thumb-2 multiply instruction instead of the 32-bit MUL instruction.

Thumb-2 RBIT encoding.  An assembler bug that resulted in incorrect encoding of the Thumb-2 RBIT instruction has been fixed.

Marvell Feroceon compiler bug fix.  A bug that caused an internal compiler error when optimizing for Marvell Feroceon CPUs has been fixed.

Misaligned accesses to packed structures fix.  A bug that caused GCC to generate misaligned accesses to packed structures has been fixed.

Bug fix for objdump on Windows.  An objdump bug that caused the -S option not to work on Windows in some cases has been fixed.

A.1.8. Changes in Older Releases

For information about changes in older releases of Sourcery G++ Lite for ARM SymbianOS, please refer to the Getting Started guide packaged with those releases.