https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99947
--- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> --- There's an error reported by valgrind: ==18930== Invalid read of size 8 ==18930== at 0x11005A6: quick_push (vec.h:1023) ==18930== by 0x11005A6: quick_push (vec.h:1875) ==18930== by 0x11005A6: safe_push (vec.h:1888) ==18930== by 0x11005A6: vectorizable_induction(_loop_vec_info*, _stmt_vec_info*, gimple**, _slp_tree*, vec<stmt_info_for_cost, va_heap, vl_ptr>*) (tree-vect-loop.c:8209) ==18930== by 0x10F7B00: vect_transform_stmt(vec_info*, _stmt_vec_info*, gimple_stmt_iterator*, _slp_tree*, _slp_instance*) (tree-vect-stmts.c:10901) ==18930== by 0x11298A6: vect_schedule_slp_node(vec_info*, _slp_tree*, _slp_instance*) (tree-vect-slp.c:6193) ==18930== by 0x11364A2: vect_schedule_scc(vec_info*, _slp_tree*, _slp_instance*, hash_map<_slp_tree*, slp_scc_info, simple_hashmap_traits<default_hash_traits<_slp_tree*>, slp_scc_info> >&, int&, vec<_slp_tree*, va_heap, vl_ptr>&) (tree-vect-slp.c:6355) ==18930== by 0x113621F: vect_schedule_scc(vec_info*, _slp_tree*, _slp_instance*, hash_map<_slp_tree*, slp_scc_info, simple_hashmap_traits<default_hash_traits<_slp_tree*>, slp_scc_info> >&, int&, vec<_slp_tree*, va_heap, vl_ptr>&) (tree-vect-slp.c:6336) ==18930== by 0x1136ACF: vect_schedule_slp(vec_info*, vec<_slp_instance*, va_heap, vl_ptr>) (tree-vect-slp.c:6471) ==18930== by 0x1115717: vect_transform_loop(_loop_vec_info*, gimple*) (tree-vect-loop.c:9535) ==18930== by 0x1141FFF: try_vectorize_loop_1(hash_table<simduid_to_vf, false, xcallocator>*&, unsigned int*, loop*, gimple*, gimple*) (tree-vectorizer.c:1104) ==18930== by 0x1142CE0: vectorize_loops() (tree-vectorizer.c:1243) ==18930== by 0xD99CC7: execute_one_pass(opt_pass*) (passes.c:2567) ==18930== by 0xD9A6B2: execute_pass_list_1(opt_pass*) (passes.c:2656) ==18930== by 0xD9A6C4: execute_pass_list_1(opt_pass*) (passes.c:2657) ==18930== Address 0x5b5dc38 is 8 bytes inside a block of size 40 free'd ==18930== at 0x484239F: realloc (vg_replace_malloc.c:1192) ==18930== by 0x1ADDF8D: xrealloc (xmalloc.c:179) ==18930== by 0x1100649: reserve<tree_node*> (vec.h:290) ==18930== by 0x1100649: reserve (vec.h:1778) ==18930== by 0x1100649: safe_push (vec.h:1887) ==18930== by 0x1100649: vectorizable_induction(_loop_vec_info*, _stmt_vec_info*, gimple**, _slp_tree*, vec<stmt_info_for_cost, va_heap, vl_ptr>*) (tree-vect-loop.c:8209) ==18930== by 0x10F7B00: vect_transform_stmt(vec_info*, _stmt_vec_info*, gimple_stmt_iterator*, _slp_tree*, _slp_instance*) (tree-vect-stmts.c:10901) ==18930== by 0x11298A6: vect_schedule_slp_node(vec_info*, _slp_tree*, _slp_instance*) (tree-vect-slp.c:6193) ==18930== by 0x11364A2: vect_schedule_scc(vec_info*, _slp_tree*, _slp_instance*, hash_map<_slp_tree*, slp_scc_info, simple_hashmap_traits<default_hash_traits<_slp_tree*>, slp_scc_info> >&, int&, vec<_slp_tree*, va_heap, vl_ptr>&) (tree-vect-slp.c:6355) ==18930== by 0x113621F: vect_schedule_scc(vec_info*, _slp_tree*, _slp_instance*, hash_map<_slp_tree*, slp_scc_info, simple_hashmap_traits<default_hash_traits<_slp_tree*>, slp_scc_info> >&, int&, vec<_slp_tree*, va_heap, vl_ptr>&) (tree-vect-slp.c:6336) ==18930== by 0x1136ACF: vect_schedule_slp(vec_info*, vec<_slp_instance*, va_heap, vl_ptr>) (tree-vect-slp.c:6471) ==18930== by 0x1115717: vect_transform_loop(_loop_vec_info*, gimple*) (tree-vect-loop.c:9535) ==18930== by 0x1141FFF: try_vectorize_loop_1(hash_table<simduid_to_vf, false, xcallocator>*&, unsigned int*, loop*, gimple*, gimple*) (tree-vectorizer.c:1104) ==18930== by 0x1142CE0: vectorize_loops() (tree-vectorizer.c:1243) ==18930== by 0xD99CC7: execute_one_pass(opt_pass*) (passes.c:2567) ==18930== Block was alloc'd at ==18930== at 0x483D70F: malloc (vg_replace_malloc.c:380) ==18930== by 0x1ADDF9F: xrealloc (xmalloc.c:177) ==18930== by 0x11000DE: reserve<tree_node*> (vec.h:290) ==18930== by 0x11000DE: reserve (vec.h:1778) ==18930== by 0x11000DE: safe_push (vec.h:1887) ==18930== by 0x11000DE: vectorizable_induction(_loop_vec_info*, _stmt_vec_info*, gimple**, _slp_tree*, vec<stmt_info_for_cost, va_heap, vl_ptr>*) (tree-vect-loop.c:8154) ==18930== by 0x10F7B00: vect_transform_stmt(vec_info*, _stmt_vec_info*, gimple_stmt_iterator*, _slp_tree*, _slp_instance*) (tree-vect-stmts.c:10901) ==18930== by 0x11298A6: vect_schedule_slp_node(vec_info*, _slp_tree*, _slp_instance*) (tree-vect-slp.c:6193) ==18930== by 0x11364A2: vect_schedule_scc(vec_info*, _slp_tree*, _slp_instance*, hash_map<_slp_tree*, slp_scc_info, simple_hashmap_traits<default_hash_traits<_slp_tree*>, slp_scc_info> >&, int&, vec<_slp_tree*, va_heap, vl_ptr>&) (tree-vect-slp.c:6355) ==18930== by 0x113621F: vect_schedule_scc(vec_info*, _slp_tree*, _slp_instance*, hash_map<_slp_tree*, slp_scc_info, simple_hashmap_traits<default_hash_traits<_slp_tree*>, slp_scc_info> >&, int&, vec<_slp_tree*, va_heap, vl_ptr>&) (tree-vect-slp.c:6336) ==18930== by 0x1136ACF: vect_schedule_slp(vec_info*, vec<_slp_instance*, va_heap, vl_ptr>) (tree-vect-slp.c:6471) ==18930== by 0x1115717: vect_transform_loop(_loop_vec_info*, gimple*) (tree-vect-loop.c:9535) ==18930== by 0x1141FFF: try_vectorize_loop_1(hash_table<simduid_to_vf, false, xcallocator>*&, unsigned int*, loop*, gimple*, gimple*) (tree-vectorizer.c:1104) ==18930== by 0x1142CE0: vectorize_loops() (tree-vectorizer.c:1243) ==18930== by 0xD99CC7: execute_one_pass(opt_pass*) (passes.c:2567)