4 ms·
Yes, they are equivalent (AFAICT). You can generate irreducible control flow that will still require breaks to exit loops. However, it is possible to eliminate
by DannyBee 14y ago
Yes, they are equivalent (AFAICT).
You can generate irreducible control flow that will still require breaks to exit loops.
However, it is possible to eliminate (even in the irreducible case) all gotos, switches, breaks, and continues from a structured program.
goto's can always be transformed into conditional statements or loops.
break/continue can be eliminated by an extension of the control flow elimination, and use of variables + conditional flow.
A real world implementation can be found here:
http://gcc.gnu.org/ml/gcc-patches/2002-05/msg00109.html http://gcc.gnu.org/ml/gcc-patches/2002-05/msg00109.html
(it was never merged, we decided we were fine with goto/switch/break/continue)