]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
sparc.c (sparc_expand_vector_init): Only accept literal constants in CONST_VECTORs.
authorEric Botcazou <ebotcazou@adacore.com>
Sun, 16 Oct 2016 19:38:31 +0000 (19:38 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Sun, 16 Oct 2016 19:38:31 +0000 (19:38 +0000)
* config/sparc/sparc.c (sparc_expand_vector_init): Only accept literal
constants in CONST_VECTORs.

From-SVN: r241220

gcc/ChangeLog
gcc/config/sparc/sparc.c

index 2807b974df811298dafd6030706d301cd9905593..8317108bfb62af3fc7f9c5bf6e379a9886566889 100644 (file)
@@ -1,3 +1,8 @@
+2016-10-16  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * config/sparc/sparc.c (sparc_expand_vector_init): Only accept literal
+       constants in CONST_VECTORs.
+
 2016-10-15  Eric Botcazou  <ebotcazou@adacore.com>
 
        * config/sparc/sparc.c (sparc_expand_vec_perm_bmask): Use a scratch
index 349f31f142353936378d918fcebfa37807471ccf..5e4405456182bb55b4beef97782cc749a285b989 100644 (file)
@@ -12289,14 +12289,15 @@ sparc_expand_vector_init (rtx target, rtx vals)
   const machine_mode inner_mode = GET_MODE_INNER (mode);
   const int n_elts = GET_MODE_NUNITS (mode);
   int i, n_var = 0;
-  bool all_same;
+  bool all_same = true;
   rtx mem;
 
-  all_same = true;
   for (i = 0; i < n_elts; i++)
     {
       rtx x = XVECEXP (vals, 0, i);
-      if (!CONSTANT_P (x))
+      if (!(CONST_INT_P (x)
+           || GET_CODE (x) == CONST_DOUBLE
+           || GET_CODE (x) == CONST_FIXED))
        n_var++;
 
       if (i > 0 && !rtx_equal_p (x, XVECEXP (vals, 0, 0)))