From: "Sanjiv Kumar Gupta, Noida" <sanjivg@noida.hcltech.com>
To: gcc@gcc.gnu.org
Subject: infinite loop in find_rgns
Date: Mon, 31 Mar 2003 16:15:00 -0000 [thread overview]
Message-ID: <E04CF3F88ACBD5119EFE00508BBB2121086A14F5@exch-01.noida.hcltech.com> (raw)
Curious to know how does the following piece of code
in find_rgns works.
...
passed = sbitmap_alloc (nr_edges);
sbitmap_zero (passed);
.....
/* DFS traversal to find inner loops in the cfg. */
sp = -1;
while (1)
{
if (current_edge == 0 || TEST_BIT (passed, current_edge))
{
/* We have reached a leaf node or a node that was already
processed. Pop edges off the stack until we find
an edge that has not yet been processed. */
while (sp >= 0
&& (current_edge == 0 || TEST_BIT (passed, current_edge)))
{
/* Pop entry off the stack. */
current_edge = stack[sp--];
....
}
/* See if have finished the DFS tree traversal. */
if (sp < 0 && TEST_BIT (passed, current_edge))
break;
/* Nope, continue the traversal with the popped node. */
continue;
}
In my case , current_edge is 0 at start. This is running in
infinite loop then.
--Sanjiv
next reply other threads:[~2003-03-31 10:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-03-31 16:15 Sanjiv Kumar Gupta, Noida [this message]
2003-04-02 12:23 Sanjiv Kumar Gupta, Noida
2003-04-02 20:14 ` Richard Henderson
2003-04-03 9:57 Sanjiv Kumar Gupta, Noida
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E04CF3F88ACBD5119EFE00508BBB2121086A14F5@exch-01.noida.hcltech.com \
--to=sanjivg@noida.hcltech.com \
--cc=gcc@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).