https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114465
Bug ID: 114465 Summary: "x % const1 % const2" should be optimized if const1 % const2 == 0 Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: xry111 at gcc dot gnu.org Target Milestone: --- int test(int x) { return x % 114514 % 1847; } This should be optimized as-is int test(int x) { return x % 1847; }