[Openmp-commits] [PATCH] D13827: Avoid bad conversion for __kmp_sys_max_nth

Dimitry Andric via Openmp-commits openmp-commits at lists.llvm.org
Mon Oct 19 10:34:12 PDT 2015


This revision was automatically updated to reflect the committed changes.
Closed by commit rL250708: On FreeBSD, PTHREADS_THREADS_MAX does not fit into an int, leading to (authored by dim).

Changed prior to commit:
  http://reviews.llvm.org/D13827?vs=37766&id=37774#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D13827

Files:
  openmp/trunk/runtime/src/kmp.h

Index: openmp/trunk/runtime/src/kmp.h
===================================================================
--- openmp/trunk/runtime/src/kmp.h
+++ openmp/trunk/runtime/src/kmp.h
@@ -845,10 +845,10 @@
 #define KMP_MIN_NTH           1
 
 #ifndef KMP_MAX_NTH
-#  ifdef PTHREAD_THREADS_MAX
+#  if defined(PTHREAD_THREADS_MAX) && PTHREAD_THREADS_MAX < INT_MAX
 #    define KMP_MAX_NTH          PTHREAD_THREADS_MAX
 #  else
-#    define KMP_MAX_NTH          (32 * 1024)
+#    define KMP_MAX_NTH          INT_MAX
 #  endif
 #endif /* KMP_MAX_NTH */
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D13827.37774.patch
Type: text/x-patch
Size: 542 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20151019/c65971c5/attachment.bin>


More information about the Openmp-commits mailing list