https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92712
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org,
| |law at gcc dot gnu.org,
| |uros at gcc dot gnu.org
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I don't think the testcase is actually very good, because it uses volatile that
asks the compiler not to optimize that part.
But it can be reproduced with:
static int func_base(int t, const int v) {
int x = 0;
for (int i = 0; i < t; ++i) x += v;
return x;
}
int func_default(int t, const int v) {
return func_base(t, v);
}
int func_assumed(int t, const int v) {
if (t < 0) __builtin_unreachable();
return func_base(t, v);
}
too. The first change in func_assumed was r233207 and the -1;mul;add instead
of mul appeared with r263652.