https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113533
--- Comment #9 from Oleg Endo <olegendo at gcc dot gnu.org> --- (In reply to Roger Sayle from comment #8) > Created attachment 57190 [details] > proposed patch > > Proposed patch to provide a sane/saner set of rtx_costs for SH. There's > plenty more that could be done, but these changes are (more than) sufficient > to resolve the code quality regression caused by improved fwprop. If > someone could try this out on SH, and report back the results, that would be > great. You've added differentiation for 'speed ?' in 'sh_address_cost'. Like this one. /* 'GBR + 0'. Account one more because of R0 restriction. */ if (REG_P (x) && REGNO (x) == GBR_REG) - return 2; + return speed ? 2 : 0; What's the intention here? Why does the cost of the address computation reduced when not optimizing for speed? It distorts the address costs and makes them all equal.