This page is a "brief" summary of some of the huge number of improvements in GCC 11. You may also want to check out our Porting to GCC 11 page and the full GCC documentation.
-std=gnu++17 instead of
    -std=gnu++14.  Note
      that C++17 changes to template
      template parameter matching can be disabled independently of other
      features with -fno-new-ttp-matching.
  -dumpbase,
      -dumpdir, -save-temps=*, and you expect
      any file other than the
      primary output file(s) to be created as a side effect, watch out
      for improvements and a few surprises.
      See the
      patch, particularly its textual description, for more
      details about the changes.-gsplit-dwarf no longer enables debug info generation
      on its own but requires a separate -g for this.--enable-cheaders=c_std
      is deprecated and will be removed in a future release. It should be
      possible to use --enable-cheaders=c_global (the default)
      with no change in behaviour. gcov tool have been renamed: -i to -j
      and -j to -H.--param tsan-distinguish-volatile to optionally emit
          instrumentation distinguishing volatile accesses.--param tsan-instrument-func-entry-exit to optionally
          control if function entries and exits should be instrumented.In previous releases of GCC, the "column numbers" emitted in diagnostics were actually a count of bytes from the start of the source line. This could be problematic, both because of:
For example, the character π ("GREEK SMALL LETTER PI (U+03C0)") occupies one column, and its UTF-8 encoding requires two bytes; the character 🙂 ("SLIGHTLY SMILING FACE (U+1F642)") occupies two columns, and its UTF-8 encoding requires four bytes.
      In GCC 11 the column numbers default to being column numbers, respecting
      multi-column characters.  The old behavior can be restored using a new
      option
      -fdiagnostics-column-unit=byte.
      There is also a new option
      -fdiagnostics-column-origin=,
      allowing the pre-existing default of the left-hand column being column
      1 to be overridden if desired (e.g. for 0-based columns).  The output
      of
      -fdiagnostics-format=json
      has been extended to supply both byte counts and column numbers for all source locations.
    
      Additionally, in previous releases of GCC, tab characters in the source
      would be emitted verbatim when quoting source code, but be prefixed
      with whitespace or line number information, leading to misalignments
      in the resulting output when compared with the actual source.  Tab
      characters are now printed as an appropriate number of spaces, using the
      -ftabstop
      option (which defaults to 8 spaces per tab stop).
    
Introduce Hardware-assisted AddressSanitizer support. This sanitizer currently only works for the AArch64 target. It helps debug address problems similarly to AddressSanitizer but is based on partial hardware assistance and provides probabilistic protection to use less RAM at run time. Hardware-assisted AddressSanitizer is not production-ready for user space, and is provided mainly for use compiling the Linux Kernel.
To use this sanitizer the command line arguments are:-fsanitize=hwaddress to instrument userspace code.-fsanitize=kernel-hwaddress to instrument kernel code.For targets that produce DWARF debugging information GCC now defaults to DWARF version 5 (with the exception of VxWorks and Darwin/Mac OS X which default to version 2 and AIX which defaults to version 4). This can produce up to 25% more compact debug information compared to earlier versions.
      To take full advantage of DWARF version 5 GCC needs to be build
      against binutils version 2.35.2 or higher.  When GCC is build
      against earlier versions of binutils GCC will still emit DWARF
      version 5 for most debuginfo data, but will generate version 4
      debug line tables (even when explicitly given -gdwarf-5).
    
The following debug information consumers can process DWARF version 5:
Programs embedding libbacktrace are urged to upgrade to the version shipping with GCC 11.
      To make GCC 11 generate an older DWARF version
      use -g together with -gdwarf-2,
      -gdwarf-3 or -gdwarf-4.
  
        int IsHTMLWhitespace(int aChar) {
          return aChar == 0x0009 || aChar == 0x000A ||
                 aChar == 0x000C || aChar == 0x000D ||
                 aChar == 0x0020;
        }
       
       This statement can be transformed into a switch statement and then expanded into a bit-test.
  -fbit-tests, enabled by default, can be used to enable or disable switch expansion using bit-tests.-fipa-modref option.
      -fipa-icf)
	  was significantly improved to increase the number of
	  unified functions and to reduce compile-time memory use.-fprofile-values,
	was improved by tracking more target values for e.g. indirect calls.
      allocate clause support in C/C++.
      The OMP_TARGET_OFFLOAD environment variable and the
      active-levels routines are now supported.
      For C/C++, the declare variant and map
      support has been extended.
      For Fortran, OpenMP 4.5 is now fully supported and OpenMP 5.0
      support has been extended, including the following features which were
      before only available in C and C++: order(concurrent),
      device_type, memorder-clauses for flush,
      lastprivate with conditional modifier,
      atomic construct and reduction clause
      extensions of OpenMP 5.0,
      if clause with simd and cancel
      modifiers, target data without map clause,
      and limited support for the requires construct.
  no_stack_protector
	attribute has been added to mark functions which should not be instrumented
            with stack protection (-fstack-protector).malloc
	  attribute has been extended so that it can be used to identify
	  allocator/deallocator API pairs.  A pair of new
	  -Wmismatched-dealloc and -Wmismatched-new-delete warnings will complain
	  about mismatched calls, and -Wfree-nonheap-object about deallocation calls with pointers not obtained from allocation
	  functions.  Additionally, the static analyzer will use these
	  attributes when checking for leaks, double-frees, use-after-frees,
	  and similar issues.
	-Wmismatched-dealloc,
	enabled by default, warns about calls to deallocation functions
	with pointers returned from mismatched allocation functions.
      -Wsizeof-array-div,
	  enabled by -Wall, warns
	  about divisions of two sizeof operators when the first one is applied
	  to an array and the divisor does not equal the size of the array
	  element.
      -Wstringop-overread,
	enabled by default, warns about calls to string functions reading
	past the end of the arrays passed to them as arguments.  In prior
	GCC releases most instances of his warning are diagnosed by
	-Wstringop-overflow.
      -Wtsan,
	enabled by default, warns about unsupported features in ThreadSanitizer
	(currently std::atomic_thread_fence).
      -Wfree-nonheap-object
	detects many more instances of calls to deallocation functions with
	pointers not returned from a dynamic memory allocation function.
      -Wmaybe-uninitialized
	diagnoses passing pointers or references to uninitialized memory
	to functions taking const-qualified arguments.
      -Wuninitialized
	detects reads from uninitialized dynamically allocated memory.
      
    For ELF targets that support the GNU or FreeBSD OSABIs, the
    used attribute will now save the symbol declaration it is
    applied to from linker garbage collection.
    
    To support this behavior, used symbols that have not
    been placed in specific sections (e.g. with the section
    attribute, or the -f{function,data}-sections options) will
    be placed in new, unique sections.
    
This functionality requires Binutils version 2.36 or later.
-std=c2x
  and -std=gnu2x.  Some of these features are also
  supported as extensions when compiling for older language versions.
  In addition to the features listed, some features previously
  supported as extensions and now added to the C standard are enabled
  by default in C2X mode and not diagnosed with -std=c2x
  -Wpedantic.
  BOOL_MAX and BOOL_WIDTH macros
    are provided in <limits.h>.true and false
    macros in <stdbool.h> have changed so that they
    have type bool.[[nodiscard]] standard attribute is now
    supported.__has_c_attribute preprocessor operator is
    now supported.INFINITY, NAN, FLT_SNAN,
    DBL_SNAN, LDBL_SNAN, DEC_INFINITY,
    DEC_NAN, and corresponding signaling NaN macros for
    _FloatN, _FloatNx
    and _DecimalN types, are provided
    in <float.h>.  There are also corresponding
    built-in functions __builtin_nansdN for
    decimal signaling NaNs.FLT_IS_IEC_60559, DBL_IS_IEC_60559
    and LDBL_IS_IEC_60559 are provided
    in <float.h>.__STDC_WANT_IEC_60559_EXT__ is supported
    by <float.h>.-Warray-parameter,
	enabled by -Wall, warns about redeclarations of functions
	with ordinary array arguments declared using inconsistent forms.
	The warning also enables the detection of the likely out of bounds
	accesses in calls to such functions with smaller arrays.
      -Wvla-parameter,
	enabled by -Wall, warns redeclarations of functions
	with variable length array arguments declared using inconsistent
	forms or with mismatched bounds.  The warning also enables
	the detection of the likely out of bounds accesses in calls to
	such functions with smaller arrays.
      -std=gnu++17.consteval virtual
	functionsusing enum-fmodules-ts and some aspects
      are incomplete.  Refer
      to C++ 20 Status
    -std=c++23, -std=gnu++23,
    -std=c++2b or -std=gnu++2b flags,
    including
    auto as a template-argumentnoexcept?reinterpret_casts in constexpr evaluation are now checked
      more completely (PR95307).static_assert has been improved: the
      compiler now shows the expression including its template arguments (if
      there were any), and can point to the failing clause if the condition
      comprised of any logical AND operators
      (PR97518).-Wctad-maybe-unsupported,
	disabled by default, warns
	  about performing class template argument deduction on a type with no
	  deduction guides.
      -Wrange-loop-construct,
	enabled by -Wall,
	  warns when a range-based for-loop is creating unnecessary and
	  expensive copies.
      -Wdeprecated-enum-enum-conversion,
	enabled by default in
	  C++20, warns about deprecated arithmetic conversions on operands of
	  enumeration types, as outlined in [depr.arith.conv.enum].
      -Wdeprecated-enum-float-conversion,
	enabled by default in
	  C++20, warns about deprecated arithmetic conversions on operands where
	  one is of enumeration type and the other is of a floating-point type,
	  as outlined in [depr.arith.conv.enum].
      -Wmismatched-new-delete,
	enabled by -Wall, warns about calls to C++
	operator delete with pointers returned from mismatched
	forms of operator new or from other mismatched allocation
	functions.
      -Wvexing-parse,
	enabled by default, warns about the most
	  vexing parse rule: the cases when a declaration looks like a variable
	  definition, but the C++ language requires it to be interpreted as a
	  function declaration.
      -Wnonnull
	considers the implicit this argument of every C++
	nonstatic member function to have been implicitly declared with
	attribute nonnull and triggers warnings for calls where
	the pointer is null.
      std::from_chars and std::to_chars
        for floating-point types.<chrono>.
        Thanks to Cassio Neri for optimizations.
      std::bit_caststd::source_location<barrier>, <latch>,
        and <semaphore><syncstream>basic_stringbuf's buffer.contains member functions for strings,
        thanks to Paul Fee.
      std::to_underlying, std::is_scoped_enumsimd)
    from the Parallelism 2 TS, thanks to Matthias Kretz.
  std::uniform_int_distribution,
      thanks to Daniel Lemire.
  DEPRECATED to !GCC$'s
      attributes directive.
  gcc_jit_global_set_initializer
      asm in the C front end-mcpu and -mtune options in both
  the arm and aarch64 backends (GCC identifiers in parentheses):
    cortex-a78).cortex-a78ae).cortex-a78c).cortex-x1).neoverse-v1).neoverse-n2).a64fx).cortex-r82).-march=armv8-r option.-mharden-sls= option.  Please refer to the
  documentation for usage instructions.arm_neon.h header is improved and GCC 11 supports the full
  set of intrinsics defined by ACLE Q3 2020.gfx908 GPUs has been added.-mcpu=cortex-m55 option now supports the extensions
  +nomve and +nomve.fp to control generation of
  MVE and MVE floating-point instructions.-mtsxldtrk
      compiler switch.
  -mserialize
      compiler switch.
  -mhreset
      compiler switch.
  -muintr
      compiler switch.
  -mkeylocker
      compiler switch.
  -mamx-tile, -mamx-int8, -mamx-bf16 compiler
      switches.
  -mavxvnni
      compiler switch.
  -march=sapphirerapids.
    The switch enables the MOVDIRI, MOVDIR64B, AVX512VP2INTERSECT, ENQCMD,
    CLDEMOTE, SERIALIZE, PTWRITE, WAITPKG, TSXLDTRK, AMT-TILE, AMX-INT8,
    AMX-BF16, and AVX-VNNI ISA extensions.
  -march=alderlake.
    The switch enables the CLDEMOTE, PTWRITE, WAITPKG, SERIALIZE, KEYLOCKER,
    AVX-VNNI, and HRESET ISA extensions.
  -march=rocketlake.
    Rocket Lake is based on Icelake client and minus SGX.
  znver3 core
    via -march=znver3.
  -march=x86-64-v2, -march=x86-64-v3 and
    -march=x86-64-v4.
  -mcustom-insn=N no longer produce compiler
      warnings if the custom instruction is not generated due to missing
      optimization options such as -fno-math-errno,
      -ffinite-math-only, or
      -funsafe-math-optimizations.  These warnings were not
      consistently emitted for all custom instructions.
  -mcustom-fpu-cfg=fph2 option has been added to enable
      the custom instructions supported by the Nios II Floating Point
      Hardware 2 Component.
  -misa default has changed from sm_30
      to sm_35.
  -m32 compiler switch has been removed.
  -msoft-stack-reserve-local format has been fixed.
      Previously, it accepted -msoft-stack-reserve-local<n>.
      It now accepts -msoft-stack-reserve-local=<n>.
  -fexcess-precision=standard
      (e.g., implied by -std=c99) on s390(x) targets can now be
      controlled at configure time with the flag
      --enable-s390-excess-float-precision. When enabled, GCC will
      maintain previous behavior and evaluate float expressions in double
      precision, which aligns with the definition of float_t as
      double. With the flag disabled, GCC will always evaluate
      float expressions in single precision. In native builds and cross compiles
      that have target libc headers, GCC will by default match the definition of
      float_t in the installed glibc.
  __riscv_atomic,
       are deprecated, but it will still supported for at least 2 release cycles.
  riscv*-*-linux*.--with-multilib-generator to configure time option,
      this option could flexible config multi-lib settings, syntax is same as
      RISC-V's multilib-generator.
  multilib-generator, support expansion
      operator * to reduce the complexity of complicated multi-lib
      re-use rule.
  -mcpu=* option, the behavior is aligned to RISC-V
      clang/LLVM, it will set pipeline model and architecture extension, like
      -mtune=* plus -march=*.
  __builtin_thread_pointer for RISC-V.shorten_memrefs optimization, which could reduce the
      code size for memory access, thanks to Craig Blackmore.
  malloc and free.
    malloc/free checking will also
	check new/delete
	and new[]/delete[].
	However, C++ is not yet properly supported by
	-fanalyzer
	(for example, exception-handling is unimplemented).
      malloc
	attribute has been extended so that it can be used to identify
	allocator/deallocator API pairs.  The analyzer will use these
	attributes when checking for leaks, double-frees, use-after-frees, and
	similar issues.
      -Wanalyzer-mismatching-deallocation
	warning has been added, covering such mismatches as using
	scalar delete rather vector delete[].
    -Wanalyzer-shift-count-negative,
    -Wanalyzer-shift-count-overflow,
    -Wanalyzer-write-to-const, and
    -Wanalyzer-write-to-string-literal,
    all enabled by default when
    -fanalyzer
    is enabled.
  -fdump-analyzer-json and
    -fno-analyzer-feasibility.
  GCC_EXTRA_DIAGNOSTIC_OUTPUT
    which can be used by IDEs to request machine-readable fix-it hints
    without needing to adjust build flags.
  This is the list of problem reports (PRs) from GCC's bug tracking system that are known to be fixed in the 11.1 release. This list might not be complete (that is, it is possible that some PRs that have been fixed are not listed here).