From 9ae91886f6a59fbcba0559299e170ee82fa592cb Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Tue, 26 Jun 2018 06:42:46 +0000 Subject: re PR tree-optimization/86287 (AddressSanitizer: heap-use-after-free on bootstrap with -O3) 2018-06-26 Richard Biener PR tree-optimization/86287 PR bootstrap/86316 * tree-vect-loop.c (vect_transform_loop_stmt): Fix read-after-free. (vect_analyze_loop): Initialize n_stmts. From-SVN: r262132 --- gcc/tree-vect-loop.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'gcc/tree-vect-loop.c') diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c index dacc881..615b6bb 100644 --- a/gcc/tree-vect-loop.c +++ b/gcc/tree-vect-loop.c @@ -2315,7 +2315,7 @@ vect_analyze_loop (struct loop *loop, loop_vec_info orig_loop_vinfo, return NULL; } - unsigned n_stmts; + unsigned n_stmts = 0; poly_uint64 autodetected_vector_size = 0; while (1) { @@ -8342,8 +8342,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; @@ -8354,7 +8355,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; } -- cgit v1.1