From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22437 invoked by alias); 17 Apr 2008 08:24:16 -0000 Received: (qmail 22361 invoked by uid 22791); 17 Apr 2008 08:24:14 -0000 X-Spam-Check-By: sourceware.org Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 17 Apr 2008 08:23:37 +0000 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP; 17 Apr 2008 01:22:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.25,670,1199692800"; d="scan'208";a="318123576" Received: from fmsmsx334.amr.corp.intel.com ([132.233.42.1]) by fmsmga002.fm.intel.com with ESMTP; 17 Apr 2008 01:22:02 -0700 Received: from pdsmsx414.ccr.corp.intel.com ([172.16.12.95]) by fmsmsx334.amr.corp.intel.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 17 Apr 2008 01:23:35 -0700 Received: from pdsmsx415.ccr.corp.intel.com ([172.16.12.184]) by pdsmsx414.ccr.corp.intel.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 17 Apr 2008 16:23:32 +0800 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: [PATCH 1/6] Stack align: New data in function.h Date: Thu, 17 Apr 2008 09:01:00 -0000 Message-ID: From: "Ye, Joey" To: "GCC Patches" Cc: "Lu, Hongjiu" , "Guo, Xuepeng" , "Ye, Joey" X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2008-04/txt/msg01352.txt.bz2 Refer to discussion:=20 http://gcc.gnu.org/ml/gcc-patches/2008-04/msg01019.html Thanks - Joey 2008-04-17 Joey Ye H.J. Lu * function.h (function): Add new field stack_alignment_estimated, need_frame_pointer, need_frame_pointer_set, stack_realign_needed, stack_realign_really, need_drap, save_param_ptr_reg, stack_realign_processed, stack_realign_finalized and=20 stack_realign_used. (rtl_data): Add new field drap_reg.=20 (stack_realign_fp): New macro. (stack_realign_drap): Likewise. Index: function.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- function.h (.../trunk/gcc) (revision 134203) +++ function.h (.../branches/stack/gcc) (revision 134368) @@ -271,6 +271,9 @@ struct rtl_data GTY(()) needed by inner routines. */ rtx x_arg_pointer_save_area; =20 + /* Dynamic Realign Argument Pointer used for realigning stack. */ + rtx drap_reg; + /* Offset to end of allocated area of stack frame. If stack grows down, this is the address of the last stack slot allocated. If stack grows up, this is the address for the next slot. */ @@ -352,9 +362,16 @@ struct function GTY(()) /* tm.h can use this to store whatever it likes. */ struct machine_function * GTY ((maybe_undef)) machine; =20 - /* The largest alignment of slot allocated on the stack. */ + /* The largest alignment needed on the stack, including requirement + for outgoing stack alignment. */ unsigned int stack_alignment_needed; =20 + /* The largest alignment of slot allocated on the stack. */ + unsigned int stack_alignment_used; + + /* The estimated stack alignment. */ + unsigned int stack_alignment_estimated; + /* Preferred alignment of the end of stack frame. */ unsigned int preferred_stack_boundary; =20 @@ -509,6 +526,31 @@ struct function GTY(()) =20 /* Nonzero if pass_tree_profile was run on this function. */ unsigned int after_tree_profile : 1; + + /* Nonzero if, by estimation, current function stack needs realignment. */ + unsigned int stack_realign_needed : 1; + + /* Nonzero if function stack realignment is really needed. This flag + will be set after reload if by then criteria of stack realignment + is still true. Its value may be contridition to stack_realign_needed + since the latter was set before reload. This flag is more accurate + than stack_realign_needed so prologue/epilogue should be generated + according to both flags */ + unsigned int stack_realign_really : 1; + + /* Nonzero if function being compiled needs dynamic realigned + argument pointer (drap) if stack needs realigning. */ + unsigned int need_drap : 1; + + /* Nonzero if current function needs to save/restore parameter + pointer register in prolog, because it is a callee save reg. */ + unsigned int save_param_ptr_reg : 1; + + /* Nonzero if function stack realignment estimatoin is done. */ + unsigned int stack_realign_processed : 1; + + /* Nonzero if function stack realignment has been finalized. */ + unsigned int stack_realign_finalized : 1; }; =20 /* If va_list_[gf]pr_size is set to this, it means we don't know how @@ -563,6 +605,8 @@ extern void instantiate_decl_rtl (rtx x) #define dom_computed (cfun->cfg->x_dom_computed) #define n_bbs_in_dom_tree (cfun->cfg->x_n_bbs_in_dom_tree) #define VALUE_HISTOGRAMS(fun) (fun)->value_histograms +#define stack_realign_fp (cfun->stack_realign_needed && !cfun->need_drap) +#define stack_realign_drap (cfun->stack_realign_needed && cfun->need_drap) =20 /* Given a function decl for a containing function, return the `struct function' for it. */