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]

SH: Avoid pop-PR-is-dead warnings from flow


Under some conditions I couldn't determine exactly, flow would warn
that the epilogue insn that restored PR was dead.

Some time ago, I had suggested adding a USE to the return insn, but
Joern said it wasn't a good idea because some optimization passes
wouldn't recognize a return within a PARALLEL.

And now, we have sibcalls, so adjusting the return insn alone is no
longer enough.

So, I've decided to introduce an explicit USE or PR in case it is
restored, so that flow doesn't warn.  I'm checking this in.

Index: gcc/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>
	* config/sh/sh.c (sh_expand_epilogue): Use PR explicitly.

Index: gcc/config/sh/sh.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/sh/sh.c,v
retrieving revision 1.86
diff -u -p -r1.86 sh.c
--- gcc/config/sh/sh.c 2001/01/13 07:21:35 1.86
+++ gcc/config/sh/sh.c 2001/01/13 07:56:37
@@ -4048,6 +4048,10 @@ sh_expand_epilogue ()
   /* Switch back to the normal stack if necessary.  */
   if (sp_switch)
     emit_insn (gen_sp_switch_2 ());
+
+  /* Tell flow the insn that pops PR isn't dead.  */
+  if (live_regs_mask & (1 << PR_REG))
+    emit_insn (gen_rtx_USE (VOIDmode, gen_rtx_REG (SImode, PR_REG)));
 }
 
 static int sh_need_epilogue_known = 0;

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me

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