diff mbox series

[RS6000] rs6000_output_mi_thunk tidy

Message ID 20190727053827.GR3379@bubble.grove.modra.org
State New
Headers show
Series [RS6000] rs6000_output_mi_thunk tidy | expand

Commit Message

Alan Modra July 27, 2019, 5:38 a.m. UTC
Since svn r123193 (git 327202e27a) the comment about scratch regs was
no longer correct, and I think gen_sibcall could have been used even
then.

Bootstrapped and regression tested powerpc64le-linux.  OK for mainline?

	* gcc/config/rs6000/rs6000-call.c (rs6000_output_mi_thunk): Use
	gen_sibcall.

Comments

Segher Boessenkool July 27, 2019, 6:29 p.m. UTC | #1
On Sat, Jul 27, 2019 at 03:08:27PM +0930, Alan Modra wrote:
> Since svn r123193 (git 327202e27a) the comment about scratch regs was
> no longer correct, and I think gen_sibcall could have been used even
> then.

And the expander you call no does the special Mach-O handling.  Okay.

> Bootstrapped and regression tested powerpc64le-linux.  OK for mainline?
> 
> 	* gcc/config/rs6000/rs6000-call.c (rs6000_output_mi_thunk): Use
> 	gen_sibcall.

Yes please.  Okay for trunk.  Thanks!


Segher
diff mbox series

Patch

diff --git a/gcc/config/rs6000/rs6000-call.c b/gcc/config/rs6000/rs6000-call.c
index 2ef8c7f861e..832eda7cbad 100644
--- a/gcc/config/rs6000/rs6000-call.c
+++ b/gcc/config/rs6000/rs6000-call.c
@@ -8099,20 +8099,7 @@  rs6000_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
   funexp = XEXP (DECL_RTL (function), 0);
   funexp = gen_rtx_MEM (FUNCTION_MODE, funexp);
 
-#if TARGET_MACHO
-  if (MACHOPIC_INDIRECT)
-    funexp = machopic_indirect_call_target (funexp);
-#endif
-
-  /* gen_sibcall expects reload to convert scratch pseudo to LR so we must
-     generate sibcall RTL explicitly.  */
-  insn = emit_call_insn (
-	   gen_rtx_PARALLEL (VOIDmode,
-	     gen_rtvec (3,
-			gen_rtx_CALL (VOIDmode,
-				      funexp, const0_rtx),
-			gen_rtx_USE (VOIDmode, const0_rtx),
-			simple_return_rtx)));
+  insn = emit_call_insn (gen_sibcall (funexp, const0_rtx, const0_rtx));
   SIBLING_CALL_P (insn) = 1;
   emit_barrier ();