public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] aarch64: Do not alter force_reg returned rtx expanding pauth builtins
@ 2020-09-22 10:02 Andrea Corallo
  2020-09-23 10:33 ` Richard Sandiford
  0 siblings, 1 reply; 7+ messages in thread
From: Andrea Corallo @ 2020-09-22 10:02 UTC (permalink / raw)
  To: gcc-patches; +Cc: kyrylo.tkachov, richard.earnshaw, nd

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

Hi all,

having a look for force_reg returned rtx later on modified I've found
this other case in `aarch64_general_expand_builtin` while expanding 
pointer authentication builtins.

Regtested and bootsraped on aarch64-linux-gnu.

Okay for trunk?

  Andrea


[-- Attachment #2: 0001-aarch64-Do-not-alter-force_reg-returned-rtx-expandin.patch --]
[-- Type: text/plain, Size: 1169 bytes --]

From 8869ee04e3788fdec86aa7e5a13e2eb477091d0e Mon Sep 17 00:00:00 2001
From: Andrea Corallo <andrea.corallo@arm.com>
Date: Mon, 21 Sep 2020 13:52:45 +0100
Subject: [PATCH] aarch64: Do not alter force_reg returned rtx expanding pauth
 builtins

2020-09-21  Andrea Corallo  <andrea.corallo@arm.com>

	* config/aarch64/aarch64-builtins.c
	(aarch64_general_expand_builtin): Do not alter value on a
	force_reg returned rtx.
---
 gcc/config/aarch64/aarch64-builtins.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gcc/config/aarch64/aarch64-builtins.c b/gcc/config/aarch64/aarch64-builtins.c
index b787719cf5e..a77718ccfac 100644
--- a/gcc/config/aarch64/aarch64-builtins.c
+++ b/gcc/config/aarch64/aarch64-builtins.c
@@ -2079,10 +2079,10 @@ aarch64_general_expand_builtin (unsigned int fcode, tree exp, rtx target,
       arg0 = CALL_EXPR_ARG (exp, 0);
       op0 = force_reg (Pmode, expand_normal (arg0));
 
-      if (!target)
+      if (!(target
+	    && REG_P (target)
+	    && GET_MODE (target) == Pmode))
 	target = gen_reg_rtx (Pmode);
-      else
-	target = force_reg (Pmode, target);
 
       emit_move_insn (target, op0);
 
-- 
2.17.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-09-28 10:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-22 10:02 [PATCH] aarch64: Do not alter force_reg returned rtx expanding pauth builtins Andrea Corallo
2020-09-23 10:33 ` Richard Sandiford
2020-09-24 15:20   ` Andrea Corallo
2020-09-25 12:27     ` Richard Sandiford
2020-09-28  8:59       ` [PATCH V2] " Andrea Corallo
2020-09-28  9:48         ` Richard Sandiford
2020-09-28 10:33           ` Andrea Corallo

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).