This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
[fix] for: ra-colorize.c:1068: `inv_reg_alloc_order' undeclared
- From: Michael Matz <matz at suse dot de>
- To: John David Anglin <dave at hiauly1 dot hia dot nrc dot ca>
- Cc: <gcc at gcc dot gnu dot org>, <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 24 Jul 2002 22:14:33 +0200 (CEST)
- Subject: [fix] for: ra-colorize.c:1068: `inv_reg_alloc_order' undeclared
Hi,
On Wed, 24 Jul 2002, John David Anglin wrote:
> The error occurs because inv_reg_alloc_order is only defined when
> REG_ALLOC_ORDER is defined. None of the vax ports define this macro.
Fixed thusly (will checkin after bootstrap/regtest):
Ciao,
Michael.
--
* ra-colorize.c (inv_reg_alloc_order): New macro.
(free_reg): Use it.
Index: ra-colorize.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ra-colorize.c,v
retrieving revision 1.2
diff -u -p -r1.2 ra-colorize.c
--- ra-colorize.c 15 Jul 2002 14:07:05 -0000 1.2
+++ ra-colorize.c 24 Jul 2002 20:09:14 -0000
@@ -1031,6 +1031,13 @@ color_usable_p (c, dont_begin_colors, fr
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_co
{
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