diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2020-12-17 00:14:58 +0000 |
---|---|---|
committer | Richard Sandiford <richard.sandiford@arm.com> | 2020-12-17 00:14:58 +0000 |
commit | 900846cda693e199f4ebafd99af72445c3016629 (patch) | |
tree | 3741d62cc4b98bee806d5b058c8663127be9a8e9 /gcc | |
parent | 7c1e7eed891a7b8fd8bbe6a13e6435cfbe7e9055 (diff) | |
download | gcc-900846cda693e199f4ebafd99af72445c3016629.zip gcc-900846cda693e199f4ebafd99af72445c3016629.tar.gz gcc-900846cda693e199f4ebafd99af72445c3016629.tar.bz2 |
reginfo: Add a global_reg_set
A later patch wants to use the set of global registers as a HARD_REG_SET
rather than a bool/char array. Most other arrays already have a
HARD_REG_SET counterpart, but this one didn't.
gcc/
* hard-reg-set.h (global_reg_set): Declare.
* reginfo.c (global_reg_set): New variable.
(init_reg_sets_1, globalize_reg): Update it when globalizing
registers.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/hard-reg-set.h | 2 | ||||
-rw-r--r-- | gcc/reginfo.c | 5 |
2 files changed, 7 insertions, 0 deletions
diff --git a/gcc/hard-reg-set.h b/gcc/hard-reg-set.h index 1ec1b4e..787da3a 100644 --- a/gcc/hard-reg-set.h +++ b/gcc/hard-reg-set.h @@ -359,6 +359,8 @@ hard_reg_set_iter_next (hard_reg_set_iterator *iter, unsigned *regno) extern char global_regs[FIRST_PSEUDO_REGISTER]; +extern HARD_REG_SET global_reg_set; + class simplifiable_subreg; class subreg_shape; diff --git a/gcc/reginfo.c b/gcc/reginfo.c index e34b74a..cc7d174 100644 --- a/gcc/reginfo.c +++ b/gcc/reginfo.c @@ -91,6 +91,9 @@ static const char initial_call_used_regs[] = CALL_USED_REGISTERS; and are also considered fixed. */ char global_regs[FIRST_PSEUDO_REGISTER]; +/* The set of global registers. */ +HARD_REG_SET global_reg_set; + /* Declaration for the global register. */ tree global_regs_decl[FIRST_PSEUDO_REGISTER]; @@ -390,6 +393,7 @@ init_reg_sets_1 (void) { fixed_regs[i] = call_used_regs[i] = 1; SET_HARD_REG_BIT (fixed_reg_set, i); + SET_HARD_REG_BIT (global_reg_set, i); } } @@ -724,6 +728,7 @@ globalize_reg (tree decl, int i) global_regs[i] = 1; global_regs_decl[i] = decl; + 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 |