| © 1998 IRISA / INRIA - University of Rennes 1 |
Version |
Because of dark implementation details, the action analysis may produce wrong annotations if the entry point is recursive (actually when there is mutual recursion). The workaround is to encapsulate the recursive entry point in a (non-recursive) function.
Tempo doesn't give an error if there is mutual recursion among structure declarations. However side-effect analysis just might not collect as many read/written non-locals as it should. Self recursion is OK though.
break, return, or
continue, will generate a specialization whose semantics
is not equivalent to the original code. The problem arises from the
analysis not capturing the dynamic conditions which exit the loop.
For example, consider the following loop.
for( n = 0; n < 5; n++ )
{
if (Dyn)
return Stat;
*side_effect++;
}
Because the loop is static, the side_effect variable will
be incremented 5 times during specialization even if the dynamic
Dyn condition exits the loop, say, after 3 iterations.
For the same reason, Tempo will loop forever during specialization inside infinite static loops containing dynamic conditionals that exit the loop. E.g.,
do
{
if (Dyn)
return Stat;
Something;
}
while (1);
The workaround is to change the loop conditional in order to take into account the dynamic control. In the following example, the loop condition becomes dynamic because it is side-effected under dynamic control.
exit = 1;
do
{
if (Dyn)
{
exit = 0;
return Stat;
}
Something;
}
while (exit);
Another approach is to explicitly force a dynamic conditional, and manually restore the static value in the residualized program. For example,
do
{
if (Dyn)
return Stat;
Something;
}
while (dyn_exit);
dyn_exit must then be set to 1 in
the specialized program.
Of course, the loop will not be evaluated away since it is has become dynamic.
tempo-talk@irisa.fr
tempo@irisa.fr
http://compose.labri.fr
tempo