On Sat, Oct 31, 2009 at 8:27 PM, Andrew Hutchinson
<andrewhutchinson@cox.net> wrote:
Thanks - patch was not as tested. Correction below.
This patch corrects a testcase where malloc size 1,000,000 is way too big
for target.
Size requested is reduce if stack size is below 16000.
The patch removes failures for AVR target.
Ok to commit?
I think for this kind of tests you should simply skip AVR. Note that it
mallocs sizeof (struct small), which is small. So I don't see why
you get a failure here anyway.
Richard.
2009-10-31 Andy Hutchinson <hutchinsonandy@gcc.gnu.org>
*gcc.c-torture/execute/ipa-sra-2.c: Reduce allocation if stack is small.
Index: ipa-sra-2.c
===================================================================
--- ipa-sra-2.c (revision 153773)
+++ ipa-sra-2.c (working copy)
@@ -1,6 +1,11 @@
+#if defined(STACK_SIZE) && STACK_SIZE < 16000
+#define ARRAY_SIZE (STACK_SIZE)
+#else
+#define ARRAY_SIZE 1000000
+#endif
struct big
{
- int data[1000000];
+ int data[ARRAY_SIZE];
};
struct small
@@ -23,7 +28,7 @@
{
int r;
if (fail)
- r = agg->big.data[999999];
+ r = agg->big.data[ARRAY_SIZE - 1];
else
r = agg->small.data[0];
return r;