This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH; RFC] Alignment of component_ref's.


Maxim Kuvyrkov writes:
> Adam Nemet wrote:
> > Maxim Kuvyrkov <maxim@codesourcery.com> writes:
> >> +	  /* If the reference is with offset outstanding on T,
> >> +	     use alignment of the field.  This is used to avoid
> >> +	     suboptimal field references via referencing a larger value
> >> +	     and then extracting pieces of it.  Instead, we prefer to
> >> +	     generate several smaller references.
> > 
> > I don't think this is true for loads.
> 
> What part of it is not true for loads?

That multiple smaller loads are better that one aligned load and an
extraction.

> > Is this code used for loads as well?
> 
> No, set_mem_attributes_minus_bitpos(..., bitpos != 0) is only used for 
> storing to bitfields.

Then maybe the comment should say that we are trying to avoid a
read-modify-write sequence here and do multiple smaller stores instead.  Am I
misunderstanding your patch?

Adam


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]