avr-gcc 4.0 (20050116) replaces multiplication by a constant to a combination of more simple operations. Thus it does not pay attention to efficiency of such replacement. For example: int foo (int x) { return 24011 * x; } produce 49 words (-mmcu=atmega8 -Os). Older GCC branches -- only 11 words in this case.
-- Summary: avr-gcc 4.0, multiplication by constant, very long code Product: gcc Version: 4.0.0 Status: UNCONFIRMED Severity: normal Priority: P2 Component: rtl-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: dmixm at marine dot febras dot ru CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19597