Hello,
We observe the following behavior which seems to be incorrect for the C55 compiler version 4.3.9. For a loop with an indeterminate count, the compiler does not remove the 0-iteration test in the following despite the presence of the MUST_ITERATE pragma which guarantees at least one iteration through the loop.
void doloop(int niters)
{
#pragma MUST_ITERATE(1,10,)
for (int i=0; i<niters; ++i) do something;
}
The resulting assembly code still shows a 0-iteration loop test. However, the following code does not result in the 0-iteration test, which is the expected behavior.
void doloop(int niters)
{
int i = 0;
#pragma MUST_ITERATE(1,10,)
for (; i<niters; ++i) do something;
}
It appears that declaring the index variable in the for loop is somehow causing the 0-iteration information to be ignored.
Thanks for looking into this.