Paul Krill
Editor at Large

GCC GNU compiler adds C++ 17 support

news
May 3, 20172 mins

GCC 7x release series brings diagnostics enhancements and improved compilation and runtime performance

gnu computer cartoon
Credit: B-lenos

With the 7.1 version of the GCC (GNU Compiler Collection), released this week, the platform gets early support for the C++ 17 standard and diagnostics enhancements.

Version 7.1 has a C++ front end with experimental support for all of the the C++ 17 draft specification. The -std=c++1z and -std=gnu++1z options and the libstdc++ are supported, and the library has most C++17 draft library features implemented. The earlier GCC 6.1 release abided by the C++ 14 standard.

The GCC 7 series differs from previous releases by using LRA (Local Register Allocator) by default for new targets and deprecating Cilk+ extensions to the C and C++ languages. Also, some behaviors have been relaxed in order to improve compilation or runtime performance. However, some changes could “cause grief” when porting to GCC 7, according to release notes, which cite preprocessor and C issues, as well as C++ language issues, such as stricter rules for templates. “GCC 7 no longer accepts various ill-formed constructs involving the use of templates,” the notes say.

GCC 7.1 also boosts emitted diagnostics, including improved locations, and optimizer improvements appear in all of intra- and interprocedural optimizations, link time optimizations, and various target back ends, such as additions of store merging pass, code-hoisting optimization, loop splitting, and shrink-wrapping improvements. Additionally, GCC’s address sanitizer now can report uses of variables after they leave their scope. GCC can be configured for the OpenMP API offloading to Nvidia PTX GPGPUs, but some code that compiled with older GCC versions might need adjustments. The collection includes front ends for C, C++, Objective-C, Fortran, Ada, and Go.

Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author