#include <stdio.h>
#define ALIGNED(n) __attribute__((aligned(n)))
typedef ALIGNED(16) struct
{
int i;
} S;
int main(void)
{
S s;
printf("%p\n", &s); // I have 0022FF74
}
#include <stdio.h>
#define ALIGNED(n) __attribute__((aligned(n)))
typedef struct
{
int i ALIGNED(16);
} S;
int main(void)
{
S s;
printf("%p\n", &s); // 0022FF60
}
16-byte alignment should be used in ExfAcquirePushLockExclusive() and ExfAcquirePushLockShared(), EX_PUSH_LOCK_WAIT_BLOCK WaitBlock structure. Misalignment can cause crash / hang, I believe.
Andrew Pinski wrote:
Actually this is just a missed diagnostic. The compiler cannot align the stack variables where the alignment is greater than stack alignment that the compiler can give for the stack.
I do not agree. Stack variable can be aligned even by hand.
we are thinking of slash gcc 3.4.x and go for 4.2.x for it seam align work in that.
the align are also broken in gcc 4.1.x for complex code. simple code as u show hto works in gcc 4.1.x but when the code start getting complex it break the align.
we are investing how this should be solv at irc channel
a new RosBE will be made
with gcc 4.1.2 and gcc 4.2 and alex intruduse a hack for gcc 3.4.x so align work in puch lock. it is only there we are using align now what I am aware. The new RosBe will problare be avail later today.