public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Fix PR middle-end/78700
@ 2016-12-06 22:47 Eric Botcazou
  0 siblings, 0 replies; only message in thread
From: Eric Botcazou @ 2016-12-06 22:47 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 757 bytes --]

The PR is about a couple of regressions in the Go testsuite on PowerPC64/Linux 
introduced by the patch implementing support for custom descriptors for nested 
functions.  The problematic hunk is the change to expand_call, which moves up 
the call to prepare_call_address ; this turns out to be problematic because 
this call can load the static chain register and it now can be clobbered by a 
call to memcpy used to copy the parameters.

The attached patch simply reverts the change, which was not really necessary.

Tested on x86-64/Linux, PowerPC64/Linux and SPARC/Solaris, applied as obvious.


2016-12-06  Eric Botcazou  <ebotcazou@adacore.com>

	PR middle-end/78700
	* calls.c (expand_call): Move back call to prepare_call_address.

-- 
Eric Botcazou

[-- Attachment #2: pr78700.diff --]
[-- Type: text/x-patch, Size: 1140 bytes --]

Index: calls.c
===================================================================
--- calls.c	(revision 243245)
+++ calls.c	(working copy)
@@ -3427,13 +3427,6 @@ expand_call (tree exp, rtx target, int i
       if (STRICT_ALIGNMENT)
 	store_unaligned_arguments_into_pseudos (args, num_actuals);
 
-      /* Prepare the address of the call.  This must be done before any
-	 register parameters is loaded for find_first_parameter_load to
-	 work properly in the presence of descriptors.  */
-      funexp = prepare_call_address (fndecl ? fndecl : fntype, funexp,
-				     static_chain_value, &call_fusage,
-				     reg_parm_seen, flags);
-
       /* Now store any partially-in-registers parm.
 	 This is the last place a block-move can happen.  */
       if (reg_parm_seen)
@@ -3544,6 +3537,9 @@ expand_call (tree exp, rtx target, int i
 	}
 
       after_args = get_last_insn ();
+      funexp = prepare_call_address (fndecl ? fndecl : fntype, funexp,
+				     static_chain_value, &call_fusage,
+				     reg_parm_seen, flags);
       load_register_parameters (args, num_actuals, &call_fusage, flags,
 				pass == 0, &sibcall_failure);
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-12-06 22:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-06 22:47 Fix PR middle-end/78700 Eric Botcazou

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).