This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/18694] [4.0 regression] loop miscompilation at -O1 (-ftree-ch)
- From: "kazu at cs dot umass dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 Dec 2004 05:24:46 -0000
- Subject: [Bug tree-optimization/18694] [4.0 regression] loop miscompilation at -O1 (-ftree-ch)
- References: <20041127224610.18694.falk@debian.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From kazu at cs dot umass dot edu 2004-12-09 05:24 -------
Updated the testcase like so:
/* PR tree-optimization/18694
The dominator optimization didn't take the PHI evaluation order
into account when threading an edge. */
extern void abort (void) __attribute__((noreturn));
extern void exit (int) __attribute__((noreturn));
void __attribute__((noinline))
foo (int i)
{
int next_n = 1;
int j = 0;
for (; i != 0; i--)
{
int n;
for (n = next_n; j < n; j++)
next_n++;
if (j != n)
abort ();
}
}
int
main (void)
{
foo (2);
exit (0);
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18694