arm: Fix an rtl checking failure in cde-errors.c
authorRichard Sandiford <richard.sandiford@arm.com>
Mon, 27 Apr 2020 16:25:20 +0000 (17:25 +0100)
committerRichard Sandiford <richard.sandiford@arm.com>
Mon, 27 Apr 2020 16:25:20 +0000 (17:25 +0100)
cde-errors.c and cde-mve-error-2.c were failing with an rtl checking
failure because we applied UINTVAL to a nonconstant argument
(specifically a REG).

2020-04-27  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
* config/arm/arm-builtins.c (arm_expand_builtin_args): Only apply
UINTVAL to CONST_INTs.

gcc/ChangeLog
gcc/config/arm/arm-builtins.c

index ecffa447903701e90636042216e36131eb088134..64d71d03b7a28fa97d46e5d942915353bd08794c 100644 (file)
@@ -1,3 +1,8 @@
+2020-04-27  Richard Sandiford  <richard.sandiford@arm.com>
+
+       * config/arm/arm-builtins.c (arm_expand_builtin_args): Only apply
+       UINTVAL to CONST_INTs.
+
 2020-04-27  Srinath Parvathaneni  <srinath.parvathaneni@arm.com>
 
        * config/arm/constraints.md (e): Remove constraint.
index 16d2fb0b3f0a5197c6e8d1e45a705b026cb706da..aee3fd6e2ff452cc7d068caef2ee943c34c91788 100644 (file)
@@ -3081,7 +3081,8 @@ constant_arg:
                    {
                      if (argc == 0)
                        {
-                         unsigned int cp_bit = UINTVAL (op[argc]);
+                         unsigned int cp_bit = (CONST_INT_P (op[argc])
+                                                ? UINTVAL (op[argc]) : -1);
                          if (IN_RANGE (cp_bit, 0, ARM_CDE_CONST_COPROC))
                            error ("%Kcoprocessor %d is not enabled "
                                   "with +cdecp%d", exp, cp_bit, cp_bit);