https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120265
Bug ID: 120265
Summary: Optimize modular counters
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: mcccs at gmx dot com
Target Milestone: ---
I have a patch, opening this pr to reserve pr number for testcase.
we'd like to optimize
unsigned hours = 0;
for (...) {
...
hours++;
hours %= 60;
}
to
unsigned hours = 0;
for (...) {
...
hours++;
hours = hours == 60 ? 0 : hours;
}