https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123002
--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Richard Biener <[email protected]>: https://gcc.gnu.org/g:1da0e5c1405e87e9f2a11ed358b40dff21085657 commit r16-5902-g1da0e5c1405e87e9f2a11ed358b40dff21085657 Author: Richard Biener <[email protected]> Date: Thu Aug 21 13:46:06 2025 +0200 Move even/odd validity check from supportable_widening_operation to caller The following moves the incomplete validity check to use WIDEN_MULT_{EVEN,ODD} to the caller of supportable_widening_operation where we have access to more (but not enough) information. I have made the test conservative enough I hope. For the testcase what was broken is that it uses a SLP reduction where lane-swizzling isn't valid. PR tree-optimization/123002 * tree-vectorizer.h (supportable_widening_operation): Remove vinfo and stmt_info parameters, add flag to indicate whether the context would allow OP_{EVEN,ODD}. * tree-vect-patterns.cc (vect_recog_abd_pattern): Adjust and pass false. (vect_recog_widen_op_pattern): Likewise. (vect_recog_widen_abd_pattern): Likewise. * tree-vect-stmts.cc (vectorizable_conversion): Move even/odd validity check here, from supportable_widening_operation. Adjust it to be conservative. (supportable_widening_operation): Get flag whether even/odd is OK to use and remove then unused parameters and code. * gcc.dg/vect/vect-pr123002.c: New testcase.
