This page is a "brief" summary of some of the huge number of improvements in GCC 16. You may also want to check out our Porting to GCC 16 page and the full GCC documentation.
int8_t etc. are now signed char on Solaris
for conformance with the C99 standard. However, this is an
incompatible change. See the
porting notes for more information.-pthread option no longer
predefines _REENTRANT on Solaris.
See the porting notes for more
information.json" format for
-fdiagnostics-format=
has been removed in this release.
Users seeking machine-readable diagnostics from GCC should use
SARIF.
-flto-toplevel-asm-heuristics.See the GNU Offloading and Multi-Processing Project (GOMP) page for general information.
pinned trait, including ompx_gnu_pinned_mem_alloc,
the CUDA
API (if available) is used; this improves the performance when accessing
this memory on Nvidia GPUs. The newly added ompx_gnu_managed_mem_alloc
allocator and the ompx_gnu_managed_mem_space (both GNU
extensions) allocate device-accessible memory on the host. Such memory is
device accessible even when unified-shared memory is not supported and
might have different page-migration behavior than other memory on systems
even if all host memory is device accessible.declare mapper has been added
for C and C++, only. The uses_allocators clause is now
supported, including the OpenMP 5.2 syntax changes and supporting
semicolons (OpenMP 6.0); for now, only predefined allocators are supported.
iterator modifier in map
clauses and the target update construct has been added for C
and C++.begin declare variant directive for C
and C++ is now supported.omp_target_memset and
omp_target_memset_async API routines have been
added. The no_openmp_constructs assumptions clause can now
be used.omp_default_device
constant has been added to denote the default-device number.-Wno-deprecated-openmp. Additionally, a deprecation warning is
shown when using a deprecated named constant or API routine; this warning
can be silenced using -Wno-deprecated-declarations.
See the GCC OpenACC wiki page for general information.
acc_memcpy_device and acc_memcpy_device_async
API routines have been added for C, C++ and Fortran.wait directive now accepts the
if clause.
acc_attach and
acc_detach now augment their OpenACC 2.6 C/C++ counterparts.
PARAMETER) used as
var in data clauses are now permitted by the specification and
GCC for better compatibility with existing code; however, with GCC,
specifying them in data clauses affects neither compile-time nor runtime
behavior.-gnatd_V (or -gnatd_W for verbose mode), can
be used to debug the compiler. It checks various properties of the produced
Ada Semantic Tree and reports detected violations.
-std=c++26 -freflection)define_static_{string,object,array}
(PR120783)constexpr
exceptions (PR117785)constexpr
virtual inheritance (PR120777)constexpr
structured bindings and references to constexpr variables (PR117784, only partially,
structured bindings can be constexpr but references to
constexpr automatic variables still not allowed)-fno-diagnostics-show-nesting
or
-fdiagnostics-plain-output.
--compile-std-module that
conveniently builds the <bits/stdc++.h> header unit
and the std and std.compat modules before
compiling any source files explicitly specified on the command line.
<bits/stdc++.h> header unit has been
built, GCC now transparently translates an #include of
any importable standard library header into an import of
<bits/stdc++.h>.
is_constructible_v and is_invocable_v are
improved to further elaborate why the trait is false instead
of just reporting expression is_foo_v<...> evaluated to false,
thanks to Nathaniel Shead.
std::is_integral<__int128> and similar
traits are always true. Previously this was only the case when compiling
with GNU dialects (-std=gnu++17, -std=gnu++14,
etc.) and not with strict dialects (-std=c++17, etc.)
std::generate_canonical
was implemented in all affected modes (since C++11), impacting the observed
output. The previous behavior can be restored by defining
_GLIBCXX_USE_OLD_GENERATE_CANONICAL.
std::variant ABI was updated to make it conforming
and consistent with C++20 and later modes. This impacts the layout
of classes which have a std::variant as the first member
and a base class of the same type as one of the variant's
alternatives, if that type is an empty class and has a non-trivial
destructor:
struct E { ~E(); };
struct Affected : E
{
std::variant<E, int> mem; // previously stored at offset zero,
// uses non-zero offset now
};
The previous behavior can be restored by defining
_GLIBCXX_USE_VARIANT_CXX17_OLD_ABI. This impacts only
C++17 mode.
std::regex execution has been rewritten to use a heap-based
stack instead of the system stack, avoiding stack overflows when matching
larger strings.
std::chrono::current_zone() on Windows
(thanks to Björn Schäpers).
<atomic> and
semaphore types in <semaphore>.
Synchronization for <syncstream>.
std::format args and
std::formatter specializations.
std::partial_ordering type in
<compare>.
std::variant with std::jthread,
std::stop_token, and std::stop_source
alternatives.
<ranges>.
std::mdspan, thanks to Luc Grosheintz.ranges::starts_with and ranges::ends_with.
ranges::shift_left and ranges::shift_right.
std::allocator_traits::allocate_at_least.std::simd.std::inplace_vector.std::optional<T&>.std::copyable_function and std::function_ref.
std::indirect and std::polymorphic.std::owner_equal for shared pointers, thanks to Paul Keir.
<debugging> header and contents.std::stringstream and std::bitset
member functions accepting std::string_view arguments,
thanks to Nathan Myers.
std::dims,
std::constant_wrapper, and std::submdspan
thanks to Luc Grosheintz.
std::philox_engine, thanks to 1nfocalypse.std::atomic_ref::address(), thanks to Yuao Ma.TEAM feature.IMPORT
statement, the REDUCE intrinsic and
the new GENERIC statement.sinpi intrinsic).split intrinsic subroutine is now
supported and c_f_pointer now accepts an optional
lower bound as a argument.-fexternal-blas64 option has been added to call
external BLAS routines with 64-bit integer arguments for
MATMUL. This option is only valid for
64-bit systems and when -ffrontend-optimize is
in effect.M2WIDESET.
This has changed the ABI and may lead to link-time
errors with object files generated with a previous GCC version.
BinDict has been
added to the base libraries.
Write and WriteLn
are available in the modules: ARRAYOFCHAR,
CFileSysOp, CHAR,
FileSysOp, String and
StringFileSysOp.
-fm2-pathname-root= option has been added to
improve access to external library modules.
More information about the language can be found on the Algol 68 website.
More information about the front end can be found on the wiki.
-march=znver6. This switch enables the
AVX512_BMM, AVX_NE_CONVERT, AVX_IFMA, AVX_VNNI_INT8 and
AVX512_FP16 ISA extensions on top of ISA extensions enabled
for Zen5.
znver4,
znver5 or znver6, saving code size
and improving performance.
-march=wildcatlake.
Wildcat Lake is based on Panther Lake.
-march=novalake.
Based on ISA extensions enabled on Panther Lake, the switch in addition
enables the APX_F, AVX10.1, AVX10.2 and PREFETCHI ISA extensions.
-march=diamondrapids any longer. CLDEMOTE
is not enabled through the compiler switches -march=alderlake,
-march=arrowlake, -march=arrowlake-s,
-march=gracemont, -march=lunarlake,
-march=meteorlake, -march=pantherlake and
-march=raptorlake any longer. KL and WIDEKL are not enabled
through the compiler switches -march=clearwaterforest and
-march=pantherlake any longer. PREFETCHI is not enabled
through the compiler switch -march=pantherlake any longer.
-mavx10.1-256, -mavx10.1-512, and
-mevex512 were removed together with the warning for the
behavior change on -mavx10.1. -mavx10.1 has
enabled AVX10.1 intrinsics with 512-bit vector support since GCC 15.
-mamx-transpose,
--enable-x86-64-mfentry configure option
enables -mfentry which uses __fentry__,
instead of mcount for profiling on x86-64. This
option is enabled by default for glibc targets.
--enable-tls=DIALECT is now supported to control the
default TLS dialect. The default remains gnu.
The accepted values are gnu and gnu2 (for
TLS descriptors).
gfx942) devices
has been added, including the generic gfx9-4-generic and
mostly compatible gfx950.gfx908,
gfx90a, gfx9-generic,
gfx9-4-generic, gfx10-3-generic, and
gfx11-generic. Multilibs for specific devices are no longer
built by default if a generic arch exists. Note:
_BitInt (N) and
unsigned _BitInt (N)) are supported.
target_clones
attribute can be used to generate multiple function versions for
different LoongArch CPU features
(e.g., lsx, lasx), with automatic
runtime selection of the optimal version based on CPU capabilities.
ilp32d (default), ilp32f,
and ilp32s ABIs._BitInt (N) and
unsigned _BitInt (N)) are supported, now.
_Float16 is supported. All operations
are carried out in software or by float instructions.
-mstack-protector-guard=global. Option
-mstack-protector-guard-record was added, too. The primary
use is for the Linux kernel in order to support run-time patching of the
address loading of the canary.
-m31 is deprecated and will be removed in a
future release.
-gsctf option. More information can be
found in the ctf(5) manual page.--enable-tls must be specified at configure
time and recent GNU binutils must be used (version 2.44 or later).-fdiagnostics-add-output=experimental-html
gcc \
-o build-dir/foo.o \
-fdiagnostics-add-output=sarif
foo.c
GCC 15 would write the SARIF to foo.c.sarif, whereas
GCC 16 now writes it to build-dir/foo.c.sarif.
fix objects now contain
description properties in many cases.
kinds property of threadFlowLocation,
for expressing non-standard control flow:
throw for throwing an exceptioncatch for catching an exceptionunwind for unwinding stack frame(s) during
exception-handlingsetjmp for calls to setjmplongjmp for calls to longjmp that rewind the
program counter/stack to the location of a previous setjmp callcfgs=yes on a SARIF or HTML diagnostic sink will enable
capturing GCC's intermediate representation of every function at every
optimization pass.sarif-replay tool
now uses this to provide JSON pointers when it reports on issues in its
SARIF input.GCC_DIAGNOSTICS_LOG
is set in the environment, GCC's diagnostic subsystem will emit a
text log to stderr (or a named file) to track what it's doing and the
decisions it's making (e.g. exactly when and why a diagnostic is being
rejected).EXPERIMENTAL_SARIF_SOCKET
is set in the environment, GCC will attempt to connect to that socket on
startup and send JSON-RPC notifications to it for every diagnostic emitted.
extension objects
associated with them, with a finalizer hook. Plugins can
use this to capture additional information in SARIF output files.
diagnostic-core.h header, but maintainers of plugins making
more sophisticated uses of diagnostics may need to refer to the
porting guide.
-fanalyzer
assumes that a call to an external function not marked with attribute
nothrow could throw an exception if -fexceptions
is enabled. GCC 16 adds a new option
-fanalyzer-assume-nothrow,
for disabling this assumption. This is intended as a workaround for
projects where the exception-handling generates large numbers of new
warnings, such as C code where -fexceptions is used for
interoperability with C++ but where the C APIs in use are unlikely to
throw exceptions.
-fanalyzer for representing
the user's code has been rewritten in a way that makes it easier to
understand and debug, and slightly improves locations used when reporting
diagnostics. This comes at the cost of increasing the memory usage of
the analyzer.
-fanalyzer for simulating the
contents of memory in the user's program has been reimplemented. The new
implementation is faster and easier to maintain.
value_range
machinery, eliminating some false positives.
diagnostic_manager_new_graph()diagnostic_manager_take_global_graph()diagnostic_take_graph()diagnostic_graph_release()diagnostic_graph_set_description()diagnostic_graph_add_node()diagnostic_graph_add_edge()diagnostic_graph_get_node_by_id()diagnostic_graph_get_edge_by_id()diagnostic_node_set_label()diagnostic_node_set_location()diagnostic_node_set_logical_location()diagnostic_message_buffer_new()diagnostic_message_buffer_release()diagnostic_message_buffer_append_str()diagnostic_message_buffer_append_text()diagnostic_message_buffer_append_byte()diagnostic_message_buffer_append_printf()diagnostic_message_buffer_append_event_id()diagnostic_message_buffer_begin_url()diagnostic_message_buffer_end_url()diagnostic_message_buffer_begin_quote()diagnostic_message_buffer_end_quote()diagnostic_message_buffer_begin_color()diagnostic_message_buffer_end_color()diagnostic_message_buffer_dump()diagnostic_finish_via_msg_buf()diagnostic_add_location_with_label_via_msg_buf()diagnostic_execution_path_add_event_via_msg_buf()diagnostic_manager_set_debug_physical_locations()This is the list of problem reports (PRs) from GCC's bug tracking system that are known to be fixed in the 16.1 release. This list might not be complete (that is, it is possible that some PRs that have been fixed are not listed here).