This is the mail archive of the gcc@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: *_BY_PIECES_P flaw


On Sun, 2004-08-08 at 18:56, David Edelsohn wrote:
> 	The following patch modifies the existing alignment override
> algorithm to choose the best alignment based on the largest effective mode
> for the alignment.

This looks pretty reasonable to me.

The test for BIGGEST_ALIGNMENT isn't necessary.  This is also true of
the current code.  The only way this test can trigger is if the mode of
MOVE_MAX is larger than BIGGEST_ALIGNMENT, and the alignment is smaller
than the mode of MOVE_MAX but bigger than BIGGEST_ALIGNMENT, in which
case we increase the alignment up to MOVE_MAX.  It makes no sense to do
that.  The reason the code works is because this case will never
happen.  So the test for BIGGEST_ALIGNMENT is pointless.

If align == GET_MODE_ALIGNMENT (mode), then you run through the loop and
hit the MAX which will assign align the same value it already has.   We
should avoid that somehow.

You are still using MOVE_MAX here.  I think this should be
MOVE_MAX_PIECES or STORE_MAX_PIECES depending on the context.  Jakub's
patch has already removed the other use of MOVE_MAX, so we should get
rid of this one too and be consistent.

This needs a ChangeLog entry and it needs to be sent to gcc-patches.
-- 
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com



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