From d6ff8d832d191317ae3b737d725c3b672bd49483 Mon Sep 17 00:00:00 2001 From: meissner Date: Thu, 2 Jul 1998 13:49:34 +0000 Subject: Switch reg_n_info structure to use varrays git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@20894 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/regs.h | 35 +++++++++++++---------------------- 1 file changed, 13 insertions(+), 22 deletions(-) (limited to 'gcc/regs.h') diff --git a/gcc/regs.h b/gcc/regs.h index f063d26eeb9..e248665e9ba 100644 --- a/gcc/regs.h +++ b/gcc/regs.h @@ -1,5 +1,5 @@ /* Define per-register tables for data flow info and register allocation. - Copyright (C) 1987, 1993, 1994, 1995, 1997 Free Software Foundation, Inc. + Copyright (C) 1987, 1993, 1994, 1995, 1997, 1998 Free Software Foundation, Inc. This file is part of GNU CC. @@ -19,6 +19,7 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include "varray.h" #define REG_BYTES(R) mode_size[(int) GET_MODE (R)] @@ -60,30 +61,20 @@ typedef struct reg_info_def { char changes_size; /* whether (SUBREG (REG n)) changes size */ } reg_info; -extern reg_info *reg_n_info; +extern varray_type reg_n_info; extern unsigned int reg_n_max; -/* Check for REG_N_xxx macros being in bound, return N for use as an - index. */ -#ifdef ENABLE_CHECKING -#define REG_N_CHECK(N) \ -((((unsigned)(N) < (unsigned)reg_n_max) \ - ? 0 : (fatal ("Register %d out of bounds", (N)), 0)), (N)) -#else -#define REG_N_CHECK(N) (N) -#endif - /* Indexed by n, gives number of times (REG n) is used or set. References within loops may be counted more times. */ -#define REG_N_REFS(N) (reg_n_info[REG_N_CHECK (N)].refs) +#define REG_N_REFS(N) (VARRAY_REG (reg_n_info, N)->refs) /* Indexed by n, gives number of times (REG n) is set. ??? both regscan and flow allocate space for this. We should settle on just copy. */ -#define REG_N_SETS(N) (reg_n_info[REG_N_CHECK (N)].sets) +#define REG_N_SETS(N) (VARRAY_REG (reg_n_info, N)->sets) /* Indexed by N, gives number of insns in which register N dies. Note that if register N is live around loops, it can die @@ -91,13 +82,13 @@ extern unsigned int reg_n_max; So this is only a reliable indicator of how many regions of life there are for registers that are contained in one basic block. */ -#define REG_N_DEATHS(N) (reg_n_info[REG_N_CHECK (N)].deaths) +#define REG_N_DEATHS(N) (VARRAY_REG (reg_n_info, N)->deaths) /* Indexed by N; says whether a pseudo register N was ever used within a SUBREG that changes the size of the reg. Some machines prohibit such objects to be in certain (usually floating-point) registers. */ -#define REG_CHANGES_SIZE(N) (reg_n_info[REG_N_CHECK (N)].changes_size) +#define REG_CHANGES_SIZE(N) (VARRAY_REG (reg_n_info, N)->changes_size) /* Get the number of consecutive words required to hold pseudo-reg N. */ @@ -116,7 +107,7 @@ extern unsigned int reg_n_max; /* Indexed by N, gives number of CALL_INSNS across which (REG n) is live. */ -#define REG_N_CALLS_CROSSED(N) (reg_n_info[REG_N_CHECK (N)].calls_crossed) +#define REG_N_CALLS_CROSSED(N) (VARRAY_REG (reg_n_info, N)->calls_crossed) /* Total number of instructions at which (REG n) is live. The larger this is, the less priority (REG n) gets for @@ -133,7 +124,7 @@ extern unsigned int reg_n_max; is not required. global.c makes an allocno for this but does not try to assign a hard register to it. */ -#define REG_LIVE_LENGTH(N) (reg_n_info[REG_N_CHECK (N)].live_length) +#define REG_LIVE_LENGTH(N) (VARRAY_REG (reg_n_info, N)->live_length) /* Vector of substitutions of register numbers, used to map pseudo regs into hardware regs. @@ -165,7 +156,7 @@ extern enum machine_mode reg_raw_mode[FIRST_PSEUDO_REGISTER]; It is sometimes adjusted for subsequent changes during loop, but not adjusted by cse even if cse invalidates it. */ -#define REGNO_FIRST_UID(N) (reg_n_info[REG_N_CHECK (N)].first_uid) +#define REGNO_FIRST_UID(N) (VARRAY_REG (reg_n_info, N)->first_uid) /* Vector indexed by regno; gives uid of last insn using that reg. This is computed by reg_scan for use by cse and loop. @@ -173,11 +164,11 @@ extern enum machine_mode reg_raw_mode[FIRST_PSEUDO_REGISTER]; but not adjusted by cse even if cse invalidates it. This is harmless since cse won't scan through a loop end. */ -#define REGNO_LAST_UID(N) (reg_n_info[REG_N_CHECK (N)].last_uid) +#define REGNO_LAST_UID(N) (VARRAY_REG (reg_n_info, N)->last_uid) /* Similar, but includes insns that mention the reg in their notes. */ -#define REGNO_LAST_NOTE_UID(N) (reg_n_info[REG_N_CHECK (N)].last_note_uid) +#define REGNO_LAST_NOTE_UID(N) (VARRAY_REG (reg_n_info, N)->last_note_uid) /* This is reset to LAST_VIRTUAL_REGISTER + 1 at the start of each function. After rtl generation, it is 1 plus the largest register number used. */ @@ -230,4 +221,4 @@ extern int *scratch_block; extern int scratch_list_length; /* Allocate reg_n_info tables */ -extern void allocate_reg_info PROTO((int, int, int)); +extern void allocate_reg_info PROTO((size_t, int, int)); -- cgit v1.2.1