From 855db69891d4f2a61a16f219d78daf8cd56e3058 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Sun, 16 Oct 2016 19:36:47 +0000 Subject: [PATCH] sparc.c (sparc_expand_vector_init): Only accept literal constants in CONST_VECTORs. * config/sparc/sparc.c (sparc_expand_vector_init): Only accept literal constants in CONST_VECTORs. From-SVN: r241218 --- gcc/ChangeLog | 5 +++++ gcc/config/sparc/sparc.c | 5 ++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e616910bb00..e4b462c683a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2016-10-16 Eric Botcazou + + * config/sparc/sparc.c (sparc_expand_vector_init): Only accept literal + constants in CONST_VECTORs. + 2016-10-15 Eric Botcazou * config/sparc/sparc.c (sparc_expand_vec_perm_bmask): Use a scratch diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c index f737061b92c..74435a51ac5 100644 --- a/gcc/config/sparc/sparc.c +++ b/gcc/config/sparc/sparc.c @@ -12366,14 +12366,13 @@ 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_SCALAR_INT_P (x) || CONST_DOUBLE_P (x) || CONST_FIXED_P (x))) n_var++; if (i > 0 && !rtx_equal_p (x, XVECEXP (vals, 0, 0))) -- 2.30.2