Decrementing the loop counter at the end of the loop generates valid code. And doesn't crash my computer. So it seem that it is my unusual loop construct that gets the compilers knickers in a twist.
Attached is working non-crashing code snippet.
mov r99.x,l15.x whileloop if_logicalz r99.x break endif ... iadd r99.x,r99.x,l2.x endloop
to restrict the compiler to completely unroll the loop,you need to specify the limit of loop such that it cannot be determined at compile time.
do not give any hardcoded value as the loop limit.