This is the mail archive of the
mailing list for the GCC project.
Re: question about allocating local variable
- From: Prawit Chaivong <arsenal_pui at yahoo dot com>
- To: Eljay Love-Jensen <eljay at adobe dot com>, gcc-help at gcc dot gnu dot org
- Date: Mon, 28 Jun 2004 20:14:33 -0700 (PDT)
- Subject: Re: question about allocating local variable
--- Eljay Love-Jensen <firstname.lastname@example.org> wrote:
> Hi Prawit,
> >Does anybody has any explaination [why the
> compiler allocates more than
If we need char a and the compiler allocated 12
bytes for me. That makes sense. But I'm wondering why
I need 9 bytes but compiler allocated 24 bytes.
I might misunderstand about alignment. And I will be
appreciate if you could tell me why it gonna be that
> 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.
gcc 2.96 on x86 And asm code are the same no matter
what you gonna optimized or not.
> 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.)
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!