From: Richard Biener Date: Tue, 26 Jun 2018 06:42:46 +0000 (+0000) Subject: re PR tree-optimization/86287 (AddressSanitizer: heap-use-after-free on bootstrap... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9ae91886f6a59fbcba0559299e170ee82fa592cb;p=gcc.git 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 342c69b1240..ec68212bc0a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +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. + 2018-06-26 Richard Biener PR middle-end/86271 diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c index dacc8811636..615b6bb101f 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; }