This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]