2018-10-19 Richard Biener <rguenther@suse.de>
PR target/87657
* config/i386/i386.c (ix86_builtin_vectorization_cost): Use
TYPE_VECTOR_SUBPARTS and avoid relying on vector mode.
* gcc.target/i386/pr87657.c: New testcase.
From-SVN: r265316
+2018-10-19 Richard Biener <rguenther@suse.de>
+
+ PR target/87657
+ * config/i386/i386.c (ix86_builtin_vectorization_cost): Use
+ TYPE_VECTOR_SUBPARTS and avoid relying on vector mode.
+
2018-10-19 H.J. Lu <hongjiu.lu@intel.com>
PR target/72782
case vec_construct:
{
- gcc_assert (VECTOR_MODE_P (mode));
/* N element inserts into SSE vectors. */
- int cost = GET_MODE_NUNITS (mode) * ix86_cost->sse_op;
+ int cost = TYPE_VECTOR_SUBPARTS (vectype) * ix86_cost->sse_op;
/* One vinserti128 for combining two SSE vectors for AVX256. */
if (GET_MODE_BITSIZE (mode) == 256)
cost += ix86_vec_cost (mode, ix86_cost->addss);
+2018-10-19 Richard Biener <rguenther@suse.de>
+
+ PR target/87657
+ * gcc.target/i386/pr87657.c: New testcase.
+
2018-10-19 H.J. Lu <hongjiu.lu@intel.com>
PR target/72782
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-slp-vectorize -fno-vect-cost-model -mno-sse" } */
+
+int x;
+
+void foo (short a, short b)
+{
+ ((short *)&x)[0] = a;
+ ((short *)&x)[1] = b;
+}
+
+#if __SIZEOF_LONG__ == 8
+long y;
+
+void bar (short a, short b)
+{
+ ((short *)&y)[0] = a;
+ ((short *)&y)[1] = b;
+ ((short *)&y)[2] = a;
+ ((short *)&y)[3] = b;
+}
+#endif