DATA_ALIGNMENT vs. DECL_USER_ALIGNMENT
Ulrich Weigand
Ulrich.Weigand@de.ibm.com
Tue Apr 8 17:47:00 GMT 2003
Hello,
the target macro DATA_ALIGNMENT is supposed to be able to override the
alignment used for global data variables. We are using this on s390x
to make sure all data objects are at least 2-byte aligned. This is not
an optimization, but essential for correctness, as we cannot load the
address of a label that is not 2-byte aligned.
Unfortunately, DATA_ALIGNMENT is simply ignored when outputting a
variable that has the DECL_USER_ALIGNMENT flag set. While this does
not usually occur with C code unless using source code like
char x __attribute__ ((__aligned__(1)));
this flag is apparently much more frequently set by the Ada frontend.
In fact, this is currently causing bootstrap errors for Ada on s390x
because an elaboration check flag variable is not correctly aligned.
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?
Mit freundlichen Gruessen / Best Regards
Ulrich Weigand
--
Dr. Ulrich Weigand
Linux for S/390 Design & Development
IBM Deutschland Entwicklung GmbH, Schoenaicher Str. 220, 71032 Boeblingen
Phone: +49-7031/16-3727 --- Email: Ulrich.Weigand@de.ibm.com
More information about the Gcc
mailing list