Advertisement

Optimizing Code with GCC

  • Kurt Wall
  • William Von Hagen

Abstract

These days, compilers are pretty smart. They can perform all sorts of code transformations, from simple inlining to sophisticated register analysis, that make compiled code run faster. In most situations, faster is better than smaller, because disk space is ridiculously cheap. However, on the embedded systems with which we routinely work, small is often at least as important as fast, because the systems on which we work sometimes have extreme memory constraints and no disk space. This chapter describes GCC’s code optimization capabilities. By this point in the book, you have a pretty good grasp of how to compile your code and how to make GCC do what you want it to. The next step, accordingly, is to make your code faster or smaller. If your luck holds out, you might even be able to make your next program faster and smaller. After a quick, high-level overview of compiler optimization theory you will look at GCC’s command-line options for code optimization. First, you will look at GCC’s general, architecture-independent optimizations. Then, you will learn about the architecture-specific optimizations.

Keywords

Basic Block Optimize Code Code Size Memory Footprint Code Transformation 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Copyright information

© Kurt Wall and William von Hagen 2004

Authors and Affiliations

  • Kurt Wall
  • William Von Hagen

There are no affiliations available

Personalised recommendations