+2018-10-15 Andreas Krebbel <krebbel@linux.ibm.com>
+
+ * config/s390/s390.c (s390_expand_vec_init): Force vector element
+ into reg if it isn't a general operand.
+
2018-10-14 H.J. Lu <hongjiu.lu@intel.com>
PR target/87599
return;
}
+ /* Use vector replicate instructions. vlrep/vrepi/vrep */
if (all_same)
{
- emit_insn (gen_rtx_SET (target,
- gen_rtx_VEC_DUPLICATE (mode,
- XVECEXP (vals, 0, 0))));
+ rtx elem = XVECEXP (vals, 0, 0);
+
+ /* vec_splats accepts general_operand as source. */
+ if (!general_operand (elem, GET_MODE (elem)))
+ elem = force_reg (inner_mode, elem);
+
+ emit_insn (gen_rtx_SET (target, gen_rtx_VEC_DUPLICATE (mode, elem)));
return;
}
--- /dev/null
+/* On S/390 this ends up calling the vec_init RTL expander with a
+ parallel of two symbol_refs. */
+
+/* { dg-do compile } */
+/* { dg-options "-O3 -fPIC" } */
+
+
+struct test
+{
+ struct base
+ {
+ int key;
+ };
+ struct derived : public base
+ {
+ int key;
+ };
+
+ derived core;
+ derived &dRef;
+ base &bRef;
+
+ test() : dRef (core), bRef (core) {}
+};
+
+test test;