The -fsplit-stack runtime support code has a bug reported in PR 46093: if the size of the stack parameters is exceptionally large, the parameters can overrun the entire newly allocated stack segment. This patch fixes the problem. Bootstrapped and tested on x86_64-unknown-linux-gnu. Committed to mainline.
Ian 2011-10-07 Ian Lance Taylor <i...@google.com> PR target/46093 * generic-morestack.c (__generic_morestack): Make sure the segment is large enough for both the stack frame and the copied parameters.
Index: generic-morestack.c =================================================================== --- generic-morestack.c (revision 179665) +++ generic-morestack.c (working copy) @@ -512,7 +512,7 @@ __generic_morestack (size_t *pframe_size current = *pp; if (current == NULL) - current = allocate_segment (frame_size); + current = allocate_segment (frame_size + param_size); current->old_stack = old_stack;