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

General Improvements

New Languages and Language specific improvements

OpenMP

See theGNU Offloading and Multi-Processing Project (GOMP) page for general information.

COBOL

Ada

procedure Adjust (Obj : in out T);
procedure Finalize (Obj : in out T);
procedure Initialize (Obj : in out T);

C family

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.  */  
    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,  
          |                                ~~~~~~~~~~~~~~~^~~~~  

C

C++

Runtime Library (libstdc++)

D

Fortran

Modula-2

Rust

New Targets and Target Specific Improvements

AArch64

AMD GPU (GCN)

AVR

IA-32/x86-64

LoongArch

NVPTX

SH

Operating Systems

PowerPC Darwin

Improvements to SARIF support

Improvements to Static Analyzer

    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).