This avoids vectorizing empty loops that only contain an indirect clobber. The real bug of course is that we don't remove the loop in the first place (but we might not able to prove it terminates). Still vectorizing it adds additional prologue/epilogue loops that only convolutes the final code we generate.
Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk and branch. Richard. 2014-12-09 Richard Biener <rguent...@suse.de> PR tree-optimization/64191 * tree-vect-stmts.c (vect_stmt_relevant_p): Clobbers are not relevant (nor are their uses). Index: gcc/tree-vect-stmts.c =================================================================== --- gcc/tree-vect-stmts.c (revision 218479) +++ gcc/tree-vect-stmts.c (working copy) @@ -340,7 +340,8 @@ vect_stmt_relevant_p (gimple stmt, loop_ /* changing memory. */ if (gimple_code (stmt) != GIMPLE_PHI) - if (gimple_vdef (stmt)) + if (gimple_vdef (stmt) + && !gimple_clobber_p (stmt)) { if (dump_enabled_p ()) dump_printf_loc (MSG_NOTE, vect_location,