https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88823
Bug ID: 88823
Summary: ivopts introduces -1(OVF)
Product: gcc
Version: 9.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: glisse at gcc dot gnu.org
Target Milestone: ---
int g (int a, int *v)
{
v[0] = a;
v[1] = 0;
while (v[0]-- > 0)
v[1] += v[0];
return v[1];
}
With -O2, ivopts replaces "if (_18 > 0)" with "if (_4 != -1(OVF))". IIUC, it
should at least use drop_tree_overflow to get a clean constant -1, although I
don't know why the overflow appeared in the first place. Maybe the overflow
flag is harmless and you can just close as not-a-bug.