function-at-a-time processing in C

Per Bothner per@bothner.com
Thu Jun 15 09:40:00 GMT 2000


Diego Novillo <dnovillo@redhat.com> writes:

> Having FOR_STMT as a separate entity is also useful for doing
> high-level loop transformations. In particular if the FOR_STMT
> structure includes information like index variable, bounds and
> trip counts.

As a rule, we don't want tree nodes to contain "derived"
information.  We should not clutter them up with results
calculated by later compiler passes.

Of course it may be efficient for later pases to store information
in a tree node.  In that case, it should be done using a generic
"annotation" framework:  Every expression can have a TREE_LIST
of annotations, where an annotation is a key and a value.  Code
that set and read annotations - and should ignore annotations it
doesn't know about.

In any case, this is an argument for using a for *expression*, not a
for statement, since we don't want to write high-level loop
transformations that only work for C/C++, and don't work for languages
that have loop expressions.
-- 
	--Per Bothner
per@bothner.com   http://www.bothner.com/~per/


More information about the Gcc-patches mailing list