https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116569
--- Comment #12 from Richard Biener <rguenth at gcc dot gnu.org> --- (In reply to Andrew Pinski from comment #3) > (In reply to Richard Biener from comment #2) > > Apparently the vectorizer introduces ops that are not supported by the > > target. Or vector lowering indentifes them wrong. > > Or rather match-and-simplify puts it back together: > Applying pattern match.pd:5024, gimple-match-6.cc:5803 > Applying pattern match.pd:898, gimple-match-9.cc:1334 > gimple_simplified to _282 = vect_cst__192 % vect_cst__193; > vect_patt_106.24_204 = _282; > > Match pattern: > ``` > /* X - (X / Y) * Y is the same as X % Y. */ > (simplify > (minus (convert1? @0) (convert2? (mult:c (trunc_div @@0 @@1) @1))) > (if (INTEGRAL_TYPE_P (type) || VECTOR_INTEGER_TYPE_P (type)) > (convert (trunc_mod @0 @1)))) > ``` > > I think we need to add a check to make sure we support the mod optab here > (for after the lowering). Yes. > I also think veclowering should also lower % case > too (for general vector usage too). Yeah, but isn't that handled by generic binop code?