aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const-call.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@linaro.org>2018-01-13 17:58:06 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2018-01-13 17:58:06 +0000
commit3ea518f6f63e66e48f2d41cfa41e1efae653a484 (patch)
tree7473d7808fc322d3f684496efb33cccb2be4dc00 /gcc/fold-const-call.c
parent7e11fc7f5cecffe650b672ac1af212d4bd9f1335 (diff)
downloadgcc-3ea518f6f63e66e48f2d41cfa41e1efae653a484.zip
gcc-3ea518f6f63e66e48f2d41cfa41e1efae653a484.tar.gz
gcc-3ea518f6f63e66e48f2d41cfa41e1efae653a484.tar.bz2
Protect against min_profitable_iters going negative
We had: if (vec_outside_cost <= 0) min_profitable_iters = 0; else { min_profitable_iters = ((vec_outside_cost - scalar_outside_cost) * assumed_vf - vec_inside_cost * peel_iters_prologue - vec_inside_cost * peel_iters_epilogue) / ((scalar_single_iter_cost * assumed_vf) - vec_inside_cost); which can lead to negative min_profitable_iters when the *_outside_costs are the same and peel_iters_epilogue is nonzero (e.g. if we're peeling for gaps). This is tested as part of the patch that adds support for fully-predicated loops. 2018-01-13 Richard Sandiford <richard.sandiford@linaro.org> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> gcc/ * tree-vect-loop.c (vect_estimate_min_profitable_iters): Make sure min_profitable_iters doesn't go negative. Co-Authored-By: Alan Hayward <alan.hayward@arm.com> Co-Authored-By: David Sherwood <david.sherwood@arm.com> From-SVN: r256621
Diffstat (limited to 'gcc/fold-const-call.c')
0 files changed, 0 insertions, 0 deletions