How to detect whether we're inside of a loop??

Diego Novillo dnovillo@redhat.com
Wed Apr 9 22:40:00 GMT 2003


On Wed, 2003-04-09 at 17:10, Kaveh R. Ghazi wrote:

> The function get_loop_depth() returns how many levels of loop nesting
> you're in at the time you call it.  It ignores "do {...} while(0)" loops
> to avoid false positives.  (Thanks to Bruce Korb for suggesting that
> to me.)
> 
If you are interested in loop analysis/transformations at the tree
level, I suggest you take a look at tree-ssa.  After we build the
flowgraph for the function tree you can use the generic loop
infrastructure in cfgloop.c (flow_loops_find and friends).


Diego.



More information about the Gcc mailing list