]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
arm: fix thinko in arm_bfi_1_p() [PR105974]
authorRichard Earnshaw <rearnsha@arm.com>
Wed, 15 Jun 2022 12:42:23 +0000 (13:42 +0100)
committerRichard Earnshaw <rearnsha@arm.com>
Wed, 15 Jun 2022 12:43:25 +0000 (13:43 +0100)
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.

gcc/config/arm/arm.cc

index 2a76c7b9a72c7102295a978e09ec9d10c5406f3e..5aa48fc7664890c86b63a851301dd81f87e46565 100644 (file)
@@ -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