https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96228
Eric Botcazou <ebotcazou at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ebotcazou at gcc dot gnu.org --- Comment #3 from Eric Botcazou <ebotcazou at gcc dot gnu.org> --- The reason is rather that no flow analysis is performed by -Wstack-usage, which means that it cannot distinguish: int main(void) { char *a = __builtin_alloca(4); a[0] = 0; __builtin_printf("%c", a[0]); return 0; } from int main(void) { while (1) { char *a = __builtin_alloca(4); a[0] = 0; __builtin_printf("%c", a[0]); } return 0; } so it assumes the worst.