]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-optimization/96022 - fix ICE with vectorized shift
authorRichard Biener <rguenther@suse.de>
Thu, 2 Jul 2020 09:12:51 +0000 (11:12 +0200)
committerGiuliano Belinassi <giuliano.belinassi@usp.br>
Mon, 17 Aug 2020 16:15:52 +0000 (13:15 -0300)
commitd6d58da92187bb32923063732024fa5f2634dc47
tree94edb422ef066a6e6a70843640c650158e2bd291
parentb8365b815cb2d27d002a446940236ba23e31b264
tree-optimization/96022 - fix ICE with vectorized shift

This fixes lane extraction for internal def vectorized shifts
with an effective scalar shift operand by always using lane zero
of the first vector stmt.

It also fixes a SLP build issue noticed on the testcase where
we end up building unary vector ops with the only operand built
form scalars which isn't profitable by itself.  The exception
is for stores.

2020-07-02  Richard Biener  <rguenther@suse.de>

PR tree-optimization/96022
* tree-vect-stmts.c (vectorizable_shift): Only use the
first vector stmt when extracting the scalar shift amount.
* tree-vect-slp.c (vect_build_slp_tree_2): Also build unary
nodes with all-scalar children from scalars but not stores.
(vect_analyze_slp_instance): Mark the node not failed.

* g++.dg/vect/pr96022.cc: New testcase.
gcc/testsuite/g++.dg/vect/pr96022.cc [new file with mode: 0644]
gcc/tree-vect-slp.c
gcc/tree-vect-stmts.c