https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109595
Bug ID: 109595 Summary: Missed upper bound on number of iterations Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: hubicka at gcc dot gnu.org Target Milestone: --- The following loop can iterate only 0 times before hitting undefined behaviour. struct foo { int a[3]; int b; } c; test(int p) { for (int i = 3; i < p; i++) { c.a[i]=0; } } but we miss this fact: a-t.c.049t.profile_estimate:Loop 1 iterates at most 2147483644 times. a-t.c.049t.profile_estimate:Loop 1 likely iterates at most 2147483644 times. a-t.c.106t.cunrolli:Loop 1 iterates at most 2147483644 times. a-t.c.106t.cunrolli:Loop 1 likely iterates at most 2147483644 times. a-t.c.159t.ivcanon:Loop 1 iterates at most 2147483643 times. a-t.c.159t.ivcanon:Loop 1 likely iterates at most 2147483643 times.