------- Comment #1 from hutchinsonandy at aim dot com 2008-03-09 04:35 ------- I can confirms this regression.
There appears to be something strange in commutation of operands before RTL is created which may well explain why it used to work. BThe default expander are creating calls to commutative functions that have the opposite argument order from normal function parameters. Functionally this does not matter, but it twists up the data flow. The argument order presented by the RTL is backwards from the ideal. This happens with both target AVR expander and the default expander (the original PR was using a default expander). Clearly this is avoidable. It is not a function of the original code - gcc is purposely ordering the operands. Regardless of operand ordering (x*y or y*x), the RTL is always backwards. The other factor is the lack of forward propagation in the RTL stages. If this was effective, RTL ordering would not matter. The limited propagation that is present avoids hard registers - so never connects the arguments with the library function. Also combine can't exploit the commutation of the operands. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35507