Commit graph

1901 commits

Author SHA1 Message Date
Jakub Jelinek
89d0a14a1f Manually add ChangeLog entries from r13-3652-ge4cba49413ca429dc82f6aa2e88129ecb3fdd943
This commit caused failure of update_version_git due to the removal of
liboffloadmic with ChangeLog in it, so I had to blacklist that commit
and here I'm adding ChangeLog entries manually.
2022-11-06 12:12:47 +01:00
Thomas Schwinge
e4cba49413 Remove support for Intel MIC offloading
... after its deprecation in GCC 12.

	* Makefile.def: Remove module 'liboffloadmic'.
	* Makefile.in: Regenerate.
	* configure.ac: Remove 'liboffloadmic' handling.
	* configure: Regenerate.
	contrib/
	* gcc-changelog/git_commit.py (default_changelog_locations):
	Remove 'liboffloadmic'.
	* gcc_update (files_and_dependencies): Remove 'liboffloadmic'
	files.
	* update-copyright.py (GCCCmdLine): Remove 'liboffloadmic'
	comment.
	gcc/
	* config.gcc [target *-intelmic-* | *-intelmicemul-*]: Remove.
	* config/i386/i386-options.cc (ix86_omp_device_kind_arch_isa)
	[ACCEL_COMPILER]: Remove.
	* config/i386/intelmic-mkoffload.cc: Remove.
	* config/i386/intelmic-offload.h: Likewise.
	* config/i386/t-intelmic: Likewise.
	* config/i386/t-omp-device: Likewise.
	* configure.ac [target *-intelmic-* | *-intelmicemul-*]: Remove.
	* configure: Regenerate.
	* doc/install.texi (--enable-offload-targets=[...]): Update.
	* doc/sourcebuild.texi: Remove 'liboffloadmic' documentation.
	include/
	* gomp-constants.h (GOMP_DEVICE_INTEL_MIC): Comment out.
	(GOMP_VERSION_INTEL_MIC): Remove.
	libgomp/
	* libgomp-plugin.h (OFFLOAD_TARGET_TYPE_INTEL_MIC): Remove.
	* libgomp.texi (OpenMP Context Selectors): Remove Intel MIC
	documentation.
	* plugin/configfrag.ac <enable_offload_targets>
	[*-intelmic-* | *-intelmicemul-*]: Remove.
	* configure: Regenerate.
	* testsuite/lib/libgomp.exp (libgomp_init): Remove 'liboffloadmic'
	handling.
	(offload_target_to_openacc_device_type)
	[$offload_target = *-intelmic*]: Remove.
	(check_effective_target_offload_device_intel_mic)
	(check_effective_target_offload_device_any_intel_mic): Remove.
	* testsuite/libgomp.c-c++-common/on_device_arch.h
	(device_arch_intel_mic, on_device_arch_intel_mic, any_device_arch)
	(any_device_arch_intel_mic): Remove.
	* testsuite/libgomp.c-c++-common/target-45.c: Remove
	'offload_device_any_intel_mic' XFAIL.
	* testsuite/libgomp.fortran/target10.f90: Likewise.
	liboffloadmic/
	* ChangeLog: Remove.
	* Makefile.am: Likewise.
	* Makefile.in: Likewise.
	* aclocal.m4: Likewise.
	* configure: Likewise.
	* configure.ac: Likewise.
	* configure.tgt: Likewise.
	* doc/doxygen/config: Likewise.
	* doc/doxygen/header.tex: Likewise.
	* include/coi/common/COIEngine_common.h: Likewise.
	* include/coi/common/COIEvent_common.h: Likewise.
	* include/coi/common/COIMacros_common.h: Likewise.
	* include/coi/common/COIPerf_common.h: Likewise.
	* include/coi/common/COIResult_common.h: Likewise.
	* include/coi/common/COISysInfo_common.h: Likewise.
	* include/coi/common/COITypes_common.h: Likewise.
	* include/coi/sink/COIBuffer_sink.h: Likewise.
	* include/coi/sink/COIPipeline_sink.h: Likewise.
	* include/coi/sink/COIProcess_sink.h: Likewise.
	* include/coi/source/COIBuffer_source.h: Likewise.
	* include/coi/source/COIEngine_source.h: Likewise.
	* include/coi/source/COIEvent_source.h: Likewise.
	* include/coi/source/COIPipeline_source.h: Likewise.
	* include/coi/source/COIProcess_source.h: Likewise.
	* liboffloadmic_host.spec.in: Likewise.
	* liboffloadmic_target.spec.in: Likewise.
	* plugin/Makefile.am: Likewise.
	* plugin/Makefile.in: Likewise.
	* plugin/aclocal.m4: Likewise.
	* plugin/configure: Likewise.
	* plugin/configure.ac: Likewise.
	* plugin/libgomp-plugin-intelmic.cpp: Likewise.
	* plugin/offload_target_main.cpp: Likewise.
	* runtime/cean_util.cpp: Likewise.
	* runtime/cean_util.h: Likewise.
	* runtime/coi/coi_client.cpp: Likewise.
	* runtime/coi/coi_client.h: Likewise.
	* runtime/coi/coi_server.cpp: Likewise.
	* runtime/coi/coi_server.h: Likewise.
	* runtime/compiler_if_host.cpp: Likewise.
	* runtime/compiler_if_host.h: Likewise.
	* runtime/compiler_if_target.cpp: Likewise.
	* runtime/compiler_if_target.h: Likewise.
	* runtime/dv_util.cpp: Likewise.
	* runtime/dv_util.h: Likewise.
	* runtime/emulator/coi_common.h: Likewise.
	* runtime/emulator/coi_device.cpp: Likewise.
	* runtime/emulator/coi_device.h: Likewise.
	* runtime/emulator/coi_host.cpp: Likewise.
	* runtime/emulator/coi_host.h: Likewise.
	* runtime/emulator/coi_version_asm.h: Likewise.
	* runtime/emulator/coi_version_linker_script.map: Likewise.
	* runtime/liboffload_error.c: Likewise.
	* runtime/liboffload_error_codes.h: Likewise.
	* runtime/liboffload_msg.c: Likewise.
	* runtime/liboffload_msg.h: Likewise.
	* runtime/mic_lib.f90: Likewise.
	* runtime/offload.h: Likewise.
	* runtime/offload_common.cpp: Likewise.
	* runtime/offload_common.h: Likewise.
	* runtime/offload_engine.cpp: Likewise.
	* runtime/offload_engine.h: Likewise.
	* runtime/offload_env.cpp: Likewise.
	* runtime/offload_env.h: Likewise.
	* runtime/offload_host.cpp: Likewise.
	* runtime/offload_host.h: Likewise.
	* runtime/offload_iterator.h: Likewise.
	* runtime/offload_omp_host.cpp: Likewise.
	* runtime/offload_omp_target.cpp: Likewise.
	* runtime/offload_orsl.cpp: Likewise.
	* runtime/offload_orsl.h: Likewise.
	* runtime/offload_table.cpp: Likewise.
	* runtime/offload_table.h: Likewise.
	* runtime/offload_target.cpp: Likewise.
	* runtime/offload_target.h: Likewise.
	* runtime/offload_target_main.cpp: Likewise.
	* runtime/offload_timer.h: Likewise.
	* runtime/offload_timer_host.cpp: Likewise.
	* runtime/offload_timer_target.cpp: Likewise.
	* runtime/offload_trace.cpp: Likewise.
	* runtime/offload_trace.h: Likewise.
	* runtime/offload_util.cpp: Likewise.
	* runtime/offload_util.h: Likewise.
	* runtime/ofldbegin.cpp: Likewise.
	* runtime/ofldend.cpp: Likewise.
	* runtime/orsl-lite/include/orsl-lite.h: Likewise.
	* runtime/orsl-lite/lib/orsl-lite.c: Likewise.
	* runtime/orsl-lite/version.txt: Likewise.
2022-11-04 10:51:01 +01:00
GCC Administrator
d29260ce80 Daily bump. 2022-11-04 00:17:58 +00:00
Tobias Burnus
6629444170 OpenMP/Fortran: 'target update' with DT components
OpenMP 5.0 permits to use arrays with derived type components for the list
items to the 'from'/'to' clauses of the 'target update' directive.

gcc/fortran/ChangeLog:

	* openmp.cc (gfc_match_omp_clauses): Permit derived types for
	the 'to' and 'from' clauses of 'target update'.
	* trans-openmp.cc (gfc_trans_omp_clauses): Fixes for
	derived-type changes; fix size for scalars.

libgomp/ChangeLog:

	* testsuite/libgomp.fortran/target-11.f90: New test.
	* testsuite/libgomp.fortran/target-13.f90: New test.
2022-11-03 15:03:52 +01:00
GCC Administrator
58035eeece Daily bump. 2022-11-03 00:17:32 +00:00
Thomas Schwinge
f6ce1e77bb Support OpenACC 'declare create' with Fortran allocatable arrays, part II [PR106643, PR96668]
PR libgomp/106643
	PR fortran/96668
	libgomp/
	* oacc-mem.c (goacc_enter_data_internal): Support
	OpenACC 'declare create' with Fortran allocatable arrays, part II.
	* testsuite/libgomp.oacc-fortran/declare-allocatable-array_descriptor-1-directive.f90:
	Adjust.
	* testsuite/libgomp.oacc-fortran/pr106643-1.f90: New.
2022-11-02 20:51:41 +01:00
Thomas Schwinge
da8e0e1191 Support OpenACC 'declare create' with Fortran allocatable arrays, part I [PR106643]
PR libgomp/106643
	libgomp/
	* oacc-mem.c (goacc_enter_data_internal): Support
	OpenACC 'declare create' with Fortran allocatable arrays, part I.
	* testsuite/libgomp.oacc-fortran/declare-allocatable-1-directive.f90:
	New.
	* testsuite/libgomp.oacc-fortran/declare-allocatable-array_descriptor-1-directive.f90:
	New.
2022-11-02 20:51:40 +01:00
Thomas Schwinge
abeaf3735f Add 'libgomp.oacc-fortran/declare-allocatable-array_descriptor-1-runtime.f90'
libgomp/
	* testsuite/libgomp.oacc-fortran/declare-allocatable-array_descriptor-1-runtime.f90:
	New.
2022-11-02 20:51:40 +01:00
Thomas Schwinge
59c6c5dbf2 Add 'libgomp.oacc-fortran/declare-allocatable-1-runtime.f90'
... which is 'libgomp.oacc-fortran/declare-allocatable-1.f90' adjusted
for missing support for OpenACC "Changes from Version 2.0 to 2.5":
"The 'declare create' directive with a Fortran 'allocatable' has new behavior".
Thus, after 'allocate'/before 'deallocate', call 'acc_create'/'acc_delete'
manually.

	libgomp/
	* testsuite/libgomp.oacc-fortran/declare-allocatable-1-runtime.f90:
	New.
2022-11-02 20:51:40 +01:00
Cesar Philippidis
8c357d884b Add 'libgomp.oacc-fortran/declare-allocatable-1.f90'
libgomp/
	* testsuite/libgomp.oacc-fortran/declare-allocatable-1.f90: New.

Co-authored-by: Thomas Schwinge <thomas@codesourcery.com>
2022-11-02 20:51:40 +01:00
GCC Administrator
3055829a4a Daily bump. 2022-10-29 00:17:49 +00:00
Julian Brown
11e811d8e2 OpenACC: Don't gang-privatize artificial variables [PR90115]
This patch prevents compiler-generated artificial variables from being
treated as privatization candidates for OpenACC.

The rationale is that e.g. "gang-private" variables actually must be
shared by each worker and vector spawned within a particular gang, but
that sharing is not necessary for any compiler-generated variable (at
least at present, but no such need is anticipated either).  Variables on
the stack (and machine registers) are already private per-"thread"
(gang, worker and/or vector), and that's fine for artificial variables.

We're restricting this to blocks, as we still need to understand what it
means for a 'DECL_ARTIFICIAL' to appear in a 'private' clause.

Several tests need their scan output patterns adjusted to compensate.

2022-10-14  Julian Brown  <julian@codesourcery.com>

	PR middle-end/90115
gcc/
	* omp-low.cc (oacc_privatization_candidate_p): Artificial vars are not
	privatization candidates.

libgomp/
	* testsuite/libgomp.oacc-fortran/declare-1.f90: Adjust scan output.
	* testsuite/libgomp.oacc-fortran/host_data-5.F90: Likewise.
	* testsuite/libgomp.oacc-fortran/if-1.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/print-1.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/privatized-ref-2.f90: Likewise.

Co-authored-by: Thomas Schwinge <thomas@codesourcery.com>
2022-10-28 10:17:34 +02:00
GCC Administrator
4e939ae1cf Daily bump. 2022-10-25 00:17:33 +00:00
Thomas Schwinge
205538832b libgomp/nvptx: Prepare for reverse-offload callback handling, resolve spurious SIGSEGVs
Per commit r13-3460-g131d18e928a3ea1ab2d3bf61aa92d68a8a254609
"libgomp/nvptx: Prepare for reverse-offload callback handling",
I'm seeing a lot of libgomp execution test regressions.  Random
example, 'libgomp.c-c++-common/error-1.c':

    [...]
      GOMP_OFFLOAD_run: kernel main$_omp_fn$0: launch [(teams: 1), 1, 1] [(lanes: 32), (threads: 8), 1]

    Thread 1 "a.out" received signal SIGSEGV, Segmentation fault.
    0x00007ffff793b87d in GOMP_OFFLOAD_run (ord=<optimized out>, tgt_fn=<optimized out>, tgt_vars=<optimized out>, args=<optimized out>) at [...]/source-gcc/libgomp/plugin/plugin-nvptx.c:2127
    2127            if (__atomic_load_n (&ptx_dev->rev_data->fn, __ATOMIC_ACQUIRE) != 0)
    (gdb) print ptx_dev
    $1 = (struct ptx_device *) 0x6a55a0
    (gdb) print ptx_dev->rev_data
    $2 = (struct rev_offload *) 0xffffffff00000000
    (gdb) print ptx_dev->rev_data->fn
    Cannot access memory at address 0xffffffff00000000

	libgomp/
	* plugin/plugin-nvptx.c (nvptx_open_device): Initialize
	'ptx_dev->rev_data'.
2022-10-24 21:47:05 +02:00
Tobias Burnus
131d18e928 libgomp/nvptx: Prepare for reverse-offload callback handling
This patch adds a stub 'gomp_target_rev' in the host's target.c, which will
later handle the reverse offload.
For nvptx, it adds support for forwarding the offload gomp_target_ext call
to the host by setting values in a struct on the device and querying it on
the host - invoking gomp_target_rev on the result.

include/ChangeLog:

	* cuda/cuda.h (enum CUdevice_attribute): Add
	CU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING.
	(CU_MEMHOSTALLOC_DEVICEMAP): Define.
	(cuMemHostAlloc): Add prototype.

libgomp/ChangeLog:

	* config/nvptx/icv-device.c (GOMP_DEVICE_NUM_VAR): Remove
	'static' for this variable.
	* config/nvptx/libgomp-nvptx.h: New file.
	* config/nvptx/target.c: Include it.
	(GOMP_ADDITIONAL_ICVS): Declare extern var.
	(GOMP_REV_OFFLOAD_VAR): Declare var.
	(GOMP_target_ext): Handle reverse offload.
	* libgomp-plugin.h (GOMP_PLUGIN_target_rev): New prototype.
	* libgomp-plugin.c (GOMP_PLUGIN_target_rev): New, call ...
	* target.c (gomp_target_rev): ... this new stub function.
	* libgomp.h (gomp_target_rev): Declare.
	* libgomp.map (GOMP_PLUGIN_1.4): New; add GOMP_PLUGIN_target_rev.
	* plugin/cuda-lib.def (cuMemHostAlloc): Add.
	* plugin/plugin-nvptx.c: Include libgomp-nvptx.h.
	(struct ptx_device): Add rev_data member.
	(nvptx_open_device): Remove async_engines query, last used in
	r10-304-g1f4c5b9b; add unified-address assert check.
	(GOMP_OFFLOAD_get_num_devices): Claim unified address
	support.
	(GOMP_OFFLOAD_load_image): Free rev_fn_table if no
	offload functions exist. Make offload var available
	on host and device.
	(rev_off_dev_to_host_cpy, rev_off_host_to_dev_cpy): New.
	(GOMP_OFFLOAD_run): Handle reverse offload.
2022-10-24 17:04:08 +02:00
GCC Administrator
1043971957 Daily bump. 2022-10-22 00:17:11 +00:00
Thomas Schwinge
a9de836c2b Restore 'libgomp.oacc-c-c++-common/nvptx-sese-1.c' SESE regions checking [PR107195, PR107344]
That is, adjust for optimization introduced with recent
commit r13-3217-gc4d15dddf6b9eacb36f535807ad2ee364af46e04
"[PR107195] Set range to zero when nonzero mask is 0", where GCC now
understands that after 'r *= 2;', 'r & 1' will never hold here, and thus
transforms/optimizes/"disturbs" the original code such that GCC/nvptx's later
"Neuter whole SESE regions" optimization no longer is applicable to it:

    UNSUPPORTED: libgomp.oacc-c/../libgomp.oacc-c-c++-common/nvptx-sese-1.c -DACC_DEVICE_TYPE_nvidia=1 -DACC_MEM_SHARED=0 -foffload=nvptx-none  -O0
    PASS: libgomp.oacc-c/../libgomp.oacc-c-c++-common/nvptx-sese-1.c -DACC_DEVICE_TYPE_nvidia=1 -DACC_MEM_SHARED=0 -foffload=nvptx-none  -O2  (test for excess errors)
    PASS: libgomp.oacc-c/../libgomp.oacc-c-c++-common/nvptx-sese-1.c -DACC_DEVICE_TYPE_nvidia=1 -DACC_MEM_SHARED=0 -foffload=nvptx-none  -O2  execution test
    [-PASS:-]{+FAIL:+} libgomp.oacc-c/../libgomp.oacc-c-c++-common/nvptx-sese-1.c -DACC_DEVICE_TYPE_nvidia=1 -DACC_MEM_SHARED=0 -foffload=nvptx-none  -O2   scan-nvptx-none-offload-rtl-dump mach "SESE regions:.* [0-9]+{[0-9]+->[0-9]+(\\.[0-9]+)+}"

Same for C++.

It's unclear to me if this is an actual "problem", which optimization is "more
important", so I've filed PR107344 "GCC/nvptx SESE region optimization" to
capture this question, and here restore what we intend to be testing (to my
understanding) in 'libgomp.oacc-c-c++-common/nvptx-sese-1.c'.

	PR tree-optimization/107195
	PR target/107344
	libgomp/
	* testsuite/libgomp.oacc-c-c++-common/nvptx-sese-1.c: Restore SESE
	regions checking.
2022-10-21 11:27:27 +02:00
GCC Administrator
47a6ae5658 Daily bump. 2022-10-21 00:17:52 +00:00
Tobias Burnus
12d9f5afbd libgomp: Add offload_device_gcn check, add requires-4a.c test
Duplicate libgomp.c-c++-common/requires-4.c (as ...-4a.c) but
with using a heap-allocated instead of static memory for a variable.

This change and the added offload_device_gcn check prepare for
pseudo-USM, where the device hardware cannot access all host
memory but only managed and pinned memory; for those, requires-4.c
will fail and the new check permits to add
  target { ! { offload_device_nvptx || offload_device_gcn } }
to requires-4.c; however, it has not been added yet as pseuo-USM
support is not yet on mainline. (Review is pending for the USM
patches.)

include/ChangeLog:

	* gomp-constants.h (GOMP_DEVICE_HSA): Comment out unused define.

libgomp/ChangeLog:

	* testsuite/lib/libgomp.exp (check_effective_target_offload_device_gcn):
	New.
	* testsuite/libgomp.c-c++-common/on_device_arch.h (device_arch_gcn,
	on_device_arch_gcn): New.
	* testsuite/libgomp.c-c++-common/requires-4a.c: New test; copied from
	requires-4.c but using heap-allocated memory.
2022-10-20 12:58:52 +02:00
Thomas Schwinge
c7ebee2378 Add 'libgomp.oacc-c-c++-common/private-big-1.c' [PR105421]
After commit r13-3404-g7c55755d4c760de326809636531478fd7419e1e5
"amdgcn: Use FLAT addressing for all functions with pointer arguments [PR105421]",
"big" private data now works for GCN offloading, too.

	PR target/105421
	libgomp/
	* testsuite/libgomp.oacc-c-c++-common/private-big-1.c: New.
2022-10-20 12:07:39 +02:00
GCC Administrator
6237663c17 Daily bump. 2022-10-18 00:17:40 +00:00
Thomas Schwinge
b61796663b Fix nvptx-specific '-foffload-options' syntax in 'libgomp.c/reverse-offload-sm30.c'
That is, '-mptx=_' is only valid in '-foffload-options=nvptx-none', too.

Fix test case added in recent
commit r13-2625-g6b43f556f392a7165582aca36a19fe7389d995b2 "nvptx/mkoffload.cc:
Warn instead of error when reverse offload is not possible".

	libgomp/
	* testsuite/libgomp.c/reverse-offload-sm30.c: Fix nvptx-specific
	'-foffload-options' syntax.
2022-10-17 13:50:57 +02:00
GCC Administrator
621a911d33 Daily bump. 2022-10-14 00:16:35 +00:00
Tobias Burnus
ab8477af99 libgomp: Add Fortran testcases for omp_in_explicit_task
Fortranized testcases of commits r13-3257-ga58a965eb73
and r13-3258-g0ec4e93fb9f.

libgomp/ChangeLog:

	* testsuite/libgomp.fortran/task-7.f90: New test.
	* testsuite/libgomp.fortran/task-8.f90: New test.
	* testsuite/libgomp.fortran/task-in-explicit-1.f90: New test.
	* testsuite/libgomp.fortran/task-in-explicit-2.f90: New test.
	* testsuite/libgomp.fortran/task-in-explicit-3.f90: New test.
	* testsuite/libgomp.fortran/task-reduction-17.f90: New test.
	* testsuite/libgomp.fortran/task-reduction-18.f90: New test.
2022-10-13 20:38:27 +02:00
GCC Administrator
781f477a13 Daily bump. 2022-10-13 00:17:37 +00:00
Jakub Jelinek
caf9db5a7f libgomp: Fix up OpenMP 5.2 feature bullet
The previous bullet correctly mentions 5.2 added for Fortran
allocators directive which is a replacement of allocate directive
associated with ALLOCATE statement to differentiate it at parse time
from allocate directive as declarative one not associated with ALLOCATE
statement, but the deprecation bullet talks about non-existing allocator
directive.

2022-10-12  Jakub Jelinek  <jakub@redhat.com>

	* libgomp.texi (OpenMP 5.2): Fix up allocator -> allocate directive
	in deprecation bullet.
2022-10-12 18:49:22 +02:00
Jakub Jelinek
0ec4e93fb9 libgomp: Add omp_in_explicit_task support
This is pretty straightforward, if gomp_thread ()->task is NULL,
it can't be explicit task, otherwise if
gomp_thread ()->task->kind == GOMP_TASK_IMPLICIT, it is an implicit
task, otherwise explicit task.

2022-10-12  Jakub Jelinek  <jakub@redhat.com>

	* omp.h.in (omp_in_explicit_task): Declare.
	* omp_lib.h.in (omp_in_explicit_task): Likewise.
	* omp_lib.f90.in (omp_in_explicit_task): New interface.
	* libgomp.map (OMP_5.2): New symbol version, export
	omp_in_explicit_task and omp_in_explicit_task_.
	* task.c (omp_in_explicit_task): New function.
	* fortran.c (omp_in_explicit_task): Add ialias_redirect.
	(omp_in_explicit_task_): New function.
	* libgomp.texi (OpenMP 5.2): Mark omp_in_explicit_task as implemented.
	* testsuite/libgomp.c-c++-common/task-in-explicit-1.c: New test.
	* testsuite/libgomp.c-c++-common/task-in-explicit-2.c: New test.
	* testsuite/libgomp.c-c++-common/task-in-explicit-3.c: New test.
2022-10-12 18:39:20 +02:00
Jakub Jelinek
a58a965eb7 libgomp: Fix up creation of artificial teams
When not in explicit parallel/target/teams construct, we in some cases create
an artificial parallel with a single thread (either to handle target nowait
or for task reduction purposes).  In those cases, it handled again artificially
created implicit task (created by gomp_new_icv for cases where we needed to write
to some ICVs), but as the testcases show, didn't take into account possibility
of this being done from explicit task(s).  The code would destroy/free the previous
task and replace it with the new implicit task.  If task is an explicit task
(when teams is NULL, all explicit tasks behave like if (0)), it is a pointer to
a local stack variable, so freeing it doesn't work, and additionally we shouldn't
lose the explicit tasks - the new implicit task should instead replace the
ancestor task which is the first implicit one.

2022-10-12  Jakub Jelinek  <jakub@redhat.com>

	* task.c (gomp_create_artificial_team): Fix up handling of invocations
	from within explicit task.
	* target.c (GOMP_target_ext): Likewise.
	* testsuite/libgomp.c/task-7.c: New test.
	* testsuite/libgomp.c/task-8.c: New test.
	* testsuite/libgomp.c-c++-common/task-reduction-17.c: New test.
	* testsuite/libgomp.c-c++-common/task-reduction-18.c: New test.
2022-10-12 17:54:08 +02:00
Martin Liska
6d2294a83e regenerate configure files
Needed after a recent change.

gcc/ChangeLog:

	* configure: Regenerate.

libatomic/ChangeLog:

	* configure: Regenerate.

libbacktrace/ChangeLog:

	* configure: Regenerate.

libcc1/ChangeLog:

	* configure: Regenerate.

libffi/ChangeLog:

	* configure: Regenerate.

libgfortran/ChangeLog:

	* configure: Regenerate.

libgomp/ChangeLog:

	* configure: Regenerate.

libitm/ChangeLog:

	* configure: Regenerate.

libobjc/ChangeLog:

	* configure: Regenerate.

liboffloadmic/ChangeLog:

	* configure: Regenerate.
	* plugin/configure: Regenerate.

libphobos/ChangeLog:

	* configure: Regenerate.

libquadmath/ChangeLog:

	* configure: Regenerate.

libsanitizer/ChangeLog:

	* configure: Regenerate.

libssp/ChangeLog:

	* configure: Regenerate.

libstdc++-v3/ChangeLog:

	* configure: Regenerate.

libvtv/ChangeLog:

	* configure: Regenerate.

lto-plugin/ChangeLog:

	* configure: Regenerate.

zlib/ChangeLog:

	* configure: Regenerate.
2022-10-12 09:31:32 +02:00
GCC Administrator
ab332cd78d Daily bump. 2022-10-12 00:17:24 +00:00
Olivier Hainque
0ecd0f1cc6 Generic configury support for shared libs on VxWorks
This change adds the configury bits to activate the build of
shared libs on VxWorks ports configured with --enable-shared,
for libraries variants where this is generally supported (rtp,
code model !large - currently not compatible with -fPIC).

Set lt_cv_deplibs_check_method in libtool.m4, so the build of
libraries know how to establish dependencies.  This is useful in
configurations such as aarch64 where proper support of LSE relies
on accurate dependency information between libstdc++ and libgcc_s
to begin with.

Regenerate configure scripts to reflect libtool.m4 change.

2022-10-09  Olivier Hainque  <hainque@adacore.com>

	* libtool.m4 (*vxworks*): When enable_shared, set dynamic_linker
	and friends for rtp !large. Assume the linker has the required
	abilities and set lt_cv_deplibs_check_method.

gcc/
	* config.gcc (*vxworks*): Add t-slibgcc fragment
	if enable_shared.

libgcc/
	* config.host (*vxworks*): When enable_shared, add
	libgcc and crtstuff "shared" fragments for rtp except
	large code model.
	(aarch64*-wrs-vxworks7*): Remove t-slibgcc-libgcc from
	the list of fragments.

2022-10-09  Olivier Hainque  <hainque@adacore.com>

gcc/
	* configure: Regenerate.

libatomic/
	* configure: Regenerate.

libbacktrace/
	* configure: Regenerate.

libcc1/
	* configure: Regenerate.

libffi/
	* configure: Regenerate.

libgfortran/
	* configure: Regenerate.

libgomp/
	* configure: Regenerate.

libitm/
	* configure: Regenerate.

libobjc/
	* configure: Regenerate.

liboffloadmic/
	* configure: Regenerate.

liboffloadmic/
	* plugin/configure: Regenerate.

libphobos/
	* configure: Regenerate.

libquadmath/
	* configure: Regenerate.

libsanitizer/
	* configure: Regenerate.

libssp/
	* configure: Regenerate.

libstdc++-v3/
	* configure: Regenerate.

libvtv/
	* configure: Regenerate.

lto-plugin/
	* configure: Regenerate.

zlib/
	* configure: Regenerate.
2022-10-11 07:31:07 +00:00
GCC Administrator
966010b2eb Daily bump. 2022-10-06 00:17:24 +00:00
Tobias Burnus
e2a2284389 Fortran: Add OpenMP's assume(s) directives
libgomp/ChangeLog:

	* libgomp.texi (OpenMP 5.1 Impl. Status): Mark 'assume' as 'Y'.

gcc/fortran/ChangeLog:

	* dump-parse-tree.cc (show_omp_assumes): New.
	(show_omp_clauses, show_namespace): Call it.
	(show_omp_node, show_code_node): Handle OpenMP ASSUME.
	* gfortran.h (enum gfc_statement): Add ST_OMP_ASSUME,
	ST_OMP_END_ASSUME, ST_OMP_ASSUMES and ST_NOTHING.
	(gfc_exec_op): Add EXEC_OMP_ASSUME.
	(gfc_omp_assumptions): New struct.
	(gfc_get_omp_assumptions): New XCNEW #define.
	(gfc_omp_clauses, gfc_namespace): Add assume member.
	(gfc_resolve_omp_assumptions): New prototype.
	* match.h (gfc_match_omp_assume, gfc_match_omp_assumes): New.
	* openmp.cc (omp_code_to_statement): Forward declare.
	(enum gfc_omp_directive_kind, struct gfc_omp_directive): New.
	(gfc_free_omp_clauses): Free assume member and its struct data.
	(enum omp_mask2): Add OMP_CLAUSE_ASSUMPTIONS.
	(gfc_omp_absent_contains_clause): New.
	(gfc_match_omp_clauses): Call it; optionally use passed
	omp_clauses argument.
	(omp_verify_merge_absent_contains, gfc_match_omp_assume,
	 gfc_match_omp_assumes, gfc_resolve_omp_assumptions): New.
	(resolve_omp_clauses): Call the latter.
	(gfc_resolve_omp_directive, omp_code_to_statement): Handle
	EXEC_OMP_ASSUME.
	* parse.cc (decode_omp_directive): Parse OpenMP ASSUME(S).
	(next_statement, parse_executable, parse_omp_structured_block):
	Handle ST_OMP_ASSUME.
	(case_omp_decl): Add ST_OMP_ASSUMES.
	(gfc_ascii_statement): Handle Assumes, optional return
	string without '!$OMP '/'!$ACC ' prefix.
	* parse.h (gfc_ascii_statement): Add optional bool arg to prototype.
	* resolve.cc (gfc_resolve_blocks, gfc_resolve_code): Add
	EXEC_OMP_ASSUME.
	(gfc_resolve): Resolve ASSUMES directive.
	* symbol.cc (gfc_free_namespace): Free omp_assumes member.
	* st.cc (gfc_free_statement): Handle EXEC_OMP_ASSUME.
	* trans-openmp.cc (gfc_trans_omp_directive): Likewise.
	* trans.cc (trans_code): Likewise.

gcc/testsuite/ChangeLog:

	* gfortran.dg/gomp/assume-1.f90: New test.
	* gfortran.dg/gomp/assume-2.f90: New test.
	* gfortran.dg/gomp/assumes-1.f90: New test.
	* gfortran.dg/gomp/assumes-2.f90: New test.
2022-10-05 19:25:27 +02:00
GCC Administrator
85872a69ee Daily bump. 2022-10-05 00:17:25 +00:00
Jakub Jelinek
b6d5d72bd0 openmp: Add begin declare target support
The following patch adds support for the begin declare target construct,
which is another spelling for declare target construct without clauses
(where it needs paired end declare target), but unlike that one accepts
clauses.

This is an OpenMP 5.1 feature, implemented with 5.2 clarification because
in 5.1 we had a restriction in the declare target chapter shared by
declare target and begin declare target that if there are any clauses
specified at least one of them needs to be to or link.  But that
was of course meant just for declare target and not begin declare target,
because begin declare target doesn't even allow to/link/enter clauses.
In addition to that, the patch also makes device_type clause duplication
an error (as stated in 5.1) and similarly makes declare target with
just device_type clause an error rather than warning.

What this patch doesn't do is:
1) OpenMP 5.1 also added an indirect clause, we don't support that
   neither on declare target nor begin declare target
   and I couldn't find it in our features pages (neither libgomp.texi
   nor web)
2) I think device_type(nohost)/device_type(host) support can't work for
   variables (in 5.0 it only talked about procedures so this could be
   also thought as 5.1 feature that we should just add to the list
   and implement)
3) I don't see any use of the "omp declare target nohost" attribute, so
   I'm not sure if device_type(nohost) works at all

2022-10-04  Jakub Jelinek  <jakub@redhat.com>

gcc/c-family/
	* c-omp.cc (c_omp_directives): Uncomment begin declare target
	entry.
gcc/c/
	* c-lang.h (struct c_omp_declare_target_attr): New type.
	(current_omp_declare_target_attribute): Change type from
	int to vec<c_omp_declare_target_attr, va_gc> *.
	* c-parser.cc (c_parser_translation_unit): Adjust for that change.
	If last pushed directive was begin declare target, use different
	wording and simplify format strings for easier translations.
	(c_parser_omp_clause_device_type): Uncomment
	check_no_duplicate_clause call.
	(c_parser_omp_declare_target): Adjust for the
	current_omp_declare_target_attribute type change, push { -1 }.
	Use error_at rather than warning_at for declare target with
	only device_type clauses.
	(OMP_BEGIN_DECLARE_TARGET_CLAUSE_MASK): Define.
	(c_parser_omp_begin): Add begin declare target support.
	(c_parser_omp_end): Adjust for the
	current_omp_declare_target_attribute type change, adjust
	diagnostics wording and simplify format strings for easier
	translations.
	* c-decl.cc (current_omp_declare_target_attribute): Change type from
	int to vec<c_omp_declare_target_attr, va_gc> *.
	(c_decl_attributes): Adjust for the
	current_omp_declare_target_attribute type change.  If device_type
	was present on begin declare target, add "omp declare target host"
	and/or "omp declare target nohost" attributes.
gcc/cp/
	* cp-tree.h (struct omp_declare_target_attr): Rename to ...
	(cp_omp_declare_target_attr): ... this.  Add device_type member.
	(omp_begin_assumes_data): Rename to ...
	(cp_omp_begin_assumes_data): ... this.
	(struct saved_scope): Change types of omp_declare_target_attribute
	and omp_begin_assumes.
	* parser.cc (cp_parser_omp_clause_device_type): Uncomment
	check_no_duplicate_clause call.
	(cp_parser_omp_all_clauses): Fix up pasto, c_name for OMP_CLAUSE_LINK
	should be "link" rather than "to".
	(cp_parser_omp_declare_target): Adjust for omp_declare_target_attr
	to cp_omp_declare_target_attr changes, push -1 as device_type.  Use
	error_at rather than warning_at for declare target with only
	device_type clauses.
	(OMP_BEGIN_DECLARE_TARGET_CLAUSE_MASK): Define.
	(cp_parser_omp_begin): Add begin declare target support.  Adjust
	for omp_begin_assumes_data to cp_omp_begin_assumes_data change.
	(cp_parser_omp_end): Adjust for the
	omp_declare_target_attr to cp_omp_declare_target_attr and
	omp_begin_assumes_data to cp_omp_begin_assumes_data type changes,
	adjust diagnostics wording and simplify format strings for easier
	translations.
	* semantics.cc (finish_translation_unit): Likewise.
	* decl2.cc (cplus_decl_attributes): If device_type was present on
	begin declare target, add "omp declare target host" and/or
	"omp declare target nohost" attributes.
gcc/testsuite/
	* c-c++-common/gomp/declare-target-4.c: Move tests that are now
	rejected into declare-target-7.c.
	* c-c++-common/gomp/declare-target-6.c: Adjust expected diagnostics.
	* c-c++-common/gomp/declare-target-7.c: New test.
	* c-c++-common/gomp/begin-declare-target-1.c: New test.
	* c-c++-common/gomp/begin-declare-target-2.c: New test.
	* c-c++-common/gomp/begin-declare-target-3.c: New test.
	* c-c++-common/gomp/begin-declare-target-4.c: New test.
	* g++.dg/gomp/attrs-9.C: Add begin declare target tests.
	* g++.dg/gomp/attrs-18.C: New test.
libgomp/
	* libgomp.texi (Support begin/end declare target syntax in C/C++):
	Mark as implemented.
2022-10-04 10:37:14 +02:00
GCC Administrator
3a221b73d0 Daily bump. 2022-10-01 00:18:00 +00:00
Tobias Burnus
10a1161049 Fortran: Update use_device_ptr for OpenMP 5.1 [PR105318]
OpenMP 5.1 added has_device_addr and relaxed the restrictions for
use_device_ptr, including processing non-type(c_ptr) arguments as
if has_device_addr was used. (There is a semantic difference.)

For completeness, the likewise change was done for 'use_device_ptr',
where non-type(c_ptr) arguments now use use_device_addr.

Finally, a warning for 'device(omp_{initial,invalid}_device)' was
silenced on the way as affecting the new testcase.

	PR fortran/105318

gcc/fortran/ChangeLog:
	* openmp.cc (resolve_omp_clauses): Update is_device_ptr restrictions
	for OpenMP 5.1 and map to has_device_addr where applicable; map
	use_device_ptr to use_device_addr where applicable.
	Silence integer-range warning for device(omp_{initial,invalid}_device).

libgomp/ChangeLog:
	* testsuite/libgomp.fortran/is_device_ptr-2.f90: New test.

gcc/testsuite/ChangeLog:
	* gfortran.dg/gomp/is_device_ptr-1.f90: Remove dg-error.
	* gfortran.dg/gomp/is_device_ptr-2.f90: Likewise.
	* gfortran.dg/gomp/is_device_ptr-3.f90: Update tree-scan-dump.
2022-09-30 13:37:18 +02:00
GCC Administrator
9e79a25b66 Daily bump. 2022-09-29 00:16:38 +00:00
Tobias Burnus
175a89d123 libgomp.texi: Status 'P' for 'assume', remove duplicated line
libgomp/
	* libgomp.texi (OpenMP 5.1): Mark 'assume' as implemented
	for C/C++. Remove duplicated 'begin declare target' entry.
2022-09-28 10:24:58 +02:00
GCC Administrator
28a61ecdc1 Daily bump. 2022-09-25 00:18:01 +00:00
Jakub Jelinek
3c5bccb608 openmp, c: Tighten up c_tree_equal [PR106981]
This patch changes c_tree_equal to work more like cp_tree_equal, be
more strict in what it accepts.  The ICE on the first testcase was
due to INTEGER_CST wi::wide (t1) == wi::wide (t2) comparison which
ICEs if the two constants have different precision, but as the second
testcase shows, being too lenient in it can also lead to miscompilation
of valid OpenMP programs where we think certain expression is the same
even when it isn't and can be guaranteed at runtime to represent different
memory location.  So, the patch looks through only NON_LVALUE_EXPRs
and for constants as well as casts requires that the types match before
actually comparing the constant values or recursing on the cast operands.

2022-09-24  Jakub Jelinek  <jakub@redhat.com>

	PR c/106981
gcc/c/
	* c-typeck.cc (c_tree_equal): Only strip NON_LVALUE_EXPRs at the
	start.  For CONSTANT_CLASS_P or CASE_CONVERT: return false if t1 and
	t2 have different types.
gcc/testsuite/
	* c-c++-common/gomp/pr106981.c: New test.
libgomp/
	* testsuite/libgomp.c-c++-common/pr106981.c: New test.
2022-09-24 09:19:26 +02:00
GCC Administrator
ff822367bb Daily bump. 2022-09-15 00:17:35 +00:00
Julian Brown
23baa717c9 OpenMP/OpenACC struct sibling list gimplification extension and rework
This patch refactors struct sibling-list processing in gimplify.cc, and
adjusts some related mapping-clause processing in the Fortran FE and
omp-low.cc accordingly.

2022-09-13  Julian Brown  <julian@codesourcery.com>

gcc/fortran/
	* trans-openmp.cc (gfc_trans_omp_clauses): Don't create
	GOMP_MAP_TO_PSET mappings for class metadata, nor GOMP_MAP_POINTER
	mappings for POINTER_TYPE_P decls.

gcc/
	* gimplify.cc (gimplify_omp_var_data): Remove GOVD_MAP_HAS_ATTACHMENTS.
	(GOMP_FIRSTPRIVATE_IMPLICIT): Renumber.
	(insert_struct_comp_map): Refactor function into...
	(build_omp_struct_comp_nodes): This new function.  Remove list handling
	and improve self-documentation.
	(extract_base_bit_offset): Remove BASE_REF, OFFSETP parameters.  Move
	code to strip outer parts of address out of function, but strip no-op
	conversions.
	(omp_mapping_group): Add DELETED field for use during reindexing.
	(omp_strip_components_and_deref, omp_strip_indirections): New functions.
	(omp_group_last, omp_group_base): Add GOMP_MAP_STRUCT handling.
	(omp_gather_mapping_groups): Initialise DELETED field for new groups.
	(omp_index_mapping_groups): Notice DELETED groups when (re)indexing.
	(omp_siblist_insert_node_after, omp_siblist_move_node_after,
	omp_siblist_move_nodes_after, omp_siblist_move_concat_nodes_after): New
	helper functions.
	(omp_accumulate_sibling_list): New function to build up GOMP_MAP_STRUCT
	node groups for sibling lists. Outlined from gimplify_scan_omp_clauses.
	(omp_build_struct_sibling_lists): New function.
	(gimplify_scan_omp_clauses): Remove struct_map_to_clause,
	struct_seen_clause, struct_deref_set.  Call
	omp_build_struct_sibling_lists as pre-pass instead of handling sibling
	lists in the function's main processing loop.
	(gimplify_adjust_omp_clauses_1): Remove GOVD_MAP_HAS_ATTACHMENTS
	handling, unused now.
	* omp-low.cc (scan_sharing_clauses): Handle pointer-type indirect
	struct references, and references to pointers to structs also.

gcc/testsuite/
	* g++.dg/goacc/member-array-acc.C: New test.
	* g++.dg/gomp/member-array-omp.C: New test.
	* g++.dg/gomp/target-3.C: Update expected output.
	* g++.dg/gomp/target-lambda-1.C: Likewise.
	* g++.dg/gomp/target-this-2.C: Likewise.
	* c-c++-common/goacc/deep-copy-arrayofstruct.c: Move test from here.
	* c-c++-common/gomp/target-50.c: New test.

libgomp/
	* testsuite/libgomp.oacc-c-c++-common/deep-copy-15.c: New test.
	* testsuite/libgomp.oacc-c-c++-common/deep-copy-16.c: New test.
	* testsuite/libgomp.oacc-c++/deep-copy-17.C: New test.
	* testsuite/libgomp.oacc-c-c++-common/deep-copy-arrayofstruct.c: Move
	test to here, make "run" test.
2022-09-14 13:59:55 +00:00
GCC Administrator
1995a0227d Daily bump. 2022-09-14 00:18:07 +00:00
Jakub Jelinek
e11babbfac libgomp: Appease some static analyzers [PR106906]
While icv_addr[1] = false; assignments where icv_addr has void *
element type is correct and matches how it is used (in those cases
the void * pointer is then cast to bool and used that way), there is no
reason not to add explicit (void *) casts there which are there already
for (void *) true.  And, there is in fact even no point in actually
doing those stores at all because we set that pointer to NULL a few
lines earlier.  So, this patch adds the explicit casts and then
comments those out to show intent.

2022-09-13  Jakub Jelinek  <jakub@redhat.com>

	PR libgomp/106906
	* env.c (get_icv_member_addr): Cast false to void * before assigning
	it to icv_addr[1], and comment the whole assignment out.
2022-09-13 19:00:02 +02:00
Tobias Burnus
eec36f27c3 libgomp.texi: move item from gcn to nvptx
I misplaced one remark into 'gcn' instead of 'nvptx' in
commit r13-2625-g6b43f556f392a7165582aca36a19fe7389d995b2

libgomp/ChangeLog:

	* libgomp.texi (gcn): Move misplaced -march=sm_30 remark to ...
	(nvptx): ... here.
2022-09-13 09:08:57 +02:00
GCC Administrator
b5f09bd766 Daily bump. 2022-09-13 00:18:20 +00:00
Tobias Burnus
6b43f556f3 nvptx/mkoffload.cc: Warn instead of error when reverse offload is not possible
Reverse offload requests at least -misa=sm_35; with this patch, a warning
instead of an error is shown, still permitting reverse offload for all
other configured device types. This is achieved by not calling
GOMP_offload_register_ver (and stopping generating pointless 'static const char'
variables, once known.)

The tool_name as progname changes adds "nvptx " and "gcn " to the
"mkoffload: warning/error:" diagnostic.

gcc/ChangeLog:

	* config/nvptx/mkoffload.cc (process): Replace a fatal_error by
	a warning + not enabling offloading if -misa=sm_30 prevents
	reverse offload.
	(main): Use tool_name as progname for diagnostic.
	* config/gcn/mkoffload.cc (main): Likewise.

libgomp/ChangeLog:

	* libgomp.texi (Offload-Target Specifics: nvptx): Document
	that reverse offload requires >= -march=sm_35.
	* testsuite/libgomp.c-c++-common/requires-4.c: Build for nvptx
	with -misa=sm_35.
	* testsuite/libgomp.c-c++-common/requires-5.c: Likewise.
	* testsuite/libgomp.c-c++-common/requires-6.c: Likewise.
	* testsuite/libgomp.c-c++-common/reverse-offload-1.c: Likewise.
	* testsuite/libgomp.fortran/reverse-offload-1.f90: Likewise.
	* testsuite/libgomp.c/reverse-offload-sm30.c: New test.
2022-09-12 15:25:13 +02:00
Tobias Burnus
9983ab16d5 libgomp.texi: Impl. status fix/addition
libgomp/ChangeLog:

	* libgomp.texi (OpenMP 5.1 Impl. Status): Add two new minor items.
	(OpenMP 5.2 Impl. Status): Improve omp/omx/ompx wording.
2022-09-12 12:30:04 +02:00
Jakub Jelinek
994ea892bd libgomp: Fix up icv-6.c [PR106894]
The thing is,
make check
or
make check RUNTESTFLAGS="c.exp='icv-6.c' c++.exp='icv-6.c'"
in libgomp obj dir work fine, but
make -j32 -k check RUNTESTFLAGS="c.exp='icv-6.c' c++.exp='icv-6.c'"
fails.
The thing is that the testcase as written relies on OMP_NUM_THREADS not being
set in environment (as it takes priority over OMP_NUM_THREADS_ALL for the
host).
So, if either a user has OMP_NUM_THREADS=42 in the environment by himself, or
when doing make check with -jN, we trigger:
          if test $$num_cpus -gt 8 && test -z "$$OMP_NUM_THREADS"; then \
            OMP_NUM_THREADS=8; export OMP_NUM_THREADS; \
            echo @@@ libgomp OMP_NUM_THREADS adjusted to 8 because of parallel
make check and too many CPUs; \
          fi; \
in libgomp/testsuite/Makefile.am and so the test fails.

2022-09-12  Jakub Jelinek  <jakub@redhat.com>

	PR libgomp/106894
	* testsuite/libgomp.c-c++-common/icv-6.c: Include string.h.
	(main): Avoid tests for which corresponding non-_ALL suffixed variable
	is in the environment, or for OMP_NUM_TEAMS on the device
	OMP_NUM_TEAMS_DEV_?.
2022-09-12 10:48:19 +02:00