Why does AVR-GCC apparently waste 6 cycles here?
The cpi instruction can only compare against register r16 or greater...



..so because the value to be compared was in r13 ( &lt; r16), the cpi could not be use.

Still leaves the question as to why the compiler did not allocate to r24 instead of r13 in the first place an save the cycles and the push/pop sequence on r24, but maybe there are other places where r13 is used that being in the lower bank helped.