This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
How to determine access alignment in RTL ?
- From: Yossi Markovich <YOSSIM at il dot ibm dot com>
- To: gcc at gcc dot gnu dot org
- Date: Wed, 17 Dec 2003 15:29:06 +0200
- Subject: How to determine access alignment in RTL ?
I am trying to query RTL (load/store) expressions for alignment, by
querying
the MEM_ALIGN interface (which is displayed when dumping the rtl, see
below).
But even when using "__aligned__" this interface seems to return default
values, although the alignment information is maintained in the tree level.
What should be done to make this interface work?
In certain cases (e.g. allocations on the stack) the compiler can infer
alignment properties of variables, or enforce them. Is such inference or
enforcement available, or planned?
Example: for this c code
typedef int aint __attribute__ ((__aligned__(128)));
aint A[N];
aint B[N];
for (i=0;i<N;i++)
A[i] = B[i]
the first rtl dump shows default alignment (A32) of A on the load:
(insn 86 85 87 0x0 (set (reg:SI 149)
(mem:SI (reg/f:SI 144) [4 A S4 A32])) -1 (nil)
(nil))
while a tree node dump clearly shows that aint type is 1024 user aligned.
Yossi