From: Andrea Corallo <andrea.corallo@arm.com>
To: gcc-patches@gcc.gnu.org
Cc: nd@arm.com, richard.earnshaw@arm.com, richard.sandiford@arm.com
Subject: Re: [PATCH] aarch64: Do not alter force_reg returned rtx expanding pauth builtins
Date: Thu, 24 Sep 2020 17:20:22 +0200 [thread overview]
Message-ID: <gkrtuvnb3rd.fsf@arm.com> (raw)
In-Reply-To: <mpt3638kcje.fsf@arm.com> (Richard Sandiford's message of "Wed, 23 Sep 2020 11:33:41 +0100")
Hi Richard,
thanks for reviewing
Richard Sandiford <richard.sandiford@arm.com> writes:
> Andrea Corallo <andrea.corallo@arm.com> writes:
>> 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
>>
>> 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);
>
> Do we actually use the result of this move? It looked like we always
> use op0 rather than target (good) and overwrite target with a later move.
>
> If so, I think we should delete the move
Good point agree.
> and convert the later code to use expand_insn.
I'm not sure I understand the suggestion right, xpaclri&friends patterns
are written with hardcoded in/out regs, is the suggestion to just use like
'expand_insn (CODE_FOR_xpaclri, 0, NULL)' in place of GEN_FCN+emit_insn?
Thanks!
Andrea
next prev parent reply other threads:[~2020-09-24 15:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-22 10:02 Andrea Corallo
2020-09-23 10:33 ` Richard Sandiford
2020-09-24 15:20 ` Andrea Corallo [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=gkrtuvnb3rd.fsf@arm.com \
--to=andrea.corallo@arm.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=nd@arm.com \
--cc=richard.earnshaw@arm.com \
--cc=richard.sandiford@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).