This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

g++.old-deja/ patch

This patch fixes g++.old-deja/ to pass on Solaris

The test fails before and passes after this patch on Solaris 10
(building with --disable-multilib to avoid the ICE building 64-bit
libstdc++-v3).  OK to commit?

2004-11-25  Mark Mitchell  <>

	* g++.old-deja/ Robustify.

diff -rupN -x CVS gcc-merge-HEAD-csl-sol210-1/gcc/testsuite/g++.old-deja/ gcc-sol210/gcc/testsuite/g++.old-deja/
--- gcc-merge-HEAD-csl-sol210-1/gcc/testsuite/g++.old-deja/	2003-12-16 03:48:50.000000000 -0800
+++ gcc-sol210/gcc/testsuite/g++.old-deja/	2004-09-27 08:45:07.000000000 -0700
@@ -14,10 +14,9 @@ extern "C" void *memcpy(void *, const vo
 #ifdef STACK_SIZE
 const int arena_size = 256;
-#ifdef __FreeBSD__
-// FreeBSD with threads requires even more space at initialization time.
-#include "bits/c++config.h"
-#include "bits/gthr.h"
+#if defined(__FreeBSD__) || defined(__sun__)
+// FreeBSD with threads and Solaris with threads require even more
+// space at initialization time.
 const int arena_size = 131072;
 const int arena_size = 32768;
@@ -105,16 +104,15 @@ void fn_catchthrow() throw(int)
 int main()
-#ifdef __FreeBSD__
-// FreeBSD with threads fails the test unless each thread primes itself.
-  if (__gthread_active_p())
-    {
-      try{fn_throw();}
-      catch(int a){}
-    }
-// This was added to test with well-known idiom to detect regressions here
-// rather than always failing with -pthread.
+  /* On some systems (including FreeBSD and Solaris 2.10),
+     __cxa_get_globals will try to call "malloc" when threads are in
+     use.  Therefore, we throw one exception up front so that
+     __cxa_get_globals is all set up.  Ideally, this would not be
+     necessary, but it is a well-known idiom, and using this technique
+     means that we can still validate the fact that exceptions can be
+     thrown when malloc fails.  */
+  try{fn_throw();}
+  catch(int a){}
   fail = 1;

Joseph S. Myers      (personal mail) (CodeSourcery mail) (Bugzilla assignments and CCs)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]