https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116831
--- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jennifer Schmitz <jschm...@gcc.gnu.org>: https://gcc.gnu.org/g:a2e06b7f081a3d2e50e3afa8d3f1676a05099707 commit r15-4236-ga2e06b7f081a3d2e50e3afa8d3f1676a05099707 Author: Jennifer Schmitz <jschm...@nvidia.com> Date: Thu Oct 3 04:46:51 2024 -0700 match.pd: Check trunc_mod vector obtap before folding. This patch guards the simplification x / y * y == x -> x % y == 0 in match.pd by a check for: 1) Non-vector mode of x OR 2) Lack of support for vector division OR 3) Support of vector modulo The patch was bootstrapped and tested with no regression on aarch64-linux-gnu and x86_64-linux-gnu. OK for mainline? Signed-off-by: Jennifer Schmitz <jschm...@nvidia.com> gcc/ PR tree-optimization/116831 * match.pd: Guard simplification to trunc_mod with check for mod optab support. gcc/testsuite/ PR tree-optimization/116831 * gcc.dg/torture/pr116831.c: New test.