https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110728

--- Comment #12 from John McCall <rjmccall at gmail dot com> ---
While it's theoretically possible to split a computed-goto edge, in practice
you want to avoid doing so if you at all can, because the split-edge pattern
defeats the interpreter optimization that's the primary purpose for computed
goto to exist.  Users should take care to ensure that their jumps are from a
"neutral" scope instead.  That's why Clang chose to diagnose computed gotos
that potentially leave destructor/cleanup scopes instead of just making it
work, and I expect we would continue doing that even if GCC started doing
edge-splitting.

`asm goto` is different, in my opinion, and that edge could productively be
split.  Clang isn't doing that right now only because diagnosing was the
quickest path to correctness (as opposed to skipping the cleanup); I think
we're looking into splitting as the more long-term solution.

Reply via email to