How to determine access alignment in RTL ?
Yossi Markovich
YOSSIM@il.ibm.com
Wed Dec 17 16:57:00 GMT 2003
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
More information about the Gcc
mailing list