+2019-06-24 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/90972
+ * tree-vect-stmts.c (vect_init_vector): Handle CONSTANT_CLASS_P
+ in common code, dealing with STRING_CST properly.
+
2019-06-24 Richard Biener <rguenther@suse.de>
PR tree-optimization/90930
+2019-06-24 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/90972
+ * gcc.dg/torture/pr90972.c: New testcase.
+
2019-06-24 Martin Sebor <msebor@redhat.com>
* gcc.dg/Wfloat-equal-1.c: Adjust text of expected diagnostic.
--- /dev/null
+/* { dg-do compile } */
+/* { dg-additional-options "-mcpu=power8" { target powerpc*-*-* } } */
+
+long f;
+void a();
+void *g()
+{
+ char h[] = {}, j[] = {}, k[] = {}, l[] = {}, m[] = {}, n[] = {}, o[] = {},
+ q[] = {}, r[] = {};
+ static const char i[] = {6, 0};
+ const char *nops[] = {h, i, j, k, l, m, n, o, q, r};
+ long s = 2;
+ void *fill = a;
+ char *p = fill;
+ while (f) {
+ void *b = p;
+ const void *c = nops[1];
+ long d = s, e = __builtin_object_size(b, 0);
+ __builtin___memcpy_chk(b, c, d, e);
+ p += s;
+ f -= s;
+ }
+ return fill;
+}
val = new_temp;
}
}
- else if (CONSTANT_CLASS_P (val))
- val = fold_convert (TREE_TYPE (type), val);
else
{
- new_temp = make_ssa_name (TREE_TYPE (type));
+ gimple_seq stmts = NULL;
if (! INTEGRAL_TYPE_P (TREE_TYPE (val)))
- init_stmt = gimple_build_assign (new_temp,
- fold_build1 (VIEW_CONVERT_EXPR,
- TREE_TYPE (type),
- val));
+ val = gimple_build (&stmts, VIEW_CONVERT_EXPR,
+ TREE_TYPE (type), val);
else
- init_stmt = gimple_build_assign (new_temp, NOP_EXPR, val);
- vect_init_vector_1 (stmt_info, init_stmt, gsi);
- val = new_temp;
+ /* ??? Condition vectorization expects us to do
+ promotion of invariant/external defs. */
+ val = gimple_convert (&stmts, TREE_TYPE (type), val);
+ for (gimple_stmt_iterator gsi2 = gsi_start (stmts);
+ !gsi_end_p (gsi2); gsi_next (&gsi2))
+ vect_init_vector_1 (stmt_info, gsi_stmt (gsi2), gsi);
}
}
val = build_vector_from_val (type, val);