https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116637
--- Comment #1 from Greg Morse <pgmer6809 at yahoo dot com> --- i worked around this bug, by doing the malloc only once, with the maximum possible size i was likely to need, and then keeping the allocated memory until the end of the run, and re-using the same pointer whenever I called that function for the 2nd/up time(s).