Serious performance regression -- some tree optimizer questions

Jakub Jelinek jakub@redhat.com
Wed Dec 29 23:07:00 GMT 2004


On Wed, Dec 29, 2004 at 09:34:27PM +0100, Toon Moene wrote:
> [ Serious performance regression in SPEC2000's mgrid*.f* ]
> 
> >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.
> 
> Oh, sure, but we are talking Fortran here - you can't apply the 
> limitations of C to a discussion about optimizing Fortran code.  Fortran 
> knows of no UINT_MAX, or the intrincacies of C's ptrdiff_t.

I thought we were talking about middle-end and there is just one middle-end
used by both Fortran and C.
My point was just that extra care needs to be taken when handling
&A[i+1] - &A[i] folding in fold-const.  You can optimize most of these
even for C, but not all.

	Jakub



More information about the Gcc mailing list