public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Vladimir Makarov <vmakarov@redhat.com>
To: "Andre Vieira (lists)" <andre.simoesdiasvieira@arm.com>,
	gcc-patches@gcc.gnu.org
Cc: richard.sandiford@arm.com
Subject: Re: [PATCH, GCC] PR target/86487: fix the way 'uses_hard_regs_p' handles paradoxical subregs
Date: Wed, 13 Feb 2019 16:46:00 -0000	[thread overview]
Message-ID: <3d243d72-e0bb-5e81-2b6e-bd83044ea314@redhat.com> (raw)
In-Reply-To: <740125ef-a675-bb05-7fa0-f1fedcd04818@arm.com>


On 2019-02-13 5:54 a.m., Andre Vieira (lists) wrote:
> PING.
>
> Since Jeff is away can another maintainer have a look at this please?
>
>
I see the following patch

diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c
index c061093ed699620afe2dfda60d58066d6967523a..736b084acc552b75ff4d369b6584bc9ab422e21b 100644
--- a/gcc/lra-constraints.c
+++ b/gcc/lra-constraints.c
@@ -1761,11 +1761,21 @@ uses_hard_regs_p (rtx x, HARD_REG_SET set)
      return false;
    code = GET_CODE (x);
    mode = GET_MODE (x);
+
    if (code == SUBREG)
      {
+      /* For all SUBREGs we want to check whether the full multi-register
+	 overlaps the set.  For normal SUBREGs this means 'get_hard_regno' of
+	 the inner register, for paradoxical SUBREGs this means the
+	 'get_hard_regno' of the full SUBREG and for complete SUBREGs either is
+	 fine.  Use the wider mode for all cases.  */
+      rtx subreg = SUBREG_REG (x);
        mode = wider_subreg_mode (x);
-      x = SUBREG_REG (x);
-      code = GET_CODE (x);
+      if (mode == GET_MODE (subreg))
+	{
+	  x = subreg;
+	  code = GET_CODE (x);
+	}
      }
  
    if (REG_P (x))

In your case, x will be SUBREG and be processed recursively only as a register of subreg.

I think you need to change the last line on

   if (REG_P (x) || code == SUBREG)

then the subreg will processed by get_hard_regno as subreg.

  reply	other threads:[~2019-02-13 16:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-07 14:42 Andre Vieira (lists)
2019-01-07 22:50 ` Jeff Law
2019-01-08 15:21   ` Andre Vieira (lists)
2019-01-11 22:54     ` Jeff Law
2019-02-01 14:31       ` Andre Vieira (lists)
2019-02-13 10:55         ` Andre Vieira (lists)
2019-02-13 16:46           ` Vladimir Makarov [this message]
2019-02-15 11:35             ` Andre Vieira (lists)
2019-02-19  4:27               ` Vladimir Makarov

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=3d243d72-e0bb-5e81-2b6e-bd83044ea314@redhat.com \
    --to=vmakarov@redhat.com \
    --cc=andre.simoesdiasvieira@arm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --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).