public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Tobias Burnus <tobias@codesourcery.com>
To: gcc-patches <gcc-patches@gcc.gnu.org>, fortran <fortran@gcc.gnu.org>
Subject: [Patch] omp_lib.f90.in: Deprecate omp_lock_hint_* for OpenMP 5.0
Date: Thu, 19 Oct 2023 21:48:18 +0200	[thread overview]
Message-ID: <17133bf5-db9d-406f-b39d-265fe64f90af@codesourcery.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1240 bytes --]

I noticed that we only tagged half of the 5.0 deprecations in the omp_lib module;
this added the other half. (omp_lock_hint_* was renamed to omp_sync_hint_*.)

Currently, this patch has has no visible effect - but once we bump the OpenMP version
from 4.5 to 5.0, there will warnings of the those.

Comments, remarks? If not, I will commit the attached patch tomorrow.

Tobias

PS: Once the OpenMP version has been bumped (as done for testing), the warning
looks as follows:

     1 | use omp_lib
       |    1
Warning: Using parameter ‘omp_lock_hint_kind’ declared at (1) is deprecated [-Wdeprecated-declarations]

     3 | print *, omp_get_nested()
       |        1
Warning: Using function ‘omp_get_nested’ at (1) is deprecated [-Wdeprecated-declarations]

The 'omp_lock_hint_kind' warning is not ideal as it uses the declared-at location
and not the first-used location, which would be in line 2:

integer(omp_lock_hint_kind) :: hint
-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955

[-- Attachment #2: depr.diff --]
[-- Type: text/x-patch, Size: 1071 bytes --]

omp_lib.f90.in: Deprecate omp_lock_hint_* for OpenMP 5.0

The omp_lock_hint_* parameters were deprecated in favor of
omp_sync_hint_*.  While omp.h contained deprecation markers for those,
the omp_lib module only contained them for omp_{g,s}_nested.

Note: The -Wdeprecated-declarations warning will only become active once
openmp_version / _OPENMP is bumped from 201511 (4.5) to 201811 (5.0).

libgomp/ChangeLog:

	* omp_lib.f90.in: Tag omp_lock_hint_* as being deprecated when
	_OPENMP >= 201811.

diff --git a/libgomp/omp_lib.f90.in b/libgomp/omp_lib.f90.in
index e4515271252..755c0bf16ec 100644
--- a/libgomp/omp_lib.f90.in
+++ b/libgomp/omp_lib.f90.in
@@ -904,6 +904,10 @@
 
 #if _OPENMP >= 201811
 !GCC$ ATTRIBUTES DEPRECATED :: omp_get_nested, omp_set_nested
+!GCC$ ATTRIBUTES DEPRECATED :: omp_lock_hint_kind, omp_lock_hint_none
+!GCC$ ATTRIBUTES DEPRECATED :: omp_lock_hint_uncontended, omp_lock_hint_contended
+!GCC$ ATTRIBUTES DEPRECATED :: omp_lock_hint_nonspeculative
+!GCC$ ATTRIBUTES DEPRECATED :: omp_lock_hint_speculative
 #endif
 
 #if _OPENMP >= 202011

                 reply	other threads:[~2023-10-19 19:48 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=17133bf5-db9d-406f-b39d-265fe64f90af@codesourcery.com \
    --to=tobias@codesourcery.com \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).