[clang] [clang][bytecode] Use tailcalls via `[[clang::musttail]]` (PR #173756)

Timm Baeder via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 2 10:55:49 PST 2026


Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/173756 at github.com>


tbaederr wrote:

Looking at the build output of the builds in the compile-time-tracker, it doesn't seem like using the musttail attribute does much:
```
/tmp/llvm-project-build-stage1/tools/clang/lib/AST/Opcodes.inc: In function ‘bool clang::interp::Interp_ZeroIntAPS(clang::interp::InterpState&, clang::interp::CodePtr&)’:
/var/llvm-compile-time-tracker/llvm-project/clang/lib/AST/ByteCode/Interp.cpp:38:18: warning: attributes at the beginning of statement are ignored [-Wattributes]
   38 | #define MUSTTAIL [[clang::musttail]]
      |                  ^~~~~~~~~~~~~~~~~~~
/tmp/llvm-project-build-stage1/tools/clang/lib/AST/Opcodes.inc:49992:3: note: in expansion of macro ‘MUSTTAIL’
49992 |   MUSTTAIL return InterpNext(S, PC);
      |   ^~~~~~~~
```

Looks like this is only supported starting in gcc 15.

https://github.com/llvm/llvm-project/pull/173756


More information about the cfe-commits mailing list