What would be interesting is to see what GCC *doesn't* optimise, and why.
printf ("This is a static string with no percent signs\n");
... is optimised to use puts() instead.
printf ("This string shows a runtime value: %d\n", x);
... has no optimisation available.
#define X 42
printf ("This string has a compile time constant: %d\n", X);
... is also NOT optimised into the puts(), even though it could be.
It used to be the case that hand-optimisation was always necessary. Nowadays, the compiler is frequently *really* clever at optimising, but sometimes it misses "obvious" things like the one above. So it can be quite tricky to avoid writing needlessly obfuscated code (where the compiler can spot the trick), without missing out on performance.