This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] PR target/10775
- From: Kazuhiro Inaoka <inaoka dot kazuhiro at renesas dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 14 May 2003 15:57:14 +0900
- Subject: [PATCH] PR target/10775
Hi,
This patch is a proposed fix to the gcc-3.2.3 testsuite
failure of gcc.c-torture/execute/20000726-1.c (PR .10775)
Kazuhiro Inaoka
gcc/ChangeLog
PR 10775
* config/m32r/m32r.h (HARD_REGNO_RENAME_OK): New macro.
config/m32r.c: New m32r_hard_regno_rename_ok
config/m32r-protos.h : Add the prototype for
m32r_hard_regno_rename_ok
diff -u org_src/gcc-3.2.3/gcc/config/m32r/m32r-protos.h
gcc-3.2.3/gcc/config/m32r/m32r-protos.h
--- org_src/gcc-3.2.3/gcc/config/m32r/m32r-protos.h Mon Dec 10 05:13:14 2001
+++ gcc-3.2.3/gcc/config/m32r/m32r-protos.h Wed May 14 14:07:35 2003
@@ -60,6 +60,7 @@
extern void m32r_print_operand_address PARAMS ((FILE *, rtx));
extern int m32r_address_cost PARAMS ((rtx));
extern int m32r_not_same_reg PARAMS ((rtx, rtx));
+extern int m32r_hard_regno_rename_ok PARAMS ((unsigned int, unsigned
int));
#ifdef HAVE_MACHINE_MODES
extern int call_address_operand PARAMS ((rtx, Mmode));
diff -u org_src/gcc-3.2.3/gcc/config/m32r/m32r.c
gcc-3.2.3/gcc/config/m32r/m32r.c
--- org_src/gcc-3.2.3/gcc/config/m32r/m32r.c Sat Mar 23 04:25:51 2002
+++ gcc-3.2.3/gcc/config/m32r/m32r.c Wed May 14 14:26:57 2003
@@ -2968,3 +2968,20 @@
return 1;
}
+
+int m32r_hard_regno_rename_ok(old_reg, new_reg)
+ unsigned int old_reg ATTRIBUTE_UNUSED;
+ unsigned int new_reg;
+{
+ if ((lookup_attribute ("interrupt",
+ DECL_ATTRIBUTES (current_function_decl))
+ != NULL_TREE)
+ && !regs_ever_live[new_reg])
+ return 0;
+
+ if (current_function_is_leaf && (new_reg == RETURN_ADDR_REGNUM))
+ return 0;
+
+ return 1;
+}
+
diff -u org_src/gcc-3.2.3/gcc/config/m32r/m32r.h
gcc-3.2.3/gcc/config/m32r/m32r.h
--- org_src/gcc-3.2.3/gcc/config/m32r/m32r.h Wed Jan 9 07:51:33 2002
+++ gcc-3.2.3/gcc/config/m32r/m32r.h Wed May 14 14:06:15 2003
@@ -670,6 +670,9 @@
&& GET_MODE_CLASS (MODE2) == MODE_INT \
&& GET_MODE_SIZE (MODE1) <= UNITS_PER_WORD \
&& GET_MODE_SIZE (MODE2) <= UNITS_PER_WORD)
+
+#define HARD_REGNO_RENAME_OK(OLD_REG, NEW_REG) \
+ m32r_hard_regno_rename_ok(OLD_REG, NEW_REG)
/* Register classes and constants. */