https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50818
--- Comment #4 from Uroš Bizjak <ubizjak at gmail dot com> --- Executable testcase: --cut here-- int __attribute__((ms_abi)) foo (int n, ...) { __builtin_va_list ap; int sum = 0; __builtin_va_start (ap, n); while (n--) sum += __builtin_va_arg (ap, int); __builtin_va_end (ap); return sum; } int main () { int res = foo (10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10); if (res != 55) __builtin_abort (); return 0; } --cut here-- $ gcc -O2 pr50818.c $ ./a.out Segmentation fault (core dumped) $ gcc -O2 -mabi=ms pr50818.c $ ./a.out $