This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] fix address_cost for x86
- From: Zdenek Dvorak <rakdver at kam dot mff dot cuni dot cz>
- To: Uros Bizjak <ubizjak at gmail dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 5 Jul 2007 00:49:18 +0200
- Subject: Re: [patch] fix address_cost for x86
- References: <5787cf470707040518t3adb7cbal68d1cee591b02998@mail.gmail.com>
Hello,
> >ix86_address_cost considers offsetted addressing modes cheaper than
> >the modes without offset. Ivopts thus try to introduce offsets to
> >addresses
> >whenever it is possible, even in cases it does not give any gain.
> >This may result in larger code, or losing debug information (PR 32445).
>
> > * config/i386/i386.c (ix86_address_cost): Do not consider more
> > complex
> > addressing modes cheaper.
>
>
> Does this patch also fix PR 24669 and two PRs that it blocks?
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.
> BTW: Some time ago, I have played with address_cost on x86 (trying to
> fix PR 24669), but by changing the costs there, access to symbols
> regressed badly - gcc didn't produce [ref + offset] addressing, but
> ony reg = ref + offset; [reg] indirect sequences. Have you checked
> this issue with your patch?
I do not see this happen (i.e., [ref + offset] addresses seem to be
produced as expected). Do you have some concrete example that used
to cause problems?
Zdenek