The compiler was creating bogus CONST_VECTORs under specific circumstances in
sparc_expand_vector_init. Fixed by using the same test as the x86 back-end.
Tested on SPARC/Solaris, applied on all active branches.
2016-10-16 Eric Botcazou <ebotca...@adacore.com>
* config/sparc/sparc.c (sparc_expand_vector_init): Only accept literal
constants in CONST_VECTORs.
--
Eric Botcazou
Index: config/sparc/sparc.c
===================================================================
--- config/sparc/sparc.c (revision 241205)
+++ config/sparc/sparc.c (working copy)
@@ -12366,14 +12366,13 @@ sparc_expand_vector_init (rtx target, rt
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)))