This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Variable length arrays : aligned on stack


Dear all,

I've been looking to a problem where if I have this defined in the function:

void foo(int len)
{
long arr[len];
...
}

I get a complicated code to calculate the address of this
variable-length array. It seems that the compiler is aligning the
array when this code:

void foo(int len)
{
long arr[512];
...
}

Simply moves the stack pointer 512*sizeof(long) bytes down.

I suppose this is a Machine Description problem but was wondering if
you had any tips on where to look?

Thanks for your help,
Jean Christophe Beyler


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]