This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[cs] move init_reg_modes call
- From: Per Bothner <per at bothner dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 13 Aug 2003 15:17:43 -0700
- Subject: [cs] move init_reg_modes call
I checked the attached patch into the compile-server branch.
I'm still waiting for approval to check it into the trunk.
See http://gcc.gnu.org/ml/gcc-patches/2003-08/msg00580.html
--
--Per Bothner
per@bothner.com http://per.bothner.com/
2003-08-13 Per Bothner <pbothner@apple.com>
[Compile-server will need to separate one-time and once-per-output-file
backend initialization.]
* regclass.c (init_reg_modes): Make non-static.
Rename to init_reg_modes_once per new naming convention.
(init_regs): Don't call init_reg_modes here.
* emit-rtl.c (init_emit_once): Call init_reg_modes_once here instead.
* rtl.h (init_reg_modes_once): 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 9 Aug 2003 22:17:58 -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_once ();
+
/* 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 9 Aug 2003 22:17:59 -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,8 +545,8 @@ 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
-init_reg_modes (void)
+void
+init_reg_modes_once (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 9 Aug 2003 22:18:01 -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_once (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.817
diff -u -p -r1.817 toplev.c
--- toplev.c 8 Aug 2003 19:22:42 -0000 1.817
+++ toplev.c 9 Aug 2003 22:18:03 -0000
@@ -4250,9 +4250,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
@@ -4261,6 +4258,8 @@ backend_init (void)
#endif
|| flag_test_coverage
|| warn_notreached);
+
+ init_regs ();
init_fake_stack_mems ();
init_alias_once ();
init_loop ();