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]
Other format: [Raw text]

RFA: FRV: Stop the FDPIC register from being used as a register renumber target


Hi Aldy, Hi Alex,

  We recently ran across a problem with the FRV port's fdpic multilibs
  where the pic register (gr15) could become corrupted when programs
  were compiled with a high level of optimization.  I traced it down
  to the register renumbering pass which was choosing to renumber an
  ordinary register to gr15.

  The attached patch adds a definition of the HARD_REGNO_RENAME_OK
  macro to prevent this behaviour.  With this patch applied I get 30
  fewer unexpected failures in the gcc testsuite for each of the fdpic
  multilibs, and no regressions.

  Please may I apply the patch ?

Cheers
  Nick

gcc/ChangeLog
2008-10-22  Nick Clifton  <nickc@redhat.com>

	* config/frv/frv.h (HARD_REGNO_RENAME_OK): Define.  Do not allow
	the fdpic register to be a target when running in fdpic mode.

Index: gcc/config/frv/frv.h
===================================================================
--- gcc/config/frv/frv.h	(revision 141188)
+++ gcc/config/frv/frv.h	(working copy)
@@ -592,6 +592,8 @@
 #define FDPIC_FPTR_REGNO  (GPR_FIRST + 14)        /* uClinux PIC function pointer register.  */
 #define FDPIC_REGNO   (GPR_FIRST + 15)        /* uClinux PIC register.  */
 
+#define HARD_REGNO_RENAME_OK(from,to) (TARGET_FDPIC ? ((to) != FDPIC_REG) : 1)
+
 #define OUR_FDPIC_REG	get_hard_reg_initial_val (SImode, FDPIC_REGNO)
 
 #define FPR_FIRST       64			/* First FP reg */


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