https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116569
--- Comment #13 from Richard Biener <rguenth at gcc dot gnu.org> --- (In reply to ktkachov from comment #11) > (In reply to Andrew Pinski from comment #9) > > (In reply to Andrew Pinski from comment #8) > > > (In reply to Jennifer Schmitz from comment #7) > > > > Thanks for the quick reply. I tried > > > > > > > > (simplify > > > > (minus (convert1? @0) (convert2? (mult:c (trunc_div @@0 @@1) @1))) > > > > (if (INTEGRAL_TYPE_P (type) > > > > || (VECTOR_INTEGER_TYPE_P (type) > > > > && optimize_vectors_before_lowering_p ())) > > > > (convert (trunc_mod @0 @1)))) > > > > > > > > and the result is that the test case still ICEs, but fold-minus-1.c > > > > passes. > > > > > > Try: > > > INTEGRAL_TYPE_P (type) > > > || (VECTOR_INTEGER_TYPE_P (type) > > > && (optimize_vectors_before_lowering_p () > > > || target_supports_op_p (type, TRUNC_MOD_EXPR, optab_vector))) > > > > Oh wait the problem is this is before lowering but SVE vectors can't be > > lowered. > > > > I think maybe the lowering pass should handle the case where: > > !target_supports_op_p (type, TRUNC_MOD_EXPR, optab_vector) && > > target_supports_op_p (type, TRUNC_DIV_EXPR, optab_vector) && > > target_supports_op_p (type, MULT_EXPR, optab_vector) && target_supports_op_p > > (type, MINUS_EXPR, optab_vector) > > > > And expand TRUNC_MOD_EXPR there. > > > > I am thinking about adding a similar thing for MIN/MAX too. > > I don't think we have other lowering of SVE ops in the veclower, is that > something we want to start doing now? No, I think you can only get there with intrinsics in which case it's the users fault? GCC generic vectors do not support variable-length vectors IIRC.