[clang] [CIR] Defer indirect goto resolution to GotoSolver (PR #206176)
Andy Kaylor via cfe-commits
cfe-commits at lists.llvm.org
Thu Jul 2 10:23:48 PDT 2026
================
@@ -0,0 +1,13 @@
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir -verify %s
+
+// A `goto *p` that leaves a scope needing cleanup (here a VLA stack restore)
+// must run that cleanup on the branch. That is not implemented yet, so it is
+// reported rather than lowered to a branch that skips the cleanup.
+int vla(int n) {
+ int a[n];
+ void *p = &&done;
+ // expected-error at +1 {{indirect goto across a cleanup scope}}
----------------
andykaylor wrote:
This message isn't quite right. This doesn't actually exit the cleanup scope in this case. I see that it could, for example if the VLA were inside an 'if' statement. Curiously, class codegen doesn't restore the stack in this case: https://godbolt.org/z/r4eT6Ezo1
https://github.com/llvm/llvm-project/pull/206176
More information about the cfe-commits
mailing list