[Bug middle-end/123082] missed optimization: large local array in recursive function needlessly kept alive across recursive calls
jakub at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Dec 10 18:54:16 GMT 2025
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123082
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
In any case, wonder if really the compiler should fix up for badly written sort
algorithms like this, normal way would be to allocate the extra memory (through
VLA or heap allocation if larger than some constant) in the outermost call and
use that buffer then in the recursive calls.
More information about the Gcc-bugs
mailing list