+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 ...
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))
{
/* 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. */
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))))
/* 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,
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);
}
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;