http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50256
Georg-Johann Lay <gjl at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Target|atmel avr |avr CC| |gjl at gcc dot gnu.org --- Comment #3 from Georg-Johann Lay <gjl at gcc dot gnu.org> 2011-09-03 12:34:49 UTC --- Supported versions of GCC are 4.4 upward at the moment. Your C-code does not show a call to MulU3U3S3 and the constants 167772 resp. 100000 occur nowhere. Please follow http://gcc.gnu.org/bugs/#need when reporting bugs. Thanks. Notice that early clobber forces moves. Moreover, some value is passed in r20 but you clobber that register so that register must be freed i.e. that forces a move, too. Maybe you want your function static inline. Also notice that if you have MUL, you always have MOVW. You don't need to save/restore __tmp_reg__. You don't need to save __zero_reg__. It is sufficient to CLR __zero_reg__ after you are done. Last not least, you arithmetic apprears to be wrong because you add at most 3 bytes and lose the carries above.