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: DATA_ALIGNMENT vs. DECL_USER_ALIGNMENT


Hello Richard,

I wrote:
>My question is now, why is DATA_ALIGNMENT ignored in such cases?
>Is this a bug or a feature?  If the latter, what other options does
>a backend have to absolutely enforce a minimum alignment for global
>variables?

checking CVS logs showed that this is apparently a feature, 
introduced in a patch of yours a couple of years ago:
http://gcc.gnu.org/ml/gcc-patches/2001-08/msg01037.html
("suppress optional alignment for user variables").

However, the problem remains that on s390, the alignment is not
in fact 'optional' but a hard requirement.  (Looking at the
various implementations of DATA_ALIGNMENT, it seems that mmix
also needs this to be handled as required, while for the others
it is indeed optional.) 

I'm now wondering what we can do to fix this.  One way might
be to add another target macro; or else we could shift the
burden to distinguish between optional and required alignments
into the DATA_ALIGNMENT macro: the macro gets the type as
parameter, and the backend can check whether the USER_ALIGN
is bit is set and if so, only perform mandatory, not optional,
alignment adjustments.

Would you agree with this or do you have other suggestions?

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  weigand at informatik dot uni-erlangen dot de


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