This is the mail archive of the
mailing list for the GCC project.
Re: question about allocating local variable
On a solaris platform with gcc 3.0 the one i have
out put for such a behaviour is pretty predictive.
It allocates a stack of 120 for char a to char a
then 128 for char a to char a
and so on.
for an integer array
It allocates a stack of 120 for int a and int a
then 128 for int a to int a
and so on.
with a allignment of 4 bytes
save %sp, -128, %sp
.ident "GCC: (GNU) 3.0"
Hope i am correct.am i?
but then why the initial 120 bytes,???
On Mon, 28 Jun 2004 10:50:13 -0500, Eljay Love-Jensen <email@example.com> wrote:
> Hi Prawit,
> >Does anybody has any explaination [why the compiler allocates more than
> You didn't specify what platform, GCC version (3.3.4? 3.4.0?), and compile
> options you are using. If you are not generated optimized code, the code
> may not be optimized.
> It is also possible that one of the GCC Gnurus made a boo-boo. Rare, but
> can happen. Especially between optimizations that are in contention, which
> may have unintended side-effects on different platforms. (I discovered 3
> such issues, on GCC 2.95 on Solaris. They're all fixed now.)