diff mbox series

rs6000: r12 copy cleanup

Message ID 20200828164841.109586-1-wschmidt@linux.ibm.com
State New
Headers show
Series rs6000: r12 copy cleanup | expand

Commit Message

Bill Schmidt Aug. 28, 2020, 4:48 p.m. UTC
Remove unnecessary tests before copying function address to r12, as
requested by Segher.

Bootstrapped and tested on powerpc64le-unknown-linx-gnu with no
regressions, committed as obvious.

Thanks,
Bill


2020-08-28  Bill Schmidt  <wschmidt@linux.ibm.com>

gcc/
	* config/rs6000/rs6000.c (rs6000_call_aix): Remove test for r12.
	(rs6000_sibcall_aix): Likewise.
---
 gcc/config/rs6000/rs6000.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

Segher Boessenkool Aug. 29, 2020, 12:05 a.m. UTC | #1
On Fri, Aug 28, 2020 at 11:48:41AM -0500, Bill Schmidt wrote:
> Remove unnecessary tests before copying function address to r12, as
> requested by Segher.
> 
> Bootstrapped and tested on powerpc64le-unknown-linx-gnu with no
> regressions, committed as obvious.

Thanks!


Segher
diff mbox series

Patch

diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 09545278dcf..ca5b71ecdd3 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -24725,8 +24725,7 @@  rs6000_call_aix (rtx value, rtx func_desc, rtx tlsarg, rtx cookie)
 	  /* A function pointer in the ELFv2 ABI is just a plain address, but
 	     the ABI requires it to be loaded into r12 before the call.  */
 	  func_addr = gen_rtx_REG (Pmode, 12);
-	  if (!rtx_equal_p (func_addr, func))
-	    emit_move_insn (func_addr, func);
+	  emit_move_insn (func_addr, func);
 	  abi_reg = func_addr;
 	  /* Indirect calls via CTR are strongly preferred over indirect
 	     calls via LR, so move the address there.  Needed to mark
@@ -24846,8 +24845,7 @@  rs6000_sibcall_aix (rtx value, rtx func_desc, rtx tlsarg, rtx cookie)
   if (GET_CODE (func_desc) != SYMBOL_REF && DEFAULT_ABI == ABI_ELFv2)
     {
       r12 = gen_rtx_REG (Pmode, 12);
-      if (!rtx_equal_p (r12, func_desc))
-	emit_move_insn (r12, func_desc);
+      emit_move_insn (r12, func_desc);
       func_addr = gen_rtx_REG (Pmode, CTR_REGNO);
       emit_move_insn (func_addr, r12);
     }