+2014-06-25 Jan Hubicka <hubicka@ucw.cz>
+
+ * toplev.c (backend_init_target): Move init_emit_regs and init_regs to...
+ (backend_init) ... here; skip ira_init_once and backend_init_target.
+ (target_reinit) ... and here; clear this_target_rtl->lang_dependent_initialized.
+ (lang_dependent_init_target): Clear this_target_rtl->lang_dependent_initialized;
+ break out rtl initialization to ...
+ (initialize_rtl): ... here; call also backend_init_target and ira_init_once.
+ * toplev.h (initialize_rtl): New function.
+ * function.c: Include toplev.h
+ (init_function_start): Call initialize_rtl.
+ * rtl.h (target_rtl): Add target_specific_initialized,
+ lang_dependent_initialized.
+
2014-06-25 Paul Gortmaker <paul.gortmaker@windriver.com>
Jakub Jelinek <jakub@redhat.com>
/* Initialize alignment variables. */
init_alignments ();
- /* This reinitializes hard_frame_pointer, and calls init_reg_modes_target()
- to initialize reg_raw_mode[]. */
- init_emit_regs ();
-
- /* This invokes target hooks to set fixed_reg[] etc, which is
- mode-dependent. */
- init_regs ();
-
/* This depends on stack_pointer_rtx. */
init_fake_stack_mems ();
init_varasm_once ();
save_register_info ();
- /* Initialize the target-specific back end pieces. */
- ira_init_once ();
- backend_init_target ();
+ /* Middle end needs this initialization for default mem attributes
+ used by early calls to make_decl_rtl. */
+ init_emit_regs ();
+
+ /* Middle end needs this initialization for mode tables used to assign
+ modes to vector variables. */
+ init_regs ();
}
/* Initialize excess precision settings. */
front end is initialized. It also depends on the HAVE_xxx macros
generated from the target machine description. */
init_optabs ();
+ this_target_rtl->lang_dependent_initialized = false;
+}
+
+/* Perform initializations that are lang-dependent or target-dependent.
+ but matters only for late optimizations and RTL generation. */
+
+void
+initialize_rtl (void)
+{
+ static int initialized_once;
+
+ /* Initialization done just once per compilation, but delayed
+ till code generation. */
+ if (!initialized_once)
+ ira_init_once ();
+ initialized_once = true;
+
+ /* Target specific RTL backend initialization. */
+ if (!this_target_rtl->target_specific_initialized)
+ backend_init_target ();
+ this_target_rtl->target_specific_initialized = true;
+
+ if (this_target_rtl->lang_dependent_initialized)
+ return;
+ this_target_rtl->lang_dependent_initialized = true;
/* The following initialization functions need to generate rtl, so
provide a dummy function context for them. */
regno_reg_rtx = NULL;
}
- /* Reinitialize RTL backend. */
- backend_init_target ();
+ this_target_rtl->target_specific_initialized = false;
+
+ /* This initializes hard_frame_pointer, and calls init_reg_modes_target()
+ to initialize reg_raw_mode[]. */
+ init_emit_regs ();
+
+ /* This invokes target hooks to set fixed_reg[] etc, which is
+ mode-dependent. */
+ init_regs ();
/* Reinitialize lang-dependent parts. */
lang_dependent_init_target ();