https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116569
--- Comment #8 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(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)))