On Fri, 2012-06-08 at 22:33 -0400, Hans-Peter Nilsson wrote: > On Tue, 5 Jun 2012, Sandra Loosemore wrote: > > > (1) While the address cost computation is assuming in some situations > > that pre/post increment/decrement addressing will be used if > > supported by the target, it isn't actually using the target's address > > cost for such forms -- instead, just the cost of the form that would > > be used if autoinc weren't available/applicable. > > There are lots of bugzilla entries complaining about bad > autoinc/dec generation. Maybe your patch solves some of them? >
I've tried some of the cases mentioned in http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50749 with Sandra's patch applied. Unfortunately it didn't help much. There seem to be other things going wrong with auto-inc-dec. BTW, auto-inc-dec uses 'set_src_cost' in 'attempt_change' to determine the address costs. At least the SH target will not respond to that properly. I was thinking of adding something to sh_rtx_costs to invoke sh_address_cost as a fix for that, but on the other hand I was wondering why the target's address cost function isn't used in auto-inc-dec directly ... Cheers, Oleg