[Resend - lists rejected previous mail]
When -ftrivial-auto-var-init= is enabled, allocas unconditionally
receive auto-initialization since .
In certain cases, it turns out, this is causing problems , as it
causes significant overheads with no way to turn off that behaviour.
The more fundamental problem, that GCC devs pointed out to us , is
that an explicit __builtin_alloca() is not an "automatic variable",
which is also why GCC 12's behaviour of the same command-line option
diverges from Clang's behaviour.
As the command-line option's name suggestions, and also our
documentation  does point out that this is for "trivial automatic
From all that, the conclusion appears to be that initializing
__builtin_alloca is out-of-scope of ftrivial-auto-var-init.
Without entirely reverting __builtin_alloca initialization, the cleanest
option appears to be introducing yet another -f<option> to enable
auto-init of allocas.
Another alternative is to entirely leave alloca() initialization to libc
definitions of alloca():
static inline void *alloca(size_t size)
void *ret = alloca(size);
memset(ret, 0, size);