~ubuntu-branches/ubuntu/trusty/gcc-snapshot/trusty

« back to all changes in this revision

Viewing changes to debian/NEWS.gcc

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2013-05-12 14:56:42 UTC
  • mfrom: (1.20.14) (135.1.29 saucy-proposed)
  • Revision ID: package-import@ubuntu.com-20130512145642-jkg0131tyv5io67o
Tags: 20130512-0ubuntu1
Snapshot, taken from the trunk (20130512)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
GCC 4.7 Release Series -- Changes, New Features, and Fixes
 
1
GCC 4.8 Release Series -- Changes, New Features, and Fixes
2
2
==========================================================
3
3
 
4
4
 
5
5
Caveats
6
6
=======
7
7
 
8
 
 - The -fconserve-space flag has been deprecated.  The flag had no
9
 
   effect for most targets: only targets without a global .bss
10
 
   section and without support for switchable sections.  Furthermore,
11
 
   the flag only had an effect for G++, where it could result in
12
 
   wrong semantics (please refer to the GCC manual for further
13
 
   details).  The flag will be removed in GCC 4.8.
14
 
 
15
 
 - Support for a number of older systems and recently unmaintained or
16
 
   untested target ports of GCC has been declared obsolete in GCC 4.7.
17
 
   Unless there is activity to revive them, the next release of GCC
18
 
   will have their sources permanently removed.
19
 
 
20
 
 - All GCC ports for the following processor architectures have been
21
 
   declared obsolete:
22
 
 
23
 
   - picoChip (picochip-*)
24
 
 
25
 
  The following ports for individual systems on particular
26
 
  architectures have been obsoleted:
27
 
 
28
 
   - IRIX 6.5 (mips-sgi-irix6.5)
29
 
   - MIPS OpenBSD (mips*-*-openbsd*)
30
 
   - Solaris 8 (*-*-solaris2.8). Details can be found in the announcement.
31
 
   - Tru64 UNIX V5.1 (alpha*-dec-osf5.1*)
32
 
 
33
 
 - On ARM, when compiling for ARMv6 (but not ARMv6-M), ARMv7-A,
34
 
   ARMv7-R, or ARMv7-M, the new option -munaligned-access is active by
35
 
   default, which for some source codes generates code that accesses
36
 
   memory on unaligned addresses. This will require the kernel of
37
 
   those systems to enable such accesses (controlled by CP15 register
38
 
   c1, refer to ARM documentation). Alternatively or for compatibility
39
 
   with kernels where unaligned accesses are not supported, all code
40
 
   has to be compiled with -mno-unaligned-access. Linux/ARM in
41
 
   official releases has automatically and unconditionally supported
42
 
   unaligned accesses as emitted by GCC due to this option being
43
 
   active, since Linux version 2.6.28.
44
 
 
45
 
 - Support on ARM for the legacy floating-point accelerator (FPA) and
46
 
   the mixed-endian floating-point format that it used has been
47
 
   obsoleted. The ports that still use this format have been obsoleted
48
 
   as well. Many legacy ARM ports already provide an alternative that
49
 
   uses the VFP floating-point format. The obsolete ports will be
50
 
   deleted in the next release.  The obsolete ports with alternatives
51
 
   are:
52
 
 
53
 
   - arm*-*-rtems (use arm*-*-rtemseabi)
54
 
   - arm*-*-linux-gnu (use arm*-*-linux-gnueabi)
55
 
   - arm*-*-elf (use arm*-*-eabi)
56
 
   - arm*-*-uclinux* (use arm*-*-uclinux*eabi)
57
 
 
58
 
   Note, however, that these alternatives are not binary compatible
59
 
   with their legacy counterparts (although some can support running
60
 
   legacy applications).
61
 
 
62
 
   The obsolete ports that currently lack a modern alternative are:
63
 
 
64
 
   - arm*-*-ecos-elf
65
 
   - arm*-*-freebsd
66
 
   - arm*-wince-pe*
67
 
 
68
 
   New ports that support more recent versions of the architecture are
69
 
   welcome.
70
 
 
71
 
 - Support for the Maverick co-processor on ARM has been obsoleted. Code to
72
 
   support it will be deleted in the next release.
73
 
 
74
 
 - Support has been removed for Unix International threads on Solaris 2,
75
 
   so the --enable-threads=solaris configure option and the -threads
76
 
   compiler option don't work any longer.
77
 
 
78
 
 - Support has been removed for the Solaris BSD Compatibility Package,
79
 
   which lives in /usr/ucbinclude and /usr/ucblib. It has been removed
80
 
   from Solaris 11, and was only intended as a migration aid from
81
 
   SunOS 4 to SunOS 5. The -compat-bsd compiler option is not
82
 
   recognized any longer.
83
 
 
84
 
 - The AVR port's libgcc has been improved and its multilib structure
85
 
   has been enhanced. As a result, all objects contributing to an
86
 
   application must either be compiled with GCC versions up to 4.6.x
87
 
   or with GCC versions 4.7.0 or later.
88
 
 
89
 
 - The ARM port's -mwords-little-endian option has been deprecated. It will
90
 
   be removed in a future release.
91
 
 
92
 
 - Support has been removed for the NetWare x86 configuration obsoleted in
93
 
   GCC 4.6.
94
 
 
95
 
 - It is no longer possible to use the "l" constraint in MIPS16 asm statements.
96
 
 
97
 
 - GCC versions 4.7.0 and 4.7.1 had changes to the C++ standard
98
 
   library which affected the ABI in C++11 mode: a data member was
99
 
   added to std::list changing its size and altering the definitions
100
 
   of some member functions, and std::pair's move constructor was
101
 
   non-trivial which altered the calling convention for functions with
102
 
   std::pair arguments or return types. The ABI incompatibilities have
103
 
   been fixed for GCC version 4.7.2 but as a result C++11 code
104
 
   compiled with GCC 4.7.0 or 4.7.1 may be incompatible with C++11
105
 
   code compiled with different GCC versions and with C++98/C++03 code
106
 
   compiled with any version.
107
 
 
108
 
 - On ARM, a bug has been fixed in GCC's implementation of the AAPCS
109
 
   rules for the layout of vectors that could lead to wrong code being
110
 
   generated. Vectors larger than 8 bytes in size are now by default
111
 
   aligned to an 8-byte boundary. This is an ABI change: code that
112
 
   makes explicit use of vector types may be incompatible with binary
113
 
   objects built with older versions of GCC. Auto-vectorized code is
114
 
   not affected by this change. (This change affects GCC versions
115
 
   4.7.2 and later.)
116
 
 
117
 
 - More information on porting to GCC 4.7 from previous versions of GCC can
118
 
   be found in the porting_guide for this release.
119
 
 
120
 
 
121
 
General Optimizer Improvements
122
 
==============================
123
 
 
124
 
 - Support for a new parameter --param case-values-threshold=n was
125
 
   added to allow users to control the cutoff between doing switch
126
 
   statements as a series of if statements and using a jump table.
 
8
GCC now uses C++ as its implementation language. This means that to build GCC
 
9
from sources, you will need a C++ compiler that understands C++ 2003. For more
 
10
details on the rationale and specific changes, please refer to the C++
 
11
conversion page.
 
12
 
 
13
To enable the Graphite framework for loop optimizations you now need CLooG
 
14
version 0.18.0 and ISL version 0.11.1. Both can be obtained from the GCC
 
15
infrastructure directory. The installation manual contains more information
 
16
about requirements to build GCC.
 
17
 
 
18
GCC now uses a more aggressive analysis to derive an upper bound for the
 
19
number of iterations of loops using constraints imposed by language standards.
 
20
This may cause non-conforming programs to no longer work as expected, such as
 
21
SPEC CPU 2006 464.h264ref and 416.gamess. A new option, -fno-aggressive-loop-
 
22
optimizations, was added to disable this aggressive analysis. In some loops
 
23
that have known constant number of iterations, but undefined behavior is known
 
24
to occur in the loop before reaching or during the last iteration, GCC will
 
25
warn about the undefined behavior in the loop instead of deriving lower upper
 
26
bound of the number of iterations for the loop. The warning can be disabled
 
27
with -Wno-aggressive-loop-optimizations.
 
28
 
 
29
On ARM, a bug has been fixed in GCC's implementation of the AAPCS rules for
 
30
the layout of vectors that could lead to wrong code being generated. Vectors
 
31
larger than 8 bytes in size are now by default aligned to an 8-byte boundary.
 
32
This is an ABI change: code that makes explicit use of vector types may be
 
33
incompatible with binary objects built with older versions of GCC. Auto-
 
34
vectorized code is not affected by this change.
 
35
 
 
36
On AVR, support has been removed for the command-line option -mshort-calls
 
37
deprecated in GCC 4.7.
 
38
 
 
39
On AVR, the configure option --with-avrlibc supported since GCC 4.7.2 is
 
40
turned on per default for all non-RTEMS configurations. This option arranges
 
41
for a better integration of AVR_Libc with avr-gcc. For technical details, see
 
42
PR54461. To turn off the option in non-RTEMS configurations, use --with-
 
43
avrlibc=no. If the compiler is configured for RTEMS, the option is always
 
44
turned off.
 
45
 
 
46
More information on porting to GCC 4.8 from previous versions of GCC can be
 
47
found in the porting guide (http://gcc.gnu.org/gcc-4.8/porting_to.html) for
 
48
this release.
 
49
 
 
50
General Optimizer Improvements (and Changes)
 
51
============================================
 
52
 
 
53
 - DWARF4 is now the default when generating DWARF debug information. When -g
 
54
   is used on a platform that uses DWARF debugging information, GCC will now
 
55
   default to -gdwarf-4 -fno-debug-types-section.
 
56
   GDB 7.5, Valgrind 3.8.0 and elfutils 0.154 debug information consumers
 
57
   support DWARF4 by default. Before GCC 4.8 the default version used was
 
58
   DWARF2. To make GCC 4.8 generate an older DWARF version use -g together with
 
59
   -gdwarf-2 or -gdwarf-3. The default for Darwin and VxWorks is still
 
60
   -gdwarf-2 -gstrict-dwarf.
 
61
 
 
62
 - A new general optimization level, -Og, has been introduced. It addresses the
 
63
   need for fast compilation and a superior debugging experience while
 
64
   providing a reasonable level of runtime performance. Overall experience for
 
65
   development should be better than the default optimization level -O0.
 
66
 
 
67
 - A new option -ftree-partial-pre was added to control the partial redundancy
 
68
   elimination (PRE) optimization. This option is enabled by default at the -O3
 
69
   optimization level, and it makes PRE more aggressive.
 
70
 
 
71
 - The option -fconserve-space has been removed; it was no longer useful on
 
72
   most targets since GCC supports putting variables into BSS without making
 
73
   them common.
 
74
 
 
75
 - The struct reorg and matrix reorg optimizations (command-line-options
 
76
   -fipa-struct-reorg and -fipa-matrix-reorg) have been -removed. They did not
 
77
   always work correctly, nor did they work -with link-time optimization (LTO),
 
78
   hence were only applicable to -programs consisting of a single translation
 
79
   unit.
 
80
 
 
81
 - Several scalability bottle-necks have been removed from GCC's optimization
 
82
   passes. Compilation of extremely large functions, e.g. due to the use of the
 
83
   flatten attribute in the "Eigen" C++ linear algebra templates library, is
 
84
   significantly faster than previous releases of GCC.
127
85
 
128
86
 - Link-time optimization (LTO) improvements:
129
87
 
130
 
   - Improved scalability and reduced memory usage. Link time
131
 
     optimization of Firefox now requires 3GB of RAM on a 64-bit
132
 
     system, while over 8GB was needed previously. Linking time has
133
 
     been improved, too. The serial stage of linking Firefox has been
134
 
     sped up by about a factor of 10.
135
 
 
136
 
   - Reduced size of object files and temporary storage used during linking.
137
 
 
138
 
   - Streaming performance (both outbound and inbound) has been improved.
139
 
 
140
 
   - ld -r is now supported with LTO.
141
 
 
142
 
   - Several bug fixes, especially in symbol table handling and merging.
 
88
   - LTO partitioning has been rewritten for better reliability and
 
89
     maintanibility. Several important bugs leading to link failures have been
 
90
     fixed.
143
91
 
144
92
 - Interprocedural optimization improvements:
145
93
 
146
 
   - Heuristics now take into account that after inlining code will be
147
 
     optimized out because of known values (or properties) of function
148
 
     parameters. For example:
149
 
 
150
 
       void foo(int a)
151
 
       {
152
 
         if (a > 10)
153
 
           ... huge code ...
154
 
       }
155
 
       void bar (void)
156
 
       {
157
 
         foo (0);
158
 
       }
159
 
 
160
 
     The call of foo will be inlined into bar even when optimizing for
161
 
     code size. Constructs based on __builtin_constant_p are now
162
 
     understood by the inliner and code size estimates are evaluated a
163
 
     lot more realistically.
164
 
 
165
 
   - The representation of C++ virtual thunks and aliases (both
166
 
     implicit and defined via the alias attribute) has been
167
 
     re-engineered.  Aliases no longer pose optimization barriers and
168
 
     calls to an alias can be inlined and otherwise optimized.
169
 
 
170
 
   - The inter-procedural constant propagation pass has been
171
 
     rewritten.  It now performs generic function specialization. For
172
 
     example when compiling the following:
173
 
 
174
 
       void foo(bool flag)
175
 
       {
176
 
         if (flag)
177
 
           ... do something ...
178
 
         else
179
 
           ... do something else ...
180
 
       }
181
 
       void bar (void)
182
 
       {
183
 
         foo (false);
184
 
         foo (true);
185
 
         foo (false);
186
 
         foo (true);
187
 
         foo (false);
188
 
         foo (true);
189
 
       }
190
 
 
191
 
     GCC will now produce two copies of foo. One with flag being true,
192
 
     while other with flag being false. This leads to performance
193
 
     improvements previously possible only by inlining all calls.
194
 
     Cloning causes a lot less code size growth.
195
 
 
196
 
   - A string length optimization pass has been added. It attempts to
197
 
     track string lengths and optimize various standard C string
198
 
     functions like strlen, strchr, strcpy, strcat, stpcpy and their
199
 
     _FORTIFY_SOURCE counterparts into faster alternatives. This pass
200
 
     is enabled by default at -O2 or above, unless optimizing for
201
 
     size, and can be disabled by the - fno-optimize-strlen
202
 
     option. The pass can e.g. optimize
203
 
 
204
 
       char *bar (const char *a)
205
 
       {
206
 
         size_t l = strlen (a) + 2;
207
 
         char *p = malloc (l); if (p == NULL) return p;
208
 
         strcpy (p, a); strcat (p, "/"); return p;
209
 
       }
210
 
 
211
 
     into:
212
 
 
213
 
       char *bar (const char *a)
214
 
       {
215
 
         size_t tmp = strlen (a);
216
 
         char *p = malloc (tmp + 2); if (p == NULL) return p;
217
 
         memcpy (p, a, tmp); memcpy (p + tmp, "/", 2); return p;
218
 
       }
219
 
 
220
 
     or for hosted compilations where stpcpy is available in the runtime
221
 
     and headers provide its prototype, e.g.
222
 
 
223
 
       void foo (char *a, const char *b, const char *c, const char *d)
224
 
       {
225
 
         strcpy (a, b); strcat (a, c); strcat (a, d);
226
 
       }
227
 
 
228
 
     can be optimized into:
229
 
 
230
 
       void foo (char *a, const char *b, const char *c, const char *d)
231
 
       {
232
 
         strcpy (stpcpy (stpcpy (a, b), c), d);
233
 
       }
 
94
   - A new symbol table has been implemented. It builds on existing callgraph
 
95
     and varpool modules and provide a new API. Unusual symbol visibilities and
 
96
     aliases are handled more consistently leading to, for example, more
 
97
     aggressive unreachable code removal with LTO.
 
98
 
 
99
   - The inline heuristic can now bypass limits on the size of of inlined
 
100
     functions when the inlining is particularly profitable. This happens, for
 
101
     example, when loop bounds or array strides get propagated.
 
102
 
 
103
   - Values passed through aggregates (either by value or reference) are now
 
104
     propagated at the inter-procedural level leading to better inlining
 
105
     decisions (for example in the case of Fortran array descriptors) and
 
106
     devirtualization.
 
107
 
 
108
 - AddressSanitizer, a fast memory error detector, has been added and can be
 
109
   enabled via -fsanitize=address. Memory access instructions will be
 
110
   instrumented to detect heap-, stack-, and global-buffer overflow as well as
 
111
   use-after-free bugs. To get nicer stacktraces, use -fno-omit-frame-pointer.
 
112
   The AddressSanitizer is available on IA-32/x86-64/x32/PowerPC/PowerPC64 GNU/
 
113
   Linux and on x86-64 Darwin.
 
114
 
 
115
 - ThreadSanitizer has been added and can be enabled via -fsanitize=thread.
 
116
   Instructions will be instrumented to detect data races. The ThreadSanitizer
 
117
   is available on x86-64 GNU/Linux.
234
118
 
235
119
 
236
120
New Languages and Language specific improvements
237
121
================================================
238
122
 
239
 
 - Version 3.1 of the OpenMP_specification is now supported for the C, C++,
240
 
   and Fortran compilers.
241
 
 
242
 
 
243
 
Ada
244
 
---
245
 
 
246
 
 - The command-line option -feliminate-unused-debug-types has been re-
247
 
   enabled by default, as it is for the other languages, leading to a
248
 
   reduction in debug info size of 12.5% and more for relevant cases,
249
 
   as well as to a small compilation speedup.
250
 
 
251
123
 
252
124
C family
253
125
--------
254
126
 
255
 
 - A new built-in, __builtin_assume_aligned, has been added, through which
256
 
   the compiler can be hinted about pointer alignment and can use it to
257
 
   improve generated code.
258
 
 
259
 
 - A new -Wunused-local-typedefs warning was added for C, C++,
260
 
   Objective-C and Objective-C++.  This warning diagnoses typedefs
261
 
   locally defined in a function, and otherwise not used.
262
 
 
263
 
 - A new experimental -ftrack-macro-expansion option was added for C,
264
 
   C++, Objective-C, Objective-C++ and Fortran.  It allows the
265
 
   compiler to emit diagnostic about the current macro expansion
266
 
   stack when a compilation error occurs in a macro expansion.
267
 
 
268
 
 - Experimental support for transactional memory has been added. It includes
269
 
   support in the compiler, as well as a supporting runtime library called
270
 
   libitm. To compile code with transactional memory constructs, use the -
271
 
   fgnu-tm option.
272
 
 
273
 
   Support is currently available for Alpha, ARM, PowerPC, SH, SPARC, and
274
 
   32-bit/64-bit x86 platforms.
275
 
 
276
 
   For more details on transactional memory see the_GCC_WiKi.
277
 
 
278
 
 - Support for atomic operations specifying the C++11/C11 memory model has
279
 
   been added. These new __atomic routines replace the existing __sync
280
 
   built-in routines.
281
 
 
282
 
   Atomic support is also available for memory blocks. Lock-free
283
 
   instructions will be used if a memory block is the same size and
284
 
   alignment as a supported integer type. Atomic operations which do not
285
 
   have lock-free support are left as function calls. A set of library
286
 
   functions is available on the GCC atomic wiki in the "External Atomics
287
 
   Library" section.
288
 
 
289
 
   For more details on the memory models and features, see the atomic_wiki.
290
 
 
291
 
 - When a binary operation is performed on vector types and one of the
292
 
   operands is a uniform vector, it is possible to replace the vector with
293
 
   the generating element. For example:
294
 
 
295
 
     typedef int v4si __attribute__ ((vector_size (16)));
296
 
     v4si res, a = {1,2,3,4};
297
 
     int x;
298
 
 
299
 
     res = 2 + a;  /* means {2,2,2,2} + a  */
300
 
     res = a - x;  /* means a - {x,x,x,x}  */
301
 
 
302
 
 
303
 
C
304
 
-
305
 
 
306
 
 - There is support for some more features from the C11 revision of the ISO
307
 
   C standard. GCC now accepts the options -std=c11 and -std=gnu11, in
308
 
   addition to the previous -std=c1x and -std=gnu1x.
309
 
 
310
 
   - Unicode strings (previously supported only with options such as
311
 
     -std=gnu11, now supported with -std=c11), and the predefined macros
312
 
     __STDC_UTF_16__ and __STDC_UTF_32__.
313
 
 
314
 
   - Nonreturning functions (_Noreturn and <stdnoreturn.h>).
315
 
 
316
 
   - Alignment support (_Alignas, _Alignof, max_align_t, <stdalign.h>).
317
 
 
318
 
   - A built-in function __builtin_complex is provided to support C
319
 
     library implementation of the CMPLX family of macros.
 
127
 - Each diagnostic emitted now includes the original source line and a caret
 
128
   '^' indicating the column. The option -fno-diagnostics-show-caret suppresses
 
129
   this information.
 
130
 
 
131
 - The option -ftrack-macro-expansion=2 is now enabled by default. This allows
 
132
   the compiler to display the macro expansion stack in diagnostics. Combined
 
133
   with the caret information, an example diagnostic showing these two features
 
134
   is:
 
135
 
 
136
     t.c:1:94: error: invalid operands to binary < (have ‘struct mystruct’ and ‘float’)
 
137
     #define MYMAX(A,B)    __extension__ ({ __typeof__(A) __a = (A);
 
138
                                            __typeof__(B) __b = (B);
 
139
                                             __a < __b ? __b : __a; })
 
140
                                                 ^
 
141
     t.c:7:7: note: in expansion of macro 'MYMAX'
 
142
        X = MYMAX(P, F);
 
143
            ^
 
144
 
 
145
 - A new -Wsizeof-pointer-memaccess warning has been added (also enabled by
 
146
   -Wall) to warn about suspicious length parameters to certain string and
 
147
   memory built-in functions if the argument uses sizeof. This warning warns
 
148
   e.g. about memset (ptr, 0, sizeof (ptr)); if ptr is not an array, but a
 
149
   pointer, and suggests a possible fix, or about
 
150
   memcpy (&foo, ptr, sizeof (&foo));.
 
151
 
 
152
 - The new option -Wpedantic is an alias for -pedantic, which is now
 
153
   deprecated. The forms -Wno-pedantic, -Werror=pedantic, and -Wno-
 
154
   error=pedantic work in the same way as for any other -W option. One caveat
 
155
   is that -Werror=pedantic is not equivalent to -pedantic-errors, since the
 
156
   latter makes into errors some warnings that are not controlled by
 
157
   -Wpedantic, and the former only affects diagnostics that are disabled when
 
158
   using -Wno-pedantic.
 
159
 
 
160
 - The option -Wshadow no longer warns if a declaration shadows a function
 
161
   declaration, unless the former declares a function or pointer to function,
 
162
   because this is a_common_and_valid_case_in_real-world_code.
320
163
 
321
164
 
322
165
C++
323
166
---
324
167
 
325
 
 - G++ now accepts the -std=c++11, -std=gnu++11, and -Wc++11-compat options,
326
 
   which are equivalent to -std=c++0x, -std=gnu++0x, and -Wc++0x-compat,
327
 
   respectively.
328
 
 
329
 
 - G++ now implements C++11 extended friend syntax:
330
 
 
331
 
     template<class W>
332
 
     class Q
333
 
     {
334
 
       static const int I = 2;
335
 
     public:
336
 
       friend W;
337
 
     };
338
 
 
339
 
     struct B
340
 
     {
341
 
       int ar[Q<B>::I];
342
 
     };
343
 
 
344
 
 - Thanks to Ville Voutilainen, G++ now implements C++11 explicit override
345
 
   control.
346
 
 
347
 
     struct B {
348
 
       virtual void f() const final;
349
 
       virtual void f(int);
350
 
     };
351
 
 
352
 
     struct D : B {
353
 
       void f() const;            // error: D::f attempts to
354
 
     override final B::f
355
 
       void f(long) override;     // error: doesn't override
356
 
     anything
357
 
       void f(int) override;      // ok
358
 
     };
359
 
 
360
 
     struct E final { };
361
 
     struct F: E { }; // error: deriving from final class
362
 
 
363
 
 - G++ now implements C++11 non-static data member initializers.
364
 
 
365
 
     struct A {
366
 
       int i = 42;
367
 
     } a; // initializes a.i to 42
368
 
 
369
 
 - Thanks to Ed Smith-Rowland, G++ now implements C++11 user-defined
370
 
   literals.
371
 
 
372
 
     // Not actually a good approximation.  :)
373
 
     constexpr long double operator"" _degrees (long double d)
374
 
     { return d * 0.0175; }
375
 
     long double pi = 180.0_degrees;
376
 
 
377
 
 - G++ now implements C++11 alias-declarations.
378
 
 
379
 
     template <class T> using Ptr = T*;
380
 
     Ptr<int> ip;  // decltype(ip) is int*
381
 
 
382
 
 - Thanks to Ville Voutilainen and Pedro Lamarão, G++ now implements C++11
383
 
   delegating constructors.
384
 
 
385
 
     struct A {
386
 
       A(int);
387
 
       A(): A(42) { } // delegate to the A(int) constructor
388
 
     };
389
 
 
390
 
 - G++ now fully implements C++11 atomic classes rather than just integer
391
 
   derived classes.
392
 
 
393
 
     class POD {
394
 
       int a;
395
 
       int b;
396
 
     };
397
 
     std::atomic<POD> my_atomic_POD;
398
 
 
399
 
 - G++ now sets the predefined macro __cplusplus to the correct value,
400
 
   199711L for C++98/03, and 201103L for C++11.
401
 
 
402
 
 - G++ now correctly implements the two-phase lookup rules such that an
403
 
   unqualified name used in a template must have an appropriate declaration
404
 
   found either in scope at the point of definition of the template or by
405
 
   argument-dependent lookup at the point of instantiation. As a result,
406
 
   code that relies on a second unqualified lookup at the point of
407
 
   instantiation to find functions declared after the template or in
408
 
   dependent bases will be rejected. The compiler will suggest ways to fix
409
 
   affected code, and using the -fpermissive compiler flag will allow the
410
 
   code to compile with a warning.
411
 
 
412
 
     template <class T>
413
 
     void f() { g(T()); } // error, g(int) not found by argument-
414
 
     dependent lookup
415
 
     void g(int) { } // fix by moving this declaration before the
416
 
     declaration of f
417
 
 
418
 
     template <class T>
419
 
     struct A: T {
420
 
       // error, B::g(B) not found by argument-dependent lookup
421
 
       void f() { g(T()); } // fix by using this->g or A::g
422
 
     };
423
 
 
424
 
     struct B { void g(B); };
425
 
 
426
 
     int main()
427
 
     {
428
 
       f<int>();
429
 
       A<B>().f();
430
 
     }
431
 
 
432
 
 - G++ now properly re-uses stack space allocated for temporary objects when
433
 
   their lifetime ends, which can significantly lower stack consumption for
434
 
   some C++ functions. As a result of this, some code with undefined
435
 
   behavior will now break:
436
 
 
437
 
     const int &amp;f(const int &amp;i) { return i; }
438
 
     ....
439
 
     const int &amp;x = f(1);
440
 
     const int &amp;y = f(2);
441
 
 
442
 
   Here, x refers to the temporary allocated to hold the 1 argument, which
443
 
   only lives until the end of the initialization; it immediately becomes a
444
 
   dangling reference. So the next statement re-uses the stack slot to hold
445
 
   the 2 argument, and users of x get that value instead.
446
 
   Note that this should not cause any change of behavior for temporaries of
447
 
   types with non-trivial destructors, as they are already destroyed at end
448
 
   of full-expression; the change is that now the storage is released as
449
 
   well.
450
 
 
451
 
 - A new command-line option -Wdelete-non-virtual-dtor has been added to
452
 
   warn when delete is used to destroy an instance of a class which has
453
 
   virtual functions and non-virtual destructor. It is unsafe to delete an
454
 
   instance of a derived class through a pointer to a base class if the base
455
 
   class does not have a virtual destructor. This warning is enabled by -Wall.
456
 
 
457
 
 - A new command-line option -Wzero-as-null-pointer-constant has been added
458
 
   to warn when a literal '0' is used as null pointer constant. It can be
459
 
   useful to facilitate the conversion to nullptr in C++11.
460
 
 
461
 
 - As per C++98, access-declarations are now deprecated by G++. Using-
462
 
   declarations are to be used instead. Furthermore, some efforts have been
463
 
   made to improve the support of class scope using-declarations. In
464
 
   particular, using-declarations referring to a dependent type now work as
465
 
   expected (bug_c++/14258).
466
 
 
467
 
 - The ELF symbol visibility of a template instantiation is now properly
468
 
   constrained by the visibility of its template arguments (bug_c++/35688).
 
168
 - G++ now implements the C++11 thread_local keyword; this differs from the GNU
 
169
   __thread keyword primarily in that it allows dynamic initialization and
 
170
   destruction semantics. Unfortunately, this support requires a run-time
 
171
   penalty for references to non-function-local thread_local variables defined
 
172
   in a different translation unit even if they don't need dynamic
 
173
   initialization, so users may want to continue to use __thread for TLS
 
174
   variables with static initialization semantics.
 
175
 
 
176
   If the programmer can be sure that no use of the variable in a non-defining
 
177
   TU needs to trigger dynamic initialization (either because the variable is
 
178
   statically initialized, or a use of the variable in the defining TU will be
 
179
   executed before any uses in another TU), they can avoid this overhead with
 
180
   the -fno-extern-tls-init option.
 
181
 
 
182
   OpenMP threadprivate variables now also support dynamic initialization and
 
183
   destruction by the same mechanism.
 
184
 
 
185
 - G++ now implements the C++11 attribute syntax, e.g.
 
186
 
 
187
     [[noreturn]] void f();
 
188
 
 
189
   and also the alignment specifier, e.g.
 
190
 
 
191
     alignas(double) int i;
 
192
 
 
193
 - G++ now implements C++11 inheriting constructors, e.g.
 
194
 
 
195
     struct A { A(int); };
 
196
     struct B: A { using A::A; }; // defines B::B(int)
 
197
     B b(42); // OK
 
198
 
 
199
 - As of GCC 4.8.1, G++ implements the change to decltype semantics from N3276.
 
200
 
 
201
     struct A f();
 
202
     decltype(f()) g();    // OK, return type of f() is not required
 
203
     to be complete.
 
204
 
 
205
 - G++ now supports a -std=c++1y option for experimentation with features
 
206
   proposed for the next revision of the standard, expected around 2017.
 
207
   Currently the only difference from -std=c++11 is support for return type
 
208
   deduction in normal functions, as proposed in N3386.
 
209
 
 
210
 - The G++ namespace association extension, __attribute ((strong)), has been
 
211
   deprecated. Inline namespaces should be used instead.
 
212
 
 
213
 - G++ now supports a -fext-numeric-literal option to control whether GNU
 
214
   numeric literal suffixes are accepted as extensions or processed as C++11
 
215
   user-defined numeric literal suffixes. The flag is on (use suffixes for GNU
 
216
   literals) by default for -std=gnu++*, and -std=c++98. The flag is off (use
 
217
   suffixes for user-defined literals) by default for -std=c++11 and later.
469
218
 
470
219
 
471
220
Runtime Library (libstdc++)
474
223
 - Improved_experimental_support_for_the_new_ISO_C++_standard,_C++11,
475
224
   including:
476
225
 
477
 
   - using noexcept in most of the library;
478
 
 
479
 
   - implementations of pointer_traits, allocator_traits and
480
 
     scoped_allocator_adaptor;
481
 
 
482
 
   - uses-allocator construction for tuple;
483
 
 
484
 
   - vector meets the allocator-aware container requirements;
485
 
 
486
 
   - replacing monotonic_clock with steady_clock;
487
 
 
488
 
   - enabling the thread support library on most POSIX targets;
489
 
 
490
 
   - many small improvements to conform to the FDIS.
491
 
 
492
 
 - Added --enable-clocale=newlib configure option.
493
 
 
494
 
 - Debug Mode iterators for unordered associative containers.
495
 
 
496
 
 - Avoid polluting the global namespace and do not include <unistd.h>.
 
226
   - forward_list meets the allocator-aware container requirements;
 
227
 
 
228
   - this_thread::sleep_for(), this_thread::sleep_until() and this_thread::
 
229
     yield() are defined without requiring the configure option
 
230
     --enable-libstdcxx-time;
 
231
 
 
232
 - Improvements to <random>:
 
233
 
 
234
   - SSE optimized normal_distribution.
 
235
 
 
236
   - Use of hardware RNG instruction for random_device on new x86 processors
 
237
     (requires the assembler to support the instruction.)
 
238
 
 
239
   and <ext/random>:
 
240
 
 
241
   - New random number engine simd_fast_mersenne_twister_engine with an
 
242
     optimized SSE implementation.
 
243
 
 
244
   - New random number distributions beta_distribution, normal_mv_distribution,
 
245
     rice_distribution, nakagami_distribution, pareto_distribution,
 
246
     k_distribution, arcsine_distribution, hoyt_distribution.
 
247
 
 
248
 - Added --disable-libstdcxx-verbose configure option to disable diagnostic
 
249
   messages issued when a process terminates abnormally. This may be useful for
 
250
   embedded systems to reduce the size of executables that link statically to
 
251
   the library.
497
252
 
498
253
 
499
254
Fortran
500
255
-------
501
256
 
502
 
 - The compile flag -fstack-arrays has been added, which causes all local
503
 
   arrays to be put on stack memory. For some programs this will improve the
504
 
   performance significantly. If your program uses very large local arrays,
505
 
   it is possible that you will have to extend your runtime limits for stack
506
 
   memory.
507
 
 
508
 
 - The -Ofast flag now also implies -fno-protect-parens and -fstack-arrays.
509
 
 
510
 
 - Front-end optimizations can now be selected by the -ffrontend-optimize
511
 
   option and deselected by the -fno-frontend-optimize option.
512
 
 
513
 
 - When front-end optimization removes a function call, -Wfunction-
514
 
   elimination warns about that.
515
 
 
516
 
 - When performing front-end-optimization, the -faggressive-function-
517
 
   elimination option allows the removal of duplicate function calls even
518
 
   for impure functions.
519
 
 
520
 
 - The flag -Wreal-q-constant has been added, which warns if floating-point
521
 
   literals have been specified using q (such as 1.0q0); the q marker is now
522
 
   supported as a vendor extension to denote quad precision (REAL(16) or, if
523
 
   not available, REAL(10)). Consider using a kind parameter (such as in
524
 
   1.0_qp) instead, which can be obtained via SELECTED_REAL_KIND.
525
 
 
526
 
 - The GFORTRAN_USE_STDERR environment variable has been removed. GNU
527
 
   Fortran now always prints error messages to standard error. If you wish
528
 
   to redirect standard error, please consult the manual for your OS, shell,
529
 
   batch environment etc. as appropriate.
530
 
 
531
 
 - The -fdump-core option and GFORTRAN_ERROR_DUMPCORE environment variable
532
 
   have been removed. When encountering a serious error, gfortran will now
533
 
   always abort the program. Whether a core dump is generated depends on the
534
 
   user environment settings; see the ulimit -c setting for POSIX shells,
535
 
   limit coredumpsize for C shells, and the WER_user-mode_dumps_settings on
536
 
   Windows.
537
 
 
538
 
 - The -fbacktrace option is now enabled by default. When encountering a
539
 
   fatal error, gfortran will attempt to print a backtrace to standard error
540
 
   before aborting. It can be disabled with -fno-backtrace. Note: On POSIX
541
 
   targets with the addr2line utility from GNU binutils, GNU Fortran can
542
 
   print a backtrace with function name, file name, line number information
543
 
   in addition to the addresses; otherwise only the addresses are printed.
 
257
 - Compatibility notice:
 
258
 
 
259
   - Module files: The version of module files (.mod) has been incremented.
 
260
     Fortran MODULEs compiled by earlier GCC versions have to be recompiled,
 
261
     when they are USEd by files compiled with GCC 4.8. GCC 4.8 is not able to
 
262
     read .mod files created by earlier versions; attempting to do so gives an
 
263
     error message.
 
264
     Note: The ABI of the produced assembler data itself has not changed;
 
265
     object files and libraries are fully compatible with older versions except
 
266
     as noted below.
 
267
 
 
268
   - ABI: Some internal names (used in the assembler/object file) have changed
 
269
     for symbols declared in the specification part of a module. If an affected
 
270
     module - or a file using it via use association - is recompiled, the
 
271
     module and all files which directly use such symbols have to be recompiled
 
272
     as well. This change only affects the following kind of module symbols:
 
273
 
 
274
     - Procedure pointers. Note: C-interoperable function pointers (type
 
275
       (c_funptr)) are not affected nor are procedure-pointer components.
 
276
     - Deferred-length character strings.
 
277
 
 
278
 - The BACKTRACE intrinsic subroutine has been added. It shows a backtrace at
 
279
   an arbitrary place in user code; program execution continues normally
 
280
   afterwards.
 
281
 
 
282
 - The -Wc-binding-type warning option has been added (disabled by default). It
 
283
   warns if the a variable might not be C interoperable; in particular, if the
 
284
   variable has been declared using an intrinsic type with default kind instead
 
285
   of using a kind parameter defined for C interoperability in the intrinsic
 
286
   ISO_C_Binding module. Before, this warning was always printed. The
 
287
   -Wc-binding-type option is enabled by -Wall.
 
288
 
 
289
 - The -Wrealloc-lhs and -Wrealloc-lhs-all warning command-line options have
 
290
   been added, which diagnose when code to is inserted for automatic
 
291
   (re)allocation of a variable during assignment. This option can be used to
 
292
   decide whether it is safe to use -fno-realloc-lhs. Additionally, it can be
 
293
   used to find automatic (re)allocation in hot loops. (For arrays, replacing
 
294
   var= by var(:)= disables the automatic reallocation.)
 
295
 
 
296
 - The -Wcompare-reals command-line option has been added. When this is set,
 
297
   warnings are issued when comparing REAL or COMPLEX types for equality and
 
298
   inequality; consider replacing a == b by abs(a-b) < eps with a suitable eps.
 
299
   -Wcompare-reals is enabled by -Wextra.
 
300
 
 
301
 - The -Wtarget-lifetime command-line option has been added (enabled with
 
302
   -Wall), which warns if the pointer in a pointer assignment might outlive its
 
303
   target.
 
304
 
 
305
 - Reading floating point numbers which use q for the exponential (such as
 
306
   4.0q0) is now supported as vendor extension for better compatibility with
 
307
   old data files. It is strongly recommended to use for I/O the equivalent but
 
308
   standard conforming e (such as 4.0e0).
 
309
   (For Fortran source code, consider replacing the q in floating-point
 
310
   literals by a kind parameter (e.g. 4.0e0_qp with a suitable qp). Note that -
 
311
   in Fortran source code - replacing q by a simple e is not equivalent.)
 
312
 
 
313
 - The GFORTRAN_TMPDIR environment variable for specifying a non-default
 
314
   directory for files opened with STATUS="SCRATCH", is not used anymore.
 
315
   Instead gfortran checks the POSIX/GNU standard TMPDIR environment variable.
 
316
   If TMPDIR is not defined, gfortran falls back to other methods to determine
 
317
   the directory for temporary files as documented in the user_manual.
544
318
 
545
319
 - Fortran_2003:
546
320
 
547
 
   - Generic interface names which have the same name as derived types
548
 
     are now supported, which allows to write constructor functions.
549
 
     Note that Fortran does not support static constructor functions;
550
 
     only default initialization or an explicit structure-constructor
551
 
     initialization are available.
552
 
 
553
 
   - Polymorphic (class) arrays are now supported.
554
 
 
555
 
 - Fortran_2008:
556
 
 
557
 
   - Support for the DO CONCURRENT construct has been added, which
558
 
     allows the user to specify that individual loop iterations have no
559
 
     interdependencies.
560
 
 
561
 
   - Coarrays: Full single-image support except for polymorphic
562
 
     coarrays. Additionally, preliminary support for multiple images via
563
 
     an MPI-based coarray_communication_library has been added. Note:
564
 
     The library version is not yet usable as remote coarray access is
565
 
     not yet possible.
 
321
   - Support for unlimited polymorphic variables (CLASS(*)) has been added.
 
322
     Nonconstant character lengths are not yet supported.
566
323
 
567
324
 - TS_29113:
568
325
 
569
 
   - New flag -std=f2008ts permits programs that are expected to conform
570
 
     to the Fortran 2008 standard and the draft Technical Specification
571
 
     (TS) 29113 on Further Interoperability of Fortran with C.
572
 
 
573
 
   - The OPTIONAL attribute is now allowed for dummy arguments of BIND
574
 
     (C) procedures.
575
 
     
576
 
   - The RANK intrinsic has been added.
577
 
 
578
 
   - The implementation of the ASYNCHRONOUS attribute in GCC is
579
 
     compatible with the candidate draft of TS 29113 (since GCC 4.6).
 
326
   - Assumed types (TYPE(*)) are now supported.
 
327
 
 
328
   - Experimental support for assumed-rank arrays (dimension(..)) has been
 
329
     added. Note that currently gfortran's own array descriptor is used, which
 
330
     is different from the one defined in TS29113, see gfortran's_header_file
 
331
     or use the Chasm_Language_Interoperability_Tools.
580
332
 
581
333
 
582
334
Go
583
335
--
584
336
 
585
 
 - GCC 4.7 implements the Go_1_language_standard. The library support in
586
 
   4.7.0 is not quite complete, due to release timing. Release 4.7.1 is
587
 
   expected to include complete support.
 
337
 - GCC 4.8.0 implements a preliminary version of the upcoming Go 1.1 release.
 
338
   The library support is not quite complete, due to release timing.
588
339
 
589
 
 - Go has been tested on GNU/Linux and Solaris platforms. It may work on
590
 
   other platforms as well.
 
340
 - Go has been tested on GNU/Linux and Solaris platforms for various processors
 
341
   including x86, x86_64, PowerPC, SPARC, and Alpha. It may work on other
 
342
   platforms as well.
591
343
 
592
344
 
593
345
New Targets and Target Specific Improvements
594
346
============================================
595
347
 
 
348
 
 
349
AArch64
 
350
-------
 
351
 
 
352
 - A new port has been added to support AArch64, the new 64-bit architecture
 
353
   from ARM. Note that this is a separate port from the existing 32-bit ARM
 
354
   port.
 
355
 - The port provides initial support for the Cortex-A53 and the Cortex-A57
 
356
   processors with the command line options -mcpu=cortex-a53 and
 
357
   -mcpu=cortex-a57.
 
358
 
 
359
 
596
360
ARM
597
361
---
598
362
 
599
 
 - GCC now supports the Cortex-A7 processor implementing the v7-a version of
600
 
   the architecture using the option -mcpu=cortex-a7.
601
 
 
602
 
 - The default vector size in auto-vectorization for NEON is now 128 bits.
603
 
   If vectorization fails thusly, the vectorizer tries again with 64-bit
604
 
   vectors.
605
 
 
606
 
 - A new option -mvectorize-with-neon-double was added to allow users to
607
 
   change the vector size to 64 bits.
 
363
 - Initial support has been added for the AArch32 extensions defined in the
 
364
   ARMv8 architecture.
 
365
 
 
366
 - Code generation improvements for the Cortex-A7 and Cortex-A15 CPUs.
 
367
 
 
368
 - A new option, -mcpu=marvell-pj4, has been added to generate code for the
 
369
   Marvell PJ4 processor.
 
370
 
 
371
 - The compiler can now automatically generate the VFMA, VFMS, REVSH and REV16
 
372
   instructions.
 
373
 
 
374
 - A new vectorizer cost model for Advanced SIMD configurations to improve the
 
375
   auto-vectorization strategies used.
 
376
 
 
377
 - The scheduler now takes into account the number of live registers to reduce
 
378
   the amount of spilling that can occur. This should improve code performance
 
379
   in large functions. The limit can be removed by using the option -fno-sched-
 
380
   pressure.
 
381
 
 
382
 - Improvements have been made to the Marvell iWMMX code generation and support
 
383
   for the iWMMX2 SIMD unit has been added. The option -mcpu=iwmmxt2 can be
 
384
   used to enable code generation for the latter.
 
385
 
 
386
 - A number of code generation improvements for Thumb2 to reduce code size when
 
387
   compiling for the M-profile processors.
 
388
 
 
389
 - The RTEMS (arm-rtems) port has been updated to use the EABI.
 
390
 
 
391
 - Code generation support for the old FPA and Maverick floating-point
 
392
   architectures has been removed. Ports that previously relied on these
 
393
   features have also been removed. This includes the targets:
 
394
 
 
395
   - arm*-*-linux-gnu (use arm*-*-linux-gnueabi)
 
396
   - arm*-*-elf (use arm*-*-eabi)
 
397
   - arm*-*-uclinux* (use arm*-*-uclinux*eabi)
 
398
   - arm*-*-ecos-elf (no alternative)
 
399
   - arm*-*-freebsd (no alternative)
 
400
   - arm*-wince-pe* (no alternative).
608
401
 
609
402
 
610
403
AVR
611
404
---
612
405
 
613
 
 - GCC now supports the XMEGA architecture. This requires GNU binutils 2.22
614
 
   or later.
615
 
 
616
 
 - Support for the named_address_spaces __flash, __flash1, …, __flash5 and
617
 
   __memx has been added. These address spaces locate read-only data in
618
 
   flash memory and allow reading from flash memory by means of ordinary C
619
 
   code, i.e. without the need of (inline) assembler code:
620
 
 
621
 
     const __flash int values[] = { 42, 31 };
622
 
 
623
 
     int add_values (const __flash int *p, int i)
624
 
     {
625
 
         return values[i] + *p;
626
 
     }
627
 
 
628
 
 - Support has been added for a new AVR-specific configure option
629
 
   --with-avrlibc=yes in order to arrange for better integration of
630
 
   AVR-Libc. This configure option is supported in avr-gcc 4.7.2 and
631
 
   newer and will only take effect in non-RTEMS configurations. If
632
 
   avr-gcc is configured for RTEMS, the option will be ignored which is
633
 
   the same as specifying --with-avrlibc=no. See PR54461 for more
634
 
   technical details.
635
 
 
636
 
 - Support for AVR-specific built-in_functions has been added.
637
 
 
638
 
 - Support has been added for the signed and unsigned 24-bit scalar integer
639
 
   types __int24 and __uint24.
640
 
 
641
 
 - New command-line options -maccumulate-args, -mbranch-cost=cost and
642
 
   -mstrict-X were added to allow better fine-tuning of code optimization.
643
 
 
644
 
 - Many optimizations to:
645
 
 
646
 
   - 64-bit integer arithmetic
647
 
 
648
 
   - Widening multiplication
649
 
 
650
 
   - Integer division by a constant
651
 
 
652
 
   - Avoid constant reloading in multi-byte instructions.
653
 
 
654
 
   - Micro-optimizations for special instruction sequences.
655
 
 
656
 
   - Generic built-in functions like __builtin_ffs*, __builtin_clz*, etc.
657
 
 
658
 
   - If-else decision trees generated by switch instructions
659
 
 
660
 
   - Merging of data located in flash memory
661
 
 
662
 
   - New libgcc variants for devices with 8-bit wide stack pointer
663
 
 
664
 
 - Better documentation:
665
 
 
666
 
   - Handling of EIND and indirect jumps on devices with more than 128
667
 
     KiB of program memory.
668
 
 
669
 
   - Handling of the RAMPD, RAMPX, RAMPY and RAMPZ special function
670
 
     registers.
671
 
 
672
 
   - Function attributes OS_main and OS_task.
673
 
   - AVR-specific built-in macros.
674
 
 
675
 
 
676
 
C6X
677
 
---
678
 
 
679
 
 - Support has been added for the Texas Instruments C6X family of processors.
680
 
 
681
 
 
682
 
CR16
683
 
----
684
 
 
685
 
 - Support has been added for National Semiconductor's CR16 architecture.
686
 
 
687
 
 
688
 
Epiphany
689
 
--------
690
 
 
691
 
 - Support has been added for Adapteva's Epiphany architecture.
 
406
 - Support for the "Embedded C" fixed-point has been added. For details, see
 
407
   the GCC_wiki and the user_manual. The support is not complete.
 
408
 - A new print modifier %r for register operands in inline assembler is
 
409
   supported. It will print the raw register number without the register prefix
 
410
   'r':
 
411
 
 
412
     /* Return the most significant byte of 'val', a 64-bit value.  */
 
413
 
 
414
     unsigned char msb (long long val)
 
415
       {
 
416
         unsigned char c;
 
417
         __asm__ ("mov %0, %r1+7" : "=r" (c) : "r" (val));
 
418
         return c;
 
419
       }
 
420
 
 
421
   The inline assembler in this example will generate code like
 
422
 
 
423
     mov r24, 8+7
 
424
 
 
425
   provided c is allocated to R24 and val is allocated to R8...R15. This works
 
426
   because the GNU assembler accepts plain register numbers without register
 
427
   prefix.
 
428
 
 
429
 - Static initializers with 3-byte symbols are supported now:
 
430
 
 
431
     extern const __memx char foo;
 
432
     const __memx void *pfoo = &foo;
 
433
 
 
434
   This requires at least Binutils 2.23.
692
435
 
693
436
 
694
437
IA-32/x86-64
695
438
------------
696
439
 
697
 
 - Support for Intel AVX2 intrinsics, built-in functions and code generation
698
 
   is available via -mavx2.
699
 
 
700
 
 - Support for Intel BMI2 intrinsics, built-in functions and code generation
701
 
   is available via -mbmi2.
702
 
 
703
 
 - Implementation and automatic generation of __builtin_clz* using the lzcnt
704
 
   instruction is available via -mlzcnt.
705
 
 
706
 
 - Support for Intel FMA3 intrinsics and code generation is available via
707
 
   -mfma.
708
 
 
709
 
 - A new -mfsgsbase command-line option is available that makes GCC generate
710
 
   new segment register read/write instructions through dedicated built-ins.
711
 
 
712
 
 - Support for the new Intel rdrnd instruction is available via -mrdrnd.
713
 
 
714
 
 - Two additional AVX vector conversion instructions are available via
715
 
   -mf16c.
716
 
 
717
 
 - Support for new Intel processor codename IvyBridge with RDRND, FSGSBASE
718
 
   and F16C is available through -march=core-avx-i.
719
 
 
720
 
 - Support for the new Intel processor codename Haswell with AVX2, FMA, BMI,
721
 
   BMI2, LZCNT is available through -march=core-avx2.
722
 
 
723
 
 - Support for new AMD family 15h processors (Piledriver core) is now
724
 
   available through -march=bdver2 and -mtune=bdver2 options.
725
 
 
726
 
 - Support for the_x32_psABI is now available through the -mx32 option.
727
 
 
728
 
 - Windows mingw targets are using the -mms-bitfields option by default.
729
 
 
730
 
 - Windows x86 targets are using the __thiscall calling convention for C++
731
 
   class-member functions.
732
 
 
733
 
 - Support for the configure option --with-threads=posix for Windows mingw
734
 
   targets.
 
440
 - Allow -mpreferred-stack-boundary=3 for the x86-64 architecture with SSE
 
441
   extensions disabled. Since the x86-64 ABI requires 16 byte stack alignment,
 
442
   this is ABI incompatible and intended to be used in controlled environments
 
443
   where stack space is an important limitation. This option will lead to wrong
 
444
   code when functions compiled with 16 byte stack alignment (such as functions
 
445
   from a standard library) are called with misaligned stack. In this case, SSE
 
446
   instructions may lead to misaligned memory access traps. In addition,
 
447
   variable arguments will be handled incorrectly for 16 byte aligned objects
 
448
   (including x87 long double and __int128), leading to wrong results. You must
 
449
   build all modules with -mpreferred-stack-boundary=3, including any
 
450
   libraries. This includes the system libraries and startup modules.
 
451
 
 
452
 - Support for the new Intel processor codename Broadwell with RDSEED, ADCX,
 
453
   ADOX, PREFETCHW is available through -madx, -mprfchw, -mrdseed command-line
 
454
   options.
 
455
 
 
456
 - Support for the Intel RTM and HLE intrinsics, built-in functions and code
 
457
   generation is available via -mrtm and -mhle.
 
458
 
 
459
 - Support for the Intel FXSR, XSAVE and XSAVEOPT instruction sets. Intrinsics
 
460
   and built-in functions are available via -mfxsr, -mxsave and -mxsaveopt
 
461
   respectively.
 
462
 
 
463
 - New -maddress-mode=[short|long] options for x32. -maddress-mode=short
 
464
   overrides default 64-bit addresses to 32-bit by emitting the 0x67 address-
 
465
   size override prefix. This is the default address mode for x32.
 
466
 
 
467
 - New built-in functions to detect run-time CPU type and ISA:
 
468
 
 
469
   - A built-in function __builtin_cpu_is has been added to detect if the run-
 
470
     time CPU is of a particular type. It returns a positive integer on a match
 
471
     and zero otherwise. It accepts one string literal argument, the CPU name.
 
472
     For example, __builtin_cpu_is("westmere") returns a positive integer if
 
473
     the run-time CPU is an Intel Core i7 Westmere processor. Please refer to
 
474
     the user_manual for the list of valid CPU names recognized.
 
475
 
 
476
   - A built-in function __builtin_cpu_supports has been added to detect if the
 
477
     run-time CPU supports a particular ISA feature. It returns a positive
 
478
     integer on a match and zero otherwise. It accepts one string literal
 
479
     argument, the ISA feature. For example, __builtin_cpu_supports("ssse3")
 
480
     returns a positive integer if the run-time CPU supports SSSE3
 
481
     instructions. Please refer to the user_manual for the list of valid ISA
 
482
     names recognized.
 
483
 
 
484
   Caveat: If these built-in functions are called before any static
 
485
   constructors are invoked, like during IFUNC initialization, then the CPU
 
486
   detection initialization must be explicitly run using this newly provided
 
487
   built-in function, __builtin_cpu_init. The initialization needs to be done
 
488
   only once. For example, this is how the invocation would look like inside an
 
489
   IFUNC initializer:
 
490
 
 
491
        static void (*some_ifunc_resolver(void))(void)
 
492
        {
 
493
          __builtin_cpu_init();
 
494
          if (__builtin_cpu_is("amdfam10h") ...
 
495
          if (__builtin_cpu_supports("popcnt") ...
 
496
        }
 
497
 
 
498
 - Function Multiversioning Support with G++:
 
499
   It is now possible to create multiple function versions each targeting a
 
500
   specific processor and/or ISA. Function versions have the same signature but
 
501
   different target attributes. For example, here is a program with function
 
502
   versions:
 
503
 
 
504
     __attribute__ ((target ("default")))
 
505
     int foo(void)
 
506
       {
 
507
         return 1;
 
508
       }
 
509
 
 
510
     __attribute__ ((target ("sse4.2")))
 
511
     int foo(void)
 
512
       {
 
513
         return 2;
 
514
       }
 
515
 
 
516
     int main (void)
 
517
     {
 
518
       int (*p) = &foo;
 
519
       assert ((*p)() == foo());
 
520
       return 0;
 
521
     }
 
522
 
 
523
   Please refer to this wiki for more information.
 
524
 
 
525
 - The x86 backend has been improved to allow option -fschedule-insns to work
 
526
   reliably. This option can be used to schedule instructions better and leads
 
527
   to improved performace in certain cases.
 
528
 
 
529
 - Windows MinGW-w64 targets (*-w64-mingw*) require at least r5437 from the
 
530
   Mingw-w64 trunk.
 
531
 
 
532
 - Support for new AMD family 15h processors (Steamroller core) is now
 
533
   available through the -march=bdver3 and -mtune=bdver3 options.
 
534
 
 
535
 - Support for new AMD family 16h processors (Jaguar core) is now available
 
536
   through the -march=btver2 and -mtune=btver2 options.
 
537
 
 
538
 
 
539
FRV
 
540
---
 
541
 
 
542
 - This target now supports the -fstack-usage command-line option.
735
543
 
736
544
 
737
545
MIPS
738
546
----
739
547
 
740
 
 - GCC now supports thread-local storage (TLS) for MIPS16. This requires GNU
741
 
   binutils 2.22 or later.
742
 
 
743
 
 - GCC can now generate code specifically for the Cavium Octeon+ and Octeon2
744
 
   processors. The associated command-line options are -march=octeon+ and
745
 
   -march=octeon2 respectively. Both options require GNU binutils 2.22 or
746
 
   later.
747
 
 
748
 
 - GCC can now work around certain 24k errata, under the control of the
749
 
   command-line option -mfix-24k. These workarounds require GNU binutils
750
 
   2.20 or later.
751
 
 
752
 
 - 32-bit MIPS GNU/Linux targets such as mips-linux-gnu can now build n32
753
 
   and n64 multilibs. The result is effectively a 64-bit GNU/Linux toolchain
754
 
   that generates 32-bit code by default. Use the configure-time option
755
 
   --enable-targets=all to select these extra multilibs.
756
 
 
757
 
 - Passing -fno-delayed-branch now also stops the assembler from
758
 
   automatically filling delay slots.
759
 
 
760
 
 
761
 
PowerPC/PowerPC64
762
 
-----------------
763
 
 
764
 
 - Vectors of type vector long long or vector long are passed and returned
765
 
   using the same method as other vectors with the VSX instruction set.
766
 
   Previously the GCC compiler did not adhere to the ABI for 128-bit vectors
767
 
   with 64-bit integer base types (PR 48857). This will also be fixed in the
768
 
   GCC 4.6.1 and 4.5.4 releases.
769
 
 
770
 
 - A new option -mno-pointers-to-nested-functions was added to allow AIX 32-
771
 
   bit/64-bit and GNU/Linux 64-bit PowerPC users to specify that the
772
 
   compiler should not load up the chain register (r11) before calling a
773
 
   function through a pointer. If you use this option, you cannot call
774
 
   nested functions through a pointer, or call other languages that might
775
 
   use the static chain.
776
 
 
777
 
 - A new option msave-toc-indirect was added to allow AIX 32-bit/64-bit and
778
 
   GNU/Linux 64-bit PowerPC users control whether we save the TOC in the
779
 
   prologue for indirect calls or generate the save inline. This can speed
780
 
   up some programs that call through a function pointer a lot, but it can
781
 
   slow down other functions that only call through a function pointer in
782
 
   exceptional cases.
783
 
 
784
 
 - The PowerPC port will now enable machine-specific built-in functions when
785
 
   the user switches the target machine using the #pragma GCC target or
786
 
   __attribute__ ((__target__ ("target"))) code sequences. In addition, the
787
 
   target macros are updated. However, due to the way the -save-temps switch
788
 
   is implemented, you won't see the effect of these additional macros being
789
 
   defined in preprocessor output.
 
548
 - GCC can now generate code specifically for the R4700, Broadcom XLP and MIPS
 
549
   34kn processors. The associated -march options are -march=r4700, -march=xlp
 
550
   and -march=34kn respectively.
 
551
 
 
552
 - GCC now generates better DSP code for MIPS 74k cores thanks to further
 
553
   scheduling optimizations.
 
554
 
 
555
 - The MIPS port now supports the -fstack-check option.
 
556
 
 
557
 - GCC now passes the -mmcu and -mno-mcu options to the assembler.
 
558
 
 
559
 - Previous versions of GCC would silently accept -fpic and -fPIC for
 
560
   -mno-abicalls targets like mips*-elf. This combination was not intended or
 
561
   supported, and did not generate position-independent code. GCC 4.8 now
 
562
   reports an error when this combination is used.
 
563
 
 
564
 
 
565
PowerPC / PowerPC64 / RS6000
 
566
----------------------------
 
567
 
 
568
 - SVR4 configurations (GNU/Linux, FreeBSD, NetBSD) no longer save, restore or
 
569
   update the VRSAVE register by default. The respective operating systems
 
570
   manage the VRSAVE register directly.
 
571
 
 
572
 - Large TOC support has been added for AIX through the command line option
 
573
   -mcmodel=large.
 
574
 
 
575
 - Native Thread-Local Storage support has been added for AIX.
 
576
 
 
577
 - VMX (Altivec) and VSX instruction sets now are enabled implicitly when
 
578
   targetting processors that support those hardware features on AIX 6.1 and
 
579
   above.
 
580
 
 
581
 
 
582
RX
 
583
--
 
584
 
 
585
 - This target will now issue a warning message whenever multiple fast
 
586
   interrupt handlers are found in the same cpmpilation unit. This feature can
 
587
   be turned off by the new -mno-warn-multiple-fast-interrupts command-line
 
588
   option.
 
589
 
 
590
 
 
591
S/390, System z
 
592
---------------
 
593
 
 
594
 - Support for the IBM zEnterprise zEC12 processor has been added. When using
 
595
   the -march=zEC12 option, the compiler will generate code making use of the
 
596
   following new instructions:
 
597
 
 
598
   - load and trap instructions
 
599
   - 2 new compare and trap instructions
 
600
   - rotate and insert selected bits - without CC clobber
 
601
 
 
602
   The -mtune=zEC12 option enables zEC12 specific instruction scheduling
 
603
   without making use of new instructions.
 
604
 
 
605
 - Register pressure sensitive instruction scheduling is enabled by default.
 
606
 
 
607
 - The ifunc function attribute is enabled by default.
 
608
 
 
609
 - memcpy and memcmp invokations on big memory chunks or with run time lengths
 
610
   are not generated inline anymore when tuning for z10 or higher. The purpose
 
611
   is to make use of the IFUNC optimized versions in Glibc.
790
612
 
791
613
 
792
614
SH
793
615
--
794
616
 
795
 
 - A new option -msoft-atomic has been added. When it is specified, GCC will
796
 
   generate GNU/Linux-compatible gUSA atomic sequences for the new __atomic
797
 
   routines.
798
 
 
799
 
 - Since it is neither supported by GAS nor officially documented, code
800
 
   generation for little endian SH2A has been disabled. Specifying -ml with
801
 
   -m2a* will now result in a compiler error.
802
 
 
803
 
 - The defunct -mbranch-cost option has been fixed.
804
 
 
805
 
 - Some improvements to the generated code of:
806
 
 
807
 
   - Utilization of the tst #imm,R0 instruction.
808
 
 
809
 
   - Dynamic shift instructions on SH2A.
810
 
 
811
 
   - Integer absolute value calculations.
 
617
 - The default alignment settings have been reduced to be less aggressive. This
 
618
   results in more compact code for optimization levels other than -Os.
 
619
 
 
620
 - Improved support for the __atomic built-in functions:
 
621
 
 
622
   - A new option -matomic-model=model selects the model for the generated
 
623
     atomic sequences. The following models are supported:
 
624
 
 
625
     soft-gusa
 
626
         Software gUSA sequences (SH3* and SH4* only). On SH4A targets this
 
627
         will now also partially utilize the movco.l and movli.l
 
628
         instructions. This is the default when the target is sh3*-*-linux*
 
629
         or sh4*-*-linux*.
 
630
     hard-llcs
 
631
         Hardware movco.l / movli.l sequences (SH4A only).
 
632
     soft-tcb
 
633
         Software thread control block sequences.
 
634
     soft-imask
 
635
         Software interrupt flipping sequences (privileged mode only). This
 
636
         is the default when the target is sh1*-*-linux* or sh2*-*-linux*.
 
637
     none
 
638
         Generates function calls to the respective __atomic built-in
 
639
         functions. This is the default for SH64 targets or when the target
 
640
         is not sh*-*-linux*.
 
641
 
 
642
   - The option -msoft-atomic has been deprecated. It is now an alias for
 
643
     -matomic-model=soft-gusa.
 
644
 
 
645
   - A new option -mtas makes the compiler generate the tas.b instruction for
 
646
     the __atomic_test_and_set built-in function regardless of the selected
 
647
     atomic model.
 
648
 
 
649
   - The __sync functions in libgcc now reflect the selected atomic model when
 
650
     building the toolchain.
 
651
 
 
652
 - Added support for the mov.b and mov.w instructions with displacement
 
653
   addressing.
 
654
 
 
655
 - Added support for the SH2A instructions movu.b and movu.w.
 
656
 
 
657
 - Various improvements to code generated for integer arithmetic.
 
658
 
 
659
 - Improvements to conditional branches and code that involves the T bit. A new
 
660
   option -mzdcbranch tells the compiler to favor zero-displacement branches.
 
661
   This is enabled by default for SH4* targets.
 
662
 
 
663
 - The pref instruction will now be emitted by the __builtin_prefetch built-in
 
664
   function for SH3* targets.
 
665
 
 
666
 - The fmac instruction will now be emitted by the fmaf standard function and
 
667
   the __builtin_fmaf built-in function.
 
668
 
 
669
 - The -mfused-madd option has been deprecated in favor of the machine-
 
670
   independent -ffp-contract option. Notice that the fmac instruction will now
 
671
   be generated by default for expressions like a * b + c. This is due to the
 
672
   compiler default setting -ffp-contract=fast.
 
673
 
 
674
 - Added new options -mfsrra and -mfsca to allow the compiler using the fsrra
 
675
   and fsca instructions on targets other than SH4A (where they are already
 
676
   enabled by default).
 
677
 
 
678
 - Added support for the __builtin_bswap32 built-in function. It is now
 
679
   expanded as a sequence of swap.b and swap.w instructions instead of a
 
680
   library function call.
 
681
 
 
682
 - The behavior of the -mieee option has been fixed and the negative form
 
683
   -mno-ieee has been added to control the IEEE conformance of floating point
 
684
   comparisons. By default -mieee is now enabled and the option -ffinite-math-
 
685
   only implicitly sets -mno-ieee.
 
686
 
 
687
 - Added support for the built-in functions __builtin_thread_pointer and
 
688
   __builtin_set_thread_pointer. This assumes that GBR is used to hold the
 
689
   thread pointer of the current thread. Memory loads and stores relative to
 
690
   the address returned by __builtin_thread_pointer will now also utilize GBR
 
691
   based displacement address modes.
812
692
 
813
693
 
814
694
SPARC
815
695
-----
816
696
 
817
 
 - The option -mflat has been reinstated. When it is specified, the compiler
818
 
   will generate code for a single register window model. This is
819
 
   essentially a new implementation and the corresponding debugger support
820
 
   has been added to GDB 7.4.
821
 
 
822
 
 - Support for the options -mtune=native and -mcpu=native has been added on
823
 
   selected native platforms (GNU/Linux and Solaris).
824
 
 
825
 
 - Support for the SPARC T3 (Niagara 3) processor has been added.
826
 
 
827
 
 - VIS:
828
 
 
829
 
   - An intrinsics header visintrin.h has been added.
830
 
   - Builtin intrinsics for the VIS 1.0 edge handling and pixel compare
831
 
     instructions have been added.
832
 
   - The little-endian version of alignaddr is now supported.
833
 
   - When possible, VIS builtins are marked const, which should increase
834
 
     the compiler's ability to optimize VIS operations.
835
 
   - The compiler now properly tracks the %gsr register and how it
836
 
     behaves as an input for various VIS instructions.
837
 
   - Akin to fzero, the compiler can now generate fone instructions in
838
 
     order to set all of the bits of a floating-point register to 1.
839
 
   - The documentation for the VIS intrinsics in the GCC manual has been
840
 
     brought up to date and many inaccuracies were fixed.
841
 
   - Intrinsics for the VIS 2.0 bmask, bshuffle, and non-condition-code
842
 
     setting edge instructions have been added. Their availability is
843
 
     controlled by the new -mvis2 and -mno-vis2 options. They are
844
 
     enabled by default on UltraSPARC-III and later CPUs.
845
 
 
846
 
 - Support for UltraSPARC Fused Multiply-Add floating-point extensions has
847
 
   been added. These instructions are enabled by default on SPARC T3
848
 
  (Niagara 3) and later CPUs.
849
 
 
850
 
 
851
 
TILE-Gx/TILEPro
852
 
---------------
853
 
 
854
 
 - Support has been added for the Tilera TILE-Gx and TILEPro families of
855
 
   processors.
856
 
 
857
 
 
858
 
Other significant improvements
859
 
==============================
860
 
 
861
 
 - A new option (-grecord-gcc-switches) was added that appends compiler
862
 
   command-line options that might affect code generation to the
863
 
   DW_AT_producer attribute string in the DWARF debugging information.
864
 
 
865
 
 - GCC now supports various new GNU extensions to the DWARF debugging
866
 
   information format, like entry_value and call_site information, typed
867
 
   DWARF_stack or a_more_compact_macro_representation. Support for these
868
 
   extensions has been added to GDB 7.4. They can be disabled through the
869
 
   -gstrict-dwarf command-line option.
870
 
 
871
 
 
872
 
GCC 4.7.1
873
 
=========
874
 
 
875
 
This is the list of problem reports (PRs) from GCC's bug tracking
876
 
system that are known to be fixed in the 4.7.1 release. This list
877
 
might not be complete (that is, it is possible that some PRs that have
878
 
been fixed are not listed here).
879
 
 
880
 
http://gcc.gnu.org/bugzilla/buglist.cgi?bug_status=RESOLVED&amp;resolution=FIXED&amp;target_milestone=4.7.1
881
 
 
882
 
The Go frontend in the 4.7.1 release fully supports the Go 1 language
883
 
standard (http://weekly.golang.org/doc/go1.html).
884
 
 
885
 
 
886
 
GCC 4.7.2
887
 
=========
888
 
 
889
 
This is the list of problem reports (PRs) from GCC's bug tracking
890
 
system that are known to be fixed in the 4.7.2 release. This list
891
 
might not be complete (that is, it is possible that some PRs that have
892
 
been fixed are not listed here).
893
 
 
894
 
http://gcc.gnu.org/bugzilla/buglist.cgi?bug_status=RESOLVED&amp;resolution=FIXED&amp;target_milestone=4.7.2
 
697
 - Added optimized instruction scheduling for Niagara4.
 
698
 
 
699
 
 
700
TILE-Gx
 
701
-------
 
702
 
 
703
 - Added support for the -mcmodel=MODEL command-line option. The models
 
704
   supported are small and large.
 
705
 
 
706
 
 
707
V850
 
708
----
 
709
 
 
710
 - This target now supports the E3V5 architecture via the use of the new
 
711
   -mv850e3v5 command-line option. It also has experimental support for the e3v5
 
712
   LOOP instruction which can be enabled via the new -mloop command-line
 
713
   option.
 
714
 
 
715
 
 
716
XStormy16
 
717
---------
 
718
 
 
719
 - This target now supports the -fstack-usage command-line option.
 
720
 
 
721
 
 
722
Operating Systems
 
723
=================
 
724
 
 
725
 
 
726
Windows (Cygwin)
 
727
----------------
 
728
 
 
729
 - Executables are now linked against shared libgcc by default. The previous
 
730
   default was to link statically, which can still be done by explicitly
 
731
   specifying -static or -static-libgcc on the command line. However it is
 
732
   strongly advised against, as it will cause problems for any application that
 
733
   makes use of DLLs compiled by GCC. It should be alright for a monolithic
 
734
   stand-alone application that only links against the Windows OS DLLs, but
 
735
   offers little or no benefit.
895
736
 
896
737
 
897
738
For questions related to the use of GCC, please consult these web
905
746
Verbatim copying and distribution of this entire article is
906
747
permitted in any medium, provided this notice is preserved.
907
748
 
908
 
These pages are maintained_by_the_GCC_team.
 
749
These pages are maintained by the GCC team.
909
750
 
910
 
Last modified 2012-03-26.
 
751
Last modified 2013-03-23.