aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Froyd <froydnj@codesourcery.com>2007-07-06 20:43:05 +0000
committerNathan Froyd <froydnj@gcc.gnu.org>2007-07-06 20:43:05 +0000
commit2fdf2ff4259795ce3b44121e099baca82662efd2 (patch)
tree10c8f20abb9a04fdb1046909a2c2d9f65be3c0f4
parent508dabda235646a3093d923d0afbc3867adb083a (diff)
downloadgcc-2fdf2ff4259795ce3b44121e099baca82662efd2.zip
gcc-2fdf2ff4259795ce3b44121e099baca82662efd2.tar.gz
gcc-2fdf2ff4259795ce3b44121e099baca82662efd2.tar.bz2
multi-ix.c (CHUNK): Be more conservative about the chunk size when STACK_SIZE is defined.
* gcc.c-torture/execute/multi-ix.c (CHUNK): Be more conservative about the chunk size when STACK_SIZE is defined. From-SVN: r126425
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/multi-ix.c12
2 files changed, 16 insertions, 1 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 2e0437d..0789496 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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
diff --git a/gcc/testsuite/gcc.c-torture/execute/multi-ix.c b/gcc/testsuite/gcc.c-torture/execute/multi-ix.c
index d61a313..fdfa567 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 <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