On May 3, the first public release of GCC version 9.1 was announced.
It includes numerous significant improvements and additions compared to version eight.
version.
General Changes
Options
- Commands that accept size now support 64-bit values and suffixes to specify the size;
- An option has been added -flive-patching, for managing optimizations potentially destructive for dynamic code replacement;
- A new option —completion has been added to support auto-completion in the command shell;
- Compiler diagnostics now include line numbers (-fno-diagnostics-show-line-numbers) and
type information (fno-diagnostics-show-labels); - An option has been added -fdiagnostics-format=json to output diagnostics in JSON format;
- Options for specifying alignment (-falign-functions, for example) can now accept a pair of alignment options;
- Options for filtering the list of files (-fprofile-filter-files, -fprofile-exclude-files) that are subjected to instrumentation by the profiler have been added;
- AddressSanitizer now uses more compact alignment for catching invalid access to variables on the stack;
- Numerous improvements in output -fopt-info;
- An option has been added -fsave-optimization-record for saving optimization reports to a file;
- An option has been added -fipa-stack-alignment and -fipa-reference-addressable.
New built-in functions
A new attribute
- copy.
Other
Numerous code generation improvements related to:
- generation of switch constructs;
- inter-procedural optimizations;
- optimizations based on profiling information;
- optimizations at the link-time (LTO);
Also, the internal format for gcov is now JSON, and a new option —use-hotness-colors includes coloring lines of code based on their usage frequency.
Languages
The quality and completeness of OpenACC implementation in C, C++, and Fortran continue to improve. C-like languages
Partial support for OpenMP 5.0 has been implemented;
- __builtin_convertvector
- A function has been added A new warning has been added;
- -Waddress-of-packed-member Improvements in several existing warnings;;
- The error message when passing the wrong number of arguments to a macro now includes the macro's declaration;
- Improvements in typo correction suggestions.
- Support for _Static_assert with a single argument for -std=c2x (the upcoming C standard);
C
- A new warning
- -Wabsolute-value , which catches incorrect argument types for functions like abs();New warnings:
C++
- -Wdeprecated-copy -Winit-list-lifetime,
-Wredundant-move,
-Wredundant-move,
-Wpessimizing-move,
-Wclass-conversion; - Work is underway to implement new features from the upcoming standard C++ 2a;
- The frontend now retains more accurate information about a number of source code elements, allowing for more detailed information to be displayed in diagnostics;
- Diagnostics have been improved for overloaded functions, binary operators, function calls, and format strings;
- Automatic fixes supported by some development environments have been added for several common errors (missing brackets, namespaces, typos, etc.).
libstdc++
- The implementation of C++17 is no longer experimental;
- Parallel algorithms, , , and no longer require -lstdc++fs;
- Experimental support for C++ 2a (, , std::bind_front, etc.) has been improved;
- Support for opening file streams on Windows with paths containing characters beyond char;
- Initial support for on Windows;
- Initial support for Networking TS.
D
D language version 2.076 is included in GCC.
Fortran
- Full support for asynchronous input/output;
- The BACK argument for MINLOC and MAXLOC has been implemented;
- Functions FINDLOC and IS_CONTIGUOUS have been implemented;
- Syntax for accessing the components of complex numbers has been implemented: c%re and c%im;
- Syntax str%len and a%kind has been implemented;
- C descriptors and the ISO_Fortran_binding.h header have been implemented;
- Requirements for the results of MAX and MIN functions have been relaxed when one of the arguments is NaN;
- An option has been added -fdec-include;
- The directive has been added BUILTIN.
libgccjit
- A function has been added gcc_jit_context_add_driver_option.
Other
A number of architecture- and OS-specific changes.
Source: linux.org.ru

