This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/49419] [4.6/4.7 regression] gcc -O2 miscompiles gp2c
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 15 Jun 2011 12:29:55 +0000
- Subject: [Bug target/49419] [4.6/4.7 regression] gcc -O2 miscompiles gp2c
- Auto-submitted: auto-generated
- References: <bug-49419-4@http.gcc.gnu.org/bugzilla/>
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__.