This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Change type type of global_regs from char[] to HARD_REG_SET
- From: Anatoly Sokolov <aesok at post dot ru>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sun, 11 Oct 2009 21:40:40 +0400
- Subject: [PATCH] Change type type of global_regs from char[] to HARD_REG_SET
Hello.
This patch replace global_regs char array to HARD_REG_SET global_reg_set.
It is allowed in a few cases to get rid of check array elements in cycles and
replace them with operations on HARD_REG_SET directly.
* hard-reg-set.h (global_regs): Remove.
(global_reg_set): New.
* reginfo.c (global_regs): Remove.
(global_reg_set): New.
(init_reg_sets): Clear global_reg_set instead of global_regs.
(init_reg_sets_1): Use global_reg_set instead of global_regs.
(globalize_reg): (Ditto.).
* combine.c (can_combine_p): (Ditto.).
(distribute_notes): (Ditto.).
* cse.c (FIXED_REGNO_P): Use global_reg_set and fixed_reg_set
instead of global_regs and fixed_regs.
(hash_rtx_cb): (Ditto.).
* df-scan.c (df_get_call_refs): Use global_reg_set instead of
global_regs.
(df_get_exit_block_use_set): (Ditto.).
* final.c (only_leaf_regs_used): (Ditto.).
* ifcvt.c (dead_or_predicable): Use global_reg_set and fixed_reg_set
instead of global_regs and fixed_regs.
* recog.c (peep2_find_free_register): (Ditto.).
* regcprop.c (copy_value): (Ditto.).
* regname.c (regrename_optimize): (Ditto.).
* sel-sched.c (mark_referenced_resources): Use global_reg_set instead
of global_regs.
(mark_target_live_regs): (Ditto.).
(init_resource_info): (Ditto.).
* sched-deps.c (deps_analyze_insn): (Ditto.).
* sched-rgn.c (check_live_1): (Ditto.).
(update_live_1): (Ditto.).
* sel-sched.c (init_regs_for_mode): Use global_reg_set and
fixed_reg_set instead of global_regs and fixed_regs.
(mark_unavailable_hard_regs): (Ditto.).
* config/arm/arm.h (CONDITIONAL_REGISTER_USAGE): Use global_reg_set
instead of global_regs.
* config/frv/frv.c (frv_int_to_acc): Use global_reg_set instead of
global_regs.
(frv_read_iacc_argument): (Ditto.).
* config/ia64/ia64.c (find_gr_spill): Use call_used_reg_set,
global_reg_set and fixed_reg_set instead of call_used_regs,
global_regs and fixed_regs.
(next_scratch_gr_reg): (Ditto.).
* config/mep/mep.c (mep_conditional_register_usage): Use
global_reg_set instead of global_regs.
(global_reg_mentioned_p_1): (Ditto.).
* config/mips/mips.c (mips_conditional_register_usage): Use
global_reg_set instead of global_regs.
* config/rs6000/rs6000.c (rs6000_conditional_register_usage): Use
global_reg_set instead of global_regs.
(no_global_regs_above): (Ditto.).
* config/s390/s390.c (s390_register_info): Use global_reg_set and
fixed_reg_set instead of global_regs and fixed_regs.
(global_not_special_regno_p): Use global_reg_set instead of
global_regs.
* config/sh/sh.c (output_stack_adjust): Use global_reg_set and
fixed_reg_set instead of global_regs and fixed_regs.
This patch bootstrapped and regression tested on ia64-unknown-linux-gnu,
powerpc-unknown-linux-gnu and x86_64-unknown-linux-gnu, bootstrapped on
armv5tel-unknown-linux-gnueabi and regression tested on sh-unknown-elf and
frv-unknown-elf targets.
Non tested on mips, mep and s390 targets.
Ok for apply?
Index: gcc/regrename.c
===================================================================
--- gcc/regrename.c (revision 152638)
+++ gcc/regrename.c (working copy)
@@ -248,7 +248,8 @@
}
#endif
- if (fixed_regs[reg] || global_regs[reg]
+ if (TEST_HARD_REG_BIT (fixed_reg_set, reg)
+ || TEST_HARD_REG_BIT (global_reg_set, reg)
#if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM
|| (frame_pointer_needed && reg == HARD_FRAME_POINTER_REGNUM)
#else
@@ -287,8 +288,8 @@
for (i = nregs - 1; i >= 0; --i)
if (TEST_HARD_REG_BIT (this_unavailable, new_reg + i)
- || fixed_regs[new_reg + i]
- || global_regs[new_reg + i]
+ || TEST_HARD_REG_BIT (fixed_reg_set, new_reg + i)
+ || TEST_HARD_REG_BIT (global_reg_set, new_reg + i)
/* Can't use regs which aren't saved by the prologue. */
|| (! df_regs_ever_live_p (new_reg + i)
&& ! call_used_regs[new_reg + i])
Index: gcc/final.c
===================================================================
--- gcc/final.c (revision 152638)
+++ gcc/final.c (working copy)
@@ -4037,7 +4037,7 @@
const char *const permitted_reg_in_leaf_functions = LEAF_REGISTERS;
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
- if ((df_regs_ever_live_p (i) || global_regs[i])
+ if ((df_regs_ever_live_p (i) || TEST_HARD_REG_BIT (global_reg_set, i))
&& ! permitted_reg_in_leaf_functions[i])
return 0;
Index: gcc/df-scan.c
===================================================================
--- gcc/df-scan.c (revision 152638)
+++ gcc/df-scan.c (working copy)
@@ -3435,6 +3435,8 @@
unsigned int i;
df_ref def;
bitmap defs_generated = BITMAP_ALLOC (&df_bitmap_obstack);
+ unsigned cur_reg;
+ hard_reg_set_iterator hrsi;
/* Do not generate clobbers for registers that are the result of the
call. This causes ordering problems in the chain building code
@@ -3475,21 +3477,20 @@
/* Calls may also reference any of the global registers,
so they are recorded as used. */
- for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
- if (global_regs[i])
- {
- df_ref_record (DF_REF_BASE, collection_rec, regno_reg_rtx[i],
- NULL, bb, insn_info, DF_REF_REG_USE, flags, -1, -1,
- VOIDmode);
- df_ref_record (DF_REF_BASE, collection_rec, regno_reg_rtx[i],
- NULL, bb, insn_info, DF_REF_REG_DEF, flags, -1, -1,
- VOIDmode);
- }
+ EXECUTE_IF_SET_IN_HARD_REG_SET (global_reg_set, 0, cur_reg, hrsi)
+ {
+ df_ref_record (DF_REF_BASE, collection_rec, regno_reg_rtx[cur_reg],
+ NULL, bb, insn_info, DF_REF_REG_USE, flags, -1, -1,
+ VOIDmode);
+ df_ref_record (DF_REF_BASE, collection_rec, regno_reg_rtx[cur_reg],
+ NULL, bb, insn_info, DF_REF_REG_DEF, flags, -1, -1,
+ VOIDmode);
+ }
is_sibling_call = SIBLING_CALL_P (insn_info->insn);
EXECUTE_IF_SET_IN_BITMAP (regs_invalidated_by_call_regset, 0, ui, bi)
{
- if (!global_regs[ui]
+ if (!TEST_HARD_REG_BIT (global_reg_set, ui)
&& (!bitmap_bit_p (defs_generated, ui))
&& (!is_sibling_call
|| !bitmap_bit_p (df->exit_block_uses, ui)
@@ -4047,7 +4048,7 @@
epilogue as being live at the end of the function since they
may be referenced by our caller. */
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
- if (global_regs[i] || EPILOGUE_USES (i))
+ if (TEST_HARD_REG_BIT (global_reg_set, i) || EPILOGUE_USES (i))
bitmap_set_bit (exit_block_uses, i);
if (HAVE_epilogue && epilogue_completed)
Index: gcc/cse.c
===================================================================
--- gcc/cse.c (revision 152638)
+++ gcc/cse.c (working copy)
@@ -464,7 +464,8 @@
A reg wins if it is either the frame pointer or designated as fixed. */
#define FIXED_REGNO_P(N) \
((N) == FRAME_POINTER_REGNUM || (N) == HARD_FRAME_POINTER_REGNUM \
- || fixed_regs[N] || global_regs[N])
+ || TEST_HARD_REG_BIT (fixed_reg_set, (N)) \
+ || TEST_HARD_REG_BIT (global_reg_set, (N)))
/* Compute cost of X, as stored in the `cost' field of a table_elt. Fixed
hard registers and pointers into the frame are the cheapest with a cost
@@ -2298,9 +2299,9 @@
|| x == stack_pointer_rtx
|| x == pic_offset_table_rtx)
record = true;
- else if (global_regs[regno])
+ else if (TEST_HARD_REG_BIT (global_reg_set, regno))
record = false;
- else if (fixed_regs[regno])
+ else if (TEST_HARD_REG_BIT (fixed_reg_set, regno))
record = true;
else if (GET_MODE_CLASS (GET_MODE (x)) == MODE_CC)
record = true;
Index: gcc/sel-sched.c
===================================================================
--- gcc/sel-sched.c (revision 152638)
+++ gcc/sel-sched.c (working copy)
@@ -1131,8 +1131,8 @@
int i;
for (i = nregs - 1; i >= 0; --i)
- if (fixed_regs[cur_reg + i]
- || global_regs[cur_reg + i]
+ if (TEST_HARD_REG_BIT (fixed_reg_set, cur_reg + i)
+ || TEST_HARD_REG_BIT (global_reg_set, cur_reg + i)
/* Can't use regs which aren't saved by
the prologue. */
|| !TEST_HARD_REG_BIT (sel_hrd.regs_ever_used, cur_reg + i)
@@ -1231,10 +1231,10 @@
mode = GET_MODE (orig_dest);
/* Stop when mode is not supported for renaming. Also can't proceed
- if the original register is one of the fixed_regs, global_regs or
+ if the original register is one of the fixed_reg_set, global_reg_set or
frame pointer. */
- if (fixed_regs[regno]
- || global_regs[regno]
+ if (TEST_HARD_REG_BIT (fixed_reg_set, regno)
+ || TEST_HARD_REG_BIT (global_reg_set, regno)
#if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM
|| (frame_pointer_needed && regno == HARD_FRAME_POINTER_REGNUM)
#else
Index: gcc/ifcvt.c
===================================================================
--- gcc/ifcvt.c (revision 152638)
+++ gcc/ifcvt.c (working copy)
@@ -3978,8 +3978,8 @@
EXECUTE_IF_SET_IN_BITMAP (merge_set, 0, i, bi)
{
if (i < FIRST_PSEUDO_REGISTER
- && ! fixed_regs[i]
- && ! global_regs[i])
+ && ! TEST_HARD_REG_BIT (fixed_reg_set, i)
+ && ! TEST_HARD_REG_BIT (global_reg_set, i))
fail = 1;
}
}
Index: gcc/hard-reg-set.h
===================================================================
--- gcc/hard-reg-set.h (revision 152638)
+++ gcc/hard-reg-set.h (working copy)
@@ -608,15 +608,14 @@
extern HARD_REG_SET call_fixed_reg_set;
-/* Indexed by hard register number, contains 1 for registers
- that are being used for global register decls.
+/* Contains registers that are being used for global register decls.
These must be exempt from ordinary flow analysis
and are also considered fixed. */
-extern char global_regs[FIRST_PSEUDO_REGISTER];
+extern HARD_REG_SET global_reg_set;
/* Contains 1 for registers that are set or clobbered by calls. */
-/* ??? Ideally, this would be just call_used_regs plus global_regs, but
+/* ??? Ideally, this would be just call_used_reg_set plus global_reg_set, but
for someone's bright idea to have call_used_regs strictly include
fixed_regs. Which leaves us guessing as to the set of fixed_regs
that are actually preserved. We know for sure that those associated
Index: gcc/recog.c
===================================================================
--- gcc/recog.c (revision 152638)
+++ gcc/recog.c (working copy)
@@ -3020,10 +3020,10 @@
#endif
/* Don't allocate fixed registers. */
- if (fixed_regs[regno])
+ if (TEST_HARD_REG_BIT (fixed_reg_set, regno))
continue;
/* Don't allocate global registers. */
- if (global_regs[regno])
+ if (TEST_HARD_REG_BIT (global_reg_set, regno))
continue;
/* Make sure the register is of the right class. */
if (! TEST_HARD_REG_BIT (reg_class_contents[cl], regno))
Index: gcc/sched-deps.c
===================================================================
--- gcc/sched-deps.c (revision 152638)
+++ gcc/sched-deps.c (working copy)
@@ -3229,7 +3229,7 @@
{
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
/* A call may read and modify global register variables. */
- if (global_regs[i])
+ if (TEST_HARD_REG_BIT (global_reg_set, i))
{
SET_REGNO_REG_SET (reg_pending_sets, i);
SET_HARD_REG_BIT (implicit_reg_pending_uses, i);
Index: gcc/combine.c
===================================================================
--- gcc/combine.c (revision 152638)
+++ gcc/combine.c (working copy)
@@ -1666,7 +1666,7 @@
&& (find_reg_fusage (i3, USE, dest)
|| (REG_P (dest)
&& REGNO (dest) < FIRST_PSEUDO_REGISTER
- && global_regs[REGNO (dest)])))
+ && TEST_HARD_REG_BIT (global_reg_set, REGNO (dest)))))
/* Don't substitute into an incremented register. */
|| FIND_REG_INC_NOTE (i3, dest)
|| (succ && FIND_REG_INC_NOTE (succ, dest))
@@ -12986,7 +12986,8 @@
into a REG_UNUSED note instead. Don't delete sets to
global register vars. */
if ((REGNO (XEXP (note, 0)) >= FIRST_PSEUDO_REGISTER
- || !global_regs[REGNO (XEXP (note, 0))])
+ || !TEST_HARD_REG_BIT (global_reg_set,
+ REGNO (XEXP (note, 0))))
&& reg_set_p (XEXP (note, 0), PATTERN (tem)))
{
rtx set = single_set (tem);
Index: gcc/resource.c
===================================================================
--- gcc/resource.c (revision 152638)
+++ gcc/resource.c (working copy)
@@ -339,9 +339,7 @@
#endif
}
- for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
- if (global_regs[i])
- SET_HARD_REG_BIT (res->regs, i);
+ IOR_HARD_REG_SET(res->regs, global_reg_set);
/* Check for a REG_SETJMP. If it exists, then we must
assume that this call can need any register.
@@ -869,7 +867,6 @@
mark_target_live_regs (rtx insns, rtx target, struct resources *res)
{
int b = -1;
- unsigned int i;
struct target_info *tinfo = NULL;
rtx insn;
rtx jump_insn = 0;
@@ -1002,9 +999,7 @@
/* A CALL_INSN sets any global register live, since it may
have been modified by the call. */
- for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
- if (global_regs[i])
- SET_HARD_REG_BIT (current_live_regs, i);
+ IOR_HARD_REG_SET(current_live_regs, global_reg_set);
}
/* Mark anything killed in an insn to be deadened at the next
@@ -1162,7 +1157,7 @@
&end_of_function_needs, true);
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
- if (global_regs[i]
+ if (TEST_HARD_REG_BIT (global_reg_set, i)
#ifdef EPILOGUE_USES
|| EPILOGUE_USES (i)
#endif
Index: gcc/reginfo.c
===================================================================
--- gcc/reginfo.c (revision 152638)
+++ gcc/reginfo.c (working copy)
@@ -108,14 +108,14 @@
HARD_REG_SET call_fixed_reg_set;
-/* Indexed by hard register number, contains 1 for registers
- that are being used for global register decls.
+/* Contains registers that are being used for global register decls.
These must be exempt from ordinary flow analysis
and are also considered fixed. */
-char global_regs[FIRST_PSEUDO_REGISTER];
+HARD_REG_SET global_reg_set;
+
/* Contains 1 for registers that are set or clobbered by calls. */
-/* ??? Ideally, this would be just call_used_regs plus global_regs, but
+/* ??? Ideally, this would be just call_used_reg_set plus global_reg_set, but
for someone's bright idea to have call_used_regs strictly include
fixed_regs. Which leaves us guessing as to the set of fixed_regs
that are actually preserved. We know for sure that those associated
@@ -254,7 +254,7 @@
memcpy (fixed_regs, initial_fixed_regs, sizeof fixed_regs);
memcpy (call_used_regs, initial_call_used_regs, sizeof call_used_regs);
- memset (global_regs, 0, sizeof global_regs);
+ CLEAR_HARD_REG_SET (global_reg_set);
}
/* Initialize may_move_cost and friends for mode M. */
@@ -539,7 +539,7 @@
if (i == STACK_POINTER_REGNUM)
;
- else if (global_regs[i])
+ else if (TEST_HARD_REG_BIT (global_reg_set, i))
{
SET_HARD_REG_BIT (regs_invalidated_by_call, i);
SET_REGNO_REG_SET (regs_invalidated_by_call_regset, i);
@@ -570,15 +570,16 @@
/* Preserve global registers if called more than once. */
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
{
- if (global_regs[i])
+ if (TEST_HARD_REG_BIT (global_reg_set, i))
{
fixed_regs[i] = call_used_regs[i] = 1;
- SET_HARD_REG_BIT (fixed_reg_set, i);
- SET_HARD_REG_BIT (call_used_reg_set, i);
- SET_HARD_REG_BIT (call_fixed_reg_set, i);
}
}
+ IOR_HARD_REG_SET(fixed_reg_set, global_reg_set);
+ IOR_HARD_REG_SET(call_used_reg_set, global_reg_set);
+ IOR_HARD_REG_SET(call_fixed_reg_set, global_reg_set);
+
memset (have_regs_of_mode, 0, sizeof (have_regs_of_mode));
memset (contains_reg_of_mode, 0, sizeof (contains_reg_of_mode));
for (m = 0; m < (unsigned int) MAX_MACHINE_MODE; m++)
@@ -842,7 +843,7 @@
if (fixed_regs[i] == 0 && no_global_reg_vars)
error ("global register variable follows a function definition");
- if (global_regs[i])
+ if (TEST_HARD_REG_BIT (global_reg_set, i))
{
warning (0, "register used for two global register variables");
return;
@@ -851,7 +852,7 @@
if (call_used_regs[i] && ! fixed_regs[i])
warning (0, "call-clobbered register used for global register variable");
- global_regs[i] = 1;
+ SET_HARD_REG_BIT (global_reg_set, i);
/* If we're globalizing the frame pointer, we need to set the
appropriate regs_invalidated_by_call bit, even if it's already
Index: gcc/sched-rgn.c
===================================================================
--- gcc/sched-rgn.c (revision 152638)
+++ gcc/sched-rgn.c (working copy)
@@ -1681,7 +1681,8 @@
regno = REGNO (reg);
- if (regno < FIRST_PSEUDO_REGISTER && global_regs[regno])
+ if (regno < FIRST_PSEUDO_REGISTER
+ && TEST_HARD_REG_BIT (global_reg_set, regno))
{
/* Global registers are assumed live. */
return 0;
@@ -1766,7 +1767,8 @@
regno = REGNO (reg);
- if (regno >= FIRST_PSEUDO_REGISTER || !global_regs[regno])
+ if (regno >= FIRST_PSEUDO_REGISTER
+ || !TEST_HARD_REG_BIT (global_reg_set, regno))
{
if (regno < FIRST_PSEUDO_REGISTER)
{
Index: gcc/config/frv/frv.c
===================================================================
--- gcc/config/frv/frv.c (revision 152638)
+++ gcc/config/frv/frv.c (working copy)
@@ -8687,7 +8687,10 @@
unnecessary call_insn rtl in non-media code. */
for (i = 0; i <= ACC_MASK; i++)
if ((i & ACC_MASK) == i)
- global_regs[i + ACC_FIRST] = global_regs[i + ACCG_FIRST] = 1;
+ {
+ SET_HARD_REG_BIT (global_reg_set, i + ACC_FIRST);
+ SET_HARD_REG_BIT (global_reg_set, i + ACCG_FIRST);
+ }
if (GET_CODE (opval) != CONST_INT)
{
@@ -8793,7 +8796,7 @@
being used. */
regno = INTVAL (op) + IACC_FIRST;
for (i = 0; i < HARD_REGNO_NREGS (regno, mode); i++)
- global_regs[regno + i] = 1;
+ SET_HARD_REG_BIT (global_reg_set, regno + i);
return gen_rtx_REG (mode, regno);
}
Index: gcc/config/s390/s390.c
===================================================================
--- gcc/config/s390/s390.c (revision 152638)
+++ gcc/config/s390/s390.c (working copy)
@@ -6930,7 +6930,7 @@
cfun_frame_layout.high_fprs = 0;
if (TARGET_64BIT)
for (i = 24; i < 32; i++)
- if (df_regs_ever_live_p (i) && !global_regs[i])
+ if (df_regs_ever_live_p (i) && !TEST_HARD_REG_BIT (global_reg_set, i))
{
cfun_set_fpr_bit (i - 16);
cfun_frame_layout.high_fprs++;
@@ -6945,7 +6945,9 @@
s390_regs_ever_clobbered (clobbered_regs);
for (i = 0; i < 16; i++)
- clobbered_regs[i] = clobbered_regs[i] && !global_regs[i] && !fixed_regs[i];
+ clobbered_regs[i] = clobbered_regs[i]
+ && !TEST_HARD_REG_BIT (global_reg_set, i)
+ && !TEST_HARD_REG_BIT (fixed_reg_set, i);
if (frame_pointer_needed)
clobbered_regs[HARD_FRAME_POINTER_REGNUM] = 1;
@@ -7072,7 +7074,8 @@
if (!TARGET_64BIT)
for (i = 2; i < 4; i++)
- if (df_regs_ever_live_p (i + 16) && !global_regs[i + 16])
+ if (df_regs_ever_live_p (i + 16)
+ && !TEST_HARD_REG_BIT (global_reg_set, i + 16))
cfun_set_fpr_bit (i);
}
@@ -7458,7 +7461,7 @@
static inline bool
global_not_special_regno_p (int regno)
{
- return (global_regs[regno]
+ return (TEST_HARD_REG_BIT (global_reg_set, regno)
/* These registers are special and need to be
restored in any case. */
&& !(regno == STACK_POINTER_REGNUM
Index: gcc/config/mep/mep.c
===================================================================
--- gcc/config/mep/mep.c (revision 152638)
+++ gcc/config/mep/mep.c (working copy)
@@ -367,7 +367,7 @@
}
for (i = FIRST_SHADOW_REGISTER; i <= LAST_SHADOW_REGISTER; i++)
- global_regs[i] = 1;
+ SET_HARD_REG_BIT (global_reg_set, i);
}
void
@@ -6545,7 +6545,7 @@
if (REG_P (SUBREG_REG (x)))
{
if (REGNO (SUBREG_REG (x)) < FIRST_PSEUDO_REGISTER
- && global_regs[subreg_regno (x)])
+ && TEST_HARD_REG_BIT (global_reg_set, subreg_regno (x)))
return 1;
return 0;
}
@@ -6553,7 +6553,8 @@
case REG:
regno = REGNO (x);
- if (regno < FIRST_PSEUDO_REGISTER && global_regs[regno])
+ if (regno < FIRST_PSEUDO_REGISTER
+ && TEST_HARD_REG_BIT (global_reg_set, regno))
return 1;
return 0;
Index: gcc/config/sh/sh.c
===================================================================
--- gcc/config/sh/sh.c (revision 152638)
+++ gcc/config/sh/sh.c (working copy)
@@ -6158,8 +6158,10 @@
But since all this is rather unlikely to happen and
would require extra testing, we just die if r4 / r5
are not available. */
- gcc_assert (!fixed_regs[4] && !fixed_regs[5]
- && !global_regs[4] && !global_regs[5]);
+ gcc_assert (!TEST_HARD_REG_BIT (fixed_reg_set, 4)
+ && !TEST_HARD_REG_BIT (fixed_reg_set, 5)
+ && !TEST_HARD_REG_BIT (global_reg_set, 4)
+ && !TEST_HARD_REG_BIT (global_reg_set, 5));
adj_reg = gen_rtx_REG (GET_MODE (reg), 4);
tmp_reg = gen_rtx_REG (GET_MODE (reg), 5);
Index: gcc/config/ia64/ia64.c
===================================================================
--- gcc/config/ia64/ia64.c (revision 152638)
+++ gcc/config/ia64/ia64.c (working copy)
@@ -2372,9 +2372,9 @@
{
for (regno = GR_REG (1); regno <= GR_REG (31); regno++)
if (! df_regs_ever_live_p (regno)
- && call_used_regs[regno]
- && ! fixed_regs[regno]
- && ! global_regs[regno]
+ && TEST_HARD_REG_BIT (call_used_reg_set, regno)
+ && ! TEST_HARD_REG_BIT (fixed_reg_set, regno)
+ && ! TEST_HARD_REG_BIT (global_reg_set, regno)
&& ((current_frame_info.gr_used_mask >> regno) & 1) == 0
&& ! is_emitted (regno))
{
@@ -2420,9 +2420,9 @@
for (i = 0; i < 32; ++i)
{
regno = (last_scratch_gr_reg + i + 1) & 31;
- if (call_used_regs[regno]
- && ! fixed_regs[regno]
- && ! global_regs[regno]
+ if (TEST_HARD_REG_BIT (call_used_reg_set, regno)
+ && ! TEST_HARD_REG_BIT (fixed_reg_set, regno)
+ && ! TEST_HARD_REG_BIT (global_reg_set, regno)
&& ((current_frame_info.gr_used_mask >> regno) & 1) == 0)
{
last_scratch_gr_reg = regno;
Index: gcc/config/rs6000/rs6000.c
===================================================================
--- gcc/config/rs6000/rs6000.c (revision 152638)
+++ gcc/config/rs6000/rs6000.c (working copy)
@@ -5936,7 +5936,7 @@
if (TARGET_SPE)
{
- global_regs[SPEFSCR_REGNO] = 1;
+ SET_HARD_REG_BIT (global_reg_set, SPEFSCR_REGNO);
/* We used to use r14 as FIXED_SCRATCH to address SPE 64-bit
registers in prologues and epilogues. We no longer use r14
for FIXED_SCRATCH, but we're keeping r14 out of the allocation
@@ -5956,7 +5956,7 @@
}
if (TARGET_ALTIVEC || TARGET_VSX)
- global_regs[VSCR_REGNO] = 1;
+ SET_HARD_REG_BIT (global_reg_set, VSCR_REGNO);
if (TARGET_ALTIVEC_ABI)
{
@@ -18077,7 +18077,7 @@
int i;
int last = gpr ? 32 : 64;
for (i = first; i < last; i++)
- if (global_regs[i])
+ if (TEST_HARD_REG_BIT (global_reg_set, i))
return false;
return true;
}
Index: gcc/config/arm/arm.h
===================================================================
--- gcc/config/arm/arm.h (revision 152638)
+++ gcc/config/arm/arm.h (working copy)
@@ -865,7 +865,7 @@
fixed_regs[ARM_HARD_FRAME_POINTER_REGNUM] = 1; \
call_used_regs[ARM_HARD_FRAME_POINTER_REGNUM] = 1; \
if (TARGET_CALLER_INTERWORKING) \
- global_regs[ARM_HARD_FRAME_POINTER_REGNUM] = 1; \
+ SET_HARD_REG_BIT (global_reg_set, ARM_HARD_FRAME_POINTER_REGNUM); \
} \
SUBTARGET_CONDITIONAL_REGISTER_USAGE \
}
Index: gcc/config/mips/mips.c
===================================================================
--- gcc/config/mips/mips.c (revision 152638)
+++ gcc/config/mips/mips.c (working copy)
@@ -15713,8 +15713,8 @@
if (ISA_HAS_DSP)
{
/* These DSP control register fields are global. */
- global_regs[CCDSP_PO_REGNUM] = 1;
- global_regs[CCDSP_SC_REGNUM] = 1;
+ SET_HARD_REG_BIT (global_reg_set, CCDSP_PO_REGNUM);
+ SET_HARD_REG_BIT (global_reg_set, CCDSP_SC_REGNUM);
}
else
{
Index: gcc/regcprop.c
===================================================================
--- gcc/regcprop.c (revision 152638)
+++ gcc/regcprop.c (working copy)
@@ -282,7 +282,8 @@
/* Do not propagate copies to fixed or global registers, patterns
can be relying to see particular fixed register or users can
expect the chosen global register in asm. */
- if (fixed_regs[dr] || global_regs[dr])
+ if (TEST_HARD_REG_BIT (fixed_reg_set, dr)
+ || TEST_HARD_REG_BIT (global_reg_set, dr))
return;
/* If SRC and DEST overlap, don't record anything. */
Anatoly