------- Additional Comments From roger at eyesopen dot com 2005-01-24 02:53 ------- The function avr_rtx_costs needs fixing. For a start, it doesn't even use COSTS_N_INSNS, indeed COSTS_N_INSNS isn't used anywhere in the AVR backend.
I'm only mildly surprised at the code sequence we generate, it looks like the avr backend reports the costs of shifts and multiplications as free, but the code of additions as GET_MODE_SIZE (mode). i.e. SImode additions are COSTS_N_INSNS(1), but it can perform four QImode additions in a single cycle. And I don't think I even have to mention that avr_rtx_costs ignores optimize_size. Many of the middle-end improvements to make better use of rtx_costs should benefit AVR, for example, where the cost of a shift is dependent upon the number of bits by which the operand is being shifted, and where the cost of almost all operations is highly dependent upon the machine mode. But to summarise, this is a target bug. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19597