I have a large program that has a CFG structure that looks like this:
BB0:
if (condition0) goto BB1 goto BB2
BB1:
goto BB2
BB2:
if (condition1) goto BB3 goto BB4
BB3:
...
(repeat until BB7488)
When I compile this program targeting armv7, function IfConverter::AnalyzeBlock gets called recursively a large number of times, which eventually results in hitting the stack limit and segfaulting.
This patch changes the function to use iteration instead of recursion to avoid the segfault.