===================================================================
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-ldist-details" } */
+
+#include <new>
+struct T {
+ int* p;
+ T(T const&t):p(t.p){}
+};
+void f(T*__restrict a,T*__restrict b){
+ for(int i=0;i<1024;++i){
+ new(a+i)T(b[i]);
+ b[i].~T();
+ }
+}
+
+/* { dg-final { scan-tree-dump "generated memcpy" "ldist" } } */
===================================================================
@@ -3033,20 +3033,24 @@ find_seed_stmts_for_distribution (struct
the loop. */
if (!stmt_has_scalar_dependences_outside_loop (loop, phi))
continue;
work_list->safe_push (phi);
}
for (gimple_stmt_iterator gsi = gsi_start_bb (bbs[i]);
!gsi_end_p (gsi); gsi_next (&gsi))
{
gimple *stmt = gsi_stmt (gsi);
+ /* Ignore clobbers, they do not have true side effects. */
+ if (gimple_clobber_p (stmt))
+ continue;
+
/* If there is a stmt with side-effects bail out - we
cannot and should not distribute this loop. */
if (gimple_has_side_effects (stmt))
{
free (bbs);
return false;
}
/* Distribute stmts which have defs that are used outside of
the loop. */