multi-ix.c (CHUNK): Be more conservative about the chunk size when STACK_SIZE is...
authorNathan Froyd <froydnj@codesourcery.com>
Fri, 6 Jul 2007 20:43:05 +0000 (20:43 +0000)
committerNathan Froyd <froydnj@gcc.gnu.org>
Fri, 6 Jul 2007 20:43:05 +0000 (20:43 +0000)
* gcc.c-torture/execute/multi-ix.c (CHUNK): Be more conservative
about the chunk size when STACK_SIZE is defined.

From-SVN: r126425

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/multi-ix.c

index 2e0437d994b0963163bebcd77ef683fa2d6201f9..0789496dc4a634b2787f747ec7a30237389336b0 100644 (file)
@@ -1,3 +1,8 @@
+2007-07-06  Nathan Froyd  <froydnj@codesourcery.com>
+
+       * gcc.c-torture/execute/multi-ix.c (CHUNK): Be more conservative
+       about the chunk size when STACK_SIZE is defined.
+
 2007-07-06  Josh Conner  <jconner@apple.com>
 
        PR middle-end/32602
index d61a3136706840d88f46f0efc017a1b56a847df5..fdfa567795a2a17e593c4c4093c69d1781b58bd8 100644 (file)
 #include <stdarg.h>
 
 #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