http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56590
Bug #: 56590 Summary: Replace auto-inc-dec pass with generic address mode selection pass Classification: Unclassified Product: gcc Version: 4.8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: rtl-optimization AssignedTo: unassig...@gcc.gnu.org ReportedBy: olege...@gcc.gnu.org Target: sh*-*-* At least on SH there are several address mode selection issues which I'd like to group in this PR. PR 54065 [SH] Prefer @(R0,Rn) addressing for floating-point load/store PR 53911 [SH] Improve displacement addressing PR 50749 Auto-inc-dec does not find subsequent contiguous mem accesses PR 39423 [4.6/4.7/4.8 Regression] [SH] performance regression: lost mov @(disp,Rn) PR 52049 SH Target: Inefficient constant address access Based on my observations so far, I think the right thing to do is to replace the current auto-inc-dec pass with a pass that optimizes address mode selection in a more generic way, instead of just trying to find auto inc/dec opportunities. The basic idea is to look at all memory accesses in a function (or basic block as a start) that share a base address and then try to select the cheapest addressing modes for each memory access. The current address cost target hook can be used to determine the costs of a memory access with a particular address. I have already started working on such a replacement pass a while ago and would like to first do a trial with the SH target. Other targets might then also pick it up if it seems beneficial to do so.