[PATCH] New -fstack-check implementation
Richard Guenther
richard.guenther@gmail.com
Sun Mar 30 01:23:00 GMT 2008
On Sat, Mar 29, 2008 at 11:14 PM, Eric Botcazou <ebotcazou@adacore.com> wrote:
> Hi,
>
> Due to popular demand :-), I'm again submitting the new stack checking
> implementation that we have been using at AdaCore for a few years now.
>
> Previous submissions:
> http://gcc.gnu.org/ml/gcc-patches/2006-03/msg01239.html
> http://gcc.gnu.org/ml/gcc-patches/2006-11/msg01846.html
>
> But, contrary to the above submissions, this one contains the full set of
> changes (modulo some adjustments in the Ada runtime and *-unwind.h files for
> non-Linux platforms).
>
> -fstack-check is broken in the 4.x series of compilers in the sense that you
> cannot recover from a stack overflow condition (for example in Ada). It's a
> regression from the 3.x series although there were bugs in that series too.
>
> Moreover, the original implementation comes with several drawbacks:
> - modified allocation strategy for large objects: they will always be
> allocated dynamically if their size exceeds a fixed threshold.
> - fixed limit on the size of the static frame of functions: when it is
> topped by a particular function, stack checking is not reliable and
> a warning is issued by the compiler.
> - inefficiency: because of both the modified allocation strategy and the
> generic implementation, the performances of the code are unnecessarily
> hampered.
>
> We are proposing a new implementation that eliminates the aforementioned
> drawbacks. It is based on partial support code in the architecture
> back-ends, modelled on what the Alpha back-end already has because of the
> requirement of the Tru64 ABI.
Can you elaborate on the design? Why do you think we cannot remove the old
code and call -fstack-check unsupported on architectures that do not have
the required target support?
Thanks,
Richard.
More information about the Gcc-patches
mailing list