From: Matthew Wahab Date: Fri, 19 Aug 2016 13:59:18 +0000 (+0000) Subject: [ARM] Fix an invalid check for vectors of the same floating-point constants. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f0c90610e3e0646b89ae3e4b20134dc7e1cd7d12;p=gcc.git [ARM] Fix an invalid check for vectors of the same floating-point constants. 2016-08-19 Matthew Wahab PR target/77281 * config/arm/arm.c (neon_valid_immediate): Delete declaration. Use const_vec_duplicate to check for duplicated elements. From-SVN: r239610 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c8e8f6544e3..a6519b32e88 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2016-08-19 Matthew Wahab + + PR target/77281 + * config/arm/arm.c (neon_valid_immediate): Delete declaration. + Use const_vec_duplicate to check for duplicated elements. + 2016-08-19 Richard Biener PR tree-optimization/77290 diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index a6afdcc168c..c1d010cecbc 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -12471,7 +12471,6 @@ neon_valid_immediate (rtx op, machine_mode mode, int inverse, if (GET_MODE_CLASS (mode) == MODE_VECTOR_FLOAT) { rtx el0 = CONST_VECTOR_ELT (op, 0); - const REAL_VALUE_TYPE *r0; if (!vfp3_const_double_rtx (el0) && el0 != CONST0_RTX (GET_MODE (el0))) return -1; @@ -12480,14 +12479,10 @@ neon_valid_immediate (rtx op, machine_mode mode, int inverse, if (GET_MODE_INNER (mode) == HFmode) return -1; - r0 = CONST_DOUBLE_REAL_VALUE (el0); - - for (i = 1; i < n_elts; i++) - { - rtx elt = CONST_VECTOR_ELT (op, i); - if (!real_equal (r0, CONST_DOUBLE_REAL_VALUE (elt))) - return -1; - } + /* All elements in the vector must be the same. Note that 0.0 and -0.0 + are distinct in this context. */ + if (!const_vec_duplicate_p (op)) + return -1; if (modconst) *modconst = CONST_VECTOR_ELT (op, 0);