GCC 3.1 Release Series — Changes, New Features, and Fixes
GCC 3.1 Release Series
Changes, New Features, and Fixes
Additional changes in GCC 3.1.1
- A bug related to how structures and unions are returned has been fixed for
powerpc-*-netbsd*. - An important bug in the implementation of
-fprefetch-loop-arrayshas been fixed. Previously the optimization prefetched random blocks of memory for most targets except for i386. - The Java compiler now compiles Java programs much faster and also works with parallel make.
- Nested functions have been fixed for
mips*-*-netbsd*. - Some missing floating point support routines have beed added for
mips*-*-netbsd*. - This message gives additional information about the bugs fixed in this release.
Caveats
- The
-traditionalC compiler option has been deprecated and will be removed in GCC 3.3. (It remains possible to preprocess non-C code with the traditional preprocessor.) - The default debugging format for most ELF platforms (including GNU/Linux and FreeBSD; notable exception is Solaris) has changed from stabs to DWARF2. This requires GDB 5.1.1 or later.
General Optimizer Improvements
- Jan Hubicka, SuSE Labs, together with Richard Henderson, Red Hat, and Andreas Jaeger, SuSE Labs, has contributed infrastructure for profile driven optimizations.
Options-fprofile-arcsand-fbranch-probabilitiescan now be used to improve speed of the generated code by profiling the actual program behaviour on typical runs. In the absence of profile info the compiler attempts to guess the profile statically. - SPEC2000 and SPEC95 benchmark suites are now used daily to monitor performance of the generated code.
According to the SPECInt2000 results on an AMD Athlon CPU, the code generated by GCC 3.1 is 6% faster on the average (8.2% faster with profile feedback) compared to GCC 3.0. The code produced by GCC 3.0 is about 2.1% faster compared to 2.95.3. Tests were done using the-O2 -march=athloncommand-line options. - Alexandre Oliva, of Red Hat, has generalized the tree inlining infrastructure developed by CodeSourcery, LLC for the C++ front end, so that it is now used in the C front end too. Inlining functions as trees exposes them earlier to the compiler, giving it more opportunities for optimization.
- Support for data prefetching instructions has been added to the GCC back end and several targets. A new
__builtin_prefetchintrinsic is available to explicitly insert prefetch instructions and experimental support for loop array prefetching has been added (see-fprefetch-loop-arraydocumentation). - Support for emitting debugging information for macros has been added for DWARF2. It is activated using
-g3.
New Languages and Language specific improvements
C/C++
- A few more ISO C99 features.
- The preprocessor is 10-50% faster than the preprocessor in GCC 3.0.
- The preprocessor's symbol table has been merged with the symbol table of the C, C++ and Objective-C front ends.
- The preprocessor consumes less memory than the preprocessor in GCC 3.0, often significantly so. On normal input files, it typically consumes less memory than pre-3.0 cccp-based GCC, too.
C++
-fhonor-stdand-fno-honor-stdhave been removed.-fno-honor-stdwas a workaround to allow std compliant code to work with the non-std compliant libstdc++-v2. libstdc++-v3 is std compliant.- The C++ ABI has been fixed so that
void (A::*)() constis mangled as "M1AKFvvE", rather than "MK1AFvvE" as before. This change only affects pointer to cv-qualified member function types. - The C++ ABI has been changed to correctly handle this code:
struct A {
void operator delete[] (void *, size_t);
};
struct B : public A {
};
new B[10];
The amount of storage allocated for the array will be greater than it was in 3.0, in order to store the number of elements in the array, so that the correct size can be passed tooperator delete[] when the array is deleted. Previously, the value passed to operator delete[] was unpredictable.
This change will only affect code that declares a two-argumentoperator delete[] with a second parameter of typesize_t in a base class, and does not override that definition in a derived class.
- The C++ ABI has been changed so that:
struct A {
void operator delete[] (void *, size_t);
void operator delete[] (void *);
};
does not cause unnecessary storage to be allocated when an array ofA objects is allocated.
This change will only affect code that declares both of these forms of operator delete[], and declared the two-argument form before the one-argument form.
- The C++ ABI has been changed so that when a parameter is passed by value, any cleanup for that parameter is performed in the caller, as specified by the ia64 C++ ABI, rather than the called function as before. As a result, classes with a non-trivial destructor but a trivial copy constructor will be passed and returned by invisible reference, rather than by bitwise copy as before.
- G++ now supports the "named return value optimization": for code like
A f () {
A a;
...
return a;
}
G++ will allocate a in the return value slot, so that the return becomes a no-op. For this to work, all return statements in the function must return the same variable.
- Improvements to the C++ library are listed inthe libstdc++-v3 FAQ.
Objective-C
- Annoying linker warnings (due to incorrect code being generated) have been fixed.
- If a class method cannot be found, the compiler no longer issues a warning if a corresponding instance method exists in the root class.
- Forward @protocol declarations have been fixed.
- Loading of categories has been fixed in certain situations (GNU run time only).
- The class lookup in the run-time library has been rewritten so that class method dispatch is more than twice as fast as it used to be (GNU run time only).
Java
- libgcj now includes RMI,
java.lang.ref.*,javax.naming, andjavax.transaction. - Property files and other system resources can be compiled into executables which use libgcj using the new
gcj --resourcefeature. - libgcj has been ported to more platforms. In particular there is now a mostly-functional mingw32 (Windows) target port.
- JNI and CNI invocation interfaces were implemented, so gcj-compiled Java code can now be called from a C/C++ application.
- gcj can now use builtin functions for certain known methods, for instance
Math.cos. - gcj can now automatically remove redundant array-store checks in some common cases.
- The
--no-store-checksoptimization option was added. This can be used to omit runtime store checks for code which is known not to throwArrayStoreException - The following third party interface standards were added to libgcj:
org.w3c.domandorg.xml.sax. java.securityhas been merged with GNU Classpath. The new package is now JDK 1.2 compliant, and much more complete.- A bytecode verifier was added to the libgcj interpreter.
java.lang.Characterwas rewritten to comply with the Unicode 3.0 standard, and improve performance.- Partial support for many more locales was added to libgcj.
- Socket timeouts have been implemented.
- libgcj has been merged into a single shared library. There are no longer separate shared libraries for the garbage collector and zlib.
- Several performance improvements were made to gcj and libgcj:
- Hash synchronization (thin locks)
- A special allocation path for finalizer-free objects
- Thread-local allocation
- Parallel GC, and other GC tweaks
Fortran
Fortran improvements are listed in the Fortran documentation.
Ada
AdaCore, has contributed its GNAT Ada 95 front end and associated tools. The GNAT compiler fully implements the Ada language as defined by the ISO/IEC 8652 standard.
Please note that the integration of the Ada front end is still work in progress.
New Targets and Target Specific Improvements
- Hans-Peter Nilsson has contributed a port to MMIX, the CPU architecture used in new editions of Donald E. Knuth's The Art of Computer Programming.
- Axis Communications has contributed its port to the CRIS CPU architecture, used in the ETRAX system-on-a-chip series.
- Alexandre Oliva, of Red Hat, has contributed a port to the SuperH SH5 64-bit RISC microprocessor architecture, extending the existing SH port.
- UltraSPARC is fully supported in 64-bit mode. The option
-m64enables it. - For compatibility with the Sun compiler
#pragma redefine_extnamehas been implemented on Solaris. - The x86 back end has had some noticeable work done to it.
- SuSE Labs developers Jan Hubicka, Bo Thorsen and Andreas Jaeger have contributed a port to the AMD x86-64 architecture. For more information on x86-64 see http://www.x86-64.org.
- The compiler now supports MMX, 3DNow!, SSE, and SSE2 instructions. Options
-mmmx,-m3dnow,-msse, and-msse2will enable the respective instruction sets. Intel C++ compatible MMX/3DNow!/SSE intrinsics are implemented. SSE2 intrinsics will be added in next major release. - Following those improvements, targets for Pentium MMX, K6-2, K6-3, Pentium III, Pentium 4, and Athlon 4 Mobile/XP/MP were added. Refer to the documentation on
-march=and-mcpu=options for details. - For those targets that support it,
-mfpmath=ssewill cause the compiler to generate SSE/SSE2 instructions for floating point math instead of x87 instructions. Usually, this will lead to quicker code — especially on the Pentium 4. Note that only scalar floating point instructions are used and GCC does not exploit SIMD features yet. - Prefetch support has been added to the Pentium III, Pentium 4, K6-2, K6-3, and Athlon series.
- Code generated for floating point to integer conversions has been improved leading to better performance of many 3D applications.
- The PowerPC back end has added 64-bit PowerPC GNU/Linux support.
- C++ support for AIX has been improved.
- Aldy Hernandez, of Red Hat, Inc, has contributed extensions to the PowerPC port supporting the AltiVec programming model (SIMD). The support, though presently useful, is experimental and is expected to stabilize for 3.2. The support is written to conform to Motorola's AltiVec specs. See
-maltivec.
Obsolete Systems
Support for a number of older systems has been declared obsolete in GCC 3.1. Unless there is activity to revive them, the next release of GCC will have their sources permanently removed.
All configurations of the following processor architectures have been declared obsolete:
- MIL-STD-1750A,
1750a-*-* - AMD A29k,
a29k-*-* - Convex,
c*-convex-* - Clipper,
clipper-*-* - Elxsi,
elxsi-*-* - Intel i860,
i860-*-* - Sun picoJava,
pj-*-*andpjl-*-* - Western Electric 32000,
we32k-*-*
Most configurations of the following processor architectures have been declared obsolete, but we are preserving a few systems which may have active developers. It is unlikely that the remaining systems will survive much longer unless we see definite signs of port activity.
- Motorola 88000 except
- Generic a.out,
m88k-*-aout* - Generic SVR4,
m88k-*-sysv4 - OpenBSD,
m88k-*-openbsd*
- Generic a.out,
- NS32k except
- NetBSD,
ns32k-*-netbsd* - OpenBSD,
ns32k-*-openbsd*.
- NetBSD,
- ROMP except
- OpenBSD,
romp-*-openbsd*.
- OpenBSD,
Finally, only some configurations of these processor architectures are being obsoleted.
- Alpha:
- OSF/1,
alpha*-*-osf[123]*. (Digital Unix and Tru64 Unix, akaalpha*-*-osf[45], are still supported.)
- OSF/1,
- ARM:
- RISCiX,
arm-*-riscix*.
- RISCiX,
- i386:
- 386BSD,
i?86-*-bsd* - Chorus,
i?86-*-chorusos* - DG/UX,
i?86-*-dgux* - FreeBSD 1.x,
i?86-*-freebsd1.* - IBM AIX,
i?86-*-aix* - ISC UNIX,
i?86-*-isc* - GNU/Linux with pre-BFD linker,
i?86-*-linux*oldld* - NEXTstep,
i?86-next-* - OSF UNIX,
i?86-*-osf1*andi?86-*-osfrose* - RTEMS/coff,
i?86-*-rtemscoff* - RTEMS/go32,
i?86-go32-rtems* - Sequent/BSD,
i?86-sequent-bsd* - Sequent/ptx before version 3,
i?86-sequent-ptx[12]*andi?86-sequent-sysv3* - SunOS,
i?86-*-sunos*
- 386BSD,
- Motorola 68000:
- Altos,
m68[k0]*-altos-* - Apollo,
m68[k0]*-apollo-* - Apple A/UX,
m68[k0]*-apple-* - Bull,
m68[k0]*-bull-* - Convergent,
m68[k0]*-convergent-* - Generic SVR3,
m68[k0]*-*-sysv3* - ISI,
m68[k0]*-isi-* - LynxOS,
m68[k0]*-*-lynxos* - NEXT,
m68[k0]*-next-* - RTEMS/coff,
m68[k0]*-*-rtemscoff* - Sony,
m68[k0]*-sony-*
- Altos,
- MIPS:
- DEC Ultrix,
mips-*-ultrix*andmips-dec-* - Generic BSD,
mips-*-bsd* - Generic System V,
mips-*-sysv* - IRIX before version 5,
mips-sgi-irix[1234]* - RiscOS,
mips-*-riscos* - Sony,
mips-sony-* - Tandem,
mips-tandem-*
- DEC Ultrix,
- SPARC:
- RTEMS/a.out,
sparc-*-rtemsaout*.
- RTEMS/a.out,
Documentation improvements
- The old manual ("Using and Porting the GNU Compiler Collection") has been replaced by a users manual ("Using the GNU Compiler Collection") and a separate internals reference manual ("GNU Compiler Collection Internals").
- More complete and much improved documentation about GCC's internal representation used by the C and C++ front ends.
- Many cleanups and improvements in general.