GCC 15 Release Series — Changes, New Features, and Fixes
GCC 15 Release Series
Changes, New Features, and Fixes
This page is a "brief" summary of some of the huge number of improvements in GCC 15. You may also want to check out ourPorting to GCC 15 page and thefull GCC documentation.
Caveats
- Support for Nios II targets, which was marked obsolete in GCC 14, has now been removed entirely.
- In the AArch64 port, support for ILP32 (
-mabi=ilp32) has been deprecated and will be removed in a future release. - This is the last release supporting the old
reloadlocal register allocation code. It will be removed for GCC 16, causing targets that do not support the newLRAlocal register allocation code to be removed. See the list of supportedtargets for which ports are going to be affected (look for missinga, the ports that do not use LRA by default). {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=unionsoption to restore the old GCC behavior.- -fanalyzer is still only suitable for analyzing C code. In particular, using it on C++ is unlikely to give meaningful output.
- The
jsonformat for-fdiagnostics-format= is deprecated and may be removed in a future release. Users seeking machine-readable diagnostics from GCC should useSARIF.
General Improvements
- The default vectorizer cost model at
-O2has been enhanced to handle an unknown tripcount. It still disables vectorization of loops when any run-time check for data dependence or alignment is required. It also disables vectorization of epilogue loops, but is otherwise equal to the cheap cost model. - The vectorizer now supports vectorizing loops with early exits where the number of elements for the input pointers are unknown through peeling for alignment. This is supported only for loops with fixed vector lengths.
-ftime-reportnow 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.- Incremental Link-Time Optimizations significantly reduce average recompilation time of LTO when doing small code edits (e.g. editing a single function). Enable with -flto-incremental=.
- For offloading using OpenMP and OpenACC, issues preventing some host–device architecture combinations have been resolved. In particular, offloading from aarch64 hosts to nvptx devices is now supported. Additionally, the support for using C++ in offload regions has been extended.
- Improvements for compiling very large input files. The compile time for large input files with
-Wmisleading-indentationhas been significantly improved. The compiler can now track column numbers larger than 4096. Very large source files have more accurate location reporting. - GCC can now emit diagnostics in multiple formats simultaneously, via the new option-fdiagnostics-add-output=. For example, use-fdiagnostics-add-output=sarif to get both GCC's classic text output on stderr and SARIF output to a file. There is also a new option-fdiagnostics-set-output= which exposes more control than existing options for some experimental cases. These new options are an alternative to the existing-fdiagnostics-format= which only supports a single output format at a time.
New Languages and Language specific improvements
OpenMP
See theGNU Offloading and Multi-Processing Project (GOMP) page for general information.
- Support for unified-shared memory has been added for some AMD and Nvidia GPU devices, enabled when using the
unified_shared_memoryclause to therequiresdirective. The OpenMP 6.0self_mapsclause is also now supported. For details, see the offload-target specifics section in theGNU Offloading and Multi Processing Runtime Library Manual. - GCC added
ompx_gnu_pinned_mem_allocas a predefined allocator and, for C++, allocator class templates in theomp::allocatornamespace for the predefined allocators as specified in the OpenMP specification 5.0, includingomp::allocator::null_allocatorof OpenMP 6.0 andompx::allocator::gnu_pinned_mem; the allocator templates can be used with C++ containers such asstd::vector. - In C and Fortran, the
allocatedirective now supports static variables; stack variables were previously supported in those languages. C++ support is not available yet. - Offloading improvements: 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 targetstatic aggregates are now handled. - For Fortran, mapping derived-type variables with allocatable components is now supported.
- The OpenMP 5.1
unrollandtileloop-transforming constructs are now supported. - OpenMP 5.0 metadirectives are now supported, as are OpenMP 5.1 dynamic selectors in both
metadirectiveanddeclare variant(the latter with some restrictions). - The
interopconstruct and the OpenMP interoperability API routines for C, C++ and Fortran are now implemented, including the OpenMP 6.0 additions. This includes foreign-runtime support for Cuda, Cuda Driver, and HIP on Nvida GPUs and for HIP and HSA on AMD GPUs. - The OpenMP 5.1
dispatchconstruct has been implemented with support for theadjust_argsandappend_argsclauses to thedeclare variantdirective, including the following OpenMP 6.0 additions: theinteropclause todispatchand the syntax extensions toappend_argsare supported. - OpenMP 6.0: The get_device_from_uid and omp_get_uid_from_device API routines have been added.
COBOL
- GCC now includes an ISO COBOL compiler, gcobol. It has been tested on x86-64 and AArch64 targets. It is not expected to work on 32-bit systems. Efforts are underway to adapt it to other machine architectures that support native 128-bit computation.
- gcobol passes much of the NIST CCVS/85 test suite (except for parts that are now obsolete). It uses ISO/IEC 1989:2023 as a reference specification. Some parts of that document, notably object-orientation features, are yet to be implemented. Beyond ISO, gcobol recognizes some syntax common on other compilers, with special attention given to IBM.
More information about GCC COBOL can be found atthe COBOLworx website.
Ada
- GNAT now allows the 'Round attribute also for ordinary fixed-point types.
- The new GNAT attribute 'Super can be applied to objects of tagged types in order to obtain a view conversion to the most immediate specific parent type.
- Mutably tagged types with a defined size are now available through the use of
Size'Class. This allows defining a maximum size for the tagged. Example:
type Base is tagged null record with Size'Class => 16 * 8;
-- Size in bits (128 bits, or 16 bytes)
type Derived_Type is new Base with record Data_Field : Integer; end record;
-- ERROR if Derived_Type exceeds 16 bytes - New Finalizable aspect. It is a GNAT language extension which serves as a lightweight alternative to controlled types.
type T is record
...
end record with Finalizable => (Initialize => Initialize,
Adjust => Adjust,
Finalize => Finalize,
Relaxed_Finalization => True);
procedure Adjust (Obj : in out T);
procedure Finalize (Obj : in out T);
procedure Initialize (Obj : in out T);
- The aspect No_Raise has been added, it declares that a subprogram cannot raise an exception.
- The aspect External_Initialization has been added, it allows for data to be initialized using an external file which is loaded during compilation time.
- The aspect Exit_Cases has been added to annotate functions and procedures with side effects in SPARK (see SPARK reference manual) . It can be used to partition the input state into a list of cases and specify, for each case, how the subprogram is allowed to terminate.
- Language extensions are enabled through the use of
pragma Extensions_Allowed (On | Off | All_Extensions);which has had its syntax changed. An argument ofAll_Extensionshas the same effect asOn, except that some extra experimental extensions are enabled. - Several new compilation flags have been added, some examples include -gnatis, -gnatw.n, -gnatw_l and -gnatw.v. The internal debugging utilities for the compiler have also received a lot of new options, please refer to debug.adb for more information.
- The diagnostics code has seen major refactoring, it now supports the sarif format
-fdiagnostics-format=sarif-fileamong other improvements. More changes are expected in following releases. System.Image_Ahas now printing routines to output address information in HEX.- Several program units have had contracts added to them and SPARK analysis has been enabled.
- Support for FreeBSD, Android and aarch64 targets has been improved.
- Task priorities on MinGW have been reworked.
- The documentation has been rearanged for clarity, mainly the sections related to tasking and platform dependent information.
- REMOVAL:
Generic_Formal_Hash_Tablehas been removed, the SPARK Library is recommended as a substitute.
C family
- A musttail statement attribute was added to enforce tail calls.
- Extended inline assembler statements can now be used with some limitations outside of functions as well. New constraints have been added for defining symbols or using symbols inside of inline assembler, and a new generic operand modifier has been added to allow printing those regardless of PIC. For example:
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. */ - The
"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). - The nonnull_if_nonzero function attribute has been added to describe functions where some pointer parameter may be
NULLonly if some other parameter is zero. - The -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.
- The -Wheader-guard warning has been added and enabled in
-Wallto warn about some inconsistencies in header file guarding macros. - The C and C++ frontends now provide fix-it hints for some cases of missing '
&' and '*'. For example, note the ampersand fix-it hint in the following:
demo.c: In function 'int main()':
demo.c:5:22: error: invalid conversion from 'pthread_key_t' {aka 'unsigned int'}
to 'pthread_key_t*' {aka 'unsigned int*'} [-fpermissive]
5 | pthread_key_create(key, NULL);
| ^~~
| |
| pthread_key_t {aka unsigned int}
demo.c:5:22: note: possible fix: take the address with '&'
5 | pthread_key_create(key, NULL);
| ^~~
| &
In file included from demo.c:1:
/usr/include/pthread.h:1122:47: note: initializing argument 1 of
'int pthread_key_create(pthread_key_t*, void (*)(void*))'
1122 | extern int pthread_key_create (pthread_key_t *__key,
| ~~~~~~~~~~~~~~~^~~~~ - Diagnostic messages referring to attributes now provide URLs to the documentation of the pertinent attributes in sufficiently capable terminals, and in SARIF output.
- Diagnostics in which two different things in the source are being contrasted (such as type mismatches) now use color to visually highlight and distinguish the differences, in both the text message of the diagnostic, and the quoted source. For example, in:

the left-hand type is shown in green and the right-hand type in dark blue.
C
- C23 by default: GCC 15 changes the default language version for C compilation from-std=gnu17 to-std=gnu23. If your code relies on older versions of the C standard, you will need to either add-std= to your build flags, or port your code; see the porting notes.
- Some more C23 features have been implemented:
#embedpreprocessing directive support.- Support for
unsequencedandreproducibleattributes. __STDC_VERSION__predefined macro value changed for-std=c23or-std=gnu23to202311L.
- To aid the transition to C23, various diagnostics have been enhanced to clarify type errors such as incompatible function types, incorrect argument counts, and those involving
bool. - Some new features from the upcoming C2Y revision of the ISO C standard are supported with
-std=c2yand-std=gnu2y. Some of these features are also supported as extensions when compiling for older language versions.- Generic selection expression with a type operand.
- Support
++and--on complex values. - Accessing byte arrays.
alignofof an incomplete array type.- Obsolete implicitly octal literals and add delimited escape sequences (just partially implemented, support for new syntax added but nothing deprecated yet).
- Named loops.
- More Modern Bit Utilities (addition of
__builtin_stdc_rotate_leftand__builtin_stdc_rotate_rightbuiltins for use in future C library<stdbit.h>headers). - Case range expressions.
ifdeclarations.- Introduce complex literals.
- Abs Without Undefined Behavior (addition of builtins for use in future C library
<stdlib.h>headers). - Allow zero length operations on null pointers (just the compiler side, C library headers will need adjustments too if using
nonnullattribute).
C++
- Several C++26 features have been implemented:
- P2558R2, Add @, $, and ` to the basic character set (PR110343)
- P2552R3, On the ignorability of standard attributes (PR110345)
- P2662R3, Pack indexing (PR113798)
- P0609R3, Attributes for structured bindings (PR114456)
- P2573R2,
= delete("reason");(PR114458) - P2893R3, Variadic friends (PR114459)
- P3034R1, Disallow module declarations to be macros (PR114461)
- P2747R2,
constexprplacement new (PR115744) - P0963R3, Structured binding declaration as a condition (PR115745)
- P3144R2, Deleting a pointer to an incomplete type should be ill-formed (PR115747)
- P3176R0, Oxford variadic comma (PR117786)
- P2865R5, Removing deprecated array comparisons (PR117788)
- P1967R14,
#embed(PR119065) - P3247R2, Deprecating the notion of trivial types (PR117787)
- Several C++23 features have been implemented:
- Several C++ Defect Reports have been resolved, e.g.:
- DR 36,using-declarations in multiple-declaration contexts
- DR 882, Defining main as deleted
- DR 1363, Triviality vs multiple default constructors
- DR 1496, Triviality with deleted and missing default constructors
- DR 2387, Linkage of const-qualified variable template
- DR 2521, User-defined literals and reserved identifiers
- DR 2627, Bit-fields and narrowing conversions
- DR 2819, Cast from null pointer value in a constant expression (C++26 only)
- DR 2867, Order of initialization for structured bindings
- DR 2918, Consideration of constraints for address of overloaded function
- Inline assembler statements now supportconstexpr generated strings, analoguous to
static_assert. - Qualified name lookup failure into the current instantiation, e.g.
this->non_existent, is now proactively diagnosed when parsing a template. - The -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. - The -Wself-move warning now warns even in a member-initializer-list.
- The support for Concepts TS was removed.
-fconcepts-tshas no effect anymore. - A new option -Wtemplate-body was added, which can be used to disable diagnosing errors when parsing a template.
- C++ Modules have been greatly improved.
- C++11 attributes are now supported even in C++98.
- New flag_enum attribute to indicate that the enumerators are used in bitwise operations; this suppresses a
-Wswitchwarning. - The -Wdangling-reference warning has been improved: for example, it doesn't warn for empty classes anymore.
- The front end's handling of explicitly-defaulted functions has been corrected to properly handle [dcl.fct.def.default]. The new -Wdefaulted-function-deleted warning warns when an explicitly defaulted function is deleted.
- The implementation of DR 2789 was refined.
- Compilation time speed ups, e.g. by improving hashing of template specializations.
- Support for
__builtin_operator_newand__builtin_operator_deletewas added. See the manual for more info. - More prvalues are evaluated at compile time (git).
- A new way of presenting complicated diagnostics (such as C++ template errors) is available via-fdiagnostics-set-output=text:experimental-nesting=yes; an example can be seen here. This should be regarded as experimental in this release and is subject to change.
- Various other diagnostic improvements.
Runtime Library (libstdc++)
- Debug assertions are now enabled by default for unoptimized builds. Use
-D_GLIBCXX_NO_ASSERTIONSto override this. - Associative containers and lists now use custom
pointertypes internally, instead of only when interacting with their allocator. - Improved experimental support for C++26, including:
views::concat,views::to_input,views::cache_latest.- Sorting algorithms and raw memory algorithms are
constexprso can be used during constant evaluation. <stdbit.h>and<stdckdint.h>headers.std::is_virtual_base_oftype trait.- Member
visit. - Type-checking
std::formatargs.
- Improved experimental support for C++23, including:
stdandstd.compatmodules (also supported for C++20).std::flat_mapandstd::flat_set.std::from_range_tconstructors added to all containers, as well as new member functions such asinsert_range.- Formatting of ranges and tuples with
std::format, as well as string escaping for debug formats, thanks to Tomasz Kamiński. - Clarify handling of encodings in localized formatting of chrono types.
D
- Support for the D programming language has been updated to version 2.111.0 of the language and run-time library. Full changelog for this release and previous releases can be found on thedlang.org website.
- On supported targets, the version
GNU_CETis now predefined when the option-fcf-protectionis used. The protection level is also set in the traits key__traits(getTargetInfo, "CET"). - A new option -finclude-imports was added, which tells the compiler to include imported modules in the compilation, as if they were given on the command-line.
Fortran
- Fortran 2018 and 2023 locality specifiers to
do concurrentare now supported. - Experimental support for
unsignedmodular integers, enabled by-funsigned; see gfortran documentation for details. This follows (J3/24-116). With this option in force, theselected_logical_kindintrinsic function and, in theISO_FORTRAN_ENVmodule, the named constantslogical{8,16,32,64}andreal16were added. TheISO_C_BINDINGmodule has been extended accordingly. - Missing commas separating descriptors in input/output format strings are no longer permitted by default and are rejected at run-time unless -std=legacy is used when compiling the main program unit. See Fortran 2023 constraint C1302.
- The Fortran module
*.modformat 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. - Coarray support has been reworked to allow access to components in derived types that have not been compiled with coarray support enabled; especially, when the derived type is in a binary only module. This has changed the ABI and may lead to link-time errors with object files generated with a previous GCC version and to be linked to the current
caf_singlelibrary. If this library is to be used, then it is recommended to recompile all artifacts. The OpenCoarrays library is not affected, because it provides backwards compatibility with the older ABI. - The
-Wexternal-arguments-mismatchoption has been added. This checks for mismatches between the argument lists in dummy external arguments, and is implied by-Walland-fc-prototypes-externaloptions. - The
-fc-prototypesoption now also generates prototypes for interoperable procedures with assumed shape and assumed rank arguments that require the header file<ISO_Fortran_binding.h>.
Modula-2
- The keyword
FORWARDhas been implemented in the compiler and is available by default in all dialects. - The
SYSTEMmodule now exports the datatypeCOFF_Tmapping onto the POSIXoff_ttype. The size of this datatype can be controlled by the new option-fm2-file-offset-bits=. - Access to the GCC builtins
clz,clzll,ctzandctzllis now available from the moduleBuiltins.
Rust
- Basic inline assembly support has been added to the frontend, which enables us to compile the architecture specific functions of
core 1.49. - Support for
for-loopshas been added. - Fixes to our automatic dereferencing algorithm for
DerefandDerefMut. This makesgccrsmore correct and allows handling complicated cases where the type-checker would previously fail. - Fixes to our indexing and iterator traits handling, which was required for
for-loopsto be properly implemented. - Our parser is now fully implemented and fully capable of parsing the entirety of
core,allocandstd. It was still lacking in some areas, especially around unstable features likespecialization. - Support for the question-mark operator has been added. This enables
gccrsto handle all the error handling code and machinery often used in real world Rust programs, as well as incore. - Fixes to our macro expansion pass which now correctly expands all of
core 1.49. This also includes fixes to ourformat_args!()handling code, which received numerous improvements. - Support for
let-elsehas been added. While this is not used incore 1.49, it is used in the Rust-for-Linux project, our next major objective forgccrs. - Support for the unstable
specializationfeature has been added. This is required for compilingcore 1.49correctly, in which specialization is used to improve the runtime performance of Rust binaries. - Support for more
lang-itemshas been added. - Lowered minimum required Rust version to 1.49. This allows more systems to compile the Rust frontend, and also brings us closer to
gccrscompiling its own dependencies down the line. - Rewrite of our name resolution algorithm to properly handle the complex import/export structure used in
core 1.49.
New Targets and Target Specific Improvements
AArch64
- Support has been added for the AArch64 MinGW target (
aarch64-w64-mingw32). At present, this target supports C and C++ for base Armv8-A, but with some caveats:- Although most variadic functions work, the implementation of them is not yet complete.
- C++ exception handling is not yet implemented.
Further work is planned for GCC 16.
- As noted above, support for ILP32 (
-mabi=ilp32) has been deprecated and will be removed in a future release.aarch64*-elftargets no longer build the ILP32 multilibs. - The following architecture level is now supported by
-marchand related source-level constructs (GCC identifiers in parentheses):- Armv9.5-A (
armv9.5-a)
- Armv9.5-A (
- The following CPUs are now supported by
-mcpu,-mtune, and related source-level constructs (GCC identifiers in parentheses):- Apple A12 (
apple-a12) - Apple M1 (
apple-m1) - Apple M2 (
apple-m2) - Apple M3 (
apple-m3) - Arm Cortex-A520AE (
cortex-a520ae) - Arm Cortex-A720AE (
cortex-a720ae) - Arm Cortex-A725 (
cortex-a725) - Arm Cortex-R82AE (
cortex-r82ae) - Arm Cortex-X925 (
cortex-x925) - Arm Neoverse N3 (
neoverse-n3) - Arm Neoverse V3 (
neoverse-v3) - Arm Neoverse V3AE (
neoverse-v3ae) - FUJITSU-MONAKA (
fujitsu-monaka) - NVIDIA Grace (
grace) - NVIDIA Olympus (
olympus) - Qualcomm Oryon-1 (
oryon-1)
- Apple A12 (
- The following features are now supported by
-march,-mcpu, and related source-level constructs (GCC modifiers in parentheses):- FEAT_CPA (
+cpa), enabled by default for Arm9.5-A and above - FEAT_FAMINMAX (
+faminmax), enabled by default for Arm9.5-A and above - FEAT_FCMA (
+fcma), enabled by default for Armv8.3-A and above - FEAT_FLAGM2 (
+flagm2), enabled by default for Armv8.5-A and above - FEAT_FP8 (
+fp8) - FEAT_FP8DOT2 (
+fp8dot2) - FEAT_FP8DOT4 (
+fp8dot4) - FEAT_FP8FMA (
+fp8fma) - FEAT_FRINTTS (
+frintts), enabled by default for Armv8.5-A and above - FEAT_JSCVT (
+jscvt), enabled by default for Armv8.3-A and above - FEAT_LUT (
+lut), enabled by default for Arm9.5-A and above - FEAT_LRCPC2 (
+rcpc2), enabled by default for Armv8.4-A and above - FEAT_SME_B16B16 (
+sme-b16b16) - FEAT_SME_F16F16 (
+sme-f16f16) - FEAT_SME2p1 (
+sme2p1) - FEAT_SSVE_FP8DOT2 (
+ssve-fp8dot2) - FEAT_SSVE_FP8DOT4 (
+ssve-fp8dot4) - FEAT_SSVE_FP8FMA (
+ssve-fp8fma) - FEAT_SVE_B16B16 (
+sve-b16b16) - FEAT_SVE2p1 (
+sve2p1), enabled by default for Armv9.4-A and above - FEAT_WFXT (
+wfxt), enabled by default for Armv8.7-A and above - FEAT_XS (
+xs), enabled by default for Armv8.7-A and above
The features listed as being enabled by default for Armv8.7-A or earlier were previously only selectable using the associated architecture level. For example, FEAT_FCMA was previously selected by-march=armv8.3-aand above (as it still is), but it wasn't previously selectable independently.
- FEAT_CPA (
-mbranch-protectionhas been extended to support the Guarded Control Stack (GCS) extension. This support is included in-mbranch-protection=standardand can be enabled individually using-mbranch-protection=gcs.- The following additional changes have been made to the command-line options:
- In order to align with other tools, the SME feature modifier
+smeno longer enables SVE. However, GCC does not yet support using SME without SVE and instead rejects such combinations with a “not implemented” error. - The options
-mfix-cortex-a53-835769and-mfix-cortex-a53-843419are now silently ignored if the selected architecture is incompatible with Cortex-A53. This is particularly useful for toolchains that are configured to apply the Cortex-A53 workarounds by default. For example, all other things being equal, a toolchain configured with--enable-fix-cortex-a53-835769now produces the same code for-mcpu=neoverse-n2as a toolchain configured without--enable-fix-cortex-a53-835769. -mcpu=nativenow handles unrecognized heterogeneous systems by detecting which individual architecture features are supported by the CPUs. This matches the preexisting behavior for unknown homogeneous systems.- The first scheduling pass (
-fschedule-insns) is no longer enabled by default at-O2for AArch64 targets. The pass is still enabled by default at-O3and-Ofast.
- In order to align with other tools, the SME feature modifier
- Support has been added for the following features of the Arm C Language Extensions (ACLE):
- guarded control stacks
- lookup table instructions with 2-bit and 4-bit indices (predefined macro
__ARM_FEATURE_LUT, enabled by+lut) - floating-point absolute minimum and maximum instructions (predefined macro
__ARM_FEATURE_FAMINMAX, enabled by+faminmax) - FP8 conversions (predefined macro
__ARM_FEATURE_FP8, enabled by+fp8) - FP8 2-way dot product to half precision instructions (predefined macro
__ARM_FEATURE_FP8DOT2, enabled by+fp8dot2) - FP8 4-way dot product to single precision instructions (predefined macro
__ARM_FEATURE_FP8DOT4, enabled by+fp8dot4) - FP8 multiply-accumulate to half precision and single precision instructions (predefined macro
__ARM_FEATURE_FP8FMA, enabled by+fp8fma) - SVE FP8 2-way dot product to half precision instructions in Streaming SVE mode (predefined macro
__ARM_FEATURE_SSVE_FP8DOT2, enabled by+ssve-fp8dot2) - SVE FP8 4-way dot product to single precision instructions in Streaming SVE mode (predefined macro
__ARM_FEATURE_SSVE_FP8DOT4, enabled by+ssve-fp8dot4) - SVE FP8 multiply-accumulate to half precision and single precision instructions in Streaming SVE mode (predefined macro
__ARM_FEATURE_SSVE_FP8FMA, enabled by+ssve-fp8fma) - SVE2.1 instructions (predefined macro
__ARM_FEATURE_SVE2p1, enabled by+sve2p1) - SVE non-widening bfloat16 instructions (predefined macro
__ARM_FEATURE_SVE_B16B16, enabled by+sve-b16b16) - SME2.1 instructions (predefined macro
__ARM_FEATURE_SME2p1, enabled by+sme2p1) - SME non-widening bfloat16 instructions (predefined macro
__ARM_FEATURE_SME_B16B16, enabled by+sme-b16b16) - SME half-precision instructions (predefined macro
__ARM_FEATURE_SME_F16F16, enabled by+sme-f16f16) - using C and C++ prefix operators, infix operators, and postfix operators with scalable SVE ACLE types (predefined macro
__ARM_FEATURE_SVE_VECTOR_OPERATORS==2, enabled by+sve) __fma(inarm_acle.h)__fmaf(inarm_acle.h)__chkfeat(inarm_acle.h)
- In addition, the following changes have been made to preexisting ACLE features:
- The macros
__ARM_FEATURE_BF16and__ARM_FEATURE_SVE_BF16are now predefined when the associated support is available. Previous versions of GCC provided the associated intrinsics but did not predefine the macros. - OpenMP tasks can now share scalable SVE vectors and predicates. However, offloading of scalable vectors and predicates is not supported.
- ACLE system register functions (such as
__arm_rsrand__arm_wsr) no longer try to enforce the minimum architectural requirement. - A warning is reported if code attempts to use the Function Multi-Versioning feature. GCC's current implementation of this feature is still experimental and it does not conform to the ACLE specification.
- The macros
- Support has been added for the
indirect_returnfunction-type attribute, which indicates that a function might return via an indirect branch instead of via a normal return instruction. - 128-bit atomic operations have been extended to make use of FEAT_LRCPC3 instructions, when support for the instructions is detected at runtime.
- There have been many code-generation improvements to the AArch64 port. Some examples are:
- automatic use of AArch64 CRC instructions
- automatic use of AArch64 saturating vector arithmetic instructions
- better code generation of population counts
- improved handling of floating-point and vector immediates
- improved handling of vector permutations
- more use of SVE instructions to optimize Advanced SIMD code
- more folding and simplification of SVE ACLE intrinsics
- improved CPU-specific tuning
- improved register allocation, such as eliminating some vector moves
AMD GPU (GCN)
- The standard C++ library (libstdc++) is now supported and enabled.
- Experimental support for supporting generic devices has been added; specifying
gfx9-generic,gfx10-3-generic, orgfx11-genericto -march= will generate code that can run on all devices of a series. Additionally, the following specific devices are now have experimental support, all of which are compatible with a listed generic:gfx902,gfx904,gfx909,gfx1031,gfx1032,gfx1033,gfx1034,gfx1035,gfx1101,gfx1102,gfx1150, andgfx1151. To use any of the listed new devices including the generic ones, GCC has to be configured to build the runtime library for the device. Note that generic support requires ROCm 6.4.0 (or newer). For details, consult GCC's installation notes. - Support for Fiji (gfx803) devices has been removed (this was already deprecated in GCC 14).
AVR
- Support has been added for the
signal(_num_)andinterrupt(_num_)function attributes that allow to specify the interrupt vector number_num_as an argument. It allows to use static functions as interrupt handlers, and also functions defined in a C++ namespace. - Support has been added for the
noblockfunction attribute. It can be specified together with thesignalattribute to indicate that the interrupt service routine should start with aSEIinstruction to globally re-enable interrupts. The difference to theinterruptattribute is that thenoblockattribute just acts like a flag and does not impose a specific function name. - Support has been added for the
__builtin_avr_mask1built-in function. It can be used to compute some bit masks when code like1 << offsetis not fast enough. - Support has been added for a new 24-bitnamed address space
__flashx. It is similar to the__memxaddress space introduced in GCC 4.7, but reading is more efficient since it only supports reading from program memory. Objects in the__flashxaddress space are located in the.progmemx.datasection. The address space is available when the feature-test macro__FLASHXis defined. - Apart from the built-in types
__int24and__uint24supported since GCC 4.7, support has been added for thesigned __int24andunsigned __int24types. - Code generation for the 32-bit integer shifts with constant offset has been improved. The code size may slightly increase even when optimizing for code size with
-Os. - Support has been added for a compact vector table as supported by some AVR devices. It can be activated by the new command-line option-mcvt. It links
crt_mcu_-cvt.oas startup code which is supported since AVR-LibC v2.3. - Support has been added for the new option-mno-call-main. Instead of calling
main, it will be located in section.init9. - New AVR specific optimizations have been added. They can be controlled by the new command-line options-mfuse-move,-msplit-ldst,-msplit-bit-shift and-muse-nonzero-bits.
- Support for the following devices has been added in GCC 15.2:
- AVR32DA28S, AVR32DA32S, AVR32DA48S, AVR64DA28S, AVR64DA32S, AVR64DA48S AVR64DA64S, AVR128DA28S, AVR128DA32S, AVR128DA48S, AVR128DA64S.
- Support for the following devices has been added in GCC 15.3:
- AVR32EB14, AVR32EB20, AVR32EB28, AVR32EB32, AVR16LA14, AVR16LA20, AVR16LA28, AVR16LA32, AVR32LA14, AVR32LA20, AVR32LA28, AVR32LA32.
- Support for the IEEE double functions
sincosandsincoslhas been added in GCC 15.3.
IA-32/x86-64
- New ISA extension support for Intel AMX-AVX512 was added. AMX-AVX512 intrinsics are available via the
-mamx-avx512compiler switch. - New ISA extension support for Intel AMX-FP8 was added. AMX-FP8 intrinsics are available via the
-mamx-fp8compiler switch. - New ISA extension support for Intel AMX-MOVRS was added. AMX-MOVRS intrinsics are available via the
-mamx-movrscompiler switch. - New ISA extension support for Intel AMX-TF32 was added. AMX-TF32 intrinsics are available via the
-mamx-tf32compiler switch. - New ISA extension support for Intel AMX-TRANSPOSE was added. AMX-TRANSPOSE intrinsics are available via the
-mamx-transposecompiler switch. - All of new feature support for Intel APX except for CFCMOV was added, including CCMP/CTEST, NF and ZU. APX support is available via the
-mapxfcompiler switch. - New ISA extension support for Intel AVX10.2 was added. AVX10.2 intrinsics are available via the
-mavx10.2compiler switch. - New ISA extension support for Intel MOVRS was added. MOVRS intrinsics are available via the
-mmovrscompiler switch. MOVRS vector intrinsics are available via the-mmovrs -mavx10.2compiler switches. - EVEX version support for Intel SM4 was added. New 512-bit SM4 intrinsics are available via the
-msm4 -mavx10.2compiler switches. - GCC now supports the Intel CPU named Diamond Rapids through
-march=diamondrapids. Based on ISA extensions enabled on Granite Rapids D, the switch further enables the AMX-AVX512, AMX-FP8, AMX-MOVRS, AMX-TF32, AMX-TRANSPOSE, APX_F, AVX10.2, AVX-IFMA, AVX-NE-CONVERT, AVX-VNNI-INT16, AVX-VNNI-INT8, CMPccXADD, MOVRS, SHA512, SM3, SM4, and USER_MSR ISA extensions. - Support for Xeon Phi CPUs (a.k.a. Knight Landing and Knight Mill) were removed in GCC 15. GCC will no longer accept
-march=knl,-march=knm,-mavx5124fmaps,-mavx5124vnniw,-mavx512er,-mavx512pf,-mprefetchwt1,-mtune=knl, and-mtune=knmcompiler switches. -mavx10.1-256,-mavx10.1-512, and-mevex512are deprecated. Meanwhile,-mavx10.1enables AVX10.1 intrinsics with 512-bit vector support, while in GCC 14.1 and GCC 14.2, it only enables 256-bit vector support. GCC will emit a warning when using these compiler switches.-mavx10.1-256,-mavx10.1-512, and-mevex512will be removed in GCC 16 together with the warning for the behavior change on-mavx10.1.- With the
-mveclibabicompiler switch GCC is able to generate vectorized calls to external libraries. GCC 15 newly supports generating vectorized math calls to the math library from AMD Optimizing CPU Libraries (AOCL LibM). This option is available through-mveclibabi=aocl. GCC still supports generating calls to AMD Core Math Library (ACML). However, that library is end-of-life and AOCL offers many more vectorized functions.
LoongArch
- Support has been added for target attributes and pragmas. For more details on available attributes and pragmas, including their proper usage, please refer to the provided documentation.
- Support has been added for the new option -mannotate-tablejump, which can create an annotation section
.discard.tablejump_annotateto correlate thejirlinstruction and the jump table. - Add CRC expander to generate faster CRC.
- Add ABI names for FPR.
NVPTX
- The standard C++ library (libstdc++) is now supported and enabled.
- GCC's nvptx target now supports constructors and destructors. For this, a recent version of nvptx-tools is required.
S/390, System z, IBM z Systems
- Support for the z17 architecture has been added. When using option
-march=z17, the compiler will generate code making use of the new instructions introduced with the vector enhancement facility 3 and the miscellaneous instruction extension facility 4. Option-mtune=z17enables z17 specific instruction scheduling without making use of new instructions. - Builtins for the new vector instructions have been added and can be enabled as before using option
-mzvector. - Option
-mlraand its counterpart-mno-lrahave been removed.
SH
- Bare metal
sh-elftargets are now using the newer soft-fp library for improved performance of floating-point emulation on CPUs without hardware floating-point support.
Operating Systems
PowerPC Darwin
- Fortran's IEEE modules are now supported on Darwin PowerPC.
Improvements to SARIF support
- GCC's SARIF output has been extended in the following ways
- GCC's SARIF output now captures all locations and labelled source ranges associated with a diagnostic, so that e.g. for
PATH/missing-semicolon.c: In function 'missing_semicolon': PATH/missing-semicolon.c:9:12: error: expected ';' before '}' token 9 | return 42 | ^ | ; 10 | } | ~GCC's SARIF output now captures the secondary location (that of the trailing close brace), as well as that of the missing semicolon.
- For every location in a diagnostic that isn't in the main source file, GCC's SARIF output now captures the chain of
#includedirectives that led to that location, usinglocationRelationshipobjects (§3.34). - SARIF message objects now capture embedded URLs in GCC diagnostics (§3.11.6). In particular, references to other events in diagnostic paths now capture URLs to the pertinent
threadFlowLocationobject for the other event, such as
"text": "second 'free' here; first 'free' was at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)"- GCC's SARIF output now captures the command-line arguments (§3.20.2), timestamps for the start and end of compilation (§§3.20.7-8), and the working directory (§3.20.19). It also now sets the
rolesproperty for SARIFartifactobjects (§3.24.6). - For warnings where encoding is significant, such as-Wbidi-chars for a "trojan source" attack GCC's SARIF output gains a
renderedproperty (§3.3.4) that escapes non-ASCII text in source snippets, such as:
"rendered": {"text":where "text" has a string value such as:
"22 | /* end admins only <U+202E> {{ <U+2066>:*/\n" " | ~~~~~~~~ ~~~~~~~~ ^\n" " | | | |\n" " | | | end of bidirectional context\n" " | | U+2066 (LEFT-TO-RIGHT ISOLATE)\n" " | U+202E (RIGHT-TO-LEFT OVERRIDE)\n"}}}},(shown here with the JSON string split into multiple lines for clarity).
- Experimental SARIF 2.2 output has been added, via-fdiagnostics-add-output=sarif:version=2.2-prerelease. Given that the SARIF 2.2 specification is still under development, this uses an unofficial draft of the specification, and is subject to change.
- The crash handler has been extended so that it will attempt to capture a backtrace of GCC's stack in JSON form within a property bag in SARIF output. The precise format of the property is subject to change
- GCC 15 adds a new
sarif-replaycommand-line tool forviewing.sariffiles. It useslibgdiagnostics to "replay" any diagnostics found in the.sariffiles in text form as if they were GCC diagnostics, with support for details such as fix-it hints, underlined ranges, and diagnostic paths.
Improvements to Static Analyzer
- GCC's logic for printing execution paths has been improved in various ways
- The problematic event in an analyzer path is now highlighted with a warning emoji (⚠️), where the locale supports this, such as in the examples below.
- Paths can show control flow using ASCII art, such as:
infinite-loop-linked-list.c: In function ‘while_loop_missing_next’: infinite-loop-linked-list.c:30:10: warning: infinite loop [CWE-835] [-Wanalyzer-infinite-loop] 30 | while (n) | ^ ‘while_loop_missing_next’: events 1-3 30 | while (n) | ^ | | | (1) ⚠️ infinite loop here | (2) when ‘n’ is non-NULL: always following ‘true’ branch... ─>─┐ | │ | │ |┌────────────────────────────────────────────────────────────────────────┘ 31 |│ { 32 |│ sum += n->val; |│ ~~~~~~ |│ | |└─────────────>(3) ...to here ‘while_loop_missing_next’: event 4 32 | sum += n->val; | ~~~~^~~~~~~~~ | | | (4) looping back... ─>─┐ | │ ‘while_loop_missing_next’: event 5 | │ |┌─────────────────────────────────┘ 30 |│ while (n) |│ ^ |│ | |└────────>(5) ...to here- Interprocedural depth markers now use unicode box-drawing characters where the locale supports this, and they are eliminated for purely intraprocedural paths, such as in the example of-Wanalyzer-infinite-loop above.
- A new-fanalyzer warning-Wanalyzer-undefined-behavior-ptrdiff warns about pointer subtractions involving different chunks of memory. For example:
demo.c: In function ‘test_invalid_calc_of_array_size’:
demo.c:9:20: warning: undefined behavior when subtracting pointers [CWE-469] [-Wanalyzer-undefined-behavior-ptrdiff]
9 | return &sentinel - arr;
| ^
events 1-2
│
│ 3 | int arr[42];
│ | ~~~
│ | |
│ | (2) underlying object for right-hand side of subtraction created here
│ 4 | int sentinel;
│ | ^~~~~~~~
│ | |
│ | (1) underlying object for left-hand side of subtraction created here
│
└──> ‘test_invalid_calc_of_array_size’: event 3
│
│ 9 | return &sentinel - arr;
│ | ^
│ | |
│ | (3) ⚠️ subtraction of pointers has undefined behavior if they do not point into the same array object
│
Other significant improvements
libgdiagnostics
GCC's code for emitting diagnostics is now available to other GPL3-compatible projects as a shared library,libgdiagnostics. This covers such features as colorization, quoting lines of source code, labelling ranges of source, fix-it hints, execution paths, SARIF output, and so on. There is a C API, along with C++ and Python bindings.
This is the list of problem reports (PRs) from GCC's bug tracking system that are known to be fixed in the 15.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 15.2
This is the list of problem reports (PRs) from GCC's bug tracking system that are known to be fixed in the 15.2 release. This list might not be complete (that is, it is possible that some PRs that have been fixed are not listed here).