[patch] fix address_cost for x86

Rask Ingemann Lambertsen rask@sygehus.dk
Fri Jul 6 16:33:00 GMT 2007


On Thu, Jul 05, 2007 at 08:36:26AM +0200, Uros Bizjak wrote:
> On 7/5/07, Zdenek Dvorak <rakdver@kam.mff.cuni.cz> wrote:
> 
> >it fixes PR 24669, but not PRs 18219 and 26726.  The problem is
> >that both using and not using the offset has the same cost with the
> >change, and ivopts just select between them arbitrarily; which
> >happens to be the offsetted mode for these two PRs.  Anyway, this should
> >be easy to fix in ivopts.
> 
> It would be nice if this issue got fixed somehow. All costs being
> equal, IMO ivopts should prefer less complex addressing mode, as it
> implies smaller instructions. This is especially important for -Os,
> but I guess that it won't hurt even in -O2 case.

   Why should ivopts have such target specific knowledge? Why can't you fix
ix86_address_cost() to return a smaller cost for the most preferred form of
the address? In particular with optimize_size, of course the blame is on
ix86_address_cost() for returning the same cost for disp(%reg) and (%reg).

-- 
Rask Ingemann Lambertsen



More information about the Gcc-patches mailing list