* libgomp.h (gomp_cpu_affinity, gomp_cpu_affinity_len): New extern
decls.
(gomp_init_affinity, gomp_init_thread_affinity): New prototypes.
* env.c (gomp_cpu_affinity, gomp_cpu_affinity_len): New variables.
(parse_affinity): New function.
(initialize_env): Call it and gomp_init_affinity.
* team.c (gomp_team_start): If gomp_cpu_affinity != NULL,
create new pthread_attr_t and call gomp_init_thread_affinity
on it for each thread before passing the attribute to pthread_create.
* config/linux/affinity.c: New file.
* config/posix/affinity.c: New file.
* configure.ac (HAVE_PTHREAD_AFFINITY_NP): New test.
* configure: Rebuilt.
* config.h.in: Rebuilt.
* Makefile.am (libgomp_la_SOURCES): Add affinity.c.
* Makefile.in: Rebuilt.
From-SVN: r123494
2007-03-23 Andreas Tobler <a.tobler@schweiz.org>
* testsuite/lib/libgomp.exp (libgomp_init): Add -shared-libgcc for
*-*-darwin*.
* testsuite/libgomp.c++/c++.exp: Look for shared libstdc++ library
and use it if found.
From-SVN: r123162
* testsuite/config/default.exp: New file.
* testsuite/lib/libgomp.exp: New file.
* testsuite/lib/libgomp.dg (load_gcc_lib, libgomp_init,
libgomp_target_compile, libgomp_option_help, libgomp_option_proc,
load_lib *, load_gcc_lib *): Move to libgomp.exp.
(libgomp_load): Remove.
* testsuite/lib/libgomp.exp (libgomp_init): Compute
always_ld_library_path, not ld_library_path. Set additional_flags
to -march=i486 for ilp32 x86_64-*-* and i386-*-* targets.
(target_compile): Do not call libgomp_init. Append lang_library_path
and lang_link_flags to options.
* testsuite/libgomp.c/c.exp: Set DEFAULT_FLAGS to -O2. Set
ld_library_path from always_ld_library_path. Set LD_LIBRARY_PATH
here.
* testsuite/libgomp.c++/c++.exp: Set ld_library_path from
always_ld_library_path. Set LD_LIBRARY_PATH here.
* testsuite/libgomp.fortran/fortran.exp: Ditto.
* testsuite/libgomp.c/atomic-1.c: Set dg-options to
"-O2 -march=pentium" for ilp32 x86 targets. Simplify check for
CX8 flag.
* testsuite/libgomp.c/atomic-2.c: Set dg-options to "-O2 -mcx16" for
lp64 x86 targets. Do not check for SSE3 bit. Do not define bit_SSE3.
* testsuite/libgomp.c/pr29947-1.c: Remove default dg-options.
* testsuite/libgomp.c/pr29947-1.c: Ditto.
* testsuite/libgomp.c/atomic-10.c: Ditto.
From-SVN: r123125
PR c++/30703
* gimplify.c (gimplify_scan_omp_clauses): Remove special casing
of INDIRECT_REF <RESULT_DECL>.
* cp-gimplify.c (cp_genericize_r): Don't dereference invisiref
parameters and result decls in omp clauses.
(cxx_omp_privatize_by_reference): Pass also invisiref PARM_DECLs
by reference.
* testsuite/libgomp.c++/pr30703.C: New test.
From-SVN: r121688
Revert:
2006-07-05 Eric Christopher <echristo@apple.com>
* configure.ac: Depend addition of -pthread on host OS.
* configure: Regenerate.
From-SVN: r121497
PR libgomp/29947
* omp-low.c (expand_omp_for_static_nochunk,
expand_omp_for_static_chunk): Do all arithmetics in signed rather than
unsigned type.
* loop.c (gomp_loop_init): Make parameters signed. Set ws->end to
start if there shouldn't be any loop iterations.
(gomp_loop_ordered_static_start): Remove start == end test.
* testsuite/libgomp.c/pr29947-1.c: New test.
* testsuite/libgomp.c/pr29947-2.c: New test.
From-SVN: r119485
PR fortran/29629
* trans-openmp.c (gfc_trans_omp_array_reduction): Set attr.flavor
of init_val_sym and outer_sym to FL_VARIABLE.
* testsuite/libgomp.fortran/pr29629.f90: New test.
From-SVN: r118134
PR libgomp/29494
* configure.tgt: Use posix95 configuration for Solaris 2.5.1 and 2.6.
* config/posix95: New directory.
* config/posix95/omp-lock.h: New file.
* config/posix95/lock.c: Likewise.
From-SVN: r118004
2006-09-08 Steven G. Kargl <kargl@gcc.gnu.org>
* testsuite/libgomp.fortran/reduction3.f90: Change
-2147483648 to -huge(i)-1 to avoid overflow.
* testsuite/libgomp.fortran/reduction4.f90: Change
Z'ffffffff' to not(0) to avoid overflow.
From-SVN: r116786
PR fortran/28390
* trans-openmp.c (gfc_trans_omp_do): Look for LASTPRIVATE in
code->exp.omp_clauses rather than in the 3rd function argument.
* testsuite/libgomp.fortran/pr28390.f: New test.
From-SVN: r115504
* critical.c (GOMP_critical_name_start): Fix *pptr initialization
when gomp_mutex_t is larger than pointer and HAVE_SYNC_BUILTINS is
defined.
From-SVN: r114843
PR libgomp/26175
PR libgomp/26477
* configure.ac: If neither --enable-linux-futex nor
--disable-linux-futex is passed, determine the default by checking
for compiling and/or running against NPTL. With --enable-linux-futex,
check if SYS_gettid and SYS_futex are defined.
* configure: Rebuilt.
From-SVN: r114809
PR libgomp/28008
* env.c (initialize_env): Avoid using PTHREAD_STACK_MIN when
undefined. Use GOMP_STACKSIZE not OMP_STACKSIZE for environment.
From-SVN: r114643
PR middle-end/27416
* omp-low.c (build_outer_var_ref): If VAR is reference in orphaned
construct, return *VAR.
* libgomp.fortran/pr27416-1.f90: New test.
From-SVN: r113788
PR fortran/27395
* gimplify.c (gimplify_scan_omp_clauses): Compare OMP_CLAUSE_CODE
rather than TREE_CODE to OMP_CLAUSE_REDUCTION. Set also GOVD_SEEN
bit for OMP_CLAUSE_REDUCTION_PLACEHOLDER.
* testsuite/libgomp.fortran/pr27395-1.f90: New test.
* testsuite/libgomp.fortran/pr27395-2.f90: New test.
From-SVN: r113494
PR c++/26943
* omp-low.c (maybe_lookup_decl_in_outer_ctx): New function.
(build_outer_var_ref): Use maybe_lookup_decl_in_outer_ctx
to find if var will be a global variable even in the nested context.
(omp_copy_decl): Only check for global variable at the end, it might
be overridden in outer contexts.
(scan_sharing_clauses): For global variables don't create a field.
(lower_rec_input_clauses): Do nothing for global shared variables.
Emit a barrier at the end of ILIST if there were any decls in both
firstprivate and lastprivate clauses.
(lower_send_clauses): Do nothing for global variables except for
COPYIN.
* testsuite/libgomp.c/pr26943-1.c: New test.
* testsuite/libgomp.c/pr26943-2.c: New test.
* testsuite/libgomp.c/pr26943-3.c: New test.
* testsuite/libgomp.c/pr26943-4.c: New test.
* testsuite/libgomp.c++/pr27337.C: Remove barrier.
* testsuite/libgomp.c++/pr26943.C: New test.
From-SVN: r113483
PR middle-end/27337
* gimplify.c (gimplify_scan_omp_clauses): Handle INDIRECT_REF
around RESULT_DECL for result passed by reference.
(gimplify_expr): Call omp_notice_variable when RESULT_DECL is seen.
* omp-low.c (use_pointer_for_field): Don't look at
DECL_HAS_VALUE_EXPR_P for RESULT_DECLs.
(scan_omp_1): Call remap_decl on RESULT_DECLs.
(lower_rec_input_clauses): Don't allocate VLA memory for the second
time or var for passing by reference for
OMP_CLAUSE_LASTPRIVATE_FIRSTPRIVATE clauses. Allow creation of
TREE_ADDRESSABLE variables when passing by reference.
* omp-low.c (dump_omp_region): Fix output formatting.
cp/
* cp-gimplify.c (cxx_omp_privatize_by_reference): New function.
* cp-tree.h (cxx_omp_privatize_by_reference): New prototype.
* cp-objcp-common.h (LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE): Define.
testsuite/
* g++.dg/gomp/pr27337-1.C: New test.
* g++.dg/gomp/pr27337-2.C: New test.
libgomp/
* testsuite/libgomp.c++/pr27337.C: New test.
From-SVN: r113456