I've been writing an application for AVR microcontrollers. I intended to burn it on ATtiny13A (because it's cheap, and I wouldn't use complex functions anyway), but at that time I had only ATmega328P available, so I used it to develop code. Knowing that flash size of ATtiny13A is only 1kB, I spent quite a lot of time optimizing code for size, making it 910B. Today, my ATtiny13A's arrived. However, when I recompiled code for this hardware, the code took just 772B - a 15% of difference! If I knew this before, I would wait with those optimizations. I don't use any advanced library functions - the only files included are:
util/delay.h. Thus, I wonder what caused the size difference - were those some additional assumptions the compiler could use knowing the target platform? If yes, what were they? Or maybe the included files themselves contain some boilerplate code varying betweeen platforms?
Note: I'm using avr-gcc 4.8.1.