summaryrefslogtreecommitdiff
path: root/gcc/function.c
diff options
context:
space:
mode:
authorlauras <lauras@138bc75d-0d04-0410-961f-82ee72b054a4>2011-06-02 16:37:28 +0000
committerlauras <lauras@138bc75d-0d04-0410-961f-82ee72b054a4>2011-06-02 16:37:28 +0000
commitf194cdb5c2152d9e90a698b080a3c8a26c045332 (patch)
tree1548c871457714606f49c3800159d9d9a995f937 /gcc/function.c
parent48eb063e56e4ae5c089b53b6b55b599bf864fb87 (diff)
downloadgcc-gc-improv.tar.gz
2011-06-02 Laurynas Biveinis <laurynas.biveinis@gmail.com>gc-improv
* varasm.c (make_decl_rtl): Allocate DECL_RTL in the permanent RTL memory. * rtl.c: (_obstack_allocated_p): Declare. (allocated_in_function_mem_p): New. (need_copy_p): New. (copy_rtx): Re-enable sharing of CONST_VECTOR rtxes. Use need_copy_p to decide on copying vs. sharing of rtxes. * function.c (reinit_struct_function): New. (set_cfun, prepare_function_start): Call it. * config/i386/i386.c (ix86_expand_split_stack_prologue): Allocate split_stack_fn in the permanent RTL memory. (ix86_expand_split_stack_prologue): Allocate split_stack_fn_large in the permanent RTL memory. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gc-improv@174568 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/function.c')
-rw-r--r--gcc/function.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/gcc/function.c b/gcc/function.c
index a9c1541d2bc..addc243ade3 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -151,6 +151,7 @@ static void prepare_function_start (void);
static void do_clobber_return_reg (rtx, void *);
static void do_use_return_reg (rtx, void *);
static void set_insn_locators (rtx, int) ATTRIBUTE_UNUSED;
+static void reinit_struct_function (void);
/* Stack of nested functions. */
/* Keep track of the cfun stack. */
@@ -4316,6 +4317,7 @@ set_cfun (struct function *new_cfun)
{
cfun = new_cfun;
invoke_set_current_function_hook (new_cfun ? new_cfun->decl : NULL_TREE);
+ reinit_struct_function ();
}
}
@@ -4417,6 +4419,16 @@ push_struct_function (tree fndecl)
allocate_struct_function (fndecl, false);
}
+/* Initialize those parts of struct function that are cleared during PCH read
+ and write. */
+
+static void
+reinit_struct_function (void)
+{
+ if (cfun && !cfun->machine && init_machine_status)
+ cfun->machine = (*init_machine_status) ();
+}
+
/* Reset crtl and other non-struct-function variables to defaults as
appropriate for emitting rtl at the start of a function. */
@@ -4437,8 +4449,7 @@ prepare_function_start (void)
}
/* cfun->machine is NULL after PCH read. Initialize it. */
- if (!cfun->machine && init_machine_status)
- cfun->machine = (*init_machine_status) ();
+ reinit_struct_function ();
cse_not_expected = ! optimize;