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]

[ira] Move the init_ira call


MIPS is, as yet, the only port to use backend_reinit.  As it stands,
backend_reinit calls init_ira before init_optabs, but the former
depends on the latter.

The problem is that optabs uses decls, so is initialised as part of
lang_dependent_init_target.  But init_ira is not language-dependent,
so is (sensibly enough) called from backend_init_target instead.

The same problem already applies to init_set_costs.  The approach
taken by the authors of the backend_reinit patch was to call
init_set_costs from lang_dependent_init_target, with the comment:

  /* Although the actions of init_set_costs are language-independent,
     it uses optabs, so we cannot call it from backend_init.  */

This patch does the same for init_ira too.

Tested on the WIP MIPS IRA port, where it fixes some gcc.target/mips
failures.  OK to install?

Richard


gcc/
	* toplev.c (backend_init_target): Move init_ira call from here...
	(lang_dependent_init_target): ...to here.

Index: gcc/toplev.c
===================================================================
--- gcc/toplev.c	2008-05-09 18:17:33.000000000 +0100
+++ gcc/toplev.c	2008-05-09 18:26:45.000000000 +0100
@@ -1969,9 +1969,6 @@ backend_init_target (void)
   /* This depends on stack_pointer_rtx.  */
   init_fake_stack_mems ();
 
-  /* This invokes IRA to set up reg related data structures.  */
-  init_ira ();
-
   /* Sets static_base_value[HARD_FRAME_POINTER_REGNUM], which is
      mode-dependent.  */
   init_alias_target ();
@@ -2034,9 +2031,10 @@ lang_dependent_init_target (void)
   /* Do the target-specific parts of expr initialization.  */
   init_expr_target ();
 
-  /* Although the actions of init_set_costs are language-independent,
-     it uses optabs, so we cannot call it from backend_init.  */
+  /* Although the actions of these functions are language-independent,
+     they use optabs, so we cannot call them from backend_init.  */
   init_set_costs ();
+  init_ira ();
 
   expand_dummy_function_end ();
 }


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