From owner-freebsd-hackers@FreeBSD.ORG Mon Feb 16 17:52:10 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 071FE16A4CE for ; Mon, 16 Feb 2004 17:52:10 -0800 (PST) Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id E791A43D1D for ; Mon, 16 Feb 2004 17:52:09 -0800 (PST) (envelope-from dillon@apollo.backplane.com) Received: from apollo.backplane.com (localhost [127.0.0.1]) i1H1q582088727; Mon, 16 Feb 2004 17:52:05 -0800 (PST) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.12.9p2/8.12.9/Submit) id i1H1q44u088726; Mon, 16 Feb 2004 17:52:04 -0800 (PST) (envelope-from dillon) Date: Mon, 16 Feb 2004 17:52:04 -0800 (PST) From: Matthew Dillon Message-Id: <200402170152.i1H1q44u088726@apollo.backplane.com> To: kientzle@acm.org References: <200402162112.i1GLCFMV087316@apollo.backplane.com> <4031678D.2060704@acm.org> cc: des@des.no cc: Juan Tumani cc: freebsd-hackers@freebsd.org Subject: Re: FreeBSD 5.2 v/s FreeBSD 4.9 MFLOPS performance (gcc3.3.3 v/sgcc2.9.5) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2004 01:52:10 -0000 :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