------- Additional Comments From hubicka at gcc dot gnu dot org 2005-09-28 16:52 ------- The actual problem here is that from combine's point of view the two alternatives (lea preceeded by loads, or add with memory operand followed by shift) looks equivalent and previously the shorter sequence was purely choosed by luck because combine followed the right edge first. It is not quite possible to solve this by combine's splitting mechanizm as the number of instruction don't change before the read-modify instructions are broken up.
While it might be probably possible to design peephole or combiner insn patter I am tempted to close this and PR 23303 as WONTFIX as it seems to me we was optimizing this by pure luck and the patch seems to have overall positive effect on code size... Honza -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23302