public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Richard Earnshaw <rearnsha@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r13-1108] arm: fix thinko in arm_bfi_1_p() [PR105974]
Date: Wed, 15 Jun 2022 12:43:48 +0000 (GMT)	[thread overview]
Message-ID: <20220615124348.9F1073839C73@sourceware.org> (raw)

https://gcc.gnu.org/g:dc8071da0e89eab4935751f3b16745c95cbc0d30

commit r13-1108-gdc8071da0e89eab4935751f3b16745c95cbc0d30
Author: Richard Earnshaw <rearnsha@arm.com>
Date:   Wed Jun 15 13:42:23 2022 +0100

    arm: fix thinko in arm_bfi_1_p() [PR105974]
    
    I clearly wasn't thinking straight when I wrote the arm_bfi_1_p
    function and used XUINT rather than UINTVAL when extracting CONST_INT
    values.  It seemed to work in testing, but was incorrect and failed
    RTL checking.
    
    Fixed thusly:
    
    gcc/ChangeLog:
    
            PR target/105974
            * config/arm/arm.cc (arm_bfi_1_p): Use UINTVAL instead of XUINT.

Diff:
---
 gcc/config/arm/arm.cc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gcc/config/arm/arm.cc b/gcc/config/arm/arm.cc
index 2a76c7b9a72..5aa48fc7664 100644
--- a/gcc/config/arm/arm.cc
+++ b/gcc/config/arm/arm.cc
@@ -10211,15 +10211,15 @@ arm_bfi_1_p (rtx op0, rtx op1, rtx *sub0, rtx *sub1)
   if (!CONST_INT_P (XEXP (op0, 1)))
     return false;
 
-  const1 = XUINT (XEXP (op0, 1), 0);
+  const1 = UINTVAL (XEXP (op0, 1));
   if (!CONST_INT_P (XEXP (op1, 1))
-      || ~XUINT (XEXP (op1, 1), 0) != const1)
+      || ~UINTVAL (XEXP (op1, 1)) != const1)
     return false;
 
   if (GET_CODE (XEXP (op0, 0)) == ASHIFT
       && CONST_INT_P (XEXP (XEXP (op0, 0), 1)))
     {
-      const2 = XUINT (XEXP (XEXP (op0, 0), 1), 0);
+      const2 = UINTVAL (XEXP (XEXP (op0, 0), 1));
       *sub0 = XEXP (XEXP (op0, 0), 0);
     }
   else


                 reply	other threads:[~2022-06-15 12:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20220615124348.9F1073839C73@sourceware.org \
    --to=rearnsha@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /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).