https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90269
--- Comment #1 from Marc Glisse <glisse at gcc dot gnu.org> --- --- tree-loop-distribution.c (revision 270624) +++ tree-loop-distribution.c (working copy) @@ -3033,20 +3033,23 @@ 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); + 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. */ works for this testcase, but that may be too crude (?).