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]

PATH: call move init_reg_modes call (for compile-server)


This a minor moving-things-around-for-the-compile-sever patch.
The problem is that we need to separate out:
(1) true one-time-only initialization; and
(2) (re-)initialization per output file.

init_emit_once and init_reg_modes are in category (1), while
most of init_regs *except* for the call to init_reg_modes is
in category (2).  Hence the attached patch.

Bootstrapped, with no regressions.  Ok to check in?
--
	--Per Bothner
per@bothner.com   http://per.bothner.com/


2003-08-02  Per Bothner  <pbothner@apple.com>

	[Compile-server will need to separate one-time and once-per-output-file
	backend initialization.]
	* regclass.c (int_reg_modes):  Make non-static.
	(int_regs):  Don't call init_reg_modes here.
	* emit-rtl.c (init_emit_once):  Call init_reg_modes here instead.
	* rtl.h (init_reg_modes):  New declaration.
	* toplev.c (backend_init):  Call init_regs after init_emit_once.

Index: emit-rtl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/emit-rtl.c,v
retrieving revision 1.344
diff -u -p -r1.344 emit-rtl.c
--- emit-rtl.c	19 Jul 2003 14:47:02 -0000	1.344
+++ emit-rtl.c	2 Aug 2003 19:20:21 -0000
@@ -5317,6 +5317,9 @@ init_emit_once (int line_numbers)
   enum machine_mode mode;
   enum machine_mode double_mode;
 
+  /* We need reg_raw_mode, so initialize the modes now. */
+  init_reg_modes ();
+
   /* Initialize the CONST_INT, CONST_DOUBLE, and memory attribute hash
      tables.  */
   const_int_htab = htab_create_ggc (37, const_int_htab_hash,
Index: regclass.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/regclass.c,v
retrieving revision 1.177
diff -u -p -r1.177 regclass.c
--- regclass.c	22 Jul 2003 23:15:29 -0000	1.177
+++ regclass.c	2 Aug 2003 19:20:22 -0000
@@ -46,7 +46,6 @@ Software Foundation, 59 Temple Place - S
 #include "timevar.h"
 
 static void init_reg_sets_1 (void);
-static void init_reg_modes (void);
 static void init_reg_autoinc (void);
 
 /* If we have auto-increment or auto-decrement and we can have secondary
@@ -546,7 +545,7 @@ init_reg_sets_1 (void)
    These values are used to record death information for individual registers
    (as opposed to a multi-register mode).  */
 
-static void
+void
 init_reg_modes (void)
 {
   int i;
@@ -574,8 +573,6 @@ init_regs (void)
   /* This finishes what was started by init_reg_sets, but couldn't be done
      until after register usage was specified.  */
   init_reg_sets_1 ();
-
-  init_reg_modes ();
 
   init_reg_autoinc ();
 }
Index: rtl.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/rtl.h,v
retrieving revision 1.432
diff -u -p -r1.432 rtl.h
--- rtl.h	1 Aug 2003 21:51:13 -0000	1.432
+++ rtl.h	2 Aug 2003 19:20:23 -0000
@@ -2149,6 +2149,7 @@ extern void build_insn_chain (rtx);
 extern int reg_classes_intersect_p (enum reg_class, enum reg_class);
 extern int reg_class_subset_p (enum reg_class, enum reg_class);
 extern void globalize_reg (int);
+extern void init_reg_modes (void);
 extern void init_regs (void);
 extern void init_fake_stack_mems (void);
 extern void init_reg_sets (void);
Index: toplev.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/toplev.c,v
retrieving revision 1.814
diff -u -p -r1.814 toplev.c
--- toplev.c	25 Jul 2003 09:52:26 -0000	1.814
+++ toplev.c	2 Aug 2003 19:20:29 -0000
@@ -4402,9 +4402,6 @@ process_options (void)
 static void
 backend_init (void)
 {
-  /* init_emit_once uses reg_raw_mode and therefore must be called
-     after init_regs which initialized reg_raw_mode.  */
-  init_regs ();
   init_emit_once (debug_info_level == DINFO_LEVEL_NORMAL
 		  || debug_info_level == DINFO_LEVEL_VERBOSE
 #ifdef VMS_DEBUGGING_INFO
@@ -4413,6 +4410,8 @@ backend_init (void)
 #endif
 		    || flag_test_coverage
 		    || warn_notreached);
+
+  init_regs ();
   init_fake_stack_mems ();
   init_alias_once ();
   init_loop ();

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