RFA: Fix PR middle-end/50074
diff mbox

Message ID 20111126021708.kz9ae0eedcwgogc8-nzlynne@webmail.spamcop.net
State New
Headers show

Commit Message

Joern Rennecke Nov. 26, 2011, 7:17 a.m. UTC
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.rennecke@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.

Comments

Jakub Jelinek Nov. 26, 2011, 8:32 a.m. UTC | #1
On Sat, Nov 26, 2011 at 02:17:08AM -0500, Joern Rennecke wrote:
> 2011-11-19  Joern Rennecke  <joern.rennecke@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.

Ok for trunk.

> 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


	Jakub

Patch
diff mbox

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