call0 ABI functions that require 129 to 1024 bytes of stack frame and don't save any incoming registers on the stack don't get stack pointer adjustment prologue. This results in stack frame corruption in the calling functions and wrong stack pointer upon return from the function. And inevitable crash as a result.
Reproducer:
#include <stdarg.h>
long x;
void
f3 (int i, ...)
{
va_list aps[10];
va_start (aps[4], i);
x = va_arg (aps[4], long);
va_end (aps[4]);
}
call0 ABI functions that require 129 to 1024 bytes of stack frame and don't save any incoming registers on the stack don't get stack pointer adjustment prologue. This results in stack frame corruption in the calling functions and wrong stack pointer upon return from the function. And inevitable crash as a result.
Reproducer:
Generated code:
All gcc versions with call0 ABI support and the current gcc trunk are affected.