This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Altivec + 16 byte alignment
- From: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- To: fjh at cs dot mu dot oz dot au
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 12 Feb 03 08:57:20 EST
- Subject: Re: Altivec + 16 byte alignment
The alignment declaration might be used by the programmer to ensure
that the lower bits are available for use as tag bits.
Exactly.
For example, the following program should result in either success
or a compile error (if the requested alignment is not supported).
But IMHO it should not result in an assertion failure.
#include <assert.h>
#define ALIGN 32
int main() {
char c __attribute__((aligned(ALIGN)));
assert ((((unsigned long) &c) & (ALIGN - 1)) == 0);
return 0;
}
This is *desirable* in C, as you say, but the equivalent Ada program is
*required* to have the behavior you want and there are tests to ensure
that it does.