This file contains information about GCC releases which has been generated
automatically from the online release notes.  It covers releases of GCC
(and the former EGCS project) since EGCS 1.0, on the line of development
that led to GCC 3. For information on GCC 2.8.1 and older releases of GCC 2,
see ONEWS.

======================================================================
http://gcc.gnu.org/gcc-8/index.html
                              GCC 8 Release Series

   Feb 22, 2019

   The [1]GNU project and the GCC developers are pleased to announce the
   release of GCC 8.3.

   This release is a bug-fix release, containing fixes for regressions in
   GCC 8.2 relative to previous releases of GCC.

Release History

   GCC 8.3
          Feb 22, 2019 ([2]changes, [3]documentation)

   GCC 8.2
          Jul 14, 2018 ([4]changes, [5]documentation)

   GCC 8.1
          May 2, 2018 ([6]changes, [7]documentation)

References and Acknowledgements

   GCC used to stand for the GNU C Compiler, but since the compiler
   supports several other languages aside from C, it now stands for the
   GNU Compiler Collection.

   A list of [8]successful builds is updated as new information becomes
   available.

   The GCC developers would like to thank the numerous people that have
   contributed new features, improvements, bug fixes, and other changes as
   well as test results to GCC. This [9]amazing group of volunteers is
   what makes GCC successful.

   For additional information about GCC please refer to the [10]GCC
   project web site or contact the [11]GCC development mailing list.

   To obtain GCC please use [12]our mirror sites or [13]our SVN server.


    For questions related to the use of GCC, please consult these web
    pages and the [14]GCC manuals. If that fails, the
    [15]gcc-help@gcc.gnu.org mailing list might help. Comments on these
    web pages and the development of GCC are welcome on our developer
    list at [16]gcc@gcc.gnu.org. All of [17]our lists have public
    archives.

   Copyright (C) [18]Free Software Foundation, Inc. Verbatim copying and
   distribution of this entire article is permitted in any medium,
   provided this notice is preserved.

   These pages are [19]maintained by the GCC team. Last modified
   2019-02-22[20].

References

   1. http://www.gnu.org/
   2. http://gcc.gnu.org/gcc-8/changes.html
   3. http://gcc.gnu.org/onlinedocs/8.3.0/
   4. http://gcc.gnu.org/gcc-8/changes.html
   5. http://gcc.gnu.org/onlinedocs/8.2.0/
   6. http://gcc.gnu.org/gcc-8/changes.html
   7. http://gcc.gnu.org/onlinedocs/8.1.0/
   8. http://gcc.gnu.org/gcc-8/buildstat.html
   9. http://gcc.gnu.org/onlinedocs/gcc-8.1.0/gcc/Contributors.html
  10. http://gcc.gnu.org/index.html
  11. mailto:gcc@gcc.gnu.org
  12. http://gcc.gnu.org/mirrors.html
  13. http://gcc.gnu.org/svn.html
  14. https://gcc.gnu.org/onlinedocs/
  15. mailto:gcc-help@gcc.gnu.org
  16. mailto:gcc@gcc.gnu.org
  17. https://gcc.gnu.org/lists.html
  18. https://www.fsf.org/
  19. https://gcc.gnu.org/about.html
  20. http://validator.w3.org/check/referer
======================================================================
http://gcc.gnu.org/gcc-8/changes.html
                              GCC 8 Release Series
                        Changes, New Features, and Fixes

   This page is a "brief" summary of some of the huge number of
   improvements in GCC 8. You may also want to check out our [1]Porting to
   GCC 8 page and the [2]full GCC documentation.

Caveats

     * Support for the obsolete SDB/coff debug info format has been
       removed. The option -gcoff no longer does anything.
     * The Cilk+ extensions to the C and C++ languages have been removed.
     * The MPX extensions to the C and C++ languages have been deprecated
       and will be removed in a future release.
     * The extension allowing arithmetic on std::atomic<void*> and types
       like std::atomic<R(*)()> has been deprecated.
     * The non-standard C++0x std::copy_exception function was removed.
       std::make_exception_ptr should be used instead.
     * Support for the powerpc*-*-*spe* target ports which have been
       recently unmaintained and untested in GCC has been declared
       obsolete in GCC 8 as announced [3]here. Unless there is activity to
       revive them, the next release of GCC will have their sources
       permanently removed.

General Improvements

     * Inter-procedural optimization improvements:
          + Reworked run-time estimation metrics leading to more realistic
            guesses driving inliner and cloning heuristics.
          + The ipa-pure-const pass is extended to propagate the malloc
            attribute, and the corresponding warning option
            -Wsuggest-attribute=malloc emits a diagnostic for functions
            which can be annotated with the malloc attribute.
     * Profile driven optimization improvements:
          + New infrastructure for representing profiles (both statically
            guessed and profile feedback) which allows propagation of
            additional information about the reliability of the profile.
          + A number of improvements in the profile updating code solving
            problems found by new verification code.
          + Static detection of code which is not executed in a valid run
            of the program. This includes paths which trigger undefined
            behavior as well as calls to functions declared with the cold
            attribute. Newly the noreturn attribute does not imply all
            effects of cold to differentiate between exit (which is
            noreturn) and abort (which is in addition not executed in
            valid runs).
          + -freorder-blocks-and-partition, a pass splitting function
            bodies into hot and cold regions, is now enabled by default at
            -O2 and higher for x86 and x86-64.
     * Link-time optimization improvements:
          + We have significantly improved debug information on ELF
            targets using DWARF by properly preserving language-specific
            information. This allows for example the libstdc++
            pretty-printers to work with LTO optimized executables.
     * A new option -fcf-protection=[full|branch|return|none] is
       introduced to perform code instrumentation to increase program
       security by checking that target addresses of control-flow transfer
       instructions (such as indirect function call, function return,
       indirect jump) are valid. Currently the instrumentation is
       supported on x86 GNU/Linux targets only. See the user guide for
       further information about the option syntax and section "New
       Targets and Target Specific Improvements" for IA-32/x86-64 for more
       details.
     * The -gcolumn-info option is now enabled by default. It includes
       column information in addition to just filenames and line numbers
       in DWARF debugging information.
     * The polyhedral-based loop nest optimization pass
       -floop-nest-optimize has been overhauled. It's still considered
       experimental and may not result in any runtime improvements.
     * Two new classical loop nest optimization passes have been added.
       -floop-unroll-and-jam performs outer loop unrolling and fusing of
       the inner loop copies. -floop-interchange exchanges loops in a loop
       nest to improve data locality. Both passes are enabled by default
       at -O3 and above.
     * The classic loop nest optimization pass -ftree-loop-distribution
       has been improved and enabled by default at -O3 and above. It
       supports loop nest distribution in some restricted scenarios; it
       also supports cancellable innermost loop distribution with loop
       versioning under run-time alias checks.
     * The new option -fstack-clash-protection causes the compiler to
       insert probes whenever stack space is allocated statically or
       dynamically to reliably detect stack overflows and thus mitigate
       the attack vector that relies on jumping over a stack guard page as
       provided by the operating system.
     * A new pragma GCC unroll has been implemented in the C family of
       languages, as well as Fortran and Ada, so as to make it possible
       for the user to have a finer-grained control over the loop
       unrolling optimization.
     * GCC has been enhanced to detect more instances of meaningless or
       mutually exclusive attribute specifications and handle such
       conflicts more consistently. Mutually exclusive attribute
       specifications are ignored with a warning regardless of whether
       they appear on the same declaration or on distinct declarations of
       the same entity. For example, because the noreturn attribute on the
       second declaration below is mutually exclusive with the malloc
       attribute on the first, it is ignored and a warning is issued.
>
      void* __attribute__ ((malloc)) f (unsigned);
      void* __attribute__ ((noreturn)) f (unsigned);

      warning: ignoring attribute 'noreturn' because it conflicts with attribute
 'malloc' [-Wattributes]
     * The gcov tool can distinguish functions that begin on a same line
       in a source file. This can be a different template instantiation or
       a class constructor:

File 'ins.C'
Lines executed:100.00% of 8
Creating 'ins.C.gcov'

        -:    0:Source:ins.C
        -:    0:Graph:ins.gcno
        -:    0:Data:ins.gcda
        -:    0:Runs:1
        -:    0:Programs:1
        -:    1:template<class T>
        -:    2:class Foo
        -:    3:{
        -:    4: public:
        2:    5:   Foo(): b (1000) {}
------------------
Foo<char>::Foo():
        1:    5:   Foo(): b (1000) {}
------------------
Foo<int>::Foo():
        1:    5:   Foo(): b (1000) {}
------------------
        2:    6:   void inc () { b++; }
------------------
Foo<char>::inc():
        1:    6:   void inc () { b++; }
------------------
Foo<int>::inc():
        1:    6:   void inc () { b++; }
------------------
        -:    7:
        -:    8:  private:
        -:    9:   int b;
        -:   10:};
        -:   11:
        1:   12:int main(int argc, char **argv)
        -:   13:{
        1:   14:  Foo<int> a;
        1:   15:  Foo<char> b;
        -:   16:
        1:   17:  a.inc ();
        1:   18:  b.inc ();
        1:   19:}

     * The gcov tool has more accurate numbers for execution of lines in a
       source file.
     * The gcov tool can use TERM colors to provide more readable output.
     * AddressSanitizer gained a new pair of sanitization options,
       -fsanitize=pointer-compare and -fsanitize=pointer-subtract, which
       warn about subtraction (or comparison) of pointers that point to a
       different memory object:

int
main ()
{
  /* Heap allocated memory.  */
  char *heap1 = (char *)__builtin_malloc (42);
  char *heap2 = (char *)__builtin_malloc (42);
  if (heap1 > heap2)
      return 1;

  return 0;
}

==17465==ERROR: AddressSanitizer: invalid-pointer-pair: 0x604000000010 0x6040000
00050
    #0 0x40070f in main /tmp/pointer-compare.c:7
    #1 0x7ffff6a72a86 in __libc_start_main (/lib64/libc.so.6+0x21a86)
    #2 0x400629 in _start (/tmp/a.out+0x400629)

0x604000000010 is located 0 bytes inside of 42-byte region [0x604000000010,0x604
00000003a)
allocated by thread T0 here:
    #0 0x7ffff6efb390 in __interceptor_malloc ../../../../libsanitizer/asan/asan
_malloc_linux.cc:86
    #1 0x4006ea in main /tmp/pointer-compare.c:5
    #2 0x7ffff6a72a86 in __libc_start_main (/lib64/libc.so.6+0x21a86)

0x604000000050 is located 0 bytes inside of 42-byte region [0x604000000050,0x604
00000007a)
allocated by thread T0 here:
    #0 0x7ffff6efb390 in __interceptor_malloc ../../../../libsanitizer/asan/asan
_malloc_linux.cc:86
    #1 0x4006f8 in main /tmp/pointer-compare.c:6
    #2 0x7ffff6a72a86 in __libc_start_main (/lib64/libc.so.6+0x21a86)

SUMMARY: AddressSanitizer: invalid-pointer-pair /tmp/pointer-compare.c:7 in main

     * The store merging pass has been enhanced to handle bit-fields and
       not just constant stores, but also data copying from adjacent
       memory locations into other adjacent memory locations, including
       bitwise logical operations on the data. The pass can also handle
       byte swapping into memory locations.
     * The undefined behavior sanitizer gained two new options included in
       -fsanitize=undefined: -fsanitize=builtin which diagnoses at run
       time invalid arguments to __builtin_clz or __builtin_ctz prefixed
       builtins, and -fsanitize=pointer-overflow which performs cheap run
       time tests for pointer wrapping.
     * A new attribute no_sanitize can be applied to functions to instruct
       the compiler not to do sanitization of the options provided as
       arguments to the attribute. Acceptable values for no_sanitize match
       those acceptable by the -fsanitize command-line option.

void __attribute__ ((no_sanitize ("alignment", "object-size")))
f () { /* Do something. */; }

New Languages and Language specific improvements

  Ada

     * For its internal exception handling used on the host for error
       recovery in the front-end, the compiler now relies on the native
       exception handling mechanism of the host platform, which should be
       more efficient than the former mechanism.

  BRIG (HSAIL)

   In this release cycle, the focus for the BRIGFE was on stabilization
   and performance improvements. Also a couple of completely new features
   were added.
     * Improved support for function and module scope group segment
       variables. PRM specs define function and module scope group segment
       variables as an experimental feature. However, PRM test suite uses
       them. Now group segment is handled by separate book keeping of
       module scope and function (kernel) offsets. Each function has a
       "frame" in the group segment offset to which is given as an
       argument, similar to traditional call stack frame handling.
     * Reduce the number of type conversions due to the untyped HSAIL
       registers. Instead of always representing the HSAIL's untyped
       registers as unsigned int, the gccbrig now pre-analyzes the BRIG
       code and builds the register variables as a type used the most when
       storing or reading data to/from each register. This reduces the
       number of total casts which cannot be always optimized away.
     * Support for BRIG_KIND_NONE directives.
     * Made -O3 the default optimization level for BRIGFE.
     * Fixed illegal addresses generated from address expressions which
       refer only to offset 0.
     * Fixed a bug with reg+offset addressing on 32b segments. In 'large'
       mode, the offset is treated as 32bits unless it's in global,
       read-only or kernarg address space.
     * Fixed a crash caused sometimes by calls with more than 4 arguments.
     * Fixed a mis-execution issue with kernels that have both unexpanded
       ID functions and calls to subfunctions.
     * Treat HSAIL barrier builtins as setjmp/longjump style functions to
       avoid illegal optimizations.
     * Ensure per WI copies of private variables are aligned correctly.
     * libhsail-rt: Assume the host runtime allocates the work group
       memory.

  C family

     * New command-line options have been added for the C and C++
       compilers:
          + [4]-Wmultistatement-macros warns about unsafe macros expanding
            to multiple statements used as a body of a statement such as
            if, else, while, switch, or for.
          + [5]-Wstringop-truncation warns for calls to bounded string
            manipulation functions such as strncat, strncpy, and stpncpy
            that might either truncate the copied string or leave the
            destination unchanged. For example, the following call to
            strncat is diagnosed because it appends just three of the four
            characters from the source string.
void append (char *buf, size_t bufsize)
{
    strncat (buf, ".txt", 3);
}
warning: 'strncat' output truncated copying 3 bytes from a string of length 4 [-
Wstringop-truncation]
            Similarly, in the following example, the call to strncpy
            specifies the size of the destination buffer as the bound. If
            the length of the source string is equal to or greater than
            this size the result of the copy will not be NUL-terminated.
            Therefore, the call is also diagnosed. To avoid the warning,
            specify sizeof buf - 1 as the bound and set the last element
            of the buffer to NUL.
void copy (const char *s)
{
    char buf[80];
    strncpy (buf, s, sizeof buf);
    …
}
warning: 'strncpy' specified bound 80 equals destination size [-Wstringop-trunca
tion]
            The -Wstringop-truncation option is included in -Wall.
            Note that due to GCC bug [6]82944, defining strncat, strncpy,
            or stpncpy as a macro in a system header as some
            implementations do, suppresses the warning.
          + [7]-Wif-not-aligned controls warnings issued in response to
            invalid uses of objects declared with attribute
            [8]warn_if_not_aligned.
            The -Wif-not-aligned option is included in -Wall.
          + [9]-Wmissing-attributes warns when a declaration of a function
            is missing one or more attributes that a related function is
            declared with and whose absence may adversely affect the
            correctness or efficiency of generated code. For example, in
            C++, the warning is issued when an explicit specialization of
            a primary template declared with attribute alloc_align,
            alloc_size, assume_aligned, format, format_arg, malloc, or
            nonnull is declared without it. Attributes deprecated, error,
            and warning suppress the warning.
            The -Wmissing-attributes option is included in -Wall.
          + [10]-Wpacked-not-aligned warns when a struct or union declared
            with attribute packed defines a member with an explicitly
            specified alignment greater than 1. Such a member will wind up
            under-aligned. For example, a warning will be issued for the
            definition of struct A in the following:
struct __attribute__ ((aligned (8)))
S8 { char a[8]; };

struct __attribute__ ((packed)) A
{
    struct S8 s8;
};
warning: alignment 1 of 'struct S' is less than 8 [-Wpacked-not-aligned]
            The -Wpacked-not-aligned option is included in -Wall.
          + -Wcast-function-type warns when a function pointer is cast to
            an incompatible function pointer. This warning is enabled by
            -Wextra.
          + -Wsizeof-pointer-div warns for suspicious divisions of the
            size of a pointer by the size of the elements it points to,
            which looks like the usual way to compute the array size but
            won't work out correctly with pointers. This warning is
            enabled by -Wall.
          + -Wcast-align=strict warns whenever a pointer is cast such that
            the required alignment of the target is increased. For
            example, warn if a char * is cast to an int * regardless of
            the target machine.
          + -fprofile-abs-path creates absolute path names in the .gcno
            files. This allows gcov to find the correct sources in
            projects where compilations occur with different working
            directories.
     * -fno-strict-overflow is now mapped to -fwrapv -fwrapv-pointer and
       signed integer overflow is now undefined by default at all
       optimization levels. Using -fsanitize=signed-integer-overflow is
       now the preferred way to audit code, -Wstrict-overflow is
       deprecated.
     * The [11]-Warray-bounds option has been improved to detect more
       instances of out-of-bounds array indices and pointer offsets. For
       example, negative or excessive indices into flexible array members
       and string literals are detected.
     * The [12]-Wrestrict option introduced in GCC 7 has been enhanced to
       detect many more instances of overlapping accesses to objects via
       restrict-qualified arguments to standard memory and string
       manipulation functions such as memcpy and strcpy. For example, the
       strcpy call in the function below attempts to truncate the string
       by replacing its initial characters with the last four. However,
       because the function writes the terminating NUL into a[4], the
       copies overlap and the call is diagnosed.
void f (void)
{
    char a[] = "abcd1234";
    strcpy (a, a + 4);
    …
}
warning: 'strcpy' accessing 5 bytes at offsets 0 and 4 overlaps 1 byte at offset
 4 [-Wrestrict]
       The -Wrestrict option is included in -Wall.
     * Several optimizer enhancements have enabled improvements to the
       [13]-Wformat-overflow and [14]-Wformat-truncation options. The
       warnings detect more instances of buffer overflow and truncation
       than in GCC 7 and are better at avoiding certain kinds of false
       positives.
     * When reporting mismatching argument types at a function call, the C
       and C++ compilers now underline both the argument and the pertinent
       parameter in the declaration.
$ gcc arg-type-mismatch.cc
arg-type-mismatch.cc: In function 'int caller(int, int, float)':
arg-type-mismatch.cc:5:24: error: invalid conversion from 'int' to 'const char*'
 [-fpermissive]
   return callee(first, second, third);
                        ^~~~~~
arg-type-mismatch.cc:1:40: note:   initializing argument 2 of 'int callee(int, c
onst char*, float)'
 extern int callee(int one, const char *two, float three);
                            ~~~~~~~~~~~~^~~

     * When reporting on unrecognized identifiers, the C and C++ compilers
       will now emit fix-it hints suggesting #include directives for
       various headers in the C and C++ standard libraries.
$ gcc incomplete.c
incomplete.c: In function 'test':
incomplete.c:3:10: error: 'NULL' undeclared (first use in this function)
   return NULL;
          ^~~~
incomplete.c:3:10: note: 'NULL' is defined in header '<stddef.h>'; did you forge
t to '#include <stddef.h>'?
incomplete.c:1:1:
+#include <stddef.h>
 const char *test(void)
incomplete.c:3:10:
   return NULL;
          ^~~~
incomplete.c:3:10: note: each undeclared identifier is reported only once for ea
ch function it appears in

$ gcc incomplete.cc
incomplete.cc:1:6: error: 'string' in namespace 'std' does not name a type
 std::string s("hello world");
      ^~~~~~
incomplete.cc:1:1: note: 'std::string' is defined in header '<string>'; did you
forget to '#include <string>'?
+#include <string>
 std::string s("hello world");
 ^~~

     * The C and C++ compilers now use more intuitive locations when
       reporting on missing semicolons, and offer fix-it hints:
$ gcc t.c
t.c: In function 'test':
t.c:3:12: error: expected ';' before '}' token
   return 42
            ^
            ;
 }
 ~

     * When reporting on missing '}' and ')' tokens, the C and C++
       compilers will now highlight the corresponding '{' and '(' token,
       issuing a 'note' if it's on a separate line:
$ gcc unclosed.c
unclosed.c: In function 'log_when_out_of_range':
unclosed.c:12:50: error: expected ')' before '{' token
       && (temperature < MIN || temperature > MAX) {
                                                  ^~
                                                  )
unclosed.c:11:6: note: to match this '('
   if (logging_enabled && check_range ()
      ^

       or highlighting it directly if it's on the same line:
$ gcc unclosed-2.c
unclosed-2.c: In function 'test':
unclosed-2.c:8:45: error: expected ')' before '{' token
   if (temperature < MIN || temperature > MAX {
      ~                                      ^~
                                             )

       They will also emit fix-it hints.

  C++

     * GCC 8 (-fabi-version=12) has a couple of corrections to the calling
       convention, which changes the ABI for some uncommon code:
          + Passing an empty class as an argument now takes up no space on
            x86_64, as required by the psABI.
          + Passing or returning a class with only deleted copy and move
            constructors now uses the same calling convention as a class
            with a non-trivial copy or move constructor. This only affects
            C++17 mode, as in earlier standards passing or returning such
            a class was impossible.
          + WARNING: In GCC 8.1 the second change mistakenly also affects
            classes with a deleted copy constructor and defaulted trivial
            move constructor (bug [15]c++/86094). This issue is fixed in
            GCC 8.2 (-fabi-version=13).
       You can test whether these changes affect your code with -Wabi=11
       (or -Wabi=12 in GCC 8.2 for the third issue); if these changes are
       problematic for your project, the GCC 7 ABI can be selected with
       -fabi-version=11.
     * The value of the C++11 alignof operator has been corrected to match
       C _Alignof (minimum alignment) rather than GNU __alignof__
       (preferred alignment); on ia32 targets this means that
       alignof(double) is now 4 rather than 8. Code that wants the
       preferred alignment should use __alignof__ instead.
     * New command-line options have been added for the C++ compiler to
       control warnings:
          + [16]-Wclass-memaccess warns when objects of non-trivial class
            types are manipulated in potentially unsafe ways by raw memory
            functions such as memcpy, or realloc. The warning helps detect
            calls that bypass user-defined constructors or copy-assignment
            operators, corrupt virtual table pointers, data members of
            const-qualified types or references, or member pointers. The
            warning also detects calls that would bypass access controls
            to data members. For example, a call such as:
        memcpy (&std::cout, &std::cerr, sizeof std::cout);
            results in
        warning: 'void* memcpy(void*, const void*, long unsigned int)' writing t
o an object of type 'std::ostream' {aka 'class std::basic_ostream<char>'} with n
o trivial copy-assignment [-Wclass-memaccess]
            The -Wclass-memaccess option is included in -Wall.
     * The C++ front end has experimental support for some of the upcoming
       C++2a draft features with the -std=c++2a or -std=gnu++2a flags,
       including designated initializers, default member initializers for
       bit-fields, __VA_OPT__ (except that #__VA_OPT__ is unsupported),
       lambda [=, this] captures, etc. For a full list of new features,
       see [17]the C++ status page.
     * When reporting on attempts to access private fields of a class or
       struct, the C++ compiler will now offer fix-it hints showing how to
       use an accessor function to get at the field in question, if one
       exists.
$ gcc accessor.cc
accessor.cc: In function 'void test(foo*)':
accessor.cc:12:12: error: 'double foo::m_ratio' is private within this context
   if (ptr->m_ratio >= 0.5)
            ^~~~~~~
accessor.cc:7:10: note: declared private here
   double m_ratio;
          ^~~~~~~
accessor.cc:12:12: note: field 'double foo::m_ratio' can be accessed via 'double
 foo::get_ratio() const'
   if (ptr->m_ratio >= 0.5)
            ^~~~~~~
            get_ratio()

     * The C++ compiler can now give you a hint if you use a macro before
       it was defined (e.g. if you mess up the order of your #include
       directives):
$ gcc ordering.cc
ordering.cc:2:24: error: expected ';' at end of member declaration
   virtual void clone() const OVERRIDE { }
                        ^~~~~
                             ;
ordering.cc:2:30: error: 'OVERRIDE' does not name a type
   virtual void clone() const OVERRIDE { }
                              ^~~~~~~~
ordering.cc:2:30: note: the macro 'OVERRIDE' had not yet been defined
In file included from ordering.cc:5:
c++11-compat.h:2: note: it was later defined here
 #define OVERRIDE override


     * The -Wold-style-cast diagnostic can now emit fix-it hints telling
       you when you can use a static_cast, const_cast, or
       reinterpret_cast.
$ gcc -c old-style-cast-fixits.cc -Wold-style-cast
old-style-cast-fixits.cc: In function 'void test(void*)':
old-style-cast-fixits.cc:5:19: warning: use of old-style cast to 'struct foo*' [
-Wold-style-cast]
   foo *f = (foo *)ptr;
                   ^~~
            ----------
            static_cast<foo *> (ptr)

     * When reporting on problems within extern "C" linkage
       specifications, the C++ compiler will now display the location of
       the start of the extern "C".
$ gcc -c extern-c.cc
extern-c.cc:3:1: error: template with C linkage
 template <typename T> void test (void);
 ^~~~~~~~
In file included from extern-c.cc:1:
unclosed.h:1:1: note: 'extern "C"' linkage started here
 extern "C" {
 ^~~~~~~~~~
extern-c.cc:3:39: error: expected '}' at end of input
 template <typename T> void test (void);
                                       ^
In file included from extern-c.cc:1:
unclosed.h:1:12: note: to match this '{'
 extern "C" {
            ^

     * When reporting on mismatching template types, the C++ compiler will
       now use color to highlight the mismatching parts of the template,
       and will elide the parameters that are common between two
       mismatching templates, printing [...] instead:
$ gcc templates.cc
templates.cc: In function 'void test()':
templates.cc:9:8: error: could not convert 'vector<double>()' from 'vector<doubl
e>' to 'vector<int>'
   fn_1(vector<double> ());
        ^~~~~~~~~~~~~~~~~
templates.cc:10:8: error: could not convert 'map<int, double>()' from 'map<[...]
,double>' to 'map<[...],int>'
   fn_2(map<int, double>());
        ^~~~~~~~~~~~~~~~~~

       Those [...] elided parameters can be seen using -fno-elide-type:
$ gcc templates.cc -fno-elide-type
templates.cc: In function 'void test()':
templates.cc:9:8: error: could not convert 'vector<double>()' from 'vector<doubl
e>' to 'vector<int>'
   fn_1(vector<double> ());
        ^~~~~~~~~~~~~~~~~
templates.cc:10:8: error: could not convert 'map<int, double>()' from 'map<int,d
ouble>' to 'map<int,int>'
   fn_2(map<int, double>());
        ^~~~~~~~~~~~~~~~~~

       The C++ compiler has also gained an option
       -fdiagnostics-show-template-tree which visualizes such mismatching
       templates in a hierarchical form:
$ gcc templates-2.cc -fdiagnostics-show-template-tree
templates-2.cc: In function 'void test()':
templates-2.cc:9:8: error: could not convert 'vector<double>()' from 'vector<dou
ble>' to 'vector<int>'
  vector<
    [double != int]>
   fn_1(vector<double> ());
        ^~~~~~~~~~~~~~~~~
templates-2.cc:10:8: error: could not convert 'map<map<int, vector<double> >, ve
ctor<double> >()' from 'map<map<[...],vector<double>>,vector<double>>' to 'map<m
ap<[...],vector<float>>,vector<float>>'
  map<
    map<
      [...],
      vector<
        [double != float]>>,
    vector<
      [double != float]>>
   fn_2(map<map<int, vector<double>>, vector<double>> ());
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

       which again works with -fno-elide-type:
$ gcc templates-2.cc -fdiagnostics-show-template-tree -fno-elide-type
templates-2.cc: In function 'void test()':
templates-2.cc:9:8: error: could not convert 'vector<double>()' from 'vector<dou
ble>' to 'vector<int>'
  vector<
    [double != int]>
   fn_1(vector<double> ());
        ^~~~~~~~~~~~~~~~~
templates-2.cc:10:8: error: could not convert 'map<map<int, vector<double> >, ve
ctor<double> >()' from 'map<map<int,vector<double>>,vector<double>>' to 'map<map
<int,vector<float>>,vector<float>>'
  map<
    map<
      int,
      vector<
        [double != float]>>,
    vector<
      [double != float]>>
   fn_2(map<map<int, vector<double>>, vector<double>> ());
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

     * Flowing off the end of a non-void function is considered
       unreachable and may be subject to optimization on that basis. As a
       result of this change, -Wreturn-type warnings are enabled by
       default for C++.

    Runtime Library (libstdc++)

     * Improved experimental support for C++17, including the following
       features:
          + Deduction guides to support class template argument deduction.
          + std::filesystem implementation.
          + std::char_traits<char> and std::char_traits<wchar_t> are
            usable in constant expressions.
          + std::to_chars and std::from_chars (for integers only, not for
            floating point types).
     * Experimental support for C++2a: std::to_address (thanks to Glen
       Fernandes) and std::endian.
     * On GNU/Linux, std::random_device::entropy() accesses the kernel's
       entropy count for the random device, if known (thanks to Xi
       Ruoyao).
     * Support for std::experimental::source_location.
     * AddressSanitizer integration for std::vector, detecting
       out-of-range accesses to the unused capacity of a vector.
     * Extensions __gnu_cxx::airy_ai and __gnu_cxx::airy_bi added to the
       Mathematical Special Functions.

  Fortran

     * The main version of libfortran has been changed to 5.
     * Parameterized derived types, a major feature of Fortran 2003, have
       been implemented.
     * The maximum rank for arrays has been increased to 15, conforming to
       the Fortran 2008 standard.
     * Transformational intrinsics are now fully supported in
       initialization expressions.
     * New flag -fc-prototypes to write C prototypes for BIND(C)
       procedures and variables.
     * If -fmax-stack-var-size is honored if given together with -Ofast,
       -fstack-arrays is no longer set in that case.
     * New options -fdefault-real-16 and -fdefault-real-10 to control the
       default kind of REAL variables.
     * A warning is now issued if an array subscript inside a DO loop
       could lead to an out-of-bounds-access. The new option
       -Wdo-subscript, enabled by -Wextra, warns about this even if the
       compiler can not prove that the code will be executed.
     * The Fortran front end now attempts to interchange loops if it is
       deemed profitable. So far, this is restricted to FORALL and DO
       CONCURRENT statements with multiple indices. This behavior be
       controlled with the new flag -ffrontend-loop-interchange, which is
       enabled with optimization by default. The
       -Wfrontend-loop-interchange option warns about such occurrences.
     * When an actual argument contains too few elements for a dummy
       argument, an error is now issued. The -std=legacy option can be
       used to still compile such code.
     * The RECL= argument to OPEN and INQUIRE statements now allows 64-bit
       integers, making records larger than 2GiB possible.
     * The GFORTRAN_DEFAULT_RECL environment variable no longer has any
       effect. The record length for preconnected units is now larger than
       any practical limit, same as for sequential access units opened
       without an explicit RECL= specifier.
     * Character variables longer than HUGE(0) elements are now possible
       on 64-bit targets. Note that this changes the procedure call ABI
       for all procedures with character arguments on 64-bit targets, as
       the type of the hidden character length argument has changed. The
       hidden character length argument is now of type INTEGER(C_SIZE_T).
     * Partial support is provided for Fortran 2018 teams, which are
       hierarchical subsets of images that execute independently of other
       image subsets.

  Go

     * GCC 8 provides a complete implementation of the Go 1.10.1 user
       packages.
     * The garbage collector is now fully concurrent. As before, values
       stored on the stack are scanned conservatively, but value stored in
       the heap are scanned precisely.
     * Escape analysis is fully implemented and enabled by default in the
       Go frontend. This significantly reduces the number of heap
       allocations by allocating values on the stack instead.

libgccjit

   The libgccjit API gained four new entry points:
     * [18]gcc_jit_type_get_vector and
     * [19]gcc_jit_context_new_rvalue_from_vector for working with
       vectors,
     * [20]gcc_jit_type_get_aligned
     * [21]gcc_jit_function_get_address

   The C code generated by [22]gcc_jit_context_dump_reproducer_to_file is
   now easier-to-read.

New Targets and Target Specific Improvements

  AArch64

     * The Armv8.4-A architecture is now supported. It can be used by
       specifying the -march=armv8.4-a option.
     * The Dot Product instructions are now supported as an optional
       extension to the Armv8.2-A architecture and newer and are mandatory
       on Armv8.4-A. The extension can be used by specifying the +dotprod
       architecture extension. E.g. -march=armv8.2-a+dotprod.
     * The Armv8-A +crypto extension has now been split into two
       extensions for finer grained control:
          + +aes which contains the Armv8-A AES crytographic instructions.
          + +sha2 which contains the Armv8-A SHA2 and SHA1 cryptographic
            instructions.
       Using +crypto will now enable these two extensions.
     * New Armv8.4-A FP16 Floating Point Multiplication Variant
       instructions have been added. These instructions are mandatory in
       Armv8.4-A but available as an optional extension to Armv8.2-A and
       Armv8.3-A. The new extension can be used by specifying the +fp16fml
       architectural extension on Armv8.2-A and Armv8.3-A. On Armv8.4-A
       the instructions can be enabled by specifying +fp16.
     * New cryptographic instructions have been added as optional
       extensions to Armv8.2-A and newer. These instructions can be
       enabled with:
          + +sha3 New SHA3 and SHA2 instructions from Armv8.4-A. This
            implies +sha2.
          + +sm4 New SM3 and SM4 instructions from Armv8.4-A.
     * The Scalable Vector Extension (SVE) is now supported as an optional
       extension to the Armv8.2-A architecture and newer. This support
       includes automatic vectorization with SVE instructions, but it does
       not yet include the SVE Arm C Language Extensions (ACLE). It can be
       enabled by specifying the +sve architecture extension (for example,
       -march=armv8.2-a+sve). By default, the generated code works with
       all vector lengths, but it can be made specific to N-bit vectors
       using -msve-vector-bits=N.
     * Support has been added for the following processors (GCC
       identifiers in parentheses):
          + Arm Cortex-A75 (cortex-a75).
          + Arm Cortex-A55 (cortex-a55).
          + Arm Cortex-A55/Cortex-A75 DynamIQ big.LITTLE
            (cortex-a75.cortex-a55).
       The GCC identifiers can be used as arguments to the -mcpu or -mtune
       options, for example: -mcpu=cortex-a75 or -mtune=cortex-a75 or as
       arguments to the equivalent target attributes and pragmas.

  ARC

     * Added support for:
          + Fast interrupts.
          + Naked functions.
          + aux variable attributes.
          + uncached type qualifier.
          + Secure functions via sjli instruction.
     * New exception handling implementation.
     * Revamped trampoline implementation.
     * Refactored small data feature implementation, controlled via -G
       command line option.
     * New support for reduced register set ARC architecture
       configurations, controlled via -mrf16 command line option.
     * Refurbished and improved support for zero overhead loops.
       Introduced -mlpc-width command line option to control the width of
       lp_count register.

  ARM

     * The -mfpu option now takes a new option setting of -mfpu=auto. When
       set to this the floating-point and SIMD settings are derived from
       the settings of the -mcpu or -march options. The internal CPU
       configurations have been updated with information about the
       permitted floating-point configurations supported. See the user
       guide for further information about the extended option syntax for
       controlling architectural extensions via the -march option.
       -mfpu=auto is now the default setting unless the compiler has been
       configured with an explicit --with-fpu option.
     * The -march and -mcpu options now accept optional extensions to the
       architecture or CPU option, allowing the user to enable or disable
       any such extensions supported by that architecture or CPU such as
       (but not limited to) floating-point and AdvancedSIMD. For example:
       the option -mcpu=cortex-a53+nofp will generate code for the
       Cortex-A53 processor with no floating-point support. This, in
       combination with the new -mfpu=auto option, provides a
       straightforward way of specifying a valid build target through a
       single -mcpu or -march option. The -mtune option accepts the same
       arguments as -mcpu but only the CPU name has an effect on tuning.
       The architecture extensions do not have any effect. For details of
       what extensions a particular architecture or CPU option supports
       please refer to the [23]documentation.
     * The -mstructure-size-boundary option has been deprecated and will
       be removed in a future release.
     * The default link behavior for Armv6 and Armv7-R targets has been
       changed to produce BE8 format when generating big-endian images. A
       new flag -mbe32 can be used to force the linker to produce legacy
       BE32 format images. There is no change of behavior for Armv6-M and
       other Armv7 or later targets: these already defaulted to BE8
       format. This change brings GCC into alignment with other compilers
       for the ARM architecture.
     * The Armv8-R architecture is now supported. It can be used by
       specifying the -march=armv8-r option.
     * The Armv8.3-A architecture is now supported. It can be used by
       specifying the -march=armv8.3-a option.
     * The Armv8.4-A architecture is now supported. It can be used by
       specifying the -march=armv8.4-a option.
     * The Dot Product instructions are now supported as an optional
       extension to the Armv8.2-A architecture and newer and are mandatory
       on Armv8.4-A. The extension can be used by specifying the +dotprod
       architecture extension. E.g. -march=armv8.2-a+dotprod.
     * Support for setting extensions and architectures using the GCC
       target pragma and attribute has been added. It can be used by
       specifying #pragma GCC target ("arch=..."), #pragma GCC target
       ("+extension"), __attribute__((target("arch=..."))) or
       __attribute__((target("+extension"))).
     * New Armv8.4-A FP16 Floating Point Multiplication Variant
       instructions have been added. These instructions are mandatory in
       Armv8.4-A but available as an optional extension to Armv8.2-A and
       Armv8.3-A. The new extension can be used by specifying the +fp16fml
       architectural extension on Armv8.2-A and Armv8.3-A. On Armv8.4-A
       the instructions can be enabled by specifying +fp16.
     * Support has been added for the following processors (GCC
       identifiers in parentheses):
          + Arm Cortex-A75 (cortex-a75).
          + Arm Cortex-A55 (cortex-a55).
          + Arm Cortex-A55/Cortex-A75 DynamIQ big.LITTLE
            (cortex-a75.cortex-a55).
          + Arm Cortex-R52 for Armv8-R (cortex-r52).
       The GCC identifiers can be used as arguments to the -mcpu or -mtune
       options, for example: -mcpu=cortex-a75 or -mtune=cortex-r52 or as
       arguments to the equivalent target attributes and pragmas.

  AVR

     * The AVR port now supports the following XMEGA-like devices:

     ATtiny212, ATtiny214, ATtiny412, ATtiny414, ATtiny416, ATtiny417,
     ATtiny814, ATtiny816, ATtiny817, ATtiny1614, ATtiny1616, ATtiny1617,
     ATtiny3214, ATtiny3216, ATtiny3217
       The new devices are listed under [24]-mmcu=avrxmega3.
          + These devices see flash memory in the RAM address space, so
            that features like PROGMEM and __flash are not needed any more
            (as opposed to other AVR families for which read-only data
            will be located in RAM except special, non-standard features
            are used to locate and access such data). This requires that
            the compiler is used with Binutils 2.29 or newer so that
            [25]read-only data will be located in flash memory.
          + A new command-line option -mshort-calls is supported. This
            option is used internally for multilib selection of the
            avrxmega3 variants. It is not an optimization option. Do not
            set it by hand.
     * The compiler now generates [26]efficient interrupt service routine
       (ISR) prologues and epilogues. This is achieved by using the new
       [27]AVR pseudo instruction __gcc_isr which is supported and
       resolved by the GNU assembler.
          + As the __gcc_isr pseudo-instruction will be resolved by the
            assembler, inline assembly is transparent to the process. This
            means that when inline assembly uses an instruction like INC
            that clobbers the condition code, then the assembler will
            detect this and generate an appropriate ISR prologue /
            epilogue chunk to save / restore SREG as needed.
          + A new command-line option -mno-gas-isr-prologues disables the
            generation of the __gcc_isr pseudo instruction. Any non-naked
            ISR will save and restore SREG, tmp_reg and zero_reg, no
            matter whether the respective register is clobbered or used.
          + The feature is turned on per default for all optimization
            levels except for -O0 and -Og. It is explicitly enabled by
            means of option -mgas-isr-prologues.
          + Support has been added for a new [28]AVR function attribute
            no_gccisr. It can be used to disable __gcc_isr pseudo
            instruction generation for individual ISRs.
          + This optimization is only available if GCC is configured with
            GNU Binutils 2.29 or newer; or at least with a version of
            Binutils that implements feature [29]PR21683.
     * The compiler no more saves / restores registers in main; the effect
       is the same as if attribute OS_task was specified for main. This
       optimization can be switched off by the new command-line option
       -mno-main-is-OS_task.

  IA-32/x86-64

     * The x86 port now supports the naked function attribute.
     * Better tuning for znver1 and Intel Core based CPUs.
     * Vectorization cost metrics has been reworked leading to significant
       improvements on some benchmarks.
     * GCC now supports the Intel CPU named Cannonlake through
       -march=cannonlake. The switch enables the AVX512VBMI, AVX512IFMA
       and SHA ISA extensions.
     * GCC now supports the Intel CPU named Icelake through
       -march=icelake. The switch enables the AVX512VNNI, GFNI, VAES,
       AVX512VBMI2, VPCLMULQDQ, AVX512BITALG, RDPID and AVX512VPOPCNTDQ
       ISA extensions.
     * GCC now supports the Intel Control-flow Enforcement Technology
       (CET) extension through -fcf-protection option.

  NDS32

     * New command-line options -mext-perf, -mext-perf2, and -mext-string
       have been added for performance extension instructions.

  Nios II

     * The Nios II back end has been improved to generate better-optimized
       code. Changes include switching to LRA, more accurate cost models,
       and more compact code for addressing static variables.
     * New command-line options -mgprel-sec= and -mr0rel-sec= have been
       added.
     * The stack-smashing protection options are now enabled on Nios II.

  PA-RISC

     * The default call ABI on 32-bit linux has been changed from callee
       copies to caller copies. This affects objects larger than eight
       bytes passed by value. The goal is to improve compatibility with
       x86 and resolve issues with OpenMP.
     * Other PA-RISC targets are unchanged.

  PowerPC / PowerPC64 / RS6000

     * The PowerPC SPE support is split off to a separate powerpcspe port.
       The separate port is deprecated and might be removed in a future
       release.
     * The Paired Single support (as used on some PPC750 CPUs, -mpaired,
       powerpc*-*-linux*paired*) is deprecated and will be removed in a
       future release.
     * The Xilinx floating point support (-mxilinx-fpu,
       powerpc-xilinx-eabi*) is deprecated and will be removed in a future
       release.
     * Support for using big-endian AltiVec intrinsics on a little-endian
       target (-maltivec=be) is deprecated and will be removed in a future
       release.

  Tile

     * The TILE-Gx port is deprecated and will be removed in a future
       release.

Operating Systems

  Windows

     * GCC on Microsoft Windows can now be configured via
       --enable-mingw-wildcard or --disable-mingw-wildcard to force a
       specific behavior for GCC itself with regards to supporting the
       wildcard character. Prior versions of GCC would follow the
       configuration of the MinGW runtime. This behavior can still be
       obtained by not using the above options or by using
       --enable-mingw-wildcard=platform.

Improvements for plugin authors

     * Plugins can now register a callback hook for when comments are
       encountered by the C and C++ compilers, e.g. allowing for plugins
       to handle documentation markup in code comments.
     * The gdbinit support script for debugging GCC now has a
       break-on-diagnostic command, providing an easy way to trigger a
       breakpoint whenever a diagnostic is emitted.
     * The API for creating fix-it hints now supports newlines, and for
       emitting mutually incompatible fix-it hints for one diagnostic.

GCC 8.1

   This is the [30]list of problem reports (PRs) from GCC's bug tracking
   system that are known to be fixed in the 8.1 release. This list might
   not be complete (that is, it is possible that some PRs that have been
   fixed are not listed here).

GCC 8.2

   This is the [31]list of problem reports (PRs) from GCC's bug tracking
   system that are known to be fixed in the 8.2 release. This list might
   not be complete (that is, it is possible that some PRs that have been
   fixed are not listed here).

  General Improvements

     * Fixed LTO link-time performance problems caused by an overflow in
       the partitioning algorithm while building large binaries.

  Language Specific Changes

    C++

   GCC 8.2 fixed a bug introduced in GCC 8.1 affecting passing or
   returning of classes with a deleted copy constructor and defaulted
   trivial move constructor (bug [32]c++/86094). GCC 8.2 introduces
   -fabi-version=13 and makes it the default, ABI incompatibilities
   between GCC 8.1 and 8.2 can be reported with -Wabi=12. See [33]C++
   changes for more details.

  Target Specific Changes

    IA-32/x86-64

     * -mtune=native performance regression [34]PR84413 on Intel Skylake
       processors has been fixed.

GCC 8.3

   This is the [35]list of problem reports (PRs) from GCC's bug tracking
   system that are known to be fixed in the 8.3 release. This list might
   not be complete (that is, it is possible that some PRs that have been
   fixed are not listed here).

  Windows

     * A C++ Microsoft ABI bitfield layout bug, [36]PR87137 has been
       fixed. A non-field declaration could cause the current bitfield
       allocation unit to be completed, incorrectly placing a following
       bitfield into a new allocation unit. The Microsoft ABI is selected
       for:
          + Mingw targets
          + PowerPC, IA-32 or x86-64 targets when the -mms-bitfields
            option is specified, or __attribute__((ms_struct)) is used
          + SuperH targets when the -mhitachi option is specified, or
            __attribute__((renesas)) is used
       GCC 8 introduced additional cases of this defect, but rather than
       resolve only those regressions, we decided to resolve all the cases
       of this defect in single change.


    For questions related to the use of GCC, please consult these web
    pages and the [37]GCC manuals. If that fails, the
    [38]gcc-help@gcc.gnu.org mailing list might help. Comments on these
    web pages and the development of GCC are welcome on our developer
    list at [39]gcc@gcc.gnu.org. All of [40]our lists have public
    archives.

   Copyright (C) [41]Free Software Foundation, Inc. Verbatim copying and
   distribution of this entire article is permitted in any medium,
   provided this notice is preserved.

   These pages are [42]maintained by the GCC team. Last modified
   2019-02-22[43].

References

   1. http://gcc.gnu.org/gcc-8/porting_to.html
   2. http://gcc.gnu.org/onlinedocs/index.html#current
   3. https://gcc.gnu.org/ml/gcc/2018-04/msg00102.html
   4. https://gcc.gnu.org/onlinedocs/gcc-8.1.0/gcc/Warning-Options.html#index-Wmultistatement-macros
   5. https://gcc.gnu.org/onlinedocs/gcc-8.1.0/gcc/Warning-Options.html#index-Wstringop-truncation
   6. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82944
   7. https://gcc.gnu.org/onlinedocs/gcc-8.1.0/gcc/Warning-Options.html#index-Wif-not-aligned
   8. https://gcc.gnu.org/onlinedocs/gcc-8.1.0/gcc/Common-Variable-Attributes.html#index-warn_005fif_005fnot_005faligned-variable-attribute
   9. https://gcc.gnu.org/onlinedocs/gcc-8.1.0/gcc/Warning-Options.html#index-Wmissing-attributes
  10. https://gcc.gnu.org/onlinedocs/gcc-8.1.0/gcc/Warning-Options.html#index-Wpacked-not-aligned
  11. https://gcc.gnu.org/onlinedocs/gcc-8.1.0/gcc/Warning-Options.html#index-Warray-bounds
  12. https://gcc.gnu.org/onlinedocs/gcc-8.1.0/gcc/Warning-Options.html#index-Wrestrict
  13. https://gcc.gnu.org/onlinedocs/gcc-8.1.0/gcc/Warning-Options.html#index-Wformat-overflow
  14. https://gcc.gnu.org/onlinedocs/gcc-8.1.0/gcc/Warning-Options.html#index-Wformat-truncation
  15. https://gcc.gnu.org/PR86094
  16. https://gcc.gnu.org/onlinedocs/gcc/C_002b_002b-Dialect-Options.html#index-Wclass-memaccess
  17. http://gcc.gnu.org/projects/cxx-status.html#cxx2a
  18. https://gcc.gnu.org/onlinedocs/gcc-8.1.0/jit/topics/types.html#gcc_jit_type_get_vector
  19. https://gcc.gnu.org/onlinedocs/gcc-8.1.0/jit/topics/expressions.html#gcc_jit_context_new_rvalue_from_vector
  20. https://gcc.gnu.org/onlinedocs/gcc-8.1.0/jit/topics/types.html#gcc_jit_type_get_aligned
  21. https://gcc.gnu.org/onlinedocs/gcc-8.1.0/jit/topics/function-pointers.html#gcc_jit_function_get_address
  22. https://gcc.gnu.org/onlinedocs/gcc-8.1.0/jit/topics/contexts.html#gcc_jit_context_dump_reproducer_to_file
  23. https://gcc.gnu.org/onlinedocs/gcc-8.1.0/gcc/ARM-Options.html#ARM-Options
  24. https://gcc.gnu.org/onlinedocs/gcc-8.1.0/gcc/AVR-Options.html
  25. https://sourceware.org/PR21472
  26. https://gcc.gnu.org/PR20296
  27. https://sourceware.org/binutils/docs-2.29/as/AVR-Pseudo-Instructions.html
  28. https://gcc.gnu.org/onlinedocs/gcc-8.1.0/gcc/AVR-Function-Attributes.html
  29. https://sourceware.org/PR21683
  30. https://gcc.gnu.org/bugzilla/buglist.cgi?bug_status=RESOLVED&resolution=FIXED&target_milestone=8.0
  31. https://gcc.gnu.org/bugzilla/buglist.cgi?bug_status=RESOLVED&resolution=FIXED&target_milestone=8.2
  32. https://gcc.gnu.org/PR86094
  33. http://gcc.gnu.org/gcc-8/changes.html#cxx
  34. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84413
  35. https://gcc.gnu.org/bugzilla/buglist.cgi?bug_status=RESOLVED&resolution=FIXED&target_milestone=8.3
  36. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87137
  37. https://gcc.gnu.org/onlinedocs/
  38. mailto:gcc-help@gcc.gnu.org
  39. mailto:gcc@gcc.gnu.org
  40. https://gcc.gnu.org/lists.html
  41. https://www.fsf.org/
  42. https://gcc.gnu.org/about.html
  43. http://validator.w3.org/check/referer
======================================================================
http://gcc.gnu.org/gcc-7/index.html
                              GCC 7 Release Series

   Dec 6, 2018

   The [1]GNU project and the GCC developers are pleased to announce the
   release of GCC 7.4.

   This release is a bug-fix release, containing fixes for regressions in
   GCC 7.3 relative to previous releases of GCC.

Release History

   GCC 7.4
          Dec 6, 2018 ([2]changes, [3]documentation)

   GCC 7.3
          Jan 25, 2018 ([4]changes, [5]documentation)

   GCC 7.2
          Aug 14, 2017 ([6]changes, [7]documentation)

   GCC 7.1
          May 2, 2017 ([8]changes, [9]documentation)

References and Acknowledgements

   GCC used to stand for the GNU C Compiler, but since the compiler
   supports several other languages aside from C, it now stands for the
   GNU Compiler Collection.

   A list of [10]successful builds is updated as new information becomes
   available.

   The GCC developers would like to thank the numerous people that have
   contributed new features, improvements, bug fixes, and other changes as
   well as test results to GCC. This [11]amazing group of volunteers is
   what makes GCC successful.

   For additional information about GCC please refer to the [12]GCC
   project web site or contact the [13]GCC development mailing list.

   To obtain GCC please use [14]our mirror sites or [15]our SVN server.


    For questions related to the use of GCC, please consult these web
    pages and the [16]GCC manuals. If that fails, the
    [17]gcc-help@gcc.gnu.org mailing list might help. Comments on these
    web pages and the development of GCC are welcome on our developer
    list at [18]gcc@gcc.gnu.org. All of [19]our lists have public
    archives.

   Copyright (C) [20]Free Software Foundation, Inc. Verbatim copying and
   distribution of this entire article is permitted in any medium,
   provided this notice is preserved.

   These pages are [21]maintained by the GCC team. Last modified
   2018-12-06[22].

References

   1. http://www.gnu.org/
   2. http://gcc.gnu.org/gcc-7/changes.html
   3. http://gcc.gnu.org/onlinedocs/7.4.0/
   4. http://gcc.gnu.org/gcc-7/changes.html
   5. http://gcc.gnu.org/onlinedocs/7.3.0/
   6. http://gcc.gnu.org/gcc-7/changes.html
   7. http://gcc.gnu.org/onlinedocs/7.2.0/
   8. http://gcc.gnu.org/gcc-7/changes.html
   9. http://gcc.gnu.org/onlinedocs/7.1.0/
  10. http://gcc.gnu.org/gcc-7/buildstat.html
  11. http://gcc.gnu.org/onlinedocs/gcc/Contributors.html
  12. http://gcc.gnu.org/index.html
  13. mailto:gcc@gcc.gnu.org
  14. http://gcc.gnu.org/mirrors.html
  15. http://gcc.gnu.org/svn.html
  16. https://gcc.gnu.org/onlinedocs/
  17. mailto:gcc-help@gcc.gnu.org
  18. mailto:gcc@gcc.gnu.org
  19. https://gcc.gnu.org/lists.html
  20. https://www.fsf.org/
  21. https://gcc.gnu.org/about.html
  22. http://validator.w3.org/check/referer
======================================================================
http://gcc.gnu.org/gcc-7/changes.html
                              GCC 7 Release Series
                        Changes, New Features, and Fixes

   This page is a brief summary of some of the huge number of improvements
   in GCC 7. For more information, see the [1]Porting to GCC 7 page and
   the [2]full GCC documentation.

Caveats

     * GCC now uses [3]LRA (a new local register allocator) by default for
       new targets.
     * The non-standard C++0x type traits has_trivial_default_constructor,
       has_trivial_copy_constructor and has_trivial_copy_assign have been
       removed.
     * The libstdc++ [4]Profile Mode has been deprecated and will be
       removed in a future version.
     * The Cilk+ extensions to the C and C++ languages have been
       deprecated.
     * On ARM targets (arm*-*-*), [5]a bug introduced in GCC 5 that
       affects conformance to the procedure call standard (AAPCS) has been
       fixed. The bug affects some C++ code where class objects are passed
       by value to functions and could result in incorrect or inconsistent
       code being generated. This is an ABI change. If the option -Wpsabi
       is enabled (on by default) the compiler will emit a diagnostic note
       for code that might be affected.

General Optimizer Improvements

     * GCC 7 can determine the return value or range of return values of
       some calls to the sprintf family of functions and make it available
       to other optimization passes. Some calls to the snprintf function
       with a zero size argument can be folded into constants. This
       optimization is included in -O1 and can be selectively controlled
       by the -fprintf-return-value option.
     * A new store merging pass has been added. It merges constant stores
       to adjacent memory locations into fewer, wider, stores. It is
       enabled by the -fstore-merging option and at the -O2 optimization
       level or higher (and -Os).
     * A new code hoisting optimization has been added to the partial
       redundancy elimination pass. It attempts to move evaluation of
       expressions executed on all paths to the function exit as early as
       possible. This primarily helps improve code size, but can improve
       the speed of the generated code as well. It is enabled by the
       -fcode-hoisting option and at the -O2 optimization level or higher
       (and -Os).
     * A new interprocedural bitwise constant propagation optimization has
       been added, which propagates knowledge about which bits of
       variables are known to be zero (including pointer alignment
       information) across the call graph. It is enabled by the
       -fipa-bit-cp option if -fipa-cp is enabled as well, and is enabled
       at the -O2 optimization level and higher (and -Os). This
       optimization supersedes interprocedural alignment propagation of
       GCC 6, and therefore the option -fipa-cp-alignment is now
       deprecated and ignored.
     * A new interprocedural value range propagation optimization has been
       added, which propagates integral range information across the call
       graph when variable values can be proven to be within those ranges.
       It is enabled by the -fipa-vrp option and at the -O2 optimization
       level and higher (and -Os).
     * A new loop splitting optimization pass has been added. Certain
       loops which contain a condition that is always true on one side of
       the iteration space and always false on the other are split into
       two loops, such that each of the two new loops iterates on just one
       side of the iteration space and the condition does not need to be
       checked inside of the loop. It is enabled by the -fsplit-loops
       option and at the -O3 optimization level or higher.
     * The shrink-wrapping optimization can now separate portions of
       prologues and epilogues to improve performance if some of the work
       done traditionally by prologues and epilogues is not needed on
       certain paths. This is controlled by the -fshrink-wrap-separate
       option, enabled by default. It requires target support, which is
       currently only implemented in the PowerPC and AArch64 ports.
     * AddressSanitizer gained a new sanitization option,
       -fsanitize-address-use-after-scope, which enables sanitization of
       variables whose address is taken and used after a scope where the
       variable is defined:

int
main (int argc, char **argv)
{
  char *ptr;
    {
      char my_char;
      ptr = &my_char;
    }

  *ptr = 123;
  return *ptr;
}

==28882==ERROR: AddressSanitizer: stack-use-after-scope on address 0x7fffb8dba99
0 at pc 0x0000004006d5 bp 0x7fffb8dba960 sp 0x7fffb8dba958
WRITE of size 1 at 0x7fffb8dba990 thread T0
    #0 0x4006d4 in main /tmp/use-after-scope-1.c:10
    #1 0x7f9c71943290 in __libc_start_main (/lib64/libc.so.6+0x20290)
    #2 0x400739 in _start (/tmp/a.out+0x400739)

Address 0x7fffb8dba990 is located in stack of thread T0 at offset 32 in frame
    #0 0x40067f in main /tmp/use-after-scope-1.c:3

  This frame has 1 object(s):
    [32, 33) 'my_char' <== Memory access at offset 32 is inside this variable

       The option is enabled by default with -fsanitize=address and
       disabled by default with -fsanitize=kernel-address. Compared to the
       LLVM compiler, where the option already exists, the implementation
       in the GCC compiler has some improvements and advantages:
          + Complex uses of gotos and case labels are properly handled and
            should not report any false positive or false negatives.
          + C++ temporaries are sanitized.
          + Sanitization can handle invalid memory stores that are
            optimized out by the LLVM compiler when optimization is
            enabled.
     * The -fsanitize=signed-integer-overflow suboption of the
       UndefinedBehavior Sanitizer now diagnoses arithmetic overflows even
       on arithmetic operations with generic vectors.
     * Version 5 of the [6]DWARF debugging information standard is
       supported through the -gdwarf-5 option. The DWARF version 4
       debugging information remains the default until consumers of
       debugging information are adjusted.

New Languages and Language specific improvements

   OpenACC support in C, C++, and Fortran continues to be maintained and
   improved. See the [7]OpenACC and [8]Offloading wiki pages for further
   information.

  Ada

     * On mainstream native platforms, Ada programs no longer require the
       stack to be made executable in order to run properly.

  BRIG (HSAIL)

   Support for processing BRIG 1.0 files was added in this release. BRIG
   is a binary format for HSAIL (Heterogeneous System Architecture
   Intermediate Language). The BRIG front end can be used for implementing
   HSAIL "finalizers" (compilation of HSAIL to a native ISA) for
   GCC-supported targets. An implementation of an HSAIL runtime library,
   libhsail-rt is also included.

  C family

     * New command-line options have been added for the C and C++
       compilers:
          + -Wimplicit-fallthrough warns when a switch case falls through.
            This warning has five different levels. The compiler is able
            to parse a wide range of fallthrough comments, depending on
            the level. It also handles control-flow statements, such as
            ifs. It's possible to suppress the warning by either adding a
            fallthrough comment, or by using a null statement:
            __attribute__ ((fallthrough)); (C, C++), or [[fallthrough]];
            (C++17), or [[gnu::fallthrough]]; (C++11/C++14). This warning
            is enabled by -Wextra.
          + -Wpointer-compare warns when a pointer is compared with a zero
            character constant. Such code is now invalid in C++11 and GCC
            rejects it. This warning is enabled by default.
          + -Wduplicated-branches warns when an if-else has identical
            branches.
          + -Wrestrict warns when an argument passed to a
            restrict-qualified parameter aliases with another argument.
          + -Wmemset-elt-size warns for memset calls, when the first
            argument references an array, and the third argument is a
            number equal to the number of elements of the array, but not
            the size of the array. This warning is enabled by -Wall.
          + -Wint-in-bool-context warns about suspicious uses of integer
            values where boolean values are expected. This warning is
            enabled by -Wall.
          + -Wswitch-unreachable warns when a switch statement has
            statements between the controlling expression and the first
            case label which will never be executed. This warning is
            enabled by default.
          + -Wexpansion-to-defined warns when defined is used outside #if.
            This warning is enabled by -Wextra or -Wpedantic.
          + -Wregister warns about uses of the register storage specifier.
            In C++17 this keyword has been removed and for C++17 this is a
            pedantic warning enabled by default. The warning is not
            emitted for the GNU Explicit Register Variables extension.
          + -Wvla-larger-than=N warns about unbounded uses of
            variable-length arrays, and about bounded uses of
            variable-length arrays whose bound can be larger than N bytes.
          + -Wduplicate-decl-specifier warns when a declaration has
            duplicate const, volatile, restrict or _Atomic specifier. This
            warning is enabled by -Wall.
     * GCC 6's C and C++ front ends were able to offer suggestions for
       misspelled field names:

spellcheck-fields.cc:52:13: error: 'struct s' has no member named 'colour'; did
you mean 'color'?
   return ptr->colour;
               ^~~~~~

       GCC 7 greatly expands the scope of these suggestions. Firstly, it
       adds fix-it hints to such suggestions:

spellcheck-fields.cc:52:13: error: 'struct s' has no member named 'colour'; did
you mean 'color'?
   return ptr->colour;
               ^~~~~~
               color

       The suggestions now cover many other things, such as misspelled
       function names:

spellcheck-identifiers.c:11:3: warning: implicit declaration of function 'gtk_wi
dget_showall'; did you mean 'gtk_widget_show_all'? [-Wimplicit-function-declarat
ion]
   gtk_widget_showall (w);
   ^~~~~~~~~~~~~~~~~~
   gtk_widget_show_all

       misspelled macro names and enum values:

spellcheck-identifiers.cc:85:11: error: 'MAX_ITEM' undeclared here (not in a fun
ction); did you mean 'MAX_ITEMS'?
 int array[MAX_ITEM];
           ^~~~~~~~
           MAX_ITEMS

       misspelled type names:

spellcheck-typenames.c:7:14: error: unknown type name 'singed'; did you mean 'si
gned'?
 void test (singed char e);
            ^~~~~~
            signed

       and, in the C front end, named initializers:

