Commit 75f8beae by Uros Bizjak

multi-ix.c: Limit CHUNK size between 1 and 500.

        * gcc.c-torture/execute/multi-ix.c: Limit CHUNK size between 1 and 500.
        (main): Exit early for CHUNK less than 40 to avoid stack corruption.

From-SVN: r133648
parent ffd837fe
2008-03-26 Uros Bizjak <ubizjak@gmail.com>
* gcc.c-torture/execute/multi-ix.c: Limit CHUNK size between 1 and 500.
(main): Exit early for CHUNK less than 40 to avoid stack corruption.
2008-03-27 Richard Guenther <rguenther@suse.de> 2008-03-27 Richard Guenther <rguenther@suse.de>
PR c/32511 PR c/32511
...@@ -10,7 +15,7 @@ ...@@ -10,7 +15,7 @@
2008-03-27 Douglas Gregor <doug.gregor@gmail.com> 2008-03-27 Douglas Gregor <doug.gregor@gmail.com>
* g++.dg/cpp0x/variadic91.C: New. * g++.dg/cpp0x/variadic91.C: New.
2008-03-27 Zdenek Dvorak <ook@ucw.cz> 2008-03-27 Zdenek Dvorak <ook@ucw.cz>
...@@ -37,7 +42,7 @@ ...@@ -37,7 +42,7 @@
2008-03-26 Richard Guenther <rguenther@suse.de> 2008-03-26 Richard Guenther <rguenther@suse.de>
Revert Revert:
2008-03-26 Richard Guenther <rguenther@suse.de> 2008-03-26 Richard Guenther <rguenther@suse.de>
* gcc.dg/fold-addr-1.c: New testcase. * gcc.dg/fold-addr-1.c: New testcase.
...@@ -21,8 +21,15 @@ ...@@ -21,8 +21,15 @@
Subtract the last two off STACK_SIZE and figure out what the maximum 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 chunk size can be. We make the last bit conservative to account for
register saves and other processor-dependent saving. */ register saves and other processor-dependent saving. Limit the
#define CHUNK ((STACK_SIZE-40*sizeof(int)-256*sizeof(void *))/40/sizeof(int)) chunk size to some sane values. */
#define MIN(X,Y) ((X) < (Y) ? (X) : (Y))
#define MAX(X,Y) ((X) > (Y) ? (X) : (Y))
#define CHUNK \
MIN (500, (MAX (1, (signed)(STACK_SIZE-40*sizeof(int)-256*sizeof(void *)) \
/ (signed)(40*sizeof(int)))))
#else #else
#define CHUNK 500 #define CHUNK 500
#endif #endif
...@@ -146,6 +153,11 @@ f (int n) ...@@ -146,6 +153,11 @@ f (int n)
int int
main () main ()
{ {
/* CHUNK needs to be at least 40 to avoid stack corruption,
since index variable i0 in "a[i0] = i0" equals 39. */
if (CHUNK < 40)
exit (0);
f (1); f (1);
exit (0); exit (0);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment