This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Fix for register renaming on ia64
- To: <gcc-patches at gcc dot gnu dot org>
- Subject: Fix for register renaming on ia64
- From: Bernd Schmidt <bernds at cambridge dot redhat dot com>
- Date: Thu, 1 Mar 2001 14:08:49 +0000 (GMT)
This bug showed up during SPEC95 testing. When calling setjmp, we save
the contents of r1 in r4 across the call. Register renaming turned the
save register into a different one, and the contents of the other reg
were not preserved.
Bootstrapped on ia64-linux with the mainline; applied to both branch and
mainline.
Bernd
* config/ia64/ia64.c (ia64_hard_regno_rename_ok): Disallow renaming
from reg 4 if current_function_calls_setjmp.
Index: ia64.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/ia64/ia64.c,v
retrieving revision 1.72.2.1
diff -u -p -r1.72.2.1 ia64.c
--- ia64.c 2001/02/21 22:10:17 1.72.2.1
+++ ia64.c 2001/03/01 13:41:45
@@ -2436,6 +2436,10 @@ ia64_hard_regno_rename_ok (from, to)
if (PR_REGNO_P (from) && PR_REGNO_P (to))
return (from & 1) == (to & 1);
+ /* Reg 4 contains the saved gp; we can't reliably rename this. */
+ if (from == GR_REG (4) && current_function_calls_setjmp)
+ return 0;
+
return 1;
}