https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116994
Bug ID: 116994
Summary: [15 regression] GCC trunk generates larger code than
GCC 14 at -Os
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: middle-end
Assignee: unassigned at gcc dot gnu.org
Reporter: dccitaliano at gmail dot com
Target Milestone: ---
I found this at -Os and I figured I could report it. For this specific
(reduced) small example, GCC trunk generates code that's 7% larger than GCC
14.
long patatino() {
long x = 0;
for (int i = 0; i < 5; ++i) {
while (x < 10) {
x += ((x % 2 == 0 && x % 3 != 0 && x % 7 != 0) ||
(x % 2 != 0 && x % 5 == 0 && x % 11 != 0)) ? 2 : 1;
}
}
return x;
}
Godbolt example: https://godbolt.org/z/3bqfq4nM7