https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68606

--- Comment #13 from R. Diez <rdiezmail-gcc at yahoo dot de> ---
It is hard to automatically tell whether nobody else is using such a
statically-allocated emergency buffer. In my case, I am using C++ exceptions,
so the linker will probably always include the buffer.

My patch makes sure that no emergency buffer is allocated. As long as your
firmware does not run out of malloc RAM, C++ exceptions continue to work fine.

About implementing a proper solution (my patch is just a workaround): There are
probably guys who want to control the size of the emergency buffer, but for
really constrained environments, I would like an option to disable it
completely.

As a bonus, the code that allocates and uses the emergency buffer could be
optimised away too, but that is not critical for me. RAM / SRAM is often tight,
but Flash/program memory (where the code resides) tends to be much bigger. So
optimising the buffer away from RAM would be enough in most scenarios.

Reply via email to