David Malcolm

David Malcolm's contributions

GNU C library
Article

Testing... Testing... GCC

David Malcolm

The next release of the GNU Compiler Collection, GCC 7, is fast approaching, so in this post, I'm going to talk about work I've done to make GCC more reliable GCC has a large test suite: when I test a patch, roughly 330,000 tests are run, covering various aspects of the compiler, such as: handling valid and invalid syntax in the front-ends verifying that optimizations passes are run verifying that the resulting code runs correctly verifying that the debugger can...

Article Thumbnail
Article

GCC 6: -Wmisleading-indentation vs "goto fail;"

David Malcolm

I work at Red Hat on GCC, the GNU Compiler Collection. The next major release of GCC, GCC 6, is just around the corner, so I thought I'd post about a new compiler warning I've contributed to it: -Wmisleading-indentation. One of the more common "gotchas" in C and C++ programming relates to missing braces. For example, in the following: if (some_condition ()) do_foo (); do_bar (); the "do_bar ();" looks like it's guarded by the conditional, but it's actually outside...

Article Thumbnail
Article

JIT-compilation using GCC 5

David Malcolm

In an earlier post, I talked about GCC (the GNU Compiler Collection), and work that I did to make the internals of GCC more robust for GCC 5. This post is about something more user-visible: as of GCC 5, GCC's code-generation backend can now be built as a shared library. When might you want to generate machine code? The primary reason is for speed: anything that parses an input format and repeatedly acts on it, such as language interpreter, or...

Article Thumbnail
Article

Improving GCC’s internals

David Malcolm

If you've done any C or C++ development on Fedora or Red Hat Enterprise Linux (RHEL), you'll have used GCC, the GNU Compiler Collection. Red Hat has long been a leading contributor to GCC, and this continues as we work with others in the "upstream" GCC community on the next major release: GCC 5. In this post I'll talk about some of the deep architectural changes I've been making to GCC. You won't directly see these changes unless you look...