About optimizations that are performed when compiling C programs to machine code, and how programmers can perform optimizations by hand or cooperate with a compiler that performs optimizations.
- Overview what an optimizing compiler does and how a programmer can cooperate with an optimizer.
- Optimizations that can be performed by a compiler or a programmer and that are nearly always worthwhile.
- When a compiler will assume nothing about a function and when it can take advantage of a function’s implementation in callers.
- How the possibility of aliased pointers can interfere with optimization and what to do about it.
- A curious case of optimization with gcc -O2 and strlen.
- An extended example of performing optimizations by hand. You can run the code yourself.