|
|
Subscribe / Log in / New account

Development

Looking forward to GCC 7

By Jonathan Corbet
April 5, 2017
The GNU Compiler Collection (GCC) project produces a major release on an approximately annual schedule, often in April. The next major release, GCC 7, is currently in stage 4, otherwise known as "regression and documentation mode". As of mid-March, the project was still hoping for a mid-April release date. Whether that date holds or slips, the set of GCC 7 features is well known at this point. What follows is a shameless cribbing of the high points from the GCC 7 changes document.

Compilers live or die by their optimizers, so it is unsurprising that GCC has, as usual, seen some optimization work. Some of these, like the new store merging feature ("merges constant stores to adjacent memory locations into fewer, wider, stores") are the sort of thing that can strike fear into kernel developers but should yield better performance in general. A new code-hoisting option reorganizes functions by finding the code that will be executed in all paths through the function and moving it to the beginning, yielding both size and speed improvements. Another optimization, called "loop splitting", kicks in if a loop contains a conditional test where the condition itself will not change while the loop executes. The compiler may split it into two separate loops, one for each case, moving the test and the jump out of the loop body.

The AddressSanitizer mechanism is now able to detect uses of variables after they go out of scope. Usually this problem results from taking a pointer to a variable, then dereferencing the pointer after exiting the block where that variable was in scope. LLVM has had this ability for a while, but the GCC implementation is claimed to be better by virtue of better handling of complex cases involving goto, as well as the ability to handle C++ temporaries.

Warnings are one area where GCC is said to fall short of LLVM, so one would expect improvements in that area. The C compiler, in particular, has a number of new warnings. For example, -Wimplicit-fallthrough will warn about switch-statement cases that fall through into the following case. This warning can be suppressed with a special attribute declaration — or a comment like "/* falls through */". There are warnings for if-else constructs with identical code in both branches, memset() calls where the size argument matches the number of elements in the array but not the size of the array, use of the (removed in C++17) register keyword, and more.

While GCC 6 was able to perform a certain amount of spell-checking on structure field names, GCC 7 expands that feature to function, macro, type, and enum names, and is now able to offer suggestions on how to fix the problem. There is an option to get those suggestions in machine-parsable form, enabling a suitably intelligent development environment to make fixes automatically. Format-string warnings now highlight the specific part of the string that is being complained about and offer fixes as well.

There are some additional warnings for situations that could create buffer overflows, including one for code that passes a huge size to a memory-allocation function. The compiler can now calculate the size of the output string in many sprintf() calls and warn if that destination array might be overrun. Similarly, possible truncation in snprintf() calls will generate a warning. A number of possible overflows in memcpy() and strcpy() calls can be detected at compile time as well.

The C++ compiler now has experimental support for the entire C++17 draft standard; a long list of new language features was added to achieve that support. Fortran has better DO-loop optimization and partial OpenMP 4.5 support. Ada code can now run without the need for an executable stack — a somewhat overdue security improvement. There is Go 1.8 support. On the other hand, the Java front end has been removed because there was nobody to maintain it.

Support for the Fuchsia operating system has been added in GCC 7.

Finally, there is now an internal unit-testing API for GCC, and a beginning suite of tests has been added. Parsing of internal-representation dumps has been added, allowing the creation of tests for specific optimization techniques. And, of course, this release will include the usual collection of bug fixes and smaller improvements.

LLVM may be the cool kid on the compiler block at the moment, but the GCC developers are not sitting still. GCC 7 will be another full-featured release from this project, which saw the 30th anniversary of the first beta release in March. Few projects have been so important to our community for so long, and GCC clearly is not done yet.

Comments (23 posted)

Brief items

Development quotes of the week

With Vim as a sort of secondary editor, I want to be able to fire it up unconfigured and continue to be nearly as productive. A pile of remappings would prohibit this. In my mind this is like a form of emergency preparedness. Other people stock up food and supplies. I’m preparing myself to sit at a strange machine without any of my configuration so that I can start the rewrite of the software lost in the disaster, so long as that machine has vi, cc, and make. If I can’t code in C, then what’s the point in surviving anyway?
Chris Wellons

It doesn't matter how it happens, though, so long as gets started somehow. Open Source has completely changed the IT industry, and has grown beyond the point where it should need to survive off proprietary hardware leftovers. It's been enormously costly to be caught up in the churn, and an opportunity to escape has arrived at the same time that it's becoming impossible to have fully open source drivers for new devices. We can, and need, to stand on our own two (electronic) feet.
Heath Johns

The Illuminati doesn't run the world. C programmers do.
Daniel Angel Muñoz Trejo (Thanks to Paul Wise)

Open source is an antidote to the poisoning idea that what one needs to do is invent some "killer" application so that you can become a multi-billionaire.
Greg Pittman

Comments (none posted)

The Linux Foundation picks up FRRouting

The Linux Foundation has announced that the FRRouting project has come under the LF umbrella. "FRRouting (FRR) is an IP routing protocol suite for Unix and Linux platforms which includes protocol daemons for BGP, IS-IS, LDP, OSPF, PIM, and RIP, and the community is working to make this the best routing protocol stack available. FRR is rooted in the Quagga project and includes the fundamentals that made Quagga so popular as well as a ton of recent enhancements that greatly improve on that foundation." It is a fork of Quagga that originally went under the name "Cumulus private Quagga".

Comments (33 posted)

OpenShot 2.3 released

Version 2.3 of the OpenShot video editor has been released. "This is one of the biggest updates ever to OpenShot, and is filled with new features, performance improvements, and tons of bug fixes". This release adds a new transform tool, better zooming, better title editing, and more; the razor tool has also made a comeback.

Comments (3 posted)

Announcing the PostgreSQL STIG

Crunchy Data has announced the availability of a "security technical implementation guide" for the PostgreSQL database management system. "While the STIG was authored for the benefit of the U.S. Government, the DISA PostgreSQL STIG offers security-conscious enterprises a comprehensive guide for the configuration and operation of open source PostgreSQL. Enterprises can refer to the STIG as for guidance on PostgreSQL security best practices they consider open source PostgreSQL as an alternative to proprietary, closed source, database software."

Comments (2 posted)

Newsletters and articles

Development newsletters

Comments (none posted)

Kdenlive status update

Kdenlive is a video editing tool. This status report covers what the project has been working on and where they need more help. "Since the beginning of the year, we have been working on a big refactoring/rewrite of some of the core parts of Kdenlive. Being more than 10 years old, some parts of our code had become messy and impossible to maintain. Not to mention the difficulty in adding new features. Part of the process involves improving the architecture of the code, adding some tests, and switching the timeline code from QGraphicsView to the more recent QML framework. This should hopefuly improve stability, allow further developments and also more flexibility in the display and user interaction of the timeline."

Comments (none posted)

Page editor: Rebecca Sobol
Next page: Announcements>>


Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds