From c560531806f36915bd7ed6eb7419af39e872092d Mon Sep 17 00:00:00 2001 From: Michael Matz Date: Wed, 24 Jul 2002 20:52:26 +0000 Subject: [PATCH] ra-colorize.c (INV_REG_ALLOC_ORDER): New macro. * ra-colorize.c (INV_REG_ALLOC_ORDER): New macro. (free_reg): Use it. From-SVN: r55721 --- gcc/ChangeLog | 5 +++++ gcc/ra-colorize.c | 15 +++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8c38eb767ba..ce11083950e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2002-07-24 Michael Matz + + * ra-colorize.c (INV_REG_ALLOC_ORDER): New macro. + (free_reg): Use it. + 2002-07-24 Richard Earnshaw * arm.md (arm_buneq, arm_bltgt): put '\' before ';' in output diff --git a/gcc/ra-colorize.c b/gcc/ra-colorize.c index 297b419e900..f101eaa7363 100644 --- a/gcc/ra-colorize.c +++ b/gcc/ra-colorize.c @@ -1031,6 +1031,13 @@ color_usable_p (c, dont_begin_colors, free_colors, mode) return 0; } +/* I don't want to clutter up the actual code with ifdef's. */ +#ifdef REG_ALLOC_ORDER +#define INV_REG_ALLOC_ORDER(c) inv_reg_alloc_order[c] +#else +#define INV_REG_ALLOC_ORDER(c) c +#endif + /* Searches in FREE_COLORS for a block of hardregs of the right length for MODE, which doesn't begin at a hardreg mentioned in DONT_BEGIN_COLORS. If it needs more than one hardreg it prefers blocks beginning @@ -1065,16 +1072,16 @@ get_free_reg (dont_begin_colors, free_colors, mode) { if (size < 2 || (c & 1) == 0) { - if (inv_reg_alloc_order[c] < pref_reg_order) + if (INV_REG_ALLOC_ORDER (c) < pref_reg_order) { pref_reg = c; - pref_reg_order = inv_reg_alloc_order[c]; + pref_reg_order = INV_REG_ALLOC_ORDER (c); } } - else if (inv_reg_alloc_order[c] < last_resort_reg_order) + else if (INV_REG_ALLOC_ORDER (c) < last_resort_reg_order) { last_resort_reg = c; - last_resort_reg_order = inv_reg_alloc_order[c]; + last_resort_reg_order = INV_REG_ALLOC_ORDER (c); } } else -- 2.30.2