------- Comment #38 from sandra at codesourcery dot com 2010-07-21 16:08 ------- On reading the code again, I think the -7 is coming from the can_autoinc case in determine_use_iv_cost_address. I also think it is correct to prefer autoinc. E.g., here's the generated code for the loop in r161843:
.L2: addi 11,8,9216 ldx 0,10,9 stdx 0,11,9 addi 9,9,8 bdnz .L2 and in r161844: .L2: ldu 0,8(11) stdu 0,8(9) bdnz .L2 I'm no expert on powerpc architecture, but 3 instructions versus 5 looks like a win to me. Bit-rotten test case? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29256