On load-store architectures, the function address is generally loaded into
a register before any outgoing arguments are stored in the stack frame
(if any).  Thus, generally allowing memory loads before any arguments of
the sibcall have been stored in the stack frame is effective to make the
sibcall-6.c test work again.
This has been confirmed for Epiphany, x86_64-apple-darwin10 and s390x .

Bootstrapped and regtested on i686-pc-linux-gnu.
2011-11-19  Joern Rennecke  <joern.renne...@embecosm.com>

        PR middle-end/50074
        * calls.c (mem_overlaps_already_clobbered_arg_p):
        Return false if no outgoing arguments have been stored so far.

Index: calls.c
===================================================================
--- calls.c     (revision 2195)
+++ calls.c     (working copy)
@@ -1668,6 +1668,8 @@ mem_overlaps_already_clobbered_arg_p (rt
 {
   HOST_WIDE_INT i;
 
+  if (sbitmap_empty_p (stored_args_map))
+    return false;
   if (addr == crtl->args.internal_arg_pointer)
     i = 0;
   else if (GET_CODE (addr) == PLUS

Reply via email to