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]

[patch] PR19616 missed tail call opportunities


Hi,

In calls.c:check_sibcall_argument_overlap() we look for overlap from
the start of the current sequence if insn is NULL.  I don't understand
the reason for that, so I just made it return 0 in this case.  That 
fixes PR19616 for me.  Please someone add a comment and a test case if
this is wrong ;-)

Bootstrapped & tested  on {ia64,i686,x86_64,ppc64,ppc}-suse-linux-gnu.

Gr.
Steven


	* calls.c (check_sibcall_argument_overlap): Do not look for
	overlap from the start of the current sequence if insn is NULL.

Index: calls.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/calls.c,v
retrieving revision 1.377
diff -u -3 -p -r1.377 calls.c
--- calls.c	18 Jan 2005 23:06:55 -0000	1.377
+++ calls.c	25 Jan 2005 00:05:31 -0000
@@ -1716,11 +1716,9 @@ check_sibcall_argument_overlap (rtx insn
   int low, high;
 
   if (insn == NULL_RTX)
-    insn = get_insns ();
-  else
-    insn = NEXT_INSN (insn);
+    return 0;
 
-  for (; insn; insn = NEXT_INSN (insn))
+  for (insn = NEXT_INSN (insn); insn; insn = NEXT_INSN (insn))
     if (INSN_P (insn)
 	&& check_sibcall_argument_overlap_1 (PATTERN (insn)))
       break;


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