The following makes sure to purge VDEFs for all calls.
PR tree-optimization/123794
* tree-vect-slp.cc (vect_remove_slp_scalar_calls): Unlink
VOPs for all calls.
* gcc.dg/vect/vect-simd-clone-pr123794.c: New testcase.
--- /dev/null
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_simd_clones } */
+/* { dg-additional-options "-fopenmp-simd" } */
+
+extern long a[];
+#pragma omp declare simd
+long my_fun(long);
+long foo_i;
+void foo() {
+#pragma omp simd
+ for (foo_i = 0; foo_i < 3; foo_i += 1)
+ a[foo_i] = my_fun(foo_i);
+}
if (lhs)
new_stmt = gimple_build_assign (lhs, build_zero_cst (TREE_TYPE (lhs)));
else
- {
- new_stmt = gimple_build_nop ();
- unlink_stmt_vdef (stmt_info->stmt);
- }
+ new_stmt = gimple_build_nop ();
+ unlink_stmt_vdef (stmt_info->stmt);
gsi = gsi_for_stmt (stmt);
vinfo->replace_stmt (&gsi, stmt_info, new_stmt);
if (lhs)