1
GCC 4.6 Release Series -- Changes, New Features, and Fixes
1
GCC 4.7 Release Series -- Changes, New Features, and Fixes
2
2
==========================================================
8
- The options -b <machine> and -V <version> have been removed because
9
they were unreliable. Instead, users should directly run
10
<machine>-gcc when cross-compiling, or <machine>-gcc-<version>
11
to run a different version of gcc.
13
- GCC now has stricter checks for invalid command-line options. In
14
particular, when gcc was called to link object files rather than
15
compile source code, it would previously accept and ignore all options
16
starting with --, including linker options such as --as-needed and
17
--export-dynamic, although such options would result in errors if any
18
source code was compiled. Such options, if unknown to the compiler,
19
are now rejected in all cases; if the intent was to pass them to the
20
linker, options such as -Wl,--as-needed should be used.
22
- Versions of the GNU C library up to and including 2.11.1 included
23
an incorrect implementation of the cproj function. GCC optimizes
24
its builtin cproj according to the behavior specified and allowed
25
by the ISO C99 standard. If you want to avoid discrepancies
26
between the C library and GCC's builtin transformations when using
27
cproj in your code, use GLIBC 2.12 or later. If you are using an
28
older GLIBC and actually rely on the incorrect behavior of cproj,
29
then you can disable GCC's transformations using -fno-builtin-cproj.
31
- The C-only intermodule optimization framework (IMA, enabled by
32
-combine) has been removed in favor of the new generic link-time
33
optimization framework (LTO) introduced in GCC 4.5.0.
35
- GCC now ships with the LGPL-licensed libquadmath library, which
36
provides quad-precision mathematical functions for targets with a
37
__float128 datatype. __float128 is available for targets on 32-bit
38
x86, x86-64 and Itanium architectures. The libquadmath library is
39
automatically built on such targets when building the Fortran
42
- New -Wunused-but-set-variable and -Wunused-but-set-parameter
43
warnings were added for C, C++, Objective-C and Objective-C++.
44
These warnings diagnose variables respective parameters which are
45
only set in the code and never otherwise used. Usually such
46
variables are useless and often even the value assigned to them is
47
computed needlessly, sometimes expensively. The
48
-Wunused-but-set-variable warning is enabled by default by -Wall
49
flag and -Wunused-but-set-parameter by -Wall -Wextra flags.
51
- Support for a number of older systems and recently unmaintained or
52
untested target ports of GCC has been declared obsolete in GCC 4.6.
53
Unless there is activity to revive them, the next release of GCC
54
will have their sources permanently removed.
56
- All GCC ports for the following processor architectures have been
59
- Argonaut ARC (arc-*)
60
- National Semiconductor CRX (crx-*)
61
- Motorola 68HC11 and 68HC12
62
- (m68hc11-*-*, m6811-*-*,
63
- m68hc12-*-*, m6812-*-*)
64
- Sunplus S+core (score-*)
66
- The following ports for individual systems on particular
67
architectures have been obsoleted:
69
- Interix (i[34567]86-*-interix3*)
70
- Generic ARM PE (arm-*-pe* other
71
- than arm*-wince-pe*)
72
- MCore PE (mcore-*-pe*)
73
- SH SymbianOS (sh*-*-symbianelf*)
74
- GNU Hurd on Alpha and PowerPC
75
- (alpha*-*-gnu*, powerpc*-*-gnu*)
76
- M68K uClinux old ABI
77
- (m68k-*-uclinuxoldabi*)
79
- (arm*-*-netbsd*, i[34567]86-*-netbsd*,
83
- The i[34567]86-*-pe alias for Cygwin targets has also been
84
obsoleted; users should configure for i[34567]86-*-cygwin* instead.
86
- Certain configure options to control the set of libraries built with
87
GCC on some targets have been obsoleted. On ARM targets, the
88
options --disable-fpu, --disable-26bit, --disable-underscore,
89
--disable-interwork, --disable-biendian and --disable-nofmult have
90
been obsoleted. On MIPS targets, the options
91
--disable-single-float, --disable-biendian and --disable-softfloat
94
- Support has been removed for all the configurations obsoleted in
8
- Support for a number of older systems and recently unmaintained or
9
untested target ports of GCC has been declared obsolete in GCC 4.7.
10
Unless there is activity to revive them, the next release of GCC
11
will have their sources permanently removed.
13
The following ports for individual systems on particular
14
architectures have been obsoleted:
16
- IRIX 6.5 (mips-sgi-irix6.5)
17
- MIPS OpenBSD (mips*-*-openbsd*)
18
- Solaris 8 (*-*-solaris2.8). Details can be found in the announcement.
19
- Tru64 UNIX V5.1 (alpha*-dec-osf5.1*)
21
- Support on ARM for the legacy floating-point accelerator (FPA) and
22
the mixed-endian floating-point format that it used has been
23
obsoleted. The ports that still use this format have been obsoleted
24
as well. Many legacy ARM ports already provide an alternative that
25
uses the VFP floating-point format. The obsolete ports will be
26
deleted in the next release. The obsolete ports with alternatives
29
- arm*-*-rtems (use arm*-*-rtemseabi)
30
- arm*-*-linux-gnu (use arm*-*-linux-gnueabi)
31
- arm*-*-elf (use arm*-*-eabi)
32
- arm*-*-uclinux* (use arm*-*-uclinux*eabi)
34
Note, however, that these alternatives are not binary compatible
35
with their legacy counterparts (although some can support running
38
The obsolete ports that currently lack a modern alternative are:
44
New ports that support more recent versions of the architecture are
47
- Support for the Maverick co-processor on ARM has been obsoleted. Code to
48
support it will be deleted in the next release.
50
- Support has been removed for Unix International threads on Solaris 2,
51
so the --enable-threads=solaris configure option and the -threads
52
compiler option don't work any longer.
54
- Support has been removed for the Solaris BSD Compatibility Package,
55
which lives in /usr/ucbinclude and /usr/ucblib. It has been removed
56
from Solaris 11, and was only intended as a migration aid from
57
SunOS 4 to SunOS 5. The -compat-bsd compiler option is not
58
recognized any longer.
60
- The AVR port's libgcc has been improved and its multilib structure
61
has been enhanced. As a result, all objects contributing to an
62
application must either be compiled with GCC versions up to 4.6.x
63
or with GCC versions 4.7.0 or later.
65
- The ARM port's -mwords-little-endian option has been deprecated. It will
66
be removed in a future release.
68
- Support has been removed for the NetWare x86 configuration obsoleted in
71
- It is no longer possible to use the "l" constraint in MIPS16 asm statements.
73
- More information on porting to GCC 4.7 from previous versions of GCC can
74
be found in the porting_guide for this release.
98
77
General Optimizer Improvements
99
78
==============================
101
- A new general optimization level, -Ofast, has been introduced. It
102
combines the existing optimization level -O3 with options that can
103
affect standards compliance but result in better optimized code.
104
For example, -Ofast enables -ffast-math.
106
- Link-time optimization improvements:
108
- The Scalable Whole Program Optimizer (WHOPR) project has
109
stabilized to the point of being usable. It has become the
110
default mode when using the LTO optimization model. Link time
111
optimization can now split itself into multiple parallel
112
compilations. Parallelism is controlled with -flto=n (where n
113
specifies the number of compilations to execute in parallel). GCC
114
can also cooperate with a GNU make job server by specifying the
115
-flto=jobserver option and adding + to the beginning of the
116
Makefile rule executing the linker.
118
- Classical LTO mode can be enforced by -flto-partition=none. This
119
may result in small code quality improvements.
121
- A large number of bugs were fixed. GCC itself, Mozilla Firefox
122
and other large applications can be built with LTO enabled.
124
- The linker plugin support improvements
126
- Linker plugin is now enabled by default when the linker is
127
detected to have plugin support. This is the case for GNU ld
128
2.21.51 or newer (on ELF and Cygwin targets) and the Gold linker
129
on ELF targets. Plugin support of the Apple linker on Darwin is
130
not compatible with GCC. The linker plugin can also be
131
controlled by the -fuse-linker-plugin command line option.
133
- Resolution information from the linker plugin is used to drive
134
whole program assumptions. Use of the linker plugin results in
135
more aggressive optimization on binaries and on shared libraries
136
that use the hidden visibility attribute. Consequently the use
137
of -fwhole-program is not neccesary in addition to LTO.
139
- Hidden symbols used from non-LTO objects now have to be explicitly
140
annotated with externally_visible when the linker plugin is not
143
- C++ inline functions and virtual tables are now privatized more
144
aggressively, leading to better inter-procedural optimization and
145
faster dynamic linking.
147
- Memory usage and intermediate language streaming performance have
150
- Static constructors and destructors from individual units are
151
inlined into a single function. This can significantly improve
152
startup times of large C++ applications where static constructors
153
are very common. For example, static constructors are used when
154
including the iostream header.
156
- Support for the Ada language has been added.
158
- Interprocedural optimization improvements
160
- The interprocedural framework was re-tuned for link time
161
optimization. Several scalability issues were resolved.
163
- Improved auto-detection of const and pure functions. Newly,
164
noreturn functions are auto-detected.
166
- The -Wsuggest-attribute=[const|pure|noreturn] flag is available
167
that informs users when adding attributes to headers might improve
170
- A number of inlining heuristic improvements. In particular:
172
- Partial inlining is now supported and enabled by default at -O2
173
and greater. The feature can be controlled via
176
- Partial inlining splits functions with short hot path to return.
177
This allows more aggressive inlining of the hot path leading to
178
better performance and often to code size reductions (because
179
cold parts of functions are not duplicated).
181
- Scalability for large compilation units was improved significantly.
183
- Inlining of callbacks is now more aggressive.
185
- Virtual methods are considered for inlining when the caller is
186
inlined and devirtualization is then possible.
188
- Inlining when optimizing for size (either in cold regions of a
189
program or when compiling with -Os) was improved to better
190
handle C++ programs with larger abstraction penalty, leading to
191
smaller and faster code.
193
- The IPA reference optimization pass detecting global variables
194
used or modified by functions was strengthened and sped up.
196
- Functions whose address was taken are now optimized out when all
197
references to them are dead.
199
- A new inter-procedural static profile estimation pass detects
200
functions that are executed once or unlikely to be executed.
201
Unlikely executed functions are optimized for size. Functions
202
executed once are optimized for size except for the inner
205
- On most targets with named section support, functions used only at
206
startup (static constructors and main), functions used only at
207
exit and functions detected to be cold are placed into separate
208
text segment subsections. This extends the -freorder-functions
209
feature and is controlled by the same switch. The goal is to
210
improve the startup time of large C++ programs.
212
Proper function placement requires linker support. GNU ld 2.21.51
213
on ELF targets was updated to place those functions together within
214
the text section leading to better code locality and faster startup
215
times of large C++ programs. The feature is also supported in the
216
Apple linker. Support in the gold linker is planned.
218
- A new switch -fstack-usage has been added. It makes the compiler
219
output stack usage information for the program, on a per-function
220
basis, in an auxiliary file.
222
- A new switch -fcombine-stack-adjustments has been added. It can be
223
used to enable or disable the compiler's stack-slot combining pass
224
which before was enabled automatically at -O1 and above, but could
225
not be controlled on its own.
227
- A new switch -fstrict-volatile-bitfields has been added. Using it
228
indicates that accesses to volatile bitfields should use a single
229
access of the width of the field's type. This option can be useful
230
for precisely defining and accessing memory-mapped peripheral
231
registers from C or C++.
234
Compile time and memory usage improvements
235
==========================================
237
- Datastructures used by the dataflow framework in GCC were
238
reorganized for better memory usage and more cache locality.
239
Compile time is improved especially on units with large functions
240
(possibly resulting from a lot of inlining) not fitting into the
241
processor cache. The compile time of the GCC C compiler binary with
242
link-time optimization went down by over 10% (benchmarked on x86-64
80
- Support for a new parameter --param case-values-threshold=n was
81
added to allow users to control the cutoff between doing switch
82
statements as a series of if statements and using a jump table.
84
- Link-time optimization (LTO) improvements:
86
- Improved scalability and reduced memory usage. Link time
87
optimization of Firefox now requires 3GB of RAM on a 64-bit
88
system, while over 8GB was needed previously. Linking time has
89
been improved, too. The serial stage of linking Firefox has been
90
sped up by about a factor of 10.
92
- Reduced size of object files and temporary storage used during linking.
94
- Streaming performance (both outbound and inbound) has been improved.
96
- ld -r is now supported with LTO.
98
- Several bug fixes, especially in symbol table handling and merging.
100
- Interprocedural optimization improvements:
102
- Heuristics now take into account that after inlining code will be
103
optimized out because of known values (or properties) of function
104
parameters. For example:
116
The call of foo will be inlined into bar even when optimizing for
117
code size. Constructs based on __builtin_constant_p are now
118
understood by the inliner and code size estimates are evaluated a
119
lot more realistically.
121
- The representation of C++ virtual thunks and aliases (both
122
implicit and defined via the alias attribute) has been
123
re-engineered. Aliases no longer pose optimization barriers and
124
calls to an alias can be inlined and otherwise optimized.
126
- The inter-procedural constant propagation pass has been
127
rewritten. It now performs generic function specialization. For
128
example when compiling the following:
135
... do something else ...
147
GCC will now produce two copies of foo. One with flag being true,
148
while other with flag being false. This leads to performance
149
improvements previously possible only by inlining all calls.
150
Cloning causes a lot less code size growth.
152
- A string length optimization pass has been added. It attempts to
153
track string lengths and optimize various standard C string
154
functions like strlen, strchr, strcpy, strcat, stpcpy and their
155
_FORTIFY_SOURCE counterparts into faster alternatives. This pass
156
is enabled by default at -O2 or above, unless optimizing for
157
size, and can be disabled by the - fno-optimize-strlen
158
option. The pass can e.g. optimize
160
char *bar (const char *a)
162
size_t l = strlen (a) + 2;
163
char *p = malloc (l); if (p == NULL) return p;
164
strcpy (p, a); strcat (p, "/"); return p;
169
char *bar (const char *a)
171
size_t tmp = strlen (a);
172
char *p = malloc (tmp + 2); if (p == NULL) return p;
173
memcpy (p, a, tmp); memcpy (p + tmp, "/", 2); return p;
176
or for hosted compilations where stpcpy is available in the runtime
177
and headers provide its prototype, e.g.
179
void foo (char *a, const char *b, const char *c, const char *d)
181
strcpy (a, b); strcat (a, c); strcat (a, d);
184
can be optimized into:
186
void foo (char *a, const char *b, const char *c, const char *d)
188
strcpy (stpcpy (stpcpy (a, b), c), d);
246
192
New Languages and Language specific improvements
247
193
================================================
195
- Version 3.1 of the OpenMP_specification is now supported for the C, C++,
196
and Fortran compilers.
252
- Stack checking has been improved on selected architectures (Alpha,
253
IA-32/x86-64, RS/6000 and SPARC): it now will detect stack overflows
254
in all cases on these architectures.
256
- Initial support for Ada 2012 has been added.
202
- The command-line option -feliminate-unused-debug-types has been re-
203
enabled by default, as it is for the other languages, leading to a
204
reduction in debug info size of 12.5% and more for relevant cases,
205
as well as to a small compilation speedup.
262
- A new warning, enabled by -Wdouble-promotion, has been added that
263
warns about cases where a value of type float is implicitly promoted
264
to double. This is especially helpful for CPUs that handle the
265
former in hardware, but emulate the latter in software.
267
- A new function attribute leaf was introduced. This attribute allows
268
better inter-procedural optimization across calls to functions that
269
return to the current unit only via returning or exception handling.
270
This is the case for most library functions that have no callbacks.
272
- Support for a new data type __int128 for targets having wide enough
273
machine-mode support.
275
- The new function attribute callee_pop_aggregate allows to specify if
276
the caller or callee is responsible for popping the aggregate return
277
pointer value from the stack.
279
- Support for selectively enabling and disabling warnings via #pragma
280
GCC diagnostic has been added. For instance:
282
#pragma GCC diagnostic error "-Wuninitialized"
283
foo(a); /* error is given for this one */
284
#pragma GCC diagnostic push
285
#pragma GCC diagnostic ignored "-Wuninitialized"
286
foo(b); /* no diagnostic for this one */
287
#pragma GCC diagnostic pop
288
foo(c); /* error is given for this one */
289
#pragma GCC diagnostic pop
290
foo(d); /* depends on command line options */
292
- The -fmax-errors=N option is now supported. Using this option
293
causes the compiler to exit after N errors have been issued.
211
- A new built-in, __builtin_assume_aligned, has been added, through which
212
the compiler can be hinted about pointer alignment and can use it to
213
improve generated code.
215
- Experimental support for transactional memory has been added. It includes
216
support in the compiler, as well as a supporting runtime library called
217
libitm. To compile code with transactional memory constructs, use the -
220
Support is currently available for Alpha, ARM, PowerPC, SH, SPARC, and
221
32-bit/64-bit x86 platforms.
223
For more details on transactional memory see the_GCC_WiKi.
225
- Support for atomic operations specifying the C++11/C11 memory model has
226
been added. These new __atomic routines replace the existing __sync
229
Atomic support is also available for memory blocks. Lock-free
230
instructions will be used if a memory block is the same size and
231
alignment as a supported integer type. Atomic operations which do not
232
have lock-free support are left as function calls. A set of library
233
functions is available on the GCC atomic wiki in the "External Atomics
236
For more details on the memory models and features, see the atomic_wiki.
238
- When a binary operation is performed on vector types and one of the
239
operands is a uniform vector, it is possible to replace the vector with
240
the generating element. For example:
242
typedef int v4si __attribute__ ((vector_size (16)));
243
v4si res, a = {1,2,3,4};
246
res = 2 + a; /* means {2,2,2,2} + a */
247
res = a - x; /* means a - {x,x,x,x} */
299
- There is now experimental support for some features from the
300
upcoming C1X revision of the ISO C standard. This support may be
301
selected with -std=c1x, or -std=gnu1x for C1X with GNU extensions.
302
Note that this support is experimental and may change incompatibly
303
in future releases for consistency with changes to the C1X standard
304
draft. The following features are newly supported as described in
305
the N1539 draft of C1X (with changes agreed at the March 2011 WG14
306
meeting); some other features were already supported with no
307
compiler changes being needed, or have some support but not in full
308
accord with N1539 (as amended).
310
- Static assertions (_Static_assert keyword)
311
- Typedef redefinition
312
- New macros in <float.h>
313
- Anonymous structures and unions
315
- The new -fplan9-extensions option directs the compiler to support
316
some extensions for anonymous struct fields which are implemented by
317
the Plan 9 compiler. A pointer to a struct may be automatically
318
converted to a pointer to an anonymous field when calling a
319
function, in order to make the types match. An anonymous struct
320
field whose type is a typedef name may be referred to using the
253
- There is support for some more features from the C11 revision of the ISO
254
C standard. GCC now accepts the options -std=c11 and -std=gnu11, in
255
addition to the previous -std=c1x and -std=gnu1x.
257
- Unicode strings (previously supported only with options such as
258
-std=gnu11, now supported with -std=c11), and the predefined macros
259
__STDC_UTF_16__ and __STDC_UTF_32__.
261
- Nonreturning functions (_Noreturn and <stdnoreturn.h>).
263
- Alignment support (_Alignas, _Alignof, max_align_t, <stdalign.h>).
265
- A built-in function __builtin_complex is provided to support C
266
library implementation of the CMPLX family of macros.
327
- Improved experimental support for the upcoming C++0x ISO C++
328
standard, including support for constexpr (thanks to Gabriel Dos
329
Reis and Jason Merrill), nullptr (thanks to Magnus Fromreide),
330
noexcept, unrestricted unions, range-based for loops (thanks to
331
Rodrigo Rivas Costa), opaque enum declarations (thanks also to
332
Rodrigo), implicitly deleted functions and implicit move
335
- When an extern declaration within a function does not match a
336
declaration in the enclosing context, G++ now properly declares the
337
name within the namespace of the function rather than the namespace
338
which was open just before the function definition (c++/43145).
340
- GCC now warns by default when casting integers to larger pointer
341
types. These warnings can be disabled with the option
342
-Wno-int-to-pointer-cast, which is now also available in C++.
344
- G++ no longer optimizes using the assumption that a value of
345
enumeration type will fall within the range specified by the
346
standard, since that assumption is easily violated with a conversion
347
from integer type (c++/43680). The old behavior can be restored
350
- The new -fnothrow-opt flag changes the semantics of a throw()
351
exception specification to match the proposed semantics of the
352
noexcept specification: just call terminate if an exception tries to
353
propagate out of a function with such an exception specification.
354
This dramatically reduces or eliminates the code size overhead from
355
adding the exception specification.
357
- The new -Wnoexcept flag will suggest adding a noexcept qualifier to
358
a function that the compiler can tell doesn't throw if it would
359
change the value of a noexcept expression.
361
- The -Wshadow option now warns if a local variable or type
362
declaration shadows another type in C++. Note that the compiler will
363
not warn if a local variable shadows a struct/class/enum, but will
364
warn if it shadows an explicit typedef.
366
- When an identifier is not found in the current scope, G++ now offers
367
suggestions about which identifier might have been intended.
369
- G++ now issues clearer diagnostics for missing semicolons after
370
class, struct, and union definitions.
372
- G++ now issues clearer diagnostics for missing semicolons after
373
class member declarations.
375
- G++ now issues clearer diagnostics when a colon is used in a place
376
where a double-colon was intended.
378
- G++ no longer accepts mutable on reference members (c++/33558).
379
Use -fpermissive to allow the old, non-conforming behaviour.
381
- A few mangling fixes have been made, to attribute const/volatile on
382
function pointer types, decltype of a plain decl, and use of a
383
function parameter in the declaration of another parameter. By
384
default the compiler still uses the old mangling, but emits aliases
385
with the new mangling on targets that support strong aliases. Users
386
can switch over entirely to the new mangling with -fabi-version=5 or
387
-fabi-version=0. -Wabi will now warn about code that uses the old
390
- G++ no longer allows objects of const-qualified type to be default
391
initialized unless the type has a user-declared default constructor.
392
Code that fails to compile can be fixed by providing an initializer e.g.
398
Use -fpermissive to allow the old, non-conforming behaviour.
272
- G++ now accepts the -std=c++11, -std=gnu++11, and -Wc++11-compat options,
273
which are equivalent to -std=c++0x, -std=gnu++0x, and -Wc++0x-compat,
276
- G++ now implements C++11 extended friend syntax:
281
static const int I = 2;
291
- Thanks to Ville Voutilainen, G++ now implements C++11 explicit override
295
virtual void f() const final;
300
void f() const; // error: D::f attempts to
302
void f(long) override; // error: doesn't override
304
void f(int) override; // ok
308
struct F: E { }; // error: deriving from final class
310
- G++ now implements C++11 non-static data member initializers.
314
} a; // initializes a.i to 42
316
- Thanks to Ed Smith-Rowland, G++ now implements C++11 user-defined
319
// Not actually a good approximation. :)
320
constexpr long double operator"" _degrees (long double d)
321
{ return d * 0.0175; }
322
long double pi = 180.0_degrees;
324
- G++ now implements C++11 alias-declarations.
326
template <class T> using Ptr = T*;
327
Ptr<int> ip; // decltype(ip) is int*
329
- Thanks to Ville Voutilainen and Pedro Lamarão, G++ now implements C++11
330
delegating constructors.
334
A(): A(42) { } // delegate to the A(int) constructor
337
- G++ now fully implements C++11 atomic classes rather than just integer
344
std::atomic<POD> my_atomic_POD;
346
- G++ now sets the predefined macro __cplusplus to the correct value,
347
199711L for C++98/03, and 201103L for C++11.
349
- G++ now correctly implements the two-phase lookup rules such that an
350
unqualified name used in a template must have an appropriate declaration
351
found either in scope at the point of definition of the template or by
352
argument-dependent lookup at the point of instantiation. As a result,
353
code that relies on a second unqualified lookup at the point of
354
instantiation to find functions declared after the template or in
355
dependent bases will be rejected. The compiler will suggest ways to fix
356
affected code, and using the -fpermissive compiler flag will allow the
357
code to compile with a warning.
360
void f() { g(T()); } // error, g(int) not found by argument-
362
void g(int) { } // fix by moving this declaration before the
367
// error, B::g(B) not found by argument-dependent lookup
368
void f() { g(T()); } // fix by using this->g or A::g
371
struct B { void g(B); };
379
- G++ now properly re-uses stack space allocated for temporary objects when
380
their lifetime ends, which can significantly lower stack consumption for
381
some C++ functions. As a result of this, some code with undefined
382
behavior will now break:
384
const int &f(const int &i) { return i; }
386
const int &x = f(1);
387
const int &y = f(2);
389
Here, x refers to the temporary allocated to hold the 1 argument, which
390
only lives until the end of the initialization; it immediately becomes a
391
dangling reference. So the next statement re-uses the stack slot to hold
392
the 2 argument, and users of x get that value instead.
393
Note that this should not cause any change of behavior for temporaries of
394
types with non-trivial destructors, as they are already destroyed at end
395
of full-expression; the change is that now the storage is released as
398
- A new command-line option -Wdelete-non-virtual-dtor has been added to
399
warn when delete is used to destroy an instance of a class which has
400
virtual functions and non-virtual destructor. It is unsafe to delete an
401
instance of a derived class through a pointer to a base class if the base
402
class does not have a virtual destructor. This warning is enabled by -Wall.
404
- A new command-line option -Wzero-as-null-pointer-constant has been added
405
to warn when a literal '0' is used as null pointer constant. It can be
406
useful to facilitate the conversion to nullptr in C++11.
408
- As per C++98, access-declarations are now deprecated by G++. Using-
409
declarations are to be used instead. Furthermore, some efforts have been
410
made to improve the support of class scope using-declarations. In
411
particular, using-declarations referring to a dependent type now work as
412
expected (bug_c++/14258).
414
- The ELF symbol visibility of a template instantiation is now properly
415
constrained by the visibility of its template arguments (bug_c++/35688).
401
418
Runtime Library (libstdc++)
402
419
---------------------------
404
- Improved experimental support for the upcoming ISO C++ standard,
405
C++0x, including using constexpr and nullptr.
407
- Performance improvements to the Debug Mode, thanks to Fran�ois
410
- Atomic operations used for reference-counting are annotated so that
411
they can be understood by race detectors such as Helgrind, see Data
414
- Most libstdc++ standard headers have been changed to no longer
415
include the cstddef header as an implementation detail. Code that
416
relied on that header being included as side-effect of including
417
other standard headers will need to include cstddef explicitly.
421
- Improved_experimental_support_for_the_new_ISO_C++_standard,_C++11,
424
- using noexcept in most of the library;
426
- implementations of pointer_traits, allocator_traits and
427
scoped_allocator_adaptor;
429
- uses-allocator construction for tuple;
431
- vector meets the allocator-aware container requirements;
433
- replacing monotonic_clock with steady_clock;
435
- enabling the thread support library on most POSIX targets;
437
- many small improvements to conform to the FDIS.
439
- Added --enable-clocale=newlib configure option.
441
- Debug Mode iterators for unordered associative containers.
443
- Avoid polluting the global namespace and do not include <unistd.h>.
423
- On systems supporting the libquadmath library, GNU Fortran now also
424
supports a quad-precision, kind=16 floating-point data type
425
(REAL(16), COMPLEX(16)). As the data type is not fully supported in
426
hardware, calculations might be one to two orders of magnitude
427
slower than with the 4, 8 or 10 bytes floating-point data
428
types. This change does not affect systems which support REAL(16) in
429
hardware nor those which do not support libquadmath.
431
- Much improved compile time for large array constructors.
433
- In order to reduce execution time and memory consumption, use of
434
temporary arrays in assignment expressions is avoided for many
435
cases. The compiler now reverses loops in order to avoid generating
436
a temporary array where possible.
438
- Improved diagnostics, especially with -fwhole-file.
440
- The -fwhole-file flag is now enabled by default. This improves code
441
generation and diagnostics. It can be disabled using the deprecated
442
-fno-whole-file flag.
444
- Support the generation of Makefile dependencies via the -M... flags
445
of GCC; you may need to specify the -cpp option in addition. The
446
dependencies take modules, Fortran's include, and CPP's #include
447
into account. Note: Using -M for the module path is no longer
448
supported, use -J instead.
450
- The flag -Wconversion has been modified to only issue warnings where
451
a conversion leads to information loss. This drastically reduces
452
the number of warnings; -Wconversion is thus now enabled with
453
-Wall. The flag -Wconversion-extra has been added and also warns
454
about other conversions; -Wconversion-extra typically issues a huge
455
number of warnings, most of which can be ignored.
457
- A new command-line option -Wunused-dummy-argument warns about unused
458
dummy arguments and is included in -Wall. Before, -Wunused-variable
459
also warned about unused dummy arguments.
461
- Fortran 2003 support has been extended:
463
- Improved support for polymorphism between libraries and programs
464
and for complicated inheritance patterns (cf. object-oriented
467
- Experimental support of the ASSOCIATE construct.
469
- In pointer assignments it is now possible to specify the lower
470
bounds of the pointer and, for a rank-1 or a simply contiguous
471
data-target, to remap the bounds.
473
- Automatic (re)allocation: In intrinsic assignments to allocatable
474
variables the left-hand side will be automatically allocated (if
475
unallocated) or reallocated (if the shape or type parameter is
476
different). To avoid the small performance penalty, you can use
477
a(:) = ... instead of a = ... for arrays and character strings
478
-- or disable the feature using -std=f95 or -fno-realloc-lhs.
480
- Deferred type parameter: For scalar allocatable and pointer
481
variables the character length can be deferred.
483
- Namelist variables with allocatable and pointer attribute and
484
nonconstant length type parameter are supported.
486
- Fortran 2008 support has been extended:
488
- Experimental coarray support (for one image only,
489
i.e. num_images() == 1); use the -fcoarray=single flag to enable
492
- The STOP and the new ERROR STOP statements now support all
493
constant expressions.
495
- Support for the CONTIGUOUS attribute.
497
- Support for ALLOCATE with MOLD.
499
- Support for the STORAGE_SIZE intrinsic inquiry function.
501
- Support of the NORM2 and PARITY intrinsic functions.
503
- The following bit intrinsics were added: POPCNT and POPPAR for
504
counting the number of 1 bits and returning the parity; BGE, BGT,
505
BLE, and BLT for bitwise comparisons; DSHIFTL and DSHIFTR for
506
combined left and right shifts, MASKL and MASKR for simple left
507
and right justified masks, MERGE_BITS for a bitwise merge using a
508
mask, SHIFTA, SHIFTL and SHIFTR for shift operations, and the
509
transformational bit intrinsics IALL, IANY and IPARITY.
511
- Support of the EXECUTE_COMMAND_LINE intrinsic subroutine.
513
- Support for the IMPURE attribute for procedures, which allows for
514
ELEMENTAL procedures without the restrictions of PURE.
516
- Null pointers (including NULL()) and not allocated variables can
517
be used as actual argument to optional non-pointer,
518
non-allocatable dummy arguments, denoting an absent argument.
520
- Non-pointer variables with TARGET attribute can be used as actual
521
argument to POINTER dummies with INTENT(IN)
523
- Pointers including procedure pointers and those in a derived type
524
(pointer components) can now be initialized by a target instead of
527
- The EXIT statement (with construct-name) can now be used to leave
528
not only the DO but also the ASSOCIATE, BLOCK, IF, SELECT CASE and
529
SELECT TYPE constructs.
531
- Internal procedures can now be used as actual argument.
533
- The named constants INTEGER_KINDS, LOGICAL_KINDS, REAL_KINDS and
534
CHARACTER_KINDS of the intrinsic module ISO_FORTRAN_ENV have been
535
added; these arrays contain the supported kind values for the
538
- The module procedures C_SIZEOF of the intrinsic module
539
ISO_C_BINDINGS and COMPILER_VERSION and COMPILER_OPTIONS of
540
ISO_FORTRAN_ENV have been implemented.
542
- Minor changes: obsolescence diagnostics for ENTRY was added for
543
-std=f2008; a line may start with a semicolon; for internal and
544
module procedures END can be used instead of END SUBROUTINE and
545
END FUNCTION; SELECTED_REAL_KIND now also takes a RADIX argument;
546
intrinsic types are supported for TYPE(intrinsic-type-spec);
547
multiple type-bound procedures can be declared in a single
548
PROCEDURE statement; implied-shape arrays are supported for named
549
constants (PARAMETER). The transformational, three argument
550
versions of BESSEL_JN and BESSEL_YN were added -- the
551
elemental, two-argument version had been added in GCC 4.4; note
552
that the transformational functions use a recurrence algorithm.
449
- The compile flag -fstack-arrays has been added, which causes all local
450
arrays to be put on stack memory. For some programs this will improve the
451
performance significantly. If your program uses very large local arrays,
452
it is possible that you will have to extend your runtime limits for stack
455
- The -Ofast flag now also implies -fno-protect-parens and -fstack-arrays.
457
- Front-end optimizations can now be selected by the -ffrontend-optimize
458
option and deselected by the -fno-frontend-optimize option.
460
- When front-end optimization removes a function call, -Wfunction-
461
elimination warns about that.
463
- When performing front-end-optimization, the -faggressive-function-
464
elimination option allows the removal of duplicate function calls even
465
for impure functions.
467
- The flag -Wreal-q-constant has been added, which warns if floating-point
468
literals have been specified using q (such as 1.0q0); the q marker is now
469
supported as a vendor extension to denote quad precision (REAL(16) or, if
470
not available, REAL(10)). Consider using a kind parameter (such as in
471
1.0_qp) instead, which can be obtained via SELECTED_REAL_KIND.
473
- The GFORTRAN_USE_STDERR environment variable has been removed. GNU
474
Fortran now always prints error messages to standard error. If you wish
475
to redirect standard error, please consult the manual for your OS, shell,
476
batch environment etc. as appropriate.
478
- The -fdump-core option and GFORTRAN_ERROR_DUMPCORE environment variable
479
have been removed. When encountering a serious error, gfortran will now
480
always abort the program. Whether a core dump is generated depends on the
481
user environment settings; see the ulimit -c setting for POSIX shells,
482
limit coredumpsize for C shells, and the WER_user-mode_dumps_settings on
485
- The -fbacktrace option is now enabled by default. When encountering a
486
fatal error, gfortran will attempt to print a backtrace to standard error
487
before aborting. It can be disabled with -fno-backtrace. Note: On POSIX
488
targets with the addr2line utility from GNU binutils, GNU Fortran can
489
print a backtrace with function name, file name, line number information
490
in addition to the addresses; otherwise only the addresses are printed.
494
- Generic interface names which have the same name as derived types
495
are now supported, which allows to write constructor functions.
496
Note that Fortran does not support static constructor functions;
497
only default initialization or an explicit structure-constructor
498
initialization are available.
500
- Polymorphic (class) arrays are now supported.
504
- Support for the DO CONCURRENT construct has been added, which
505
allows the user to specify that individual loop iterations have no
508
- Coarrays: Full single-image support except for polymorphic
509
coarrays. Additionally, preliminary support for multiple images via
510
an MPI-based coarray_communication_library has been added. Note:
511
The library version is not yet usable as remote coarray access is
516
- New flag -std=f2008ts permits programs that are expected to conform
517
to the Fortran 2008 standard and the draft Technical Specification
518
(TS) 29113 on Further Interoperability of Fortran with C.
520
- The OPTIONAL attribute is now allowed for dummy arguments of BIND
523
- The RANK intrinsic has been added.
525
- The implementation of the ASYNCHRONOUS attribute in GCC is
526
compatible with the candidate draft of TS 29113 (since GCC 4.6).
558
Support for the Go programming language has been added to GCC. It is
559
not enabled by default when you build GCC; use the --enable-languages
560
configure option to build it. The driver program for compiling Go
563
Go is currently known to work on GNU/Linux and RTEMS. Solaris support
564
is in progress. It may or may not work on other platforms.
571
Objective-C and Objective-C++
572
-----------------------------
574
- The -fobjc-exceptions flag is now required to enable Objective-C
575
exception and synchronization syntax (introduced by the keywords
576
@try, @catch, @finally and @synchronized).
578
- A number of Objective-C 2.0 features and extensions are now
579
supported by GCC. These features are enabled by default; you can
580
disable them by using the new -fobjc-std=objc1 command-line option.
582
- The Objective-C 2.0 dot-syntax is now supported. It is an
583
alternative syntax for using getters and setters; object.count is
584
automatically converted into [object count] or [object setCount:
585
...] depending on context; for example if (object.count > 0) is
586
automatically compiled into the equivalent of if ([object count] >
587
0) while object.count = 0; is automatically compiled into the
588
equivalent ot [object setCount: 0];. The dot-syntax can be used
589
with instance and class objects and with any setters or getters, no
590
matter if they are part of a declared property or not.
592
- Objective-C 2.0 declared properties are now supported. They are
593
declared using the new @property keyword, and are most commonly used
594
in conjunction with the new Objective-C 2.0 dot-syntax. The
595
nonatomic, readonly, readwrite, assign, retain, copy, setter and
596
getter attributes are all supported. Marking declared properties
597
with __attribute__ ((deprecated)) is supported too.
599
- The Objective-C 2.0 @synthesize and @dynamic keywords are supported.
600
@synthesize causes the compiler to automatically synthesize a
601
declared property, while @dynamic is used to disable all warnings
602
for a declared property for which no implementation is provided at
603
compile time. Synthesizing declared properties requires runtime
604
support in most useful cases; to be able to use it with the GNU
605
runtime, appropriate helper functions have been added to the GNU
606
Objective-C runtime ABI, and are implemented by the GNU Objective-C
607
runtime library shipped with GCC.
609
- The Objective-C 2.0 fast enumeration syntax is supported in
610
Objective-C. This is currently not yet available in Objective-C++.
611
Fast enumeration requires support in the runtime, and such support
612
has been added to the GNU Objective-C runtime library (shipped with
615
- The Objective-C 2.0 @optional keyword is supported. It allows you
616
to mark methods or properties in a protocol as optional as opposed
619
- The Objective-C 2.0 @package keyword is supported. It has currently
620
the same effect as the @public keyword.
622
- Objective-C 2.0 method attributes are supported. Currently the
623
supported attributes are deprecated, sentinel, noreturn and format.
625
- Objective-C 2.0 method argument attributes are supported. The most
626
widely used attribute is unused, to mark an argument as unused in
629
- Objective-C 2.0 class and protocol attributes are supported.
630
Currently the only supported attribute is deprecated.
632
- Objective-C 2.0 class extensions are supported. A class extension
633
has the same syntax as a category declaration with no category name,
634
and the methods and properties declared in it are added directly to
635
the main class. It is mostly used as an alternative to a category
636
to add methods to a class without advertising them in the public
637
headers, with the advantage that for class extensions the compiler
638
checks that all the privately declared methods are actually
641
- As a result of these enhancements, GCC can now be used to build
642
Objective-C and Objective-C++ software that uses Foundation and
643
other important system frameworks with the NeXT runtime on Darwin 9
644
and Darwin 10 (Mac OS X 10.5 and 10.6). Currently this is for m32
647
- Many bugs in the compiler have been fixed in this release; in
648
particular, LTO can now be used when compiling Objective-C and
649
Objective-C++ and the parser is much more robust in dealing with
653
Runtime Library (libobjc)
654
-------------------------
656
- The GNU Objective-C runtime library now defines the macro
657
__GNU_LIBOBJC__ (with a value that is increased at every release
658
where there is any change to the API) in objc/objc.h, making it easy
659
to determine if the GNU Objective-C runtime library is being used,
660
and if so, which version. Previous versions of the GNU Objective-C
661
runtime library (and other Objective-C runtime libraries such as the
662
Apple one) do not define this macro.
664
- A new Objective-C 2.0 API, almost identical to the one implemented
665
by the Apple Objective-C runtime, has been implemented in the GNU
666
Objective-C runtime library. The new API hides the internals of
667
most runtime structures but provides a more extensive set of
668
functions to operate on them. It is much easier, for example, to
669
create or modify classes at runtime. The new API also makes it
670
easier to port software from Apple to GNU as almost no changes
671
should be required. The old API is still supported for backwards
672
compatibility; including the old objc/objc-api.h header file
673
automatically selects the old API, while including the new
674
objc/runtime.h header file automatically selects the new API.
675
Support for the old API is being phased out and upgrading the
676
software to use the new API is strongly recommended. To check for
677
the availability of the new API, the __GNU_LIBOBJC__ macro can be
678
used as older versions of the GNU Objective-C runtime library, which
679
do not support the new API, do not define such a macro.
681
- Runtime support for @synchronized has been added.
683
- Runtime support for Objective-C 2.0 synthesized property accessors
686
- Runtime support for Objective-C 2.0 fast enumeration has been added.
532
- GCC 4.7 implements the Go_1_language_standard. The library support in
533
4.7.0 is not quite complete, due to release timing. Release 4.7.1 is
534
expected to include complete support.
536
- Go has been tested on GNU/Linux and Solaris platforms. It may work on
537
other platforms as well.
689
540
New Targets and Target Specific Improvements
695
- GCC now supports the Cortex-M4 processor implementing the v7-em
696
version of the architecture using the option -mcpu=cortex-m4.
698
- Scheduling descriptions for the Cortex-M4, the Neon and the floating
699
point units of the Cortex-A9 and a pipeline description for the
700
Cortex-A5 have been added.
702
- Synchronization primitives such as __sync_fetch_and_add and friends
703
are now inlined for supported architectures rather than calling into
704
a kernel helper function.
706
- SSA loop prefetching is enabled by default for the Cortex-A9 at -O3.
708
- Several improvements were committed to improve code generation for
709
the ARM architecture including a rewritten implementation for load
712
- Several enhancements were committed to improve SIMD code generation
713
for NEON by adding support for widening instructions, misaligned
714
loads and stores, vector conditionals and support for 64 bit
717
- Support was added for the Faraday cores fa526, fa606te, fa626te,
718
fmp626te, fmp626 and fa726te and can be used with the respective
719
names as parameters to the -mcpu= option.
721
- Basic support was added for Cortex-A15 and is available through
724
- GCC for AAPCS configurations now more closely adheres to the AAPCS
725
specification by enabling -fstrict-volatile-bitfields by default.
546
- GCC now supports the Cortex-A7 processor implementing the v7-a version of
547
the architecture using the option -mcpu=cortex-a7.
549
- The default vector size in auto-vectorization for NEON is now 128 bits.
550
If vectorization fails thusly, the vectorizer tries again with 64-bit
553
- A new option -mvectorize-with-neon-double was added to allow users to
554
change the vector size to 64 bits.
560
- GCC now supports the XMEGA architecture. This requires GNU binutils 2.22
563
- Support for the named_address_spaces __flash, __flash1, …, __flash5 and
564
__memx has been added. These address spaces locate read-only data in
565
flash memory and allow reading from flash memory by means of ordinary C
566
code, i.e. without the need of (inline) assembler code:
568
const __flash int values[] = { 42, 31 };
570
int add_values (const __flash int *p, int i)
572
return values[i] + *p;
575
- Support for AVR-specific built-in_functions has been added.
577
- Support has been added for the signed and unsigned 24-bit scalar integer
578
types __int24 and __uint24.
580
- New command-line options -maccumulate-args, -mbranch-cost=cost and
581
-mstrict-X were added to allow better fine-tuning of code optimization.
583
- Many optimizations to:
585
- 64-bit integer arithmetic
587
- Widening multiplication
589
- Integer division by a constant
591
- Avoid constant reloading in multi-byte instructions.
593
- Micro-optimizations for special instruction sequences.
595
- Generic built-in functions like __builtin_ffs*, __builtin_clz*, etc.
597
- If-else decision trees generated by switch instructions
599
- Merging of data located in flash memory
601
- New libgcc variants for devices with 8-bit wide stack pointer
603
- Better documentation:
605
- Handling of EIND and indirect jumps on devices with more than 128
606
KiB of program memory.
608
- Handling of the RAMPD, RAMPX, RAMPY and RAMPZ special function
611
- Function attributes OS_main and OS_task.
612
- AVR-specific built-in macros.
618
- Support has been added for the Texas Instruments C6X family of processors.
624
- Support has been added for National Semiconductor's CR16 architecture.
630
- Support has been added for Adapteva's Epiphany architecture.
731
- The new -fsplit-stack option permits programs to use a discontiguous
732
stack. This is useful for threaded programs, in that it is no
733
longer necessary to specify the maximum stack size when creating a
734
thread. This feature is currently only implemented for 32-bit and
735
64-bit x86 GNU/Linux targets.
737
- Support for emitting profiler counter calls before function
738
prologues. This is enabled via a new command-line option -mfentry.
740
- Optimization for the Intel Core 2 processors is now available
741
through the -march=core2 and -mtune=core2 options.
743
- Support for Intel Core i3/i5/i7 processors is now available through
744
the -march=corei7 and -mtune=corei7 options.
746
- Support for Intel Core i3/i5/i7 processors with AVX is now available
747
through the -march=corei7-avx and -mtune=corei7-avx options.
749
- Support for AMD Bobcat (family 14) processors is now available
750
through the -march=btver1 and -mtune=btver1 options.
752
- The default setting (when not optimizing for size) for 32-bit
753
GNU/Linux and Darwin x86 targets has been changed to -fomit-frame-pointer.
754
The default can be reverted to -fno-omit-frame-pointer by
755
configuring GCC with the --enable-frame-pointer configure option.
757
- Darwin, FreeBSD, Solaris 2, MinGW and Cygwin now all support
758
__float128 on 32-bit and 64-bit x86 targets.
760
- AVX floating-point arithmetic can now be enabled by default at
761
configure time with the new --with-fpmath=avx option.
763
- The SSA loop prefetching pass is enabled when using -O3 when
764
optimizing for CPUs where prefetching is beneficial (AMD CPUs newer
767
- Support for TBM (Trailing Bit Manipulation) built-in functions and
768
code generation is available via -mtbm.
770
- Support for AMD's BMI (Bit Manipulation) built-in functions and code
771
generation is available via -mbmi.
777
- Support has been added for the Xilinx MicroBlaze softcore processor
778
(microblaze-elf) embedded target. This configurable processor is
779
supported on several Xilinx Spartan and Virtex FPGAs.
636
- Support for Intel AVX2 intrinsics, built-in functions and code generation
637
is available via -mavx2.
639
- Support for Intel BMI2 intrinsics, built-in functions and code generation
640
is available via -mbmi2.
642
- Implementation and automatic generation of __builtin_clz* using the lzcnt
643
instruction is available via -mlzcnt.
645
- Support for Intel FMA3 intrinsics and code generation is available via
648
- A new -mfsgsbase command-line option is available that makes GCC generate
649
new segment register read/write instructions through dedicated built-ins.
651
- Support for the new Intel rdrnd instruction is available via -mrdrnd.
653
- Two additional AVX vector conversion instructions are available via
656
- Support for new Intel processor codename IvyBridge with RDRND, FSGSBASE
657
and F16C is available through -march=core-avx-i.
659
- Support for the new Intel processor codename Haswell with AVX2, FMA, BMI,
660
BMI2, LZCNT is available through -march=core-avx2.
662
- Support for new AMD family 15h processors (Piledriver core) is now
663
available through -march=bdver2 and -mtune=bdver2 options.
665
- Support for the_x32_psABI is now available through the -mx32 option.
667
- Windows mingw targets are using the -mms-bitfields option by default.
669
- Windows x86 targets are using the __thiscall calling convention for C++
670
class-member functions.
672
- Support for the configure option --with-threads=posix for Windows mingw
785
- GCC now supports the Loongson 3A processor. Its canonical -march=
786
and -mtune= name is loongson3a.
792
- The inline assembly register constraint "A" has been renamed "c".
793
This constraint is used to select a floating-point register that can
794
be used as the destination of a multiply-accumulate instruction.
796
- New inline assembly register constraints "A" and "D" have been
797
added. These constraint letters resolve to all general registers
798
when compiling for AM33, and resolve to address registers only or
799
data registers only when compiling for MN10300.
801
- The MDR register is represented in the compiler. One can access the
802
register via the "z" constraint in inline assembly. It can be
803
marked as clobbered or used as a local register variable via the
804
"mdr" name. The compiler uses the RETF instruction if the function
805
does not modify the MDR register, so it is important that inline
806
assembly properly annotate any usage of the register.
679
- GCC now supports thread-local storage (TLS) for MIPS16. This requires GNU
680
binutils 2.22 or later.
682
- GCC can now generate code specifically for the Cavium Octeon+ and Octeon2
683
processors. The associated command-line options are -march=octeon+ and
684
-march=octeon2 respectively. Both options require GNU binutils 2.22 or
687
- GCC can now work around certain 24k errata, under the control of the
688
command-line option -mfix-24k. These workarounds require GNU binutils
691
- 32-bit MIPS GNU/Linux targets such as mips-linux-gnu can now build n32
692
and n64 multilibs. The result is effectively a 64-bit GNU/Linux toolchain
693
that generates 32-bit code by default. Use the configure-time option
694
--enable-targets=all to select these extra multilibs.
696
- Passing -fno-delayed-branch now also stops the assembler from
697
automatically filling delay slots.
809
700
PowerPC/PowerPC64
810
701
-----------------
812
- GCC now supports the Applied Micro Titan processor with -mcpu=titan.
814
- The -mrecip option has been added, which indicates whether the
815
reciprocal and reciprocal square root instructions should be used.
817
- The -mveclibabi=mass option can be used to enable the compiler to
818
autovectorize mathematical functions using the Mathematical
819
Acceleration Subsystem library.
821
- The -msingle-pic-base option has been added, which instructs the
822
compiler to avoid loading the PIC base register in function
823
prologues. The PIC base register must be initialized by the runtime
826
- The -mblock-move-inline-limit option has been added, which enables
827
the user to control the maximum size of inlined memcpy calls and
830
- PowerPC64 GNU/Linux support for applications requiring a large TOC
831
section has been improved. A new command-line option,
832
-mcmodel=MODEL, controls this feature; valid values for MODEL are
833
small, medium, or large.
835
- The altivec builtin functions vec_ld and vec_st have been modified
836
to generate the Altivec memory instructions LVX and STVX, even if
837
the -mvsx option is used. In the initial GCC 4.5 release, these
838
builtin functions were changed to generate VSX memory reference
839
instructions instead of Altivec memory instructions, but there are
840
differences between the two instructions. If the VSX instruction
841
set is available, you can now use the new builtin functions
842
vec_vsx_ld and vec_vsx_st which always generates the VSX memory
845
- The GCC compiler on AIX now defaults to a process layout with a
846
larger data space allowing larger programs to be compiled.
848
- The GCC long double type on AIX 6.1 and above has reverted to 64 bit
849
double precision, matching the AIX XL compiler default, because of
850
missing C99 symbols required by the GCC runtime.
852
- The default processor scheduling model and tuning for PowerPC64
853
GNU/Linux and for AIX 6.1 and above now is POWER7.
856
S/390, zSeries and System z9/z10, IBM zEnterprise z196
857
------------------------------------------------------
859
- Support for the zEnterprise z196 processor has been added. When
860
using the -march=z196 option, the compiler will generate code making
861
use of the following instruction facilities:
863
- Conditional load/store
865
- Floating-point-extension
869
- The -mtune=z196 option avoids the compare and branch instructions as
870
well as the load address instruction with an index register as much
871
as possible and performs instruction scheduling appropriate for the
872
new out-of-order pipeline architecture.
874
- When using the -m31 -mzarch options the generated code still
875
conforms to the 32-bit ABI but uses the general purpose registers as
876
64-bit registers internally. This requires a Linux kernel saving
877
the whole 64-bit registers when doing a context switch. Kernels
878
providing that feature indicate that by the 'highgprs' string in
881
- The SSA loop prefetching pass is enabled when using -O3.
703
- Vectors of type vector long long or vector long are passed and returned
704
using the same method as other vectors with the VSX instruction set.
705
Previously the GCC compiler did not adhere to the ABI for 128-bit vectors
706
with 64-bit integer base types (PR 48857). This will also be fixed in the
707
GCC 4.6.1 and 4.5.4 releases.
709
- A new option -mno-pointers-to-nested-functions was added to allow AIX 32-
710
bit/64-bit and GNU/Linux 64-bit PowerPC users to specify that the
711
compiler should not load up the chain register (r11) before calling a
712
function through a pointer. If you use this option, you cannot call
713
nested functions through a pointer, or call other languages that might
714
use the static chain.
716
- A new option msave-toc-indirect was added to allow AIX 32-bit/64-bit and
717
GNU/Linux 64-bit PowerPC users control whether we save the TOC in the
718
prologue for indirect calls or generate the save inline. This can speed
719
up some programs that call through a function pointer a lot, but it can
720
slow down other functions that only call through a function pointer in
723
- The PowerPC port will now enable machine-specific builtin functions when
724
the user switches the target machine using the #pragma GCC target or
725
__attribute__ ((__target__ ("target"))) code sequences. In additon, the
726
target macros are updated. However, due to the way the -save-temps switch
727
is implemented, you won't see the effect of these additional macros being
728
defined in preprocessor output.
734
- A new option -msoft-atomic has been added. When it is specified, GCC will
735
generate GNU/Linux-compatible gUSA atomic sequences for the new __atomic
738
- Since it is neither supported by GAS nor officially documented, code
739
generation for little endian SH2A has been disabled. Specifying -ml with
740
-m2a* will now result in a compiler error.
742
- The defunct -mbranch-cost option has been fixed.
744
- Some improvements to the generated code of:
746
- Utilization of the tst #imm,R0 instruction.
748
- Dynamic shift instructions on SH2A.
750
- Integer absolute value calculations.
887
- GCC now supports the LEON series of SPARC V8 processors. The code
888
generated by the compiler can either be tuned to it by means of the
889
--with-tune=leon configure option and -mtune=leon compilation
890
option, or the compiler can be built for the sparc-leon-{elf,linux}
891
and sparc-leon3-{elf,linux} targets directly.
893
- GCC has stopped sign/zero-extending parameter registers in the
894
callee for functions taking parameters with sub-word size in 32-bit
895
mode, since this is redundant with the specification of the ABI.
896
GCC has never done so in 64-bit mode since this is also redundant.
905
- GCC now supports the Bionic C library and provides a convenient way
906
of building native libraries and applications for the Android
907
platform. Refer to the documentation of the -mandroid and -mbionic
908
options for details on building native code. At the moment, Android
909
support is enabled only for ARM.
756
- The option -mflat has been reinstated. When it is specified, the compiler
757
will generate code for a single register window model. This is
758
essentially a new implementation and the corresponding debugger support
759
has been added to GDB 7.4.
761
- Support for the options -mtune=native and -mcpu=native has been added on
762
selected native platforms (GNU/Linux and Solaris).
764
- Support for the SPARC T3 (Niagara 3) processor has been added.
768
- An intrinsics header visintrin.h has been added.
769
- Builtin intrinsics for the VIS 1.0 edge handling and pixel compare
770
instructions have been added.
771
- The little-endian version of alignaddr is now supported.
772
- When possible, VIS builtins are marked const, which should increase
773
the compiler's ability to optimize VIS operations.
774
- The compiler now properly tracks the %gsr register and how it
775
behaves as an input for various VIS instructions.
776
- Akin to fzero, the compiler can now generate fone instructions in
777
order to set all of the bits of a floating-point register to 1.
778
- The documentation for the VIS intrinsics in the GCC manual has been
779
brought up to date and many inaccuracies were fixed.
780
- Intrinsics for the VIS 2.0 bmask, bshuffle, and non-condition-code
781
setting edge instructions have been added. Their availability is
782
controlled by the new -mvis2 and -mno-vis2 options. They are
783
enabled by default on UltraSPARC-III and later CPUs.
785
- Support for UltraSPARC Fused Multiply-Add floating-point extensions has
786
been added. These instructions are enabled by default on SPARC T3
787
(Niagara 3) and later CPUs.
917
- Initial support for CFString types has been added. This allows GCC
918
to build projects including the system Core Foundation
919
frameworks. The GCC Objective-C family supports CFString
920
"toll-free bridged" as per the Mac OS X system tools. CFString is
921
also recognized in the context of format attributes and arguments
922
(see the documentation for format attributes for limitations). At
923
present, 8-bit character types are supported.
925
- LTO-support. Darwin has benefited from ongoing work on LTO;
926
support for this is now stable and enabled by default.
928
- Object file size reduction. The Darwin zeroed memory allocators
929
have been re-written to make more use of .zerofill sections. For
930
non-debug code, this can reduce object file size significantly.
934
- The -mdynamic-no-pic option has been enabled.
936
- Code supporting -mdynamic-no-pic optimization has been added and
937
is applicable to -m32 builds. The compiler bootstrap uses the
938
option where appropriate.
940
- The default value for -mtune= has been changed.Since Darwin
941
systems are primarily Xeon, Core-2 or similar the default tuning
942
has been changed to -mtune=core2.
948
- Several significant bugs have been fixed, such that GCC now
949
produces code compatible with the Darwin64 PowerPC ABI.
951
- libffi and boehm-gc.The Darwin ports of the libffi and boehm-gc
952
libraries have been upgraded to include a Darwin64
953
implementation. This means that powerpc*-*-darwin9 platforms may
954
now, for example, build Java applications with -m64 enabled.
956
- Plug-in support has been enabled.
958
- The -fsection-anchors option is now available although, presently,
967
- Support symbol versioning with the Sun linker.
968
- Allow libstdc++ to leverage full ISO C99 support on Solaris 10+.
969
- Support thread-local storage (TLS) with the Sun assembler on
971
- Support TLS on Solaris 8/9 if prerequisites are met.
972
- Support COMDAT group with the GNU assembler and recent Sun linker.
973
- Support the Sun assembler visibility syntax.
974
- Default Solaris 2/x86 to -march=pentium4 (Solaris 10+) resp.
975
-march=pentiumpro (Solaris 8/9).
976
- Don't use SSE on Solaris 8/9 x86 by default.
977
- Enable 128-bit long double (__float128) support on Solaris 2/x86.
981
- Change the ABI for returning 8-byte vectors like __m64 in MMX
982
registers on Solaris 10+/x86 to match the Sun Studio 12.1+
983
compilers. This is an incompatible change. If you use such
984
types, you must either recompile all your code with the new
985
compiler or use the new -mvect8-ret-in-mem option to remain
986
compatible with previous versions of GCC and Sun Studio.
991
- Initial support for decimal floating point.
993
- Support for the __thiscall calling-convention.
995
- Support for hot-patchable function prologues via the
996
ms_hook_prologue attribute for x86_64 in addition to 32-bit x86.
998
- Improvements of stack-probing and stack-allocation mechanisms.
1000
- Support of push/pop-macro pragma as preprocessor command. With
1001
#pragma push_macro("macro-name") the current definition of
1002
macro-name is saved and can be restored with #pragma
1003
pop_macro("macro-name") to its saved definition.
1005
- Enable 128-bit long double (__float128) support on MinGW and Cygwin.
1008
Documentation improvements
1009
==========================
793
- Support has been added for the Tilera TILE-Gx and TILEPro families of
1012
797
Other significant improvements
1013
798
==============================
1015
Installation changes
1016
--------------------
1018
- An install-strip make target is provided that installs stripped
1019
executables, and may install libraries with unneeded or debugging
1022
- On Power7 systems, there is a potential problem if you build the GCC
1023
compiler with a host compiler using options that enables the VSX
1024
instruction set generation. If the host compiler has been patched
1025
so that the vec_ld and vec_st builtin functions generate Altivec
1026
memory instructions instead of VSX memory instructions, then you
1027
should be able to build the compiler with VSX instruction
1031
Changes for GCC Developers
1032
--------------------------
1034
Note: these changes concern developers that develop GCC itself or
1035
software that integrates with GCC, such as plugins, and not the
1038
- The gengtype utility, which previously was internal to the GCC build
1039
process, has been enchanced to provide GC root information for
1040
plugins as necessary.
1042
- The old GC allocation interface of ggc_alloc and friends was
1043
replaced with a type-safe alternative.
1047
Please send FSF & GNU inquiries & questions to gnu@gnu.org. There are
1048
also other ways to contact the FSF.
1050
These pages are maintained by the GCC team.
800
- A new option (-grecord-gcc-switches) was added that appends compiler
801
command-line options that might affect code generation to the
802
DW_AT_producer attribute string in the DWARF debugging information.
804
- GCC now supports various new GNU extensions to the DWARF debugging
805
information format, like entry_value and call_site information, typed
806
DWARF_stack or a_more_compact_macro_representation. Support for these
807
extensions has been added to GDB 7.4. They can be disabled through the
808
-gstrict-dwarf command-line option.
1052
811
For questions related to the use of GCC, please consult these web
1053
812
pages and the GCC manuals. If that fails, the gcc-help@gcc.gnu.org