This page is a "brief" summary of some of the huge number of improvements in GCC 17. You may also want to check out our Porting to GCC 17 page and the full GCC documentation.
Note: GCC 17 has not been released yet, so this document is a work-in-progress.
See the GCC OpenACC wiki page for general information.
init, set, and shutdown
directives.See the GNU Offloading and Multi-Processing Project (GOMP) page for general information.
declare
mapper) in C and C++ has been improved. The uses_allocators
clause now accepts traits (also with the OpenMP 5.1 syntax).iterator modifier to the
map, to, and from clauses has been
improved for C and C++ and initial support for Fortran added.device_type clause is now
supported on the target construct and the local
clause on declare target; the groupprivate directive
is supported but for now only in Fortran with device_type(nohost)
and not with AMD GPUs. A comma between the directive name and the first clause
is now also accepted in Fortran (in C/C++ since OpenMP 5.1). Only in Fortran,
directive names with underscores are accepted, likewise optional constant
logical arguments to inarguable clauses. The following API routines have
been added:
omp_get_device_num_teams,
omp_set_device_num_teams,
omp_get_device_teams_thread_limit, and
omp_set_device_teams_thread_limit.omp::allocator::user_mem can be used with allocator-aware
C++ standard library containers. The
omp_get_device_distances API
routine has been added that can be used to find the offload devices that
are closest, in terms of NUMA node, to the thread that called the
routine. The
multidimensional-information API routines have been added,
albeit GCC currently only supports one spatial dimension; already useful
are the new
omp_get_supported_teams_dim and
omp_get_supported_threads_dim routines that return,
respectively, the maximal number of teams and threads that GCC supports
on a given device.GOMP_RUNTIME_USM environment variable can be used to enable
self mapping at runtime for devices that support accessing host memory
(unified-shared memory). Global static variables, specified in declare
target, are now properly handled with the self_maps
or unified_shared_memory requirement.GOMP_BARRIER_TYPE and
GOMP_FORKJOIN_BARRIER_TYPE environment variables permit to
choose the used barrier algorithm.__builtin_call_static_chain and
__builtin_call_code_address can be used to obtain the
static chain and the underlying code address of a nested function.
This allows calling of the nested function indirectly without the use
of a trampoline.
std::format in constexpr functions.std::filesystem support for Windows symlinks,
thanks to Adam Wood.c_f_strpointer intrinsic is now
supported. Additionally, the f_c_string intrinsic
has been reimplemented to be more efficient.
-Wunused-but-set-variables option is now
also effective for Fortran.
-Wundefined-vars, enabled
by -Wall, warns about variables that are used that
have not been defined (i.e. have no value assigned to them).
-Wunused-read and
-Wunused-intent-out, both
enabled by -Wextra,
warn about variables in READ statements and variables passed to
INTENT(OUT) variables, respectively, whose values are never used.
-mprune-vectab. It removes the tail end of unused
interrupt vectors from the interrupt vector table provided the necessary
Binutils support is available.
_Accum
types.long _Fract and
unsigned long _Fract multiplications and divisions.[[len=spec]]
annotations. The code size is specified in units of 16-bit words and
is set to the sum over all such notes.
The notes can be deactivated with the new command-line option
-mno-asm-len-notes so that the default length applies.
The diagnostic behavior can be adjusted with
-Wasm-len-notes.
_ep[i|u]{32,64} suffix, which denotes packed
elements, to _[i|u]{32,64}, with _si{32,64}
aliases for the signed variants. The old names were never accepted by
other x86 compilers. See the
porting guide
for the list of affected intrinsics.
-m31 was removed and as a consequence
-mesa support.
std::nullptr_t support), arguments of type
nullptr_t, std::nullptr_t, and
decltype(nullptr) are passed in registers. However, return
values were erroneously returned in memory, violating the psABI. GCC 17
fixes this so that nullptr_t and related types are returned in
a register (r2), matching argument passing and the psABI.
Functions returning nullptr_t compiled with GCC 17 are
ABI-incompatible with binaries compiled by older GCC versions. For
example, if the translation unit of foo() is compiled with a
GCC version prior to 17
nullptr_t foo (int x)
{
return nullptr;
}
and the translation unit of main() with GCC 17
extern nullptr_t foo (int);
int main (void)
{
foo (0);
}
then running the program results in a segfault because foo()
expects in r2 the hidden argument where to store the return
value, whereas main() passes the first named argument in
r2 (which is zero), leading to a segfault once written to.
Affected code must be recompiled with GCC 17 to restore psABI
compatibility. Compiling with -Wpsabi emits a diagnostic for
function definitions and call sites affected by this change; at most one
diagnostic is emitted per function.
-mlra is now ineffective but kept around for
backwards compatibility
Copyright (C) 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 maintained by the GCC team. Last modified 2026-11-12.