From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Hayes To: Michael Matz Cc: Jeffrey A Law , Richard Henderson , gcc@gcc.gnu.org Subject: Re: flow_d_f_o_compute misnamed? (was: if-conversion a performance...) Date: Fri, 05 May 2000 19:04:00 -0000 Message-id: <14611.32183.333679.363611@ongaonga.elec.canterbury.ac.nz> References: <6780.957571481@upchuck> X-SW-Source: 2000-05/msg00289.html Michael Matz writes: > If DFS first detects inner loops (after some thinking I see that too :)) > then some comments in flow_loops_find() are wrong (some say, they are > searching for outer first), and flow_depth_first_order_compute() should be > corrected to do what the name promises ;) Or do I miss something obvious? Even though I wrote this, I cannot remember the details and unfortunately I do not have my work book with me at present. It is quite possible that my depth first search algorithm is wrong as I am naive when it comes to graph theory. I vaguely recall converting my original recursive algorithm to an iterative algorithm so I could easily have made a mistake. > I mean it works somehow right now, I'm not really sure if I can believe > that such a central function is incorrect and nobody noticed. Although the DFS algorithm may be wrong, it may have no effect on the loop finding algorithm. For the latter, it is not essential that all the outer loops in the CFG are found first but that with nested loops, an inner loop is found after its containing outer loop. Possibly my `DFS' algorithm also has this property? Michael.