This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Serious performance regression -- some tree optimizer questions
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Ulrich Weigand <Ulrich dot Weigand at de dot ibm dot com>
- Cc: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>, Zdenek Dvorak <dvorakz at suse dot de>, gcc at gcc dot gnu dot org, Michael Matz <matz at suse dot de>
- Date: Wed, 29 Dec 2004 16:00:15 +0100
- Subject: Re: Serious performance regression -- some tree optimizer questions
- References: <20041227013815.GA3289@atrey.karlin.mff.cuni.cz> <OF310432D7.DA8A69F1-ON41256F79.00503BE7-41256F79.0051125D@de.ibm.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Wed, Dec 29, 2004 at 03:45:31PM +0100, Ulrich Weigand wrote:
> The reason why I still need that param appears to be that
> ivopts does not recognize that an IV like &A[i] is related
> to a use like &A[i+1]. It appears that add_address_candidates
> would be supposed to handle this, but it doesn't -- it only
> sees though array references with a constant offset, not those
> with an offset that itself has a variable and a constant part.
>
> I've tried to add code recognizing that case there, but then
> the candidates still aren't chosen because they get assigned
> very high cost; this is because fold-const is unable to
> determine that &A[i+1] - &A[i] is a constant ...
It is not always constant.
Consider say unsigned int i; on LP64 target and
char A[(long) UINT_MAX + 1];
&A[i+1] - &A[i] is (ptrdiff_t) 1 unless i == UINT_MAX, for which
it is - (ptrdiff_t) UINT_MAX.
Jakub