https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96022
--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Richard Biener <rgue...@gcc.gnu.org>: https://gcc.gnu.org/g:d5d9f7834ab809841c4ccc90bca74808b4bcaf8d commit r11-1782-gd5d9f7834ab809841c4ccc90bca74808b4bcaf8d Author: Richard Biener <rguent...@suse.de> Date: Thu Jul 2 11:12:51 2020 +0200 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 <rguent...@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.