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]

[PowerPC] Fix PR25572, -mminimal-toc trashes r30


This patch updates regs_ever_live so that the prologue/epilogue code
knows about use of the TOC register created during reload.  Bootstrapped
and regression tested powerpc64-linux.  OK mainline?  OK for 4.1, 4.0
and 3.4 too, after I bootstrap there?

	PR target/25572
	* config/rs6000/rs6000.c (create_TOC_reference): Set regs_ever_live.

Index: gcc/config/rs6000/rs6000.c
===================================================================
--- gcc/config/rs6000/rs6000.c	(revision 109087)
+++ gcc/config/rs6000/rs6000.c	(working copy)
@@ -13499,6 +13499,8 @@ uses_TOC (void)
 rtx
 create_TOC_reference (rtx symbol)
 {
+  if (no_new_pseudos)
+    regs_ever_live[TOC_REGISTER] = 1;
   return gen_rtx_PLUS (Pmode,
 	   gen_rtx_REG (Pmode, TOC_REGISTER),
 	     gen_rtx_CONST (Pmode,

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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