Fix use after free in vector_size change
authorRichard Sandiford <richard.sandiford@arm.com>
Tue, 22 Oct 2019 08:43:01 +0000 (08:43 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Tue, 22 Oct 2019 08:43:01 +0000 (08:43 +0000)
commit87121696fb2ddbec5f33daa359234850f7fd306d
treecc0355da7614212e8c7c186339e97cd127f5ba87
parent10bce48f104de56503b17954ed79f019df3252e3
Fix use after free in vector_size change

r277235 was a bit too mechanical and ended up introducing use
after free bugs in both loop and SLP vectorisation.

2019-10-22  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
* tree-vect-slp.c (vect_slp_bb_region): Check whether
autodetected_vector_size rather than vector_size is zero.
* tree-vect-loop.c (vect_analyze_loop): Likewise.
Set autodetected_vector_size immediately after calling
vect_analyze_loop_2.  Check for a fatal error before advancing
next_size.

From-SVN: r277282
gcc/ChangeLog
gcc/tree-vect-loop.c
gcc/tree-vect-slp.c