GCC 9 Release Series — Changes, New Features, and Fixes

GCC 9 Release Series

Changes, New Features, and Fixes

This page is a "brief" summary of some of the huge number of improvements in GCC 9. You may also want to check out ourPorting to GCC 9 page and thefull GCC documentation.

Caveats

General Improvements

The following GCC command line options have been introduced or improved.

These labels can be disabled via-fno-diagnostics-show-labels.

rather than an exhaustive log of all decisions made by the vectorizer. For example:
$ gcc -c v.c -O3 -fopt-info-all-vec
v.c:7:3: missed: couldn't vectorize loop
v.c:10:7: missed: statement clobbers memory: asm volatile("" : : : "memory");
v.c:3:6: note: vectorized 0 loops in function.
v.c:10:7: missed: statement clobbers memory: asm volatile("" : : : "memory");
The old behavior can be obtained via a new -internals suboption of -fopt-info.

The following built-in functions have been introduced.

The following attributes have been introduced.

A large number of improvements to code generation have been made, including but not limited to the following.

The following improvements to the gcov command-line utility have been made.

New Languages and Language specific improvements

OpenACC support in C, C++, and Fortran continues to be maintained and improved. Most of the OpenACC 2.5 specification is implemented. See theimplementation status section on the OpenACC wiki page for further information.

C family

C

C++

bad-inits.cc:14:31: error: initializer-string for array of chars is too long [-fpermissive]
14 | char buffers[3][5] = { "red", "green", "blue" };
| ^~~~~~~
bad-inits.cc: In constructor 'X::X()':
bad-inits.cc:17:13: error: invalid conversion from 'int' to 'void*' [-fpermissive]
17 | X() : one(42), two(42), three(42)
| ^~
| |
| int
rather than emitting the error at the final closing parenthesis or brace.

param-type-mismatch.cc:3:46: note: initializing argument 2 of 'static int foo::member_1(int, const char**, float)'
3 | static int member_1 (int one, const char **two, float three);
| ~~~~~~~~~~~~~^~~
highlights both the problematic argument, and the parameter that it can't be converted to.

bad-conversion.cc:3:19: note: initializing argument 2 of 'void callee(int, void*, int)'
3 | void callee (int, void *, int)
| ^~~~~~

bad-printf.cc:6:19: warning: format '%ld' expects argument of type 'long int', but argument 4 has type 'double' [-Wformat=]
6 | printf ("%s: %*ld ", fieldname, column - width, value);
| ~~~^ ~~~~~
| | |
| long int double
| %*f

for when the compiler needs a typename:
$ g++ -c template.cc
template.cc:3:3: error: need 'typename' before 'Traits::type' because 'Traits' is a dependent scope
3 | Traits::type type;
| ^~~~~~
| typename
when trying to use an accessor member as if it were a data member:
$ g++ -c fncall.cc
fncall.cc: In function 'void hangman(const mystring&)':
fncall.cc:12:11: error: invalid use of member function 'int mystring::get_length() const' (did you forget the '()' ?)
12 | if (str.get_length > 0)
| ~~~~^~~~~~~~~~
| ()
for C++11's scoped enums:
$ g++ -c enums.cc
enums.cc: In function 'void json::test(const json::value&)':
enums.cc:12:26: error: 'STRING' was not declared in this scope; did you mean 'json::kind::STRING'?
12 | if (v.get_kind () == STRING)
| ^~~~~~
| json::kind::STRING
enums.cc:3:44: note: 'json::kind::STRING' declared here
3 | enum class kind { OBJECT, ARRAY, NUMBER, STRING, TRUE, FALSE, NULL_ };
| ^~~~~~
and a tweak to integrate the suggestions about misspelled members with that for accessors:
$ g++ -c accessor-fixit.cc
accessor-fixit.cc: In function 'int test(t*)':
accessor-fixit.cc:17:15: error: 'class t' has no member named 'ratio'; did you mean 'int t::m_ratio'? (accessible via 'int t::get_ratio() const')
17 | return ptr->ratio;
| ^~~~~
| get_ratio()
In addition, various diagnostics in the C++ front-end have been streamlined by consolidating the suggestion into the initial error, rather than emitting a follow-up note:
$ g++ typo.cc
typo.cc:5:13: error: 'BUFSIZE' was not declared in this scope; did you mean 'BUF_SIZE'?
5 | uint8_t buf[BUFSIZE];
| ^~~~~~~
| BUF_SIZE

Runtime Library (libstdc++)

D

Fortran

Go

libgccjit

New Targets and Target Specific Improvements

AArch64 & Arm

AArch64 specific
Arm specific

AMD GCN

ARC

C-SKY

IA-32/x86-64

MIPS

OpenRISC

S/390, System z, IBM z Systems

Operating Systems

Solaris

Windows

Improvements for plugin authors

Other significant improvements

This is the list of problem reports (PRs) from GCC's bug tracking system that are known to be fixed in the 9.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 9.2

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

GCC 9.3

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

GCC 9.4

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

Target Specific Changes

AArch64

GCC 9.5

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