https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79876

--- Comment #13 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Seems libgomp has a bug that without {,G}OMP_STACKSIZE and with OMP_DISPLAY_ENV
it displays random (uninitialized) value for the stack size, so I need to test
something like:
2017-03-30  Jakub Jelinek  <ja...@redhat.com>

        * env.c (initialize_env): Initialize stacksize to 0.

--- libgomp/env.c.jj    2017-01-01 12:45:52.000000000 +0100
+++ libgomp/env.c       2017-03-30 16:07:29.800247913 +0200
@@ -1187,7 +1187,7 @@ handle_omp_display_env (unsigned long st
 static void __attribute__((constructor))
 initialize_env (void)
 {
-  unsigned long thread_limit_var, stacksize;
+  unsigned long thread_limit_var, stacksize = 0;
   int wait_policy;

   /* Do a compile time check that mkomp_h.pl did good job.  */

If we figure out what Darwin versions have so insanely low defaults and agree
on some more reasonable one (1M or 2M?), then we could change this to something
like:
  stacksize = GOMP_DEFAULT_STACKSIZE;
and later on where it parse_stacksize add || stacksize to the condition last,
then define GOMP_DEFAULT_STACKSIZE 0 by default and let some config/darwin/
header override it.

Reply via email to