aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans-Peter Nilsson <hp@axis.com>2014-09-02 17:00:28 +0000
committerHans-Peter Nilsson <hp@gcc.gnu.org>2014-09-02 17:00:28 +0000
commitbb42f96863d48ea9a091e993c10c10f902035c9d (patch)
tree85b11e447b4c6da561ff8ae834ba28c40c82633f
parent86eb9e2fbeb5541af8ac0ce37fa60cded76877b4 (diff)
downloadgcc-bb42f96863d48ea9a091e993c10c10f902035c9d.zip
gcc-bb42f96863d48ea9a091e993c10c10f902035c9d.tar.gz
gcc-bb42f96863d48ea9a091e993c10c10f902035c9d.tar.bz2
badalloc1.C (arena_size): Scale according to target pointer size.
* g++.old-deja/g++.eh/badalloc1.C [!STACK_SIZE && !__FreeBSD__] [!__sun__ && !__hpux__] (arena_size): Scale according to target pointer size. From-SVN: r214828
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/g++.old-deja/g++.eh/badalloc1.C7
2 files changed, 11 insertions, 2 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index fa8fb47..0be30a7 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2014-09-02 Hans-Peter Nilsson <hp@axis.com>
+
+ * g++.old-deja/g++.eh/badalloc1.C [!STACK_SIZE && !__FreeBSD__]
+ [!__sun__ && !__hpux__] (arena_size): Scale according to
+ target pointer size.
+
2014-09-02 Marek Polacek <polacek@redhat.com>
PR fortran/62270
diff --git a/gcc/testsuite/g++.old-deja/g++.eh/badalloc1.C b/gcc/testsuite/g++.old-deja/g++.eh/badalloc1.C
index c034101..5cde10e 100644
--- a/gcc/testsuite/g++.old-deja/g++.eh/badalloc1.C
+++ b/gcc/testsuite/g++.old-deja/g++.eh/badalloc1.C
@@ -3,7 +3,7 @@
// itself call malloc(), and will fail if there is no more
// memory available.
// { dg-do run { xfail { { xstormy16-*-* *-*-darwin[3-7]* } || vxworks_rtp } } }
-// Copyright (C) 2000, 2002, 2003, 2010, 2012 Free Software Foundation, Inc.
+// Copyright (C) 2000, 2002, 2003, 2010, 2012, 2014 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 6 June 2000 <nathan@codesourcery.com>
// Check we can throw a bad_alloc exception when malloc dies.
@@ -23,7 +23,10 @@ const int arena_size = 256;
// FreeBSD 5 now requires over 131072 bytes.
const int arena_size = 262144;
#else
-const int arena_size = 32768;
+// Because pointers make up the bulk of our exception-initialization
+// allocations, we scale by the pointer size from the original
+// 32-bit-systems-based estimate.
+const int arena_size = 32768 * ((sizeof (void *) + 3)/4);
#endif
#endif