This page is a "brief" summary of some of the huge number of improvements in GCC 15. You may also want to check out our Porting to GCC 15 page
Note: GCC 15 has not been released yet, so this document is a work-in-progress.
-mabi=ilp32
) has
been deprecated and will be removed in a future release.
{0}
initializer in C or C++ for unions no longer
guarantees clearing of the whole union (except for static storage
duration initialization), it just initializes the first
union member to zero. If initialization of the whole union including
padding bits is desirable, use {}
(valid in C23 or C++)
or use -fzero-init-padding-bits=unions
option to restore
old GCC behavior.-O2
has been enhanced
to handle unknown tripcount. But it still disables vectorization of loops
when any runtime check for data dependence or alignment is required,
it also disables vectorization of epilogue loops but otherwise is equal
to the cheap cost model.
-ftime-report
now only reports monotonic run time instead of
system and user time. This reduces the overhead of the option significantly,
making it possible to use in standard build systems.
unified_shared_memory
clause to the requires
directive. For details,
see the offload-target specifics section in the
GNU Offloading and Multi Processing Runtime Library Manual.
GCC added ompx_gnu_pinned_mem_alloc
as predefined
allocator. On Nvidia
GPUs, writing to the terminal from OpenMP target regions (but not from
OpenACC compute regions) is now also supported in Fortran; in C/C++ and
on AMD GPUs this was already supported before with both OpenMP and OpenACC.
Constructors and destructors on the device side for declare target
static aggregates are now handled.
unroll
and tile
loop-transformation constructs are now supported.
get_device_from_uid
and
omp_get_uid_from_device
API routines have been added.
musttail
statement attribute was added to enforce tail calls.struct S { int a, b, c; }; extern foo (void); extern char var; int var2; asm (".text; %cc0: mov %cc2, %%r0; .previous;" ".rodata: %cc1: .byte %3; .previous" : : ":" (foo), /* Tell compiler asm defines foo function. */ ":" (&var), /* Tell compiler asm defines var variable. */ "-s" (var2), /* Tell compiler asm uses var2 variable. */ /* "s" would work too but might not work with -fpic. */ "i" (sizeof (struct S))); /* It is possible to pass constants to toplevel asm. */
"redzone"
clobber is now allowed in inline
assembler statements to describe that the assembler can overwrite
memory in the stack red zone (e.g. on x86-64 or PowerPC).NULL
only
if some other parameter is zero.-Wtrailing-whitespace=
and
-Wleading-whitespace=
options have been added to
diagnose certain whitespace characters at the end of source lines or
whitespace characters at the start of source lines violating certain
indentation styles.-Wheader-guard
warning has been added and enabled
in -Wall
to warn about some inconsistencies in header
file guarding macros.#embed
preprocessing directive support
(as an extension enabled in C++ as well).unsequenced
and reproducible
attributes.__STDC_VERSION__
predefined macro value changed
for -std=c23
or -std=gnu23
to
202311L
.-std=c2y
and -std=gnu2y
. Some of these features are also
supported as extensions when compiling for older language versions.
++
and --
on complex values.alignof
of an incomplete array type.__builtin_stdc_rotate_left
and
__builtin_stdc_rotate_right
builtins for use in future
C library <stdbit.h>
headers).if
declarations.<stdlib.h>
headers).= delete("reason");
(PR114458)
constexpr
placement new (PR115744)
constexpr
generated strings,
analoguous to static_assert
.this->non_existent
, is now proactively diagnosed
when parsing a template.
-fassume-sane-operators-new-delete
option has been
added and enabled by default. This option allows control over some
optimizations around calls to replaceable global operators new and
delete. If a program overrides those replaceable global operators and
the replaced definitions read or modify global state visible to the
rest of the program, programs might need to be compiled with
-fno-assume-sane-operators-new-delete
.
-D_GLIBCXX_NO_ASSERTIONS
to override this.
views::concat
.visit
.std::format
args.selected_logical_kind
intrinsic function
and, in the ISO_FORTRAN_ENV
module, the named constants
logical{8,16,32,64}
and real16
were added.unsigned
integers, enabled by
-funsigned
; see gfortran documentation for details. These have been proposed
(J3/24-116)
for inclusion in the next Fortran standard.*.mod
format generated by GCC 15 is
incompatible with the module format generated by GCC 8 - 14, but GCC
15 can for compatibility still read GCC 8 - 14 created module
files.signal
and interrupt
function attributes
that allow to specify the interrupt vector number as an argument.
It allows to use static functions as interrupt handlers, and also
functions defined in a C++ namespace.noblock
function attribute.
It can be specified together with the signal
attribute to
indicate that the interrupt service routine should start with a
SEI
instruction to globally re-enable interrupts.
The difference to the interrupt
attribute is that the
noblock
attribute just acts like a flag and does not
impose a specific function name.__builtin_avr_mask1
built-in function. It can be used to compute some bit masks when
code like 1 << offset
is not fast enough.-mamx-avx512
compiler switch.
-mamx-fp8
compiler switch.
-mamx-movrs
compiler switch.
-mamx-tf32
compiler switch.
-mamx-transpose
compiler switch.
-mavx10.2
or
-mavx10.2-256
compiler switch with 256-bit vector size
support. 512-bit vector size support for AVX10.2 intrinsics are
available via the -mavx10.2-512
compiler switch.
-mmovrs
compiler switch. 128- and 256- bit MOVRS intrinsics are available via
the -mmovrs -mavx10.2
compiler switch. 512-bit MOVRS
intrinsics are available via the -mmovrs -mavx10.2-512
compiler switch.
-msm4 -mavx10.2-512
compiler switch.
-march=diamondrapids
.
Based on Granite Rapids, the switch further enables the AMX-AVX512,
AMX-FP8, AMX-MOVRS, AMX-TF32, AMX-TRANSPOSE, APX_F, AVX10.2 with 512-bit
support, AVX-IFMA. AVX-NE-CONVERT, AVX-VNNI-INT16, AVX-VNNI-INT8,
CMPccXADD, MOVRS, SHA512, SM3, SM4 and USER_MSR ISA extensions.
-march=knl
,
-march=knm
, -mavx5124fmaps
,
-mavx5124vnniw
, -mavx512er
,
-mavx512pf
, -mprefetchwt1
,
-mtune=knl
, and -mtune=knm
compiler switches.
sh-elf
targets are now using the newer soft-fp
library for improved performance of floating-point emulation on CPUs
without hardware floating-point support.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 2025-01-17.