Eric Botcazou wrote: >> When in different files, no inline is done (this is good) >> When in the same file, inline is done up to 5 times (weird and bad for >> code size) >> > > What happens if you pass -fwhole-program alongside -flto at link time? > > Well, now that depends on the GCC version too. I always pass -fwhole-program along with -flto. I do compile and link in a single GCC call. With 4.6.0 (I had this because of the patch you added to the mainline to remove the cast in the callee): - when main and f1 in the same file: f1 was inlined the 5 times (288 bytes) - when main and f1 in separate files: f1 was not inlined (240 bytes) With 4.5.1 - when main and f1 in the same file: f1 was inlined the 5 times (360 bytes) - when main and f1 in separate files: f1 was inlined the 5 times (360 bytes)