Skip to content
Snippets Groups Projects
  1. May 05, 2023
    • Julian Brown's avatar
      OpenACC: Further attach/detach clause fixes for Fortran [PR109622] · a4cc474b
      Julian Brown authored
      This patch moves several tests introduced by the following patch:
      
        https://gcc.gnu.org/pipermail/gcc-patches/2023-April/616939.html
        commit r14-325-gcacf65d74463600815773255e8b82b4043432bd7
      
      into the proper location for OpenACC testing (thanks to Thomas for
      spotting my mistake!), and also fixes a few additional problems --
      missing diagnostics for non-pointer attaches, and a case where a pointer
      was incorrectly dereferenced. Tests are also adjusted for vector-length
      warnings on nvidia accelerators.
      
      2023-04-29  Julian Brown  <julian@codesourcery.com>
      
      	PR fortran/109622
      
      gcc/fortran/
      	* openmp.cc (resolve_omp_clauses): Add diagnostic for
      	non-pointer/non-allocatable attach/detach.
      	* trans-openmp.cc (gfc_trans_omp_clauses): Remove dereference for
      	pointer-to-scalar derived type component attach/detach.  Fix
      	attach/detach handling for descriptors.
      
      gcc/testsuite/
      	* gfortran.dg/goacc/pr109622-5.f90: New test.
      	* gfortran.dg/goacc/pr109622-6.f90: New test.
      
      libgomp/
      	* testsuite/libgomp.fortran/pr109622.f90: Move test...
      	* testsuite/libgomp.oacc-fortran/pr109622.f90: ...to here. Ignore
      	vector length warning.
      	* testsuite/libgomp.fortran/pr109622-2.f90: Move test...
      	* testsuite/libgomp.oacc-fortran/pr109622-2.f90: ...to here.  Add
      	missing copyin/copyout variable. Ignore vector length warnings.
      	* testsuite/libgomp.fortran/pr109622-3.f90: Move test...
      	* testsuite/libgomp.oacc-fortran/pr109622-3.f90: ...to here.  Ignore
      	vector length warnings.
      	* testsuite/libgomp.oacc-fortran/pr109622-4.f90: New test.
      
      (cherry picked from commit 0a26a42b)
      a4cc474b
    • Julian Brown's avatar
      OpenACC: Stand-alone attach/detach clause fixes for Fortran [PR109622] · fa7c4ab3
      Julian Brown authored
      This patch fixes several cases where multiple attach or detach mapping
      nodes were being created for stand-alone attach or detach clauses
      in Fortran.  After the introduction of stricter checking later during
      compilation, these extra nodes could cause ICEs, as seen in the PR.
      
      The patch also fixes cases that "happened to work" previously where
      the user attaches/detaches a pointer to array using a descriptor, and
      (I think!) the "_data" field has offset zero, hence the same address as
      the descriptor as a whole.
      
      2023-04-27  Julian Brown  <julian@codesourcery.com>
      
      	PR fortran/109622
      
      gcc/fortran/
      	* trans-openmp.cc (gfc_trans_omp_clauses): Attach/detach clause fixes.
      
      gcc/testsuite/
      	* gfortran.dg/goacc/attach-descriptor.f90: Adjust expected output.
      
      libgomp/
      	* testsuite/libgomp.fortran/pr109622.f90: New test.
      	* testsuite/libgomp.fortran/pr109622-2.f90: New test.
      	* testsuite/libgomp.fortran/pr109622-3.f90: New test.
      
      (cherry picked from commit cacf65d7)
      fa7c4ab3
  2. Apr 26, 2023
  3. Mar 29, 2023
  4. Mar 28, 2023
    • Rainer Orth's avatar
      testsuite: Fix weak_undefined handling on Darwin · 8443f42f
      Rainer Orth authored
      The patch that introduced the weak_undefined effective-target keyword
      and corresponding dg-add-options support
      
      commit 378ec7b8
      Author: Alexandre Oliva <oliva@adacore.com>
      Date:   Thu Mar 23 00:45:05 2023 -0300
      
          [testsuite] test for weak_undefined support and add options
      
      badly broke the affected tests on macOS like so:
      
      ERROR: gcc.dg/addr_equal-1.c: unknown dg option: 89 for " dg-add-options 5 weak_undefined "
      ERROR: gcc.dg/addr_equal-1.c: unknown dg option: 89 for " dg-add-options 5 weak_undefined "
      
      add_options_for_weak_undefined tries to call an non-existant proc "89".
      Even after fixing this by escaping the brackets, two tests still failed to
      link since they lacked the corresponding calls do dg-add-options
      weak_undefined.
      
      Tested on x86_64-apple-darwin20.6.0 and i386-pc-solaris2.11.
      
      2023-03-27  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
      
      	gcc/testsuite:
      	* lib/target-supports.exp (add_options_for_weak_undefined): Escape
      	brackets.
      	* gcc.dg/visibility-22.c: Add weak_undefined options.
      
      	libgomp:
      	* testsuite/libgomp.oacc-c-c++-common/routine-nohost-2.c: Add
      	weak_undefined options.
      8443f42f
  5. Mar 25, 2023
  6. Mar 24, 2023
  7. Mar 11, 2023
  8. Mar 10, 2023
    • Thomas Schwinge's avatar
      Use 'GOMP_MAP_VARS_TARGET' for OpenACC compute constructs [PR90596] · f8332e52
      Thomas Schwinge authored
      Thereby considerably simplify the device plugins' 'GOMP_OFFLOAD_openacc_exec',
      'GOMP_OFFLOAD_openacc_async_exec' functions: in terms of lines of code, but in
      particular conceptually: no more device memory allocation, host to device data
      copying, device memory deallocation -- 'GOMP_MAP_VARS_TARGET' does all that for
      us.
      
      This depends on commit 2b2340e2
      "Allow libgomp 'cbuf' buffering with OpenACC 'async' for 'ephemeral' data",
      where I said that "a use will emerge later", which is this one here.
      
      	PR libgomp/90596
      	libgomp/
      	* target.c (gomp_map_vars_internal): Allow for
      	'param_kind == GOMP_MAP_VARS_OPENACC | GOMP_MAP_VARS_TARGET'.
      	* oacc-parallel.c (GOACC_parallel_keyed): Pass
      	'GOMP_MAP_VARS_TARGET' to 'goacc_map_vars'.
      	* plugin/plugin-gcn.c (alloc_by_agent, gcn_exec)
      	(GOMP_OFFLOAD_openacc_exec, GOMP_OFFLOAD_openacc_async_exec):
      	Adjust, simplify.
      	(gomp_offload_free): Remove.
      	* plugin/plugin-nvptx.c (nvptx_exec, GOMP_OFFLOAD_openacc_exec)
      	(GOMP_OFFLOAD_openacc_async_exec): Adjust, simplify.
      	(cuda_free_argmem): Remove.
      	* testsuite/libgomp.oacc-c-c++-common/acc_prof-parallel-1.c:
      	Adjust.
      f8332e52
    • Thomas Schwinge's avatar
      Allow libgomp 'cbuf' buffering with OpenACC 'async' for 'ephemeral' data · 2b2340e2
      Thomas Schwinge authored
      This does *allow*, but under no circumstances is this currently going to be
      used: all potentially applicable data is non-'ephemeral', and thus not
      considered for 'gomp_coalesce_buf_add' for OpenACC 'async'.  (But a use will
      emerge later.)
      
      Follow-up to commit r12-2530-gd88a6951586c7229b25708f4486eaaf4bf4b5bbe
      "Don't use libgomp 'cbuf' buffering with OpenACC 'async'", addressing this
      TODO comment:
      
          TODO ... but we could allow CBUF usage for EPHEMERAL data?  (Open question:
          is it more performant to use libgomp CBUF buffering or individual device
          asyncronous copying?)
      
      Ephemeral data is small, and therefore individual device asyncronous copying
      does seem dubious -- in particular given that for all those, we'd individually
      have to allocate and queue for deallocation a temporary buffer to capture the
      ephemeral data.  Instead, just let the 'cbuf' *be* the temporary buffer.
      
      	libgomp/
      	* target.c (gomp_copy_host2dev, gomp_map_vars_internal): Allow
      	libgomp 'cbuf' buffering with OpenACC 'async' for 'ephemeral'
      	data.
      2b2340e2
    • Thomas Schwinge's avatar
      Simplify OpenACC 'no_create' clause implementation · 199867d0
      Thomas Schwinge authored
      For 'OFFSET_INLINED', 'gomp_map_val' does the right thing, and we may then
      simplify the device plugins accordingly.
      
      This is a follow-up to
      Subversion r279551 (Git commit a6163563)
      "Add OpenACC 2.6's no_create",
      Subversion r279622 (Git commit 5bcd470b)
      "Use gomp_map_val for OpenACC host-to-device address translation".
      
      	libgomp/
      	* target.c (gomp_map_vars_internal): Use 'OFFSET_INLINED' for
      	'GOMP_MAP_IF_PRESENT'.
      	* plugin/plugin-gcn.c (gcn_exec, GOMP_OFFLOAD_openacc_exec)
      	(GOMP_OFFLOAD_openacc_async_exec): Adjust.
      	* plugin/plugin-nvptx.c (nvptx_exec, GOMP_OFFLOAD_openacc_exec)
      	(GOMP_OFFLOAD_openacc_async_exec): Likewise.
      	* testsuite/libgomp.oacc-c-c++-common/no_create-1.c: Add 'async'
      	testing.
      	* testsuite/libgomp.oacc-c-c++-common/no_create-2.c: Likewise.
      199867d0
    • Thomas Schwinge's avatar
      OpenACC: Remove 'acc_async_test' -> skip shortcut in 'libgomp/oacc-async.c:goacc_wait' · b5037d4a
      Thomas Schwinge authored
      We're not taking such a shortcut anywhere else, and (with future changes) it
      has potential to confuse things if synchronization in a libgomp plugin happens
      to have side effects even if an async queue currently is empty.
      
      	libgomp/
      	* oacc-async.c (goacc_wait): Remove 'acc_async_test' -> skip
      	shortcut.
      b5037d4a
    • Thomas Schwinge's avatar
      Document/verify another aspect of OpenACC 'async' semantics in 'libgomp.oacc-c-c++-common/data-3.c' · 442d51a2
      Thomas Schwinge authored
      ... that I almost broke with later implementation changes.
      
      	libgomp/
      	* testsuite/libgomp.oacc-c-c++-common/data-3.c: Document/verify
      	another aspect of OpenACC 'async' semantics.
      442d51a2
    • Thomas Schwinge's avatar
      Fix OpenACC/GCN 'acc_ev_enqueue_launch_end' position · 649f1939
      Thomas Schwinge authored
      For an OpenACC compute construct, we've currently got:
      
        - [...]
        - acc_ev_enqueue_launch_start
        - launch kernel
        - free memory
        - acc_ev_free
        - acc_ev_enqueue_launch_end
      
      This confused another thing that I'm working on, so I adjusted that to:
      
        - [...]
        - acc_ev_enqueue_launch_start
        - launch kernel
        - acc_ev_enqueue_launch_end
        - free memory
        - acc_ev_free
      
      Correspondingly, verify 'acc_ev_alloc', 'acc_ev_free' in
      'libgomp.oacc-c-c++-common/acc_prof-parallel-1.c'.
      
      	libgomp/
      	* plugin/plugin-gcn.c (gcn_exec): Fix 'acc_ev_enqueue_launch_end'
      	position.
      	* testsuite/libgomp.oacc-c-c++-common/acc_prof-parallel-1.c:
      	Verify 'acc_ev_alloc', 'acc_ev_free'.
      649f1939
    • GCC Administrator's avatar
      Daily bump. · da2b9c6e
      GCC Administrator authored
      da2b9c6e
  9. Mar 09, 2023
    • Hongyu Wang's avatar
      libgomp: Fix default value of GOMP_SPINCOUNT [PR 109062] · 288bc7b5
      Hongyu Wang authored
      When OMP_WAIT_POLICY is not specified, current implementation will cause
      icv flag GOMP_ICV_WAIT_POLICY unset, so global variable wait_policy
      will remain its uninitialized value. Initialize it to -1 to make
      GOMP_SPINCOUNT behavior consistent with its description.
      
      libgomp/ChangeLog:
      
      	PR libgomp/109062
      	* env.c (wait_policy): Initialize to -1.
      	(initialize_icvs): Initialize icvs->wait_policy to -1.
      	* testsuite/libgomp.c-c++-common/pr109062.c: New test.
      288bc7b5
    • GCC Administrator's avatar
      Daily bump. · 6a87fdd3
      GCC Administrator authored
      6a87fdd3
  10. Mar 08, 2023
  11. Mar 03, 2023
  12. Mar 02, 2023
    • Kwok Cheung Yeung's avatar
      amdgcn: Enable SIMD vectorization of math functions · ce9cd725
      Kwok Cheung Yeung authored
      Calls to vectorized versions of routines in the math library will now
      be inserted when vectorizing code containing supported math functions.
      
      2023-03-02  Kwok Cheung Yeung  <kcy@codesourcery.com>
      	    Paul-Antoine Arras  <pa@codesourcery.com>
      
      	gcc/
      	* builtins.cc (mathfn_built_in_explicit): New.
      	* config/gcn/gcn.cc: Include case-cfn-macros.h.
      	(mathfn_built_in_explicit): Add prototype.
      	(gcn_vectorize_builtin_vectorized_function): New.
      	(gcn_libc_has_function): New.
      	(TARGET_LIBC_HAS_FUNCTION): Define.
      	(TARGET_VECTORIZE_BUILTIN_VECTORIZED_FUNCTION): Define.
      
      	gcc/testsuite/
      	* gcc.target/gcn/simd-math-1.c: New testcase.
      	* gcc.target/gcn/simd-math-2.c: New testcase.
      
      	libgomp/
      	* testsuite/libgomp.c/simd-math-1.c: New testcase.
      ce9cd725
    • GCC Administrator's avatar
      Daily bump. · c88a7c63
      GCC Administrator authored
      c88a7c63
  13. Mar 01, 2023
    • Tobias Burnus's avatar
      OpenMP/Fortran: Fix handling of optional is_device_ptr + bind(C) [PR108546] · 96ff97ff
      Tobias Burnus authored
      For is_device_ptr, optional checks should only be done before calling
      libgomp, afterwards they are NULL either because of absent or, by
      chance, because it is unallocated or unassociated (for pointers/allocatables).
      
      Additionally, it fixes an issue with explicit mapping for 'type(c_ptr)'.
      
      	PR middle-end/108546
      
      gcc/fortran/ChangeLog:
      
      	* trans-openmp.cc (gfc_trans_omp_clauses): Fix mapping of
      	type(C_ptr) variables.
      
      gcc/ChangeLog:
      
      	* omp-low.cc (lower_omp_target): Remove optional handling
      	on the receiver side, i.e. inside target (data), for
      	use_device_ptr.
      
      libgomp/ChangeLog:
      
      	* testsuite/libgomp.fortran/is_device_ptr-3.f90: New test.
      	* testsuite/libgomp.fortran/use_device_ptr-optional-4.f90: New test.
      96ff97ff
  14. Feb 23, 2023
  15. Feb 22, 2023
    • Thomas Schwinge's avatar
      Add '-Wno-complain-wrong-lang', and use it in... · 320dc51c
      Thomas Schwinge authored
      Add '-Wno-complain-wrong-lang', and use it in 'gcc/testsuite/lib/target-supports.exp:check_compile' and elsewhere
      
      I noticed that GCC/Rust recently lost all LTO variants in torture testing:
      
           PASS: rust/compile/torture/all_doc_comment_line_blocks.rs   -O0  (test for excess errors)
           PASS: rust/compile/torture/all_doc_comment_line_blocks.rs   -O1  (test for excess errors)
           PASS: rust/compile/torture/all_doc_comment_line_blocks.rs   -O2  (test for excess errors)
          -PASS: rust/compile/torture/all_doc_comment_line_blocks.rs   -O2 -flto -fno-use-linker-plugin -flto-partition=none  (test for excess errors)
          -PASS: rust/compile/torture/all_doc_comment_line_blocks.rs   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  (test for excess errors)
           PASS: rust/compile/torture/all_doc_comment_line_blocks.rs   -O3 -g  (test for excess errors)
           PASS: rust/compile/torture/all_doc_comment_line_blocks.rs   -Os  (test for excess errors)
      
      Etc.
      
      The reason is that when probing for availability of LTO, we run into:
      
          spawn [...]/build-gcc/gcc/testsuite/rust/../../gccrs -B[...]/build-gcc/gcc/testsuite/rust/../../ -fdiagnostics-plain-output -frust-incomplete-and-experimental-compiler-do-not-use -flto -c -o lto8274.o lto8274.c
          cc1: warning: command-line option '-frust-incomplete-and-experimental-compiler-do-not-use' is valid for Rust but not for C
      
      For GCC/Rust testing, this flag is (as of recently) defaulted in
      'gcc/testsuite/lib/rust.exp:rust_init':
      
          lappend ALWAYS_RUSTFLAGS "additional_flags=-frust-incomplete-and-experimental-compiler-do-not-use"
      
      A few more "command-line option [...] is valid for [...] but not for [...]"
      instances were found in the test suite logs, when more than one language is
      involved.
      
      With '-Wno-complain-wrong-lang' used in
      'gcc/testsuite/lib/target-supports.exp:check_compile', we get back:
      
           PASS: rust/compile/torture/all_doc_comment_line_blocks.rs   -O0  (test for excess errors)
           PASS: rust/compile/torture/all_doc_comment_line_blocks.rs   -O1  (test for excess errors)
           PASS: rust/compile/torture/all_doc_comment_line_blocks.rs   -O2  (test for excess errors)
          +PASS: rust/compile/torture/all_doc_comment_line_blocks.rs   -O2 -flto -fno-use-linker-plugin -flto-partition=none  (test for excess errors)
          +PASS: rust/compile/torture/all_doc_comment_line_blocks.rs   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  (test for excess errors)
           PASS: rust/compile/torture/all_doc_comment_line_blocks.rs   -O3 -g  (test for excess errors)
           PASS: rust/compile/torture/all_doc_comment_line_blocks.rs   -Os  (test for excess errors)
      
      Etc., and in total:
      
                          === rust Summary for unix ===
      
          # of expected passes            [-4990-]{+6718+}
          # of expected failures          [-39-]{+51+}
      
      Anything that 'gcc/opts-global.cc:complain_wrong_lang' might do is cut
      short by '-Wno-complain-wrong-lang', not just the one 'warning'
      diagnostic.  This corresponds to what already exists via
      'lang_hooks.complain_wrong_lang_p'.
      
      The 'gcc/opts-common.cc:prune_options' changes follow the same rationale
      as PR67640 "driver passes -fdiagnostics-color= always last": we need to
      process '-Wno-complain-wrong-lang' early, so that it properly affects
      other options appearing before it on the command line.
      
      	gcc/
      	* common.opt (-Wcomplain-wrong-lang): New.
      	* doc/invoke.texi (-Wno-complain-wrong-lang): Document it.
      	* opts-common.cc (prune_options): Handle it.
      	* opts-global.cc (complain_wrong_lang): Use it.
      	gcc/testsuite/
      	* gcc.dg/Wcomplain-wrong-lang-1.c: New.
      	* gcc.dg/Wcomplain-wrong-lang-2.c: Likewise.
      	* gcc.dg/Wcomplain-wrong-lang-3.c: Likewise.
      	* gcc.dg/Wcomplain-wrong-lang-4.c: Likewise.
      	* gcc.dg/Wcomplain-wrong-lang-5.c: Likewise.
      	* lib/target-supports.exp (check_compile): Use
      	'-Wno-complain-wrong-lang'.
      	* g++.dg/abi/empty12.C: Likewise.
      	* g++.dg/abi/empty13.C: Likewise.
      	* g++.dg/abi/empty14.C: Likewise.
      	* g++.dg/abi/empty15.C: Likewise.
      	* g++.dg/abi/empty16.C: Likewise.
      	* g++.dg/abi/empty17.C: Likewise.
      	* g++.dg/abi/empty18.C: Likewise.
      	* g++.dg/abi/empty19.C: Likewise.
      	* g++.dg/abi/empty22.C: Likewise.
      	* g++.dg/abi/empty25.C: Likewise.
      	* g++.dg/abi/empty26.C: Likewise.
      	* gfortran.dg/bind-c-contiguous-1.f90: Likewise.
      	* gfortran.dg/bind-c-contiguous-4.f90: Likewise.
      	* gfortran.dg/bind-c-contiguous-5.f90: Likewise.
      	libgomp/
      	* testsuite/libgomp.fortran/alloc-10.f90: Use
      	'-Wno-complain-wrong-lang'.
      	* testsuite/libgomp.fortran/alloc-11.f90: Likewise.
      	* testsuite/libgomp.fortran/alloc-7.f90: Likewise.
      	* testsuite/libgomp.fortran/alloc-9.f90: Likewise.
      	* testsuite/libgomp.fortran/allocate-1.f90: Likewise.
      	* testsuite/libgomp.fortran/depend-4.f90: Likewise.
      	* testsuite/libgomp.fortran/depend-5.f90: Likewise.
      	* testsuite/libgomp.fortran/depend-6.f90: Likewise.
      	* testsuite/libgomp.fortran/depend-7.f90: Likewise.
      	* testsuite/libgomp.fortran/depend-inoutset-1.f90: Likewise.
      	* testsuite/libgomp.fortran/examples-4/declare_target-1.f90:
      	Likewise.
      	* testsuite/libgomp.fortran/examples-4/declare_target-2.f90:
      	Likewise.
      	* testsuite/libgomp.fortran/order-reproducible-1.f90: Likewise.
      	* testsuite/libgomp.fortran/order-reproducible-2.f90: Likewise.
      	* testsuite/libgomp.oacc-fortran/parallel-dims.f90: Likewise.
      	* testsuite/libgomp.fortran/task-detach-6.f90: Remove left-over
      	'dg-prune-output'.
      320dc51c
  16. Feb 17, 2023
  17. Feb 16, 2023
    • Jakub Jelinek's avatar
      libgomp: Fix up some typos in libgomp.texi · 0b9bd33d
      Jakub Jelinek authored
      I decided to check for repeated the the in libgomp and noticed
      there are several occurrences of a typo theads rather than threads
      in libgomp.texi.
      
      2023-02-16  Jakub Jelinek  <jakub@redhat.com>
      
      	* libgomp.texi: Fix typos - theads -> threads.
      0b9bd33d
    • Jakub Jelinek's avatar
      libgomp: Fix comment typo · 9d71955f
      Jakub Jelinek authored
      I saw
      FAIL: libgomp.fortran/target-nowait-array-section.f90   -O  execution test
      in my last x86_64-linux bootstrap.  From quick skimming, it might be just
      unreliable test, which assumes that asynchronous execution wouldn't produce
      ordered sequence, but can't it happen even with asynchronous execution?
      
      That said, while skimming the test, I've noticed a comment typo and
      this patch fixes that up.
      
      2023-02-16  Jakub Jelinek  <jakub@redhat.com>
      
      	* testsuite/libgomp.fortran/target-nowait-array-section.f90: Fix
      	comment typo and improve its wording.
      9d71955f
    • GCC Administrator's avatar
      Daily bump. · 29a35391
      GCC Administrator authored
      29a35391
  18. Feb 15, 2023
    • Tobias Burnus's avatar
      libgomp: Fix reverse-offload for GOMP_MAP_TO_PSET · edaf1d60
      Tobias Burnus authored
      libgomp/
      	* target.c (gomp_target_rev): Dereference ptr
      	to get device address.
      	* testsuite/libgomp.fortran/reverse-offload-5.f90: Add test
      	for unallocated allocatable.
      edaf1d60
    • Tobias Burnus's avatar
      libgomp: Fix 'target enter data' with always pointer · c7a9655b
      Tobias Burnus authored
      As GOMP_MAP_ALWAYS_POINTER operates on the previous map item, ensure that
      with 'target enter data' both are passed together to gomp_map_vars_internal.
      
      libgomp/ChangeLog:
      
      	* target.c (gomp_map_vars_internal): Add 'i > 0' before doing a
      	kind check.
      	(GOMP_target_enter_exit_data): If the next map item is
      	GOMP_MAP_ALWAYS_POINTER map it together with the current item.
      	* testsuite/libgomp.fortran/target-enter-data-3.f90: New test.
      c7a9655b
  19. Feb 10, 2023
  20. Feb 09, 2023
    • Tobias Burnus's avatar
      OpenMP/Fortran: Partially fix non-rect loop nests [PR107424] · ac294957
      Tobias Burnus authored
      This patch ensures that loop bounds depending on outer loop vars use the
      proper TREE_VEC format. It additionally gives a sorry if such an outer
      var has a non-one/non-minus-one increment as currently a count variable
      is used in this case (see PR).
      
      Finally, it avoids 'count' and just uses a local loop variable if the
      step increment is +/-1.
      
      	PR fortran/107424
      
      gcc/fortran/ChangeLog:
      
      	* trans-openmp.cc (struct dovar_init_d): Add 'sym' and
      	'non_unit_incr' members.
      	(gfc_nonrect_loop_expr): New.
      	(gfc_trans_omp_do): Call it; use normal loop bounds
      	for unit stride - and only create local loop var.
      
      libgomp/ChangeLog:
      
      	* testsuite/libgomp.fortran/non-rectangular-loop-1.f90: New test.
      	* testsuite/libgomp.fortran/non-rectangular-loop-1a.f90: New test.
      	* testsuite/libgomp.fortran/non-rectangular-loop-2.f90: New test.
      	* testsuite/libgomp.fortran/non-rectangular-loop-3.f90: New test.
      	* testsuite/libgomp.fortran/non-rectangular-loop-4.f90: New test.
      	* testsuite/libgomp.fortran/non-rectangular-loop-5.f90: New test.
      
      gcc/testsuite/ChangeLog:
      
      	* gfortran.dg/goacc/privatization-1-compute-loop.f90: Update dg-note.
      	* gfortran.dg/goacc/privatization-1-routine_gang-loop.f90: Likewise.
      ac294957
  21. Feb 08, 2023
  22. Feb 07, 2023
  23. Feb 04, 2023
  24. Feb 03, 2023
    • Tobias Burnus's avatar
      libgomp: Fix reverse offload issues · 0b1ce70a
      Tobias Burnus authored
      If there is nothing to map, skip the mapping and avoid attempting to
      copy 0 bytes from addrs, sizes and kinds.
      
      Additionally, it could happen that a non-allocated address was deallocated,
      such as a pointer set, leading to a free for the actual data.
      
      libgomp/
      	* target.c (gomp_target_rev): Handle mapnum == 0 and avoid
      	freeing not allocated memory.
      	* testsuite/libgomp.fortran/reverse-offload-6.f90: New test.
      0b1ce70a
    • Tobias Burnus's avatar
      libgomp: enable reverse offload for AMDGCN · f84fdb13
      Tobias Burnus authored
      libgomp/ChangeLog:
      
      	* libgomp.texi (5.0 Impl. Status, gcn specifics): Update for
      	reverse offload.
      	* plugin/plugin-gcn.c (GOMP_OFFLOAD_get_num_devices): Accept
      	reverse-offload requirement.
      f84fdb13
    • GCC Administrator's avatar
      Daily bump. · a37a0cb3
      GCC Administrator authored
      a37a0cb3
  25. Feb 02, 2023
    • Andrew Stubbs's avatar
      amdgcn, libgomp: Manually allocated stacks · f6fff8a6
      Andrew Stubbs authored
      Switch from using stacks in the "private segment" to using a memory block
      allocated on the host side.  The primary reason is to permit the reverse
      offload implementation to access values located on the device stack, but
      there may also be performance benefits, especially with repeated kernel
      invocations.
      
      This implementation unifies the stacks with the "team arena" optimization
      feature, and now allows both to have run-time configurable sizes.
      
      A new ABI is needed, so all libraries must be rebuilt, and newlib must be
      version 4.3.0.20230120 or newer.
      
      gcc/ChangeLog:
      
      	* config/gcn/gcn-run.cc: Include libgomp-gcn.h.
      	(struct kernargs): Replace the common content with kernargs_abi.
      	(struct heap): Delete.
      	(main): Read GCN_STACK_SIZE envvar.
      	Allocate space for the device stacks.
      	Write the new kernargs fields.
      	* config/gcn/gcn.cc (gcn_option_override): Remove stack_size_opt.
      	(default_requested_args): Remove PRIVATE_SEGMENT_BUFFER_ARG and
      	PRIVATE_SEGMENT_WAVE_OFFSET_ARG.
      	(gcn_addr_space_convert): Mask the QUEUE_PTR_ARG content.
      	(gcn_expand_prologue): Move the TARGET_PACKED_WORK_ITEMS to the top.
      	Set up the stacks from the values in the kernargs, not private.
      	(gcn_expand_builtin_1): Match the stack configuration in the prologue.
      	(gcn_hsa_declare_function_name): Turn off the private segment.
      	(gcn_conditional_register_usage): Ensure QUEUE_PTR is fixed.
      	* config/gcn/gcn.h (FIXED_REGISTERS): Fix the QUEUE_PTR register.
      	* config/gcn/gcn.opt (mstack-size): Change the description.
      
      include/ChangeLog:
      
      	* gomp-constants.h (GOMP_VERSION_GCN): Bump.
      
      libgomp/ChangeLog:
      
      	* config/gcn/libgomp-gcn.h (DEFAULT_GCN_STACK_SIZE): New define.
      	(DEFAULT_TEAM_ARENA_SIZE): New define.
      	(struct heap): Move to this file.
      	(struct kernargs_abi): Likewise.
      	* config/gcn/team.c (gomp_gcn_enter_kernel): Use team arena size from
      	the kernargs.
      	* libgomp.h: Include libgomp-gcn.h.
      	(TEAM_ARENA_SIZE): Remove.
      	(team_malloc): Update the error message.
      	* plugin/plugin-gcn.c (struct kernargs): Move common content to
      	struct kernargs_abi.
      	(struct agent_info): Rename team arenas to ephemeral memories.
      	(struct team_arena_list): Rename ....
      	(struct ephemeral_memories_list): to this.
      	(struct heap): Delete.
      	(team_arena_size): New variable.
      	(stack_size): New variable.
      	(print_kernel_dispatch): Update debug messages.
      	(init_environment_variables): Read GCN_TEAM_ARENA_SIZE.
      	Read GCN_STACK_SIZE.
      	(get_team_arena): Rename ...
      	(configure_ephemeral_memories): ... to this, and set up stacks.
      	(release_team_arena): Rename ...
      	(release_ephemeral_memories): ... to this.
      	(destroy_team_arenas): Rename ...
      	(destroy_ephemeral_memories): ... to this.
      	(create_kernel_dispatch): Add num_threads parameter.
      	Adjust for kernargs_abi refactor and ephemeral memories.
      	(release_kernel_dispatch): Adjust for ephemeral memories.
      	(run_kernel): Pass thread-count to create_kernel_dispatch.
      	(GOMP_OFFLOAD_init_device): Adjust for ephemeral memories.
      	(GOMP_OFFLOAD_fini_device): Adjust for ephemeral memories.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.c-torture/execute/pr47237.c: Xfail on amdgcn.
      	* gcc.dg/builtin-apply3.c: Xfail for amdgcn.
      	* gcc.dg/builtin-apply4.c: Xfail for amdgcn.
      	* gcc.dg/torture/stackalign/builtin-apply-3.c: Xfail for amdgcn.
      	* gcc.dg/torture/stackalign/builtin-apply-4.c: Xfail for amdgcn.
      f6fff8a6
Loading