>> Now finiteness assertion is only used in a very late CD-DCE, which is >> located after all loop optimizations are done. And we can even place it as >> late as just before RTL-expansion. This might be safe enough to let hidden >> infinite loops exposed.
> Is that so? The early pipeline contains a CD-DCE pass as well. Note we also > have pure/const discovery affected by this. I specialized a CD-DCE pass, named CD-DCE2, and only in this pass, loop removal based on assumed finteness is performed. Please check the patch. >> Now we still need to define "non-trivial exit condition" and a way to actually test for that. Still not very clear on "non-trival exit condition". I think if a loop contains non-EH exit, it is terminable. Feng