This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] fix mark_single_exit_loops
- From: Mostafa Hagog <MUSTAFA at il dot ibm dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: rakdver at atrey dot karlin dot mff dot cuni dot cz, Jeffrey A Law <law at redhat dot com>
- Date: Thu, 10 Mar 2005 12:32:20 +0200
- Subject: [PATCH] fix mark_single_exit_loops
Hi,
While trying to bootstrap sms changes I have encountered the following bug
in
in mark_single_exit_loops code, it turns out that this function will fail
in the case
where a loop has an exit to another loop and the later loop outer doesn't
contain
the former loop. The following trivial fix make us ignore this case and
not fail on it.
Ok for mainline?
Index: cfgloop.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfgloop.c,v
retrieving revision 1.49
diff -c -p -r1.49 cfgloop.c
*** cfgloop.c 1 Mar 2005 13:44:42 -0000 1.49
--- cfgloop.c 10 Mar 2005 10:24:36 -0000
*************** mark_single_exit_loops (struct loops *lo
*** 300,306 ****
continue;
for (loop = bb->loop_father;
! loop != e->dest->loop_father;
loop = loop->outer)
{
/* If we have already seen an exit, mark this by the edge
that
--- 300,306 ----
continue;
for (loop = bb->loop_father;
! loop && (loop != e->dest->loop_father);
loop = loop->outer)
{
/* If we have already seen an exit, mark this by the edge
that