On 18/03/2011 11:15, Paulo J. Matos wrote:
On 18/03/11 10:08, WANG.Jiong wrote:
This may related with subreg regmove finding
Suggest specifiy -fdump-rtl-regmove to see what happen after this pass
Maybe avr need a target dependent regmove pass to handle this


It doesn't look like it's regmove, whose result looks pretty sane:

As far as I can see, you are correct - avr-gcc generates subobtimal code here, and your version is better.

There are only a few people who work with the AVR backend, and while these people are both clever and dedicated, they are limited in how much they can do - correct code generation and support for newer devices or features rightly takes priority over optimisation issues. Thus there are a fair number of "missed optimisation" issues filed for the AVR backend, and many more cases like this of suboptimal code that don't even have issues filed.

There are also a number of patches that are generally applied to avr-gcc builds (most of which eventually make it into the main FSF tree). I could not say if any of these are relevant here.

If you are digging through the AVR backend and find ways to improve code sequences like this, the avr-gcc community would be very grateful.

There is an avr-gcc mailing list at <http://lists.nongnu.org/mailman/listinfo/avr-gcc-list>, which may be of interest to you.

Reply via email to