This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
fix PR 5705
- From: Phil Blundell <pb at nexus dot co dot uk>
- To: gcc-patches at gcc dot gnu dot org
- Date: 19 Feb 2002 16:08:51 +0000
- Subject: fix PR 5705
This is a bit ugly but it does seem to solve the problem. Anyone got a
better idea?
p.
2002-02-19 Philip Blundell <philb@gnu.org>
* regrename.c (CALL_USED_REG_THIS_FUNCTION): New macro.
(regrename_optimize): Use it instead of checking call_used_regs[].
* config/arm/arm.h (CALL_USED_REG_THIS_FUNCTION): Define here.
Index: regrename.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/regrename.c,v
retrieving revision 1.44
diff -u -r1.44 regrename.c
--- regrename.c 19 Feb 2002 02:53:12 -0000 1.44
+++ regrename.c 19 Feb 2002 16:04:07 -0000
@@ -47,6 +47,10 @@
#define REG_MODE_OK_FOR_BASE_P(REGNO, MODE) REG_OK_FOR_BASE_P (REGNO)
#endif
+#ifndef CALL_USED_REG_THIS_FUNCTION(n)
+#define CALL_USED_REG_THIS_FUNCTION(n) (call_used_regs[n])
+#endif
+
static const char *const reg_class_names[] = REG_CLASS_NAMES;
struct du_chain
@@ -307,7 +311,7 @@
|| global_regs[new_reg + i]
/* Can't use regs which aren't saved by the prologue. */
|| (! regs_ever_live[new_reg + i]
- && ! call_used_regs[new_reg + i])
+ && ! CALL_USED_REG_THIS_FUNCTION (new_reg + i))
#ifdef LEAF_REGISTERS
/* We can't use a non-leaf register if we're in a
leaf function. */
Index: config/arm/arm.h
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/config/arm/arm.h,v
retrieving revision 1.136
diff -u -r1.136 arm.h
--- config/arm/arm.h 4 Feb 2002 20:23:07 -0000 1.136
+++ config/arm/arm.h 19 Feb 2002 16:04:08 -0000
@@ -1027,6 +1027,11 @@
16, 17, 18, 19, 20, 21, 22, 23, \
24, 25, 26 \
}
+
+#define CALL_USED_REG_THIS_FUNCTION(n) \
+ (!IS_INTERRUPT(cfun->machine->func_type) && \
+ call_used_regs[n])
+
/* Register and constant classes. */