This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Gcc extra alignment..
- To: Loren James Rittle <rittle at latour dot rsch dot comm dot mot dot com>
- Subject: Re: Gcc extra alignment..
- From: Linus Torvalds <torvalds at transmeta dot com>
- Date: Tue, 31 Oct 2000 12:16:47 -0800 (PST)
- cc: gcc at gcc dot gnu dot org
On Tue, 31 Oct 2000, Loren James Rittle wrote:
>
> bar ();
>
> foo ()
> {
> do { bar (); } while (0);
> }
>
> [ deleted ]
>
> Looks like the padding is still there.
Not just that. When you enable optimizations, the padding goes away, but
it looks like
foo:
subl $12, %esp
call bar
addl $12, %esp
ret
even at -O3 -fomit-frame-pointer.
Now, remove the "do { } while (0)", and the end result is the much more
reasonable (even pretty):
foo:
jmp bar
So obviously padding isn't the only thing that "do { } while (0)" will do
for you..
(I wonder why. It's not as if we're adding any new variables in scope or
anything like that. Strange. I'm sure it has a perfectly good explanation,
but it does look like some obvious optimization is trivially missed).
Linus