This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] Introduce DECL_NONLOCAL_FRAME


Hi,

this is the seemingly non-controversial part of the FRAME splitting patch.
It introduces the DECL_NONLOCAL_FRAME flag, sets it during nested function 
lowering and... that's pretty much it.

Tested on x86_64-suse-linux, OK for mainline?


2012-10-02  Eric Botcazou  <ebotcazou@adacore.com>

        * tree.h (DECL_NONLOCAL_FRAME): New macro.
        * tree-nested.c (get_frame_type): Set DECL_NONLOCAL_FRAME.
        * tree-streamer-in.c (unpack_ts_decl_common_value_fields): Stream in
        DECL_NONLOCAL_FRAME flag.
        * tree-streamer-out.c (pack_ts_decl_common_value_fields): Stream out
        DECL_NONLOCAL_FRAME flag.

	
-- 
Eric Botcazou
Index: tree.h
===================================================================
--- tree.h	(revision 191924)
+++ tree.h	(working copy)
@@ -712,6 +712,9 @@ struct GTY(()) tree_base {
 
        SSA_NAME_IS_DEFAULT_DEF in
            SSA_NAME
+
+       DECL_NONLOCAL_FRAME in
+	   VAR_DECL
 */
 
 struct GTY(()) tree_typed {
@@ -3270,9 +3273,14 @@ extern void decl_fini_priority_insert (t
    libraries.  */
 #define MAX_RESERVED_INIT_PRIORITY 100
 
+/* In a VAR_DECL, nonzero if this is a global variable for VOPs.  */
 #define VAR_DECL_IS_VIRTUAL_OPERAND(NODE) \
   (VAR_DECL_CHECK (NODE)->base.u.bits.saturating_flag)
 
+/* In a VAR_DECL, nonzero if this is a non-local frame structure.  */
+#define DECL_NONLOCAL_FRAME(NODE)  \
+  (VAR_DECL_CHECK (NODE)->base.default_def_flag)
+
 struct GTY(()) tree_var_decl {
   struct tree_decl_with_vis common;
 };
Index: tree-streamer-out.c
===================================================================
--- tree-streamer-out.c	(revision 191909)
+++ tree-streamer-out.c	(working copy)
@@ -181,6 +181,9 @@ pack_ts_decl_common_value_fields (struct
       bp_pack_value (bp, expr->decl_common.off_align, 8);
     }
 
+  if (TREE_CODE (expr) == VAR_DECL)
+    bp_pack_value (bp, DECL_NONLOCAL_FRAME (expr), 1);
+
   if (TREE_CODE (expr) == RESULT_DECL
       || TREE_CODE (expr) == PARM_DECL
       || TREE_CODE (expr) == VAR_DECL)
Index: tree-nested.c
===================================================================
--- tree-nested.c	(revision 191909)
+++ tree-nested.c	(working copy)
@@ -235,6 +235,7 @@ get_frame_type (struct nesting_info *inf
 
       info->frame_type = type;
       info->frame_decl = create_tmp_var_for (info, type, "FRAME");
+      DECL_NONLOCAL_FRAME (info->frame_decl) = 1;
 
       /* ??? Always make it addressable for now, since it is meant to
 	 be pointed to by the static chain pointer.  This pessimizes
Index: tree-streamer-in.c
===================================================================
--- tree-streamer-in.c	(revision 191909)
+++ tree-streamer-in.c	(working copy)
@@ -216,6 +216,9 @@ unpack_ts_decl_common_value_fields (stru
       expr->decl_common.off_align = bp_unpack_value (bp, 8);
     }
 
+  if (TREE_CODE (expr) == VAR_DECL)
+    DECL_NONLOCAL_FRAME (expr) = (unsigned) bp_unpack_value (bp, 1);
+
   if (TREE_CODE (expr) == RESULT_DECL
       || TREE_CODE (expr) == PARM_DECL
       || TREE_CODE (expr) == VAR_DECL)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]