X-Git-Url: http://git.sourceforge.jp/view?p=pf3gnuchains%2Fgcc-fork.git;a=blobdiff_plain;f=gcc%2Ftestsuite%2Fgcc.c-torture%2Fexecute%2Fmulti-ix.c;h=fdfa567795a2a17e593c4c4093c69d1781b58bd8;hp=d61a3136706840d88f46f0efc017a1b56a847df5;hb=56bcf859add3c5a99a2d5b2d8178af7343255c18;hpb=f03c17bc9da480b383fb3ac81f00663c7b58566d diff --git a/gcc/testsuite/gcc.c-torture/execute/multi-ix.c b/gcc/testsuite/gcc.c-torture/execute/multi-ix.c index d61a3136706..fdfa567795a 100644 --- a/gcc/testsuite/gcc.c-torture/execute/multi-ix.c +++ b/gcc/testsuite/gcc.c-torture/execute/multi-ix.c @@ -12,7 +12,17 @@ #include #ifdef STACK_SIZE -#define CHUNK ((STACK_SIZE-100)/40/sizeof(int)) +/* We need to be careful that we don't blow our stack. Function f, in the + worst case, needs to fit on the stack: + + * 40 int[CHUNK] arrays; + * ~40 ints; + * ~40 pointers for stdarg passing. + + Subtract the last two off STACK_SIZE and figure out what the maximum + chunk size can be. We make the last bit conservative to account for + register saves and other processor-dependent saving. */ +#define CHUNK ((STACK_SIZE-40*sizeof(int)-256*sizeof(void *))/40/sizeof(int)) #else #define CHUNK 500 #endif