[PATCH] fix mark_single_exit_loops

Mostafa Hagog MUSTAFA@il.ibm.com
Thu Mar 10 10:32:00 GMT 2005





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



More information about the Gcc-patches mailing list