aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2003-08-29 15:44:05 -0700
committerRichard Henderson <rth@gcc.gnu.org>2003-08-29 15:44:05 -0700
commitd560a41c5c43524d82795ac4421eab2df6764e30 (patch)
treeb8bd1c0f20314f33063c82cf2cf403d0630408e5
parent3a70d621853e616201bac254b8e3900b63b6fcf4 (diff)
downloadgcc-d560a41c5c43524d82795ac4421eab2df6764e30.zip
gcc-d560a41c5c43524d82795ac4421eab2df6764e30.tar.gz
gcc-d560a41c5c43524d82795ac4421eab2df6764e30.tar.bz2
function.h (struct function): Add rtl_inline_init, saved_for_inline.
* function.h (struct function): Add rtl_inline_init, saved_for_inline. * integrate.c (save_for_inline): Set saved_for_inline. * c-semantics.c (genrtl_scope_stmt): Check it. * toplev.c (wrapup_global_declarations): Check it. (rest_of_handle_inlining): Set and check rtl_inline_init. (rest_of_compilation): Remove out of date comment. From-SVN: r70931
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/c-semantics.c1
-rw-r--r--gcc/function.h7
-rw-r--r--gcc/integrate.c2
-rw-r--r--gcc/toplev.c9
5 files changed, 22 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d3443b5..d573615 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,14 @@
2003-08-29 Richard Henderson <rth@redhat.com>
+ * function.h (struct function): Add rtl_inline_init, saved_for_inline.
+ * integrate.c (save_for_inline): Set saved_for_inline.
+ * c-semantics.c (genrtl_scope_stmt): Check it.
+ * toplev.c (wrapup_global_declarations): Check it.
+ (rest_of_handle_inlining): Set and check rtl_inline_init.
+ (rest_of_compilation): Remove out of date comment.
+
+2003-08-29 Richard Henderson <rth@redhat.com>
+
* function.c (allocate_struct_function): New, split out of ...
(prepare_function_start, init_function_start): ... here.
* expr.c (init_expr): Use ggc_alloc_cleared.
diff --git a/gcc/c-semantics.c b/gcc/c-semantics.c
index cbffbe0..4163d44 100644
--- a/gcc/c-semantics.c
+++ b/gcc/c-semantics.c
@@ -645,6 +645,7 @@ genrtl_scope_stmt (tree t)
if (TREE_CODE (fn) == FUNCTION_DECL
&& DECL_CONTEXT (fn) == current_function_decl
&& DECL_SAVED_INSNS (fn)
+ && DECL_SAVED_INSNS (fn)->saved_for_inline
&& !TREE_ASM_WRITTEN (fn)
&& TREE_ADDRESSABLE (fn))
{
diff --git a/gcc/function.h b/gcc/function.h
index 4216acb..f94a642 100644
--- a/gcc/function.h
+++ b/gcc/function.h
@@ -504,6 +504,13 @@ struct function GTY(())
/* Nonzero if code to initialize arg_pointer_save_area has been emitted. */
unsigned int arg_pointer_save_area_init : 1;
+
+ /* Flag for use by ther rtl inliner, to tell if the function has been
+ processed at least once. */
+ unsigned int rtl_inline_init : 1;
+
+ /* Nonzero if the rtl inliner has saved the function for inlining. */
+ unsigned int saved_for_inline : 1;
};
/* The function currently being compiled. */
diff --git a/gcc/integrate.c b/gcc/integrate.c
index a8ee4fa..15474ba 100644
--- a/gcc/integrate.c
+++ b/gcc/integrate.c
@@ -492,7 +492,7 @@ save_for_inline (tree fndecl)
}
cfun->original_decl_initial = DECL_INITIAL (fndecl);
cfun->no_debugging_symbols = (write_symbols == NO_DEBUG);
- DECL_SAVED_INSNS (fndecl) = cfun;
+ cfun->saved_for_inline = 1;
/* Clean up. */
if (! flag_no_inline)
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 418fa35..3e639c6 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -1588,6 +1588,7 @@ wrapup_global_declarations (tree *vec, int len)
if (TREE_CODE (decl) == FUNCTION_DECL
&& DECL_INITIAL (decl) != 0
&& DECL_SAVED_INSNS (decl) != 0
+ && DECL_SAVED_INSNS (decl)->saved_for_inline
&& (flag_keep_inline_functions
|| (TREE_PUBLIC (decl) && !DECL_COMDAT (decl))
|| TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl))))
@@ -2464,8 +2465,9 @@ rest_of_handle_inlining (tree decl)
/* If we are reconsidering an inline function at the end of
compilation, skip the stuff for making it inline. */
- if (DECL_SAVED_INSNS (decl) != 0)
+ if (cfun->rtl_inline_init)
return 0;
+ cfun->rtl_inline_init = 1;
/* If this is nested inside an inlined external function, pretend
it was only declared. Since we cannot inline such functions,
@@ -2522,7 +2524,7 @@ rest_of_handle_inlining (tree decl)
if (open_dump_file (DFI_rtl, decl))
{
- if (DECL_SAVED_INSNS (decl))
+ if (DECL_SAVED_INSNS (decl) && DECL_SAVED_INSNS (decl)->saved_for_inline)
fprintf (rtl_dump_file, ";; (integrable)\n\n");
close_dump_file (DFI_rtl, print_rtl, insns);
}
@@ -3553,9 +3555,6 @@ rest_of_compilation (tree decl)
if (! DECL_DEFER_OUTPUT (decl))
{
free_after_compilation (cfun);
-
- /* Clear integrate.c's pointer to the cfun structure we just
- destroyed. */
DECL_SAVED_INSNS (decl) = 0;
}
cfun = 0;