aboutsummaryrefslogtreecommitdiff
path: root/gcc/reload1.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@cygnus.com>2000-06-13 14:47:44 -0700
committerRichard Henderson <rth@gcc.gnu.org>2000-06-13 14:47:44 -0700
commit02188693ed5ff368a8c4340d449baf07c87812ec (patch)
tree18a58d10aaf4181b83524ed496b484df5ceed88e /gcc/reload1.c
parentd8058091121489b75926656e25d50e01ad1e46db (diff)
downloadgcc-02188693ed5ff368a8c4340d449baf07c87812ec.zip
gcc-02188693ed5ff368a8c4340d449baf07c87812ec.tar.gz
gcc-02188693ed5ff368a8c4340d449baf07c87812ec.tar.bz2
combine.c (subst): Use CLASS_CANNOT_CHANGE_MODE and CLASS_CANNOT_CHANGE_MODE_P instead of...
* combine.c (subst): Use CLASS_CANNOT_CHANGE_MODE and CLASS_CANNOT_CHANGE_MODE_P instead of CLASS_CANNOT_CHANGE_SIZE and hard-coded tests. (simplify_set): Likewise. (gen_lowpart_for_combine): Likewise. * emit-rtl.c (gen_lowpart_common): Likewise. * global.c (find_reg): Likewise. * local-alloc.c (find_free_reg): Likewise. * recog.c (register_operand): Likewise. * regclass.c (init_reg_sets_1): Likewise. (record_operand_costs, regclass): Likewise. * reload.c (push_reload): Likewise. * reload1.c (choose_reload_regs): Likewise. * flow.c (mark_used_regs): Conditionally set REG_CHANGES_MODE. * local-alloc.c (struct qty): Rename changes_size to changes_mode. Update all references. * regs.h (struct reg_info_def): Likewise. (REG_CHANGES_MODE): Rename from REG_CHANGES_SIZE. * tm.texi (CLASS_CANNOT_CHANGE_MODE): Document. (CLASS_CANNOT_CHANGE_MODE_P): Likewise. * config/alpha/alpha.h (CLASS_CANNOT_CHANGE_MODE): Rename. (CLASS_CANNOT_CHANGE_MODE_P): New. * config/mips/mips.h: Likewise. * config/pa/pa32-regs.h: Likewise. * config/pa/pa64-regs.h: Likewise. * config/rs6000/rs6000.h: Likewise. * config/sh/sh.h: Likewise. * config/ia64/ia64.h (CLASS_CANNOT_CHANGE_MODE): New. (CLASS_CANNOT_CHANGE_MODE_P): New. * config/avr/avr.h (CLASS_CANNOT_CHANGE_SIZE): Remove dead code. * config/d30v/d30v.h: Likewise. From-SVN: r34526
Diffstat (limited to 'gcc/reload1.c')
-rw-r--r--gcc/reload1.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/gcc/reload1.c b/gcc/reload1.c
index 6f73aea..4949b89 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -5305,20 +5305,25 @@ choose_reload_regs (chain)
{
enum reg_class class = rld[r].class, last_class;
rtx last_reg = reg_last_reload_reg[regno];
+ enum machine_mode need_mode;
i = REGNO (last_reg) + word;
last_class = REGNO_REG_CLASS (i);
+
+ need_mode = smallest_mode_for_size ((word+1) * UNITS_PER_WORD,
+ GET_MODE_CLASS (mode));
+
if (
-#ifdef CLASS_CANNOT_CHANGE_SIZE
+#ifdef CLASS_CANNOT_CHANGE_MODE
(TEST_HARD_REG_BIT
- (reg_class_contents[CLASS_CANNOT_CHANGE_SIZE], i)
- ? (GET_MODE_SIZE (GET_MODE (last_reg))
- == GET_MODE_SIZE (mode) + word * UNITS_PER_WORD)
+ (reg_class_contents[(int) CLASS_CANNOT_CHANGE_MODE], i)
+ ? ! CLASS_CANNOT_CHANGE_MODE_P (GET_MODE (last_reg),
+ need_mode)
: (GET_MODE_SIZE (GET_MODE (last_reg))
- >= GET_MODE_SIZE (mode) + word * UNITS_PER_WORD))
+ >= GET_MODE_SIZE (need_mode)))
#else
(GET_MODE_SIZE (GET_MODE (last_reg))
- >= GET_MODE_SIZE (mode) + word * UNITS_PER_WORD)
+ >= GET_MODE_SIZE (need_mode))
#endif
&& reg_reloaded_contents[i] == regno
&& TEST_HARD_REG_BIT (reg_reloaded_valid, i)