summaryrefslogtreecommitdiff
path: root/gcc/doc/loop.texi
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/doc/loop.texi')
-rw-r--r--gcc/doc/loop.texi15
1 files changed, 11 insertions, 4 deletions
diff --git a/gcc/doc/loop.texi b/gcc/doc/loop.texi
index fade89d32e8..e486b0c5d10 100644
--- a/gcc/doc/loop.texi
+++ b/gcc/doc/loop.texi
@@ -64,17 +64,24 @@ function. Each of the loops is represented in a @code{struct loop}
structure. Each loop is assigned an index (@code{num} field of the
@code{struct loop} structure), and the pointer to the loop is stored in
the corresponding field of the @code{larray} vector in the loops
-structure. Index of a sub-loop is always greater than the index of its
-super-loop. The indices do not have to be continuous, there may be
+structure. The indices do not have to be continuous, there may be
empty (@code{NULL}) entries in the @code{larray} created by deleting
-loops. The index of a loop never changes.
+loops. Also, there is no guarantee on the relative order of a loop
+and its subloops in the numbering. The index of a loop never changes.
The entries of the @code{larray} field should not be accessed directly.
The function @code{get_loop} returns the loop description for a loop with
the given index. @code{number_of_loops} function returns number of
loops in the function. To traverse all loops, use @code{FOR_EACH_LOOP}
macro. The @code{flags} argument of the macro is used to determine
-the direction of traversal and the set of loops visited.
+the direction of traversal and the set of loops visited. Each loop is
+guaranteed to be visited exactly once, regardless of the changes to the
+loop tree, and the loops may be removed during the traversal. The newly
+created loops are never traversed, if they need to be visited, this
+must be done separately after their creation. The @code{FOR_EACH_LOOP}
+macro allocates temporary variables. If the @code{FOR_EACH_LOOP} loop
+were ended using break or goto, they would not be released;
+@code{FOR_EACH_LOOP_BREAK} macro must be used instead.
Each basic block contains the reference to the innermost loop it belongs
to (@code{loop_father}). For this reason, it is only possible to have