http://arxiv.org/pdf/1403.6997
C++ templates can cause some exceedingly inefficient code, with much duplication. Refcounting is one such example: you have foo::grab, bar::grab, and so on for every single refcounted type, compiled as a separate function. The code of each function is the same - increment an int. Likewise, many constructors and destructors are identical in code.
This is some new work, should be in gcc 4.10, that can remove duplicate functions. It was tested on Firefox: 5.41% smaller binary.