Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Feb 2004 17:52:04 -0800 (PST)
From:      Matthew Dillon <dillon@apollo.backplane.com>
To:        kientzle@acm.org
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: FreeBSD 5.2 v/s FreeBSD 4.9 MFLOPS performance (gcc3.3.3 v/sgcc2.9.5)
Message-ID:  <200402170152.i1H1q44u088726@apollo.backplane.com>
References:  <BAY12-F357RapPBVToy00031029@hotmail.com> <200402162112.i1GLCFMV087316@apollo.backplane.com> <4031678D.2060704@acm.org>

next in thread | previous in thread | raw e-mail | index | archive | help
:I've not looked at 3.3, but I seem to recall that GCC 3.2
:did not actually align the stack within each function, but
:preserved the alignment.  (That is, each function assumed the stack
:had a certain alignment on entry and ensured that alignment
:was preserved for any subsequent function calls.)

    Easy to test... ah, ok.  3.3 aligns the stack in main().

main:
        pushl   %ebp
        movl    %esp, %ebp
        subl    $8, %esp
        andl    $-16, %esp	<<<<< ailgns stack here andl 0xfffffff0,%esp
	...

    And the preserves the alignment in other procedures... 8 + ebp + retaddr
    is 16 bytes:

charlie:
        pushl   %ebp
        movl    %esp, %ebp
        subl    $8, %esp     /* I declared 'volatile int x' as a stack var */
        call    fubar
        call    fubar
        call    fubar
        leave
        ret

:If I'm remembering this correctly, then aligning
:the stack in crt1.o would be pretty much essential.
:
:Tim Kientzle

    For gcc 2.95, yes.

					-Matt
					Matthew Dillon 
					<dillon@backplane.com>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200402170152.i1H1q44u088726>