[PATCH] Fix PR86287

Richard Biener rguenther@suse.de
Mon Jun 25 14:03:00 GMT 2018


Bootstrapped on x86_64-unknown-linux-gnu, testing in progress.

Richard.

2018-06-25  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/86287
	* tree-vect-loop.c (vect_transform_loop_stmt): Fix read-after-free.

diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index 8e3f5f550b0..bd549566245 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -8380,8 +8380,9 @@ vect_transform_loop_stmt (loop_vec_info loop_vinfo, gimple *stmt,
 
   /* SLP.  Schedule all the SLP instances when the first SLP stmt is
      reached.  */
-  if (STMT_SLP_TYPE (stmt_info))
+  if (slp_vect_type slptype = STMT_SLP_TYPE (stmt_info))
     {
+
       if (!*slp_scheduled)
 	{
 	  *slp_scheduled = true;
@@ -8392,7 +8393,7 @@ vect_transform_loop_stmt (loop_vec_info loop_vinfo, gimple *stmt,
 	}
 
       /* Hybrid SLP stmts must be vectorized in addition to SLP.  */
-      if (PURE_SLP_STMT (stmt_info))
+      if (slptype == pure_slp)
 	return;
     }
 



More information about the Gcc-patches mailing list