https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125887
Drea Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |INVALID
Status|UNCONFIRMED |RESOLVED
--- Comment #3 from Drea Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Roman Rotko from comment #2)
> Just checked with simple { } scope and behavior is exactly the same.
>
> But new mystery appears: why doesn't it deallocate stack space with
> optimizations enabled or known size?
With optimizations enabled, GCC figures out that it can promote the array to be
known statically.
Also known static size is how C works.