This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix bootstrap failure on ppc-darwin
- From: Richard Earnshaw <rearnsha at gcc dot gnu dot org>
- To: Geoffrey Keating <geoffk at geoffk dot org>
- Cc: Andrew Pinski <pinskia at physics dot uc dot edu>, Nathan Sidwell <nathan at codesourcery dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 02 Nov 2004 11:04:57 +0000
- Subject: Re: [PATCH] Fix bootstrap failure on ppc-darwin
- Organization: GNU
- References: <28AE3EDD-2A9F-11D9-9310-000A95D692F4@physics.uc.edu> <m2is8qxhdr.fsf@greed.local>
On Mon, 2004-11-01 at 05:33, Geoffrey Keating wrote:
> Andrew Pinski <pinskia@physics.uc.edu> writes:
>
> > We had a block copy which was not being SRA'd but I don't know if we
> > should
> > have. This patch fixes the problem by not having the block copy of the
> > struct by passing a pointer into bmp_iter_end_p instead of the struct
> > it self. Yes we optimize this case already so it should not slow it
> > down at all (in fact the bootstrap might be sped up because we have
> > to less work by SRAing the block copy). Someone should look into if we
> > really should be SRAing the block copy in this case.
> >
> > OK? Bootstrapped and testing on powerpc-darwin.
>
> This is OK, but can you make sure there's a bugzilla about the underlying
> problem?
>
> > Thanks,
> > Andrew Pinski
> >
> > ChangeLog:
> >
> > * bitmap.h (bmp_iter_end_p): Take a const pointer instead of a struct.
> > (EXECUTE_IF_SET_IN_BITMAP): Update call to bmp_iter_end_p.
> > (EXECUTE_IF_AND_COMPL_IN_BITMAP): Likewise.
> > (EXECUTE_IF_AND_IN_BITMAP): Likewise.
This patch begs the question why we are passing iterators by value at
all. Looking at the code generated for all of these little structures
we see huge numbers of structure copies that aren't being eliminated
even when the iterator functions get inlined.
If this were C++, I guess the iterators would be implemented with const
references; but it ain't, so the nearest equivalent is a pointer to
const.
Is there any chance we can fix up this mess before it becomes too
pervasive?
R.