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:] Fix PR rtl-optimization/19462 reorg: return andcurrent_function_epilogue_delay_list


See the PR and also PR target/7042.  Xfailed test-case committed
in gcc/testsuite/gcc.dg/torture/pr19462-1.c.

The problem is hopefully completely spelled out in the comment
(assuming a reader familiar with this machinery): once
current_function_epilogue_delay_list is non-null, any new
non-exceptional return paths must also run the insns in
current_function_epilogue_delay_list and the code wasn't caring
for that being non-null.  However, moving those insns seems
excessive for obsoleted functionality, so I'd prefer not
creating the new return paths.  Making sure that return insns
don't clash with current_function_epilogue_delay_list could be
made the responsibility of the target, but why doing it for each
target when it can be handled by the middle-end for known
invalid cases?

I also seek comments (perhaps approval) regarding removing all
traces of current_function_epilogue_delay_list and related
macros on 4.1, because it's only used for textual epilogues, and
we don't want them, right?  Particularly when this functionality
has shown a tendency to attract bugs related to filling
delay-slots of normal insns.

No regressions tested cross to cris-axis-linux-gnu, bootstrapped
and checked native on sparc-sun-solaris2.8 (c,c++,java,objc)
(which has delay-slots but doesn't have textual epilogues; it
does use that framework, but only to output a nop in some rare
cases).

Ok to commit?

	PR rtl-optimization/19462
	* reorg.c (find_end_label): Create return insn only if
	current_function_epilogue_delay_list is empty.

Index: reorg.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/reorg.c,v
retrieving revision 1.102
diff -c -p -r1.102 reorg.c
*** reorg.c	9 Sep 2004 17:19:12 -0000	1.102
--- reorg.c	15 Jan 2005 21:44:47 -0000
*************** find_end_label (void)
*** 420,426 ****
  	     if needed.  */
  	  emit_label (end_of_function_label);
  #ifdef HAVE_return
! 	  if (HAVE_return)
  	    {
  	      /* The return we make may have delay slots too.  */
  	      rtx insn = gen_return ();
--- 420,431 ----
  	     if needed.  */
  	  emit_label (end_of_function_label);
  #ifdef HAVE_return
! 	  /* We don't bother trying to create a return insn if the
! 	     epilogue has filled delay-slots; we would have to try and
! 	     move the delay-slot fillers to the delay-slots for the new
! 	     return insn or in front of the new return insn.  */
! 	  if (current_function_epilogue_delay_list == NULL
! 	      && HAVE_return)
  	    {
  	      /* The return we make may have delay slots too.  */
  	      rtx insn = gen_return ();

brgds, H-P


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