This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Fix for register renaming on ia64


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;
 }



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]