This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR middle-end/28862, losing user alignment for vectors
- From: Roger Sayle <roger at eyesopen dot com>
- To: Andrew Pinski <pinskia at physics dot uc dot edu>
- Cc: gcc-patches at gcc dot gnu dot org, Paolo Bonzini <paolo dot bonzini at lu dot unisi dot ch>
- Date: Thu, 7 Sep 2006 08:18:19 -0600 (MDT)
- Subject: Re: [PATCH] Fix PR middle-end/28862, losing user alignment for vectors
On Wed, 6 Sep 2006, Andrew Pinski wrote:
> * stor-layout.c (relayout_decl): Don't zero the alignment if it
> was set by the user.
This makes sense. OK for mainline, together with the new testcase
you propose. Re: Paolo's comments about GCC complaining about the
alignment being too high on some targets, that makes sense but I
suspect his suggested alignment of 4 is too small to test this
functionality on many targets where global variables already have
a significant alignment.
Might I recommend using a #define for the aligned() argument and the
__alignof__ test, such that it should be easy to customize the value
used for different platforms if the default fails anywhere. Then
we can use a relatively high default 128 or 64, but lower it as
appropriate using #ifdef __mips__ or #ifdef __alpha__ on platforms
with maximum alignment constraints.
Once the testcase has stablized with any necessary changes, we can
backport the fix to the 4.1 and 4.0 branches to resolve the P1 PR.
Thanks for fixing this,
Roger
--