This is the mail archive of the 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: PR18173 - can't force alignment of global arrays with static initializer?

Dorit Naishlos <> writes:

> Hi,
> The problem in PR18173 seems to be related to the alignment of global
> arrays with static initialization: We force the alignment of arrays in the
> vectorizer by setting the DECL_ALIGN field. This does not seem to work for
> global arrays with static initialization - DECL_ALIGN seems to be reset to
> TYPE_ALIGN somewhere along the way. The patch below fixes the problem by
> having the function 'vect_can_force_dr_alignment_p' return false for decls
> with static initializer (is that a correct check?). The question is - is it
> really impossible to force the alignment of such decls, or is it a bug that
> the setting of DECL_ALIGN doesn't work?

I'm actually not sure why DECL_ALIGN exists, it should really always
be equal to TYPE_ALIGN.  What you do if you want to change the
alignment is you create a new type that's the same as the previous one
but with a different TYPE_ALIGN, and then change the decl's type, and
then maybe re-layout the decl.

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