http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49419
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-06-15
12:29:51 UTC ---
Perhaps even for:
void bar (void);
int test (int);
int fn (int x, int y)
{
int i;
for (i = 0; i < y && test (i); i++)
;
if (i == y)
return;
if (i == __INT_MAX__)
bar ();
}
we should be able to determine that bar can't be called. In the loop body
i is known to be i < y, after the loop i <= y but the i == y test rules out the
equality again, so we end up again with i < y which is certainly i <
__INT_MAX__.