From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8823 invoked by alias); 19 Dec 2007 01:46:52 -0000 Received: (qmail 8813 invoked by uid 22791); 19 Dec 2007 01:46:50 -0000 X-Spam-Check-By: sourceware.org Received: from mga02.intel.com (HELO mga02.intel.com) (134.134.136.20) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 19 Dec 2007 01:46:42 +0000 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 18 Dec 2007 17:46:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.24,182,1196668800"; d="scan'208";a="243428769" Received: from fmsmsx334.amr.corp.intel.com ([132.233.42.1]) by orsmga002.jf.intel.com with ESMTP; 18 Dec 2007 17:46:41 -0800 Received: from pdsmsx411.ccr.corp.intel.com ([172.16.12.89]) by fmsmsx334.amr.corp.intel.com with Microsoft SMTPSVC(6.0.3790.1830); Tue, 18 Dec 2007 17:46:32 -0800 Received: from pdsmsx415.ccr.corp.intel.com ([172.16.12.184]) by pdsmsx411.ccr.corp.intel.com with Microsoft SMTPSVC(6.0.3790.1830); Wed, 19 Dec 2007 09:46:30 +0800 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: A proposal to align GCC stack Date: Wed, 19 Dec 2007 01:53:00 -0000 Message-ID: In-Reply-To: <20071218233126.3EA1973D2A@caffeine.csclub.uwaterloo.ca> References: <20071218233126.3EA1973D2A@caffeine.csclub.uwaterloo.ca> From: "Ye, Joey" To: "Ross Ridge" , X-IsSubscribed: yes Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2007-12/txt/msg00550.txt.bz2 =20 Ross Ridge wrote: > I'm currently using -fpreferred-stack-boundary without any trouble. > Your proposal would in fact generate code to align stack when it's not > necessary. This would change the behaviour of -fpreferred-stack-boundary, > hurting performance and that's unacceptable to me. This proposal values correctness at first place. So when compile can't make sure a function is only called from functions with the same or bigger=20 preferred-stack-boundary, it will conservatively align the stack. One optimization is to set INCOMING =3D PREFERRED for local functions. Do you think it more acceptable? >> Ok, if people are using this flag to change the alignment to something >> smaller than used by the standard ABI, then INCOMING should be >> MAX(STACK_BOUNDARY, PREFERRED_STACK_BOUNDARY). > > On x86-64, ABI_STACK_BOUNDARY is 16byte, but the Linux kernel may > want to use 8 byte for PREFERRED_STACK_BOUNDARY. INCOMING will > be MIN(STACK_BOUNDARY, PREFERRED_STACK_BOUNDARY) =3D=3D 8 byte. > Using MAX(STACK_BOUNDARY, PREFERRED_STACK_BOUNDARY) also equals 8 in that > case and preserves the behaviour -fpreferred-stack-boundary in every case. I think HJ means MIN(ABI_STACK_BOUNDARY, PREFERRED_STACK_BOUNDARY).=20 MAX(ABI, PREFERRED) =3D=3D 16 in this case. Thanks - Joey