GCC 11.1 Is Released

From LinuxReviews
Jump to navigationJump to search
Black-and-white-gnu-head.png

GCC 11.1 has made std=gnu++17 the default C++ language and DWARF 5 the default debugging format for targets that produce DWARF debugging information. There is also very experimental C++23 support, C2X enhancements and a whole lot more.

written by 윤채경 (Yoon Chae-kyung)  2021-04-28 - last edited 2021-06-01. © CC BY

Gcc-compiling-hello-world.jpg
GCC compiling a simple "hello world" program.

The GNU Compiler Collection 11.1 release is not, as the version number would imply, a bug-fix release for GCC 11. There was no GCC 11.0, there never are any .0 GCC releases. GCC 11.1 is the first major release in the GCC 11 series.

The biggest change since GCC 10 is that -std=gnu++17, instead of -std=gnu++14, is now the default C++ language. That's just one of many changes to the GNU Compiler Collection's C++ compiler. This release adds several new C++20 features like array size deduction in new-expressions and pseudo-destructors end object lifetimes. The C++ Standards Support in GCC has an overview of what parts of the C++20 standard, published in 2020 as the name implies, are implemented in GCC 11.1.

GCC 11.1 introduces two new warnings that are enabled if C++20 is used: -Wdeprecated-enum-enum-conversion and -Wdeprecated-enum-float-conversion. First first warns about deprecated arithmetic conversions on operands of enumeration types, and the latter warns about deprecated arithmetic conversions on operands where one is of enumeration type and the other is of a floating-point type.

GCC 11.1 also adds some initial support for the upcoming C++23 standard. That standard is still a draft, so it is way too early to actually use any of the C++23 features.

The libstdc++ configure option --enable-cheaders=c_std is now deprecated and scheduled for removal in a future release. Developers should use --enable-cheaders=c_global instead.

Hardware-Assisted AddressSanitizer[edit]

GCC 11.1 introduces hardware-assisted AddressSanitizer support. It is currently only available for AArch64 targets. It works similar to the AddressSanitizer. The release notes note that:

" Hardware-assisted AddressSanitizer is not production-ready for user space, and is provided mainly for use compiling the Linux Kernel."

DWARF 5[edit]

GCC 11.1 defaults to the DWARF 5 debugging format on targets with support for it (most except Darwin/macOS X, VxWorks and AIX). The advantage is a up to 25% reduction in the size the debugging information takes up. DWARF 5 has been supported since GDB 8.0, valgrind 3.17.0, elfutils 0.172 and dwz 0.14 GDB 10.2 was released just a few days ago, GDB 8 has been around since September 2017.

OpenMP Enhancements[edit]

OpenMP is a open API for shared memory multiprocessing (CPU+GPU, or CPU+hardware accelerators) programs in C, C++ and Fortran. GCC 11.1 fully supports OpenMP 4.5 in the Fortran programming language, and several new features have been added that bring it closer to full OpenMP 5.0 support.

RISC-V[edit]

The list of new RISC-V features for in the GCC 11.1 release announcement is rather long. Support for __builtin_thread_pointer, a new shorten_memrefs optimization, big-endian support and an address sanitizer are the highlights.

Other Highlights[edit]

GCC 11.1 has "initial support" for the Radeon Instinct MI100 Accelerator (gfx908). LLVM has supported it for quite a while, so it is about time GCC caught up. There are also new attributes, warnings and enhancements to the C family support, seven new ISA extensions for x86-64, support for the Intel Alderlake and Sapphire Rapids CPUs (-march=sapphirerapids and -march=alderlake) and quite a lot more.

We have barely scratched the surface and we highly recommend reading the rather long GCC 11 Release Series Changes, New Features, and Fixes page to learn more. You may also want to take a long hard look at Porting to GCC 11 if you have written programs that are typically compiled with GCC because there are some changes you may want to be aware of. You may, for example, need to explicitly declare <limits>, memory, utility and thread when you compile with GCC 11.1.

The source code for GCC 11.1 can be acquired from sourceware.org/pub/gcc/releases/gcc-11.1.0/ and a long list of worldwide mirrors listed at gcc.gnu.org/mirrors.html.

The GCC mailing list, which is currently full of drama light discussions about principles, censorship and other topics of that nature, can be enjoyed at gcc.gnu.org/pipermail/gcc/.

0.00
(0 votes)


avatar

Gnu4ever

32 months ago
Score 0++
c++ is such a lousy language
avatar

Anonymous (43d6fc45b7)

30 months ago
Score 0
haha. I totally agree :p but it still has little to do with actual releases. try D!
Add your comment
LinuxReviews welcomes all comments. If you do not want to be anonymous, register or log in. It is free.