3 ms·
Compilers really like canonical forms. There's a good chance that if, for, while, goto, break and so forth all turn into an edge between basic blocks (anything
by JonChesterfield 2y ago
Compilers really like canonical forms. There's a good chance that if, for, while, goto, break and so forth all turn into an edge between basic blocks (anything that doesn't have a branch or branch target in it). In a rather literal sense it's usually all sugar over goto, unless you're doing something niche like carefully preserving structure because your target language doesn't have branches.
So seeing someone say that their compiler struggles to represent goto throws some doubt on how the thing is implemented. Goto should generally be the easiest possible control flow to translate into your IR.