libgomp: Fix locking in OpenMP GOMP_target* functions.
libgomp/
* libgomp.c (struct gomp_device_descr): Add lock member.
* oacc-host.c (goacc_host_init): Initialize it.
* target.c (gomp_target_init): Likewise.
(gomp_init_dev_tables): Remove function.
(GOMP_target, GOMP_target_data, GOMP_target_update): Instead of
calling gomp_init_dev_tables, separate device and memory mapping
initilization, guarded by appropriate locking. Check (immutable)
device capabilities early.
With Intel MIC offloading (emulation), this fixes:
FAIL: libgomp.fortran/target7.f90 -O0 execution test
FAIL: libgomp.fortran/target7.f90 -O1 execution test
FAIL: libgomp.fortran/target7.f90 -O2 execution test
FAIL: libgomp.fortran/target7.f90 -O3 -fomit-frame-pointer execution test
FAIL: libgomp.fortran/target7.f90 -O3 -fomit-frame-pointer -funroll-loops execution test
FAIL: libgomp.fortran/target7.f90 -O3 -fomit-frame-pointer -funroll-all-loops -finline-functions execution test
FAIL: libgomp.fortran/target7.f90 -O3 -g execution test
FAIL: libgomp.fortran/target7.f90 -Os execution test
FAIL: libgomp.fortran/target8.f90 -O0 execution test
FAIL: libgomp.fortran/target8.f90 -O1 execution test
FAIL: libgomp.fortran/target8.f90 -O2 execution test
FAIL: libgomp.fortran/target8.f90 -O3 -fomit-frame-pointer execution test
FAIL: libgomp.fortran/target8.f90 -O3 -fomit-frame-pointer -funroll-loops execution test
FAIL: libgomp.fortran/target8.f90 -O3 -fomit-frame-pointer -funroll-all-loops -finline-functions execution test
FAIL: libgomp.fortran/target8.f90 -O3 -g execution test
FAIL: libgomp.fortran/target8.f90 -Os execution test
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gomp-4_0-branch@219036 138bc75d-0d04-0410-961f-82ee72b054a4