diff mbox

Fix half of PR64191

Message ID alpine.LSU.2.11.1412091002040.8254@zhemvz.fhfr.qr
State New
Headers show

Commit Message

Richard Biener Dec. 9, 2014, 9:04 a.m. UTC
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  <rguenther@suse.de>

	PR tree-optimization/64191
	* tree-vect-stmts.c (vect_stmt_relevant_p): Clobbers are
	not relevant (nor are their uses).
diff mbox

Patch

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,