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).

Tested on arm-linux-gnueabihf.  OK to install?

Richard


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

gcc/
        * config/arm/arm-builtins.c (arm_expand_builtin_args): Only apply
        UINTVAL to CONST_INTs.
---
 gcc/config/arm/arm-builtins.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/config/arm/arm-builtins.c b/gcc/config/arm/arm-builtins.c
index 16d2fb0b3f0..aee3fd6e2ff 100644
--- a/gcc/config/arm/arm-builtins.c
+++ b/gcc/config/arm/arm-builtins.c
@@ -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);

Reply via email to