public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "H.J. Lu" <hjl.tools@gmail.com>
To: Jakub Jelinek <jakub@redhat.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>,
	Tobias Burnus <tobias@codesourcery.com>
Subject: Re: [committed] openmp: Add support for OpenMP 5.1 atomics for C++
Date: Sat, 2 Oct 2021 15:58:49 -0700	[thread overview]
Message-ID: <CAMe9rOpfaykbrsnaBALN6947JwouzfgmOQBet0UQLzo1X5AWXw@mail.gmail.com> (raw)
In-Reply-To: <20210917093155.GM304296@tucnak>

On Fri, Sep 17, 2021 at 2:34 AM Jakub Jelinek via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> Hi!
>
> Besides the C++ FE changes, I've noticed that the C FE didn't reject
>   #pragma omp atomic capture compare
>   { v = x; x = y; }
> and other forms of atomic swap, this patch fixes that too.  And the
> c-family/ routine needed quite a few changes so that the new code
> in it works fine with both FEs.
>
> Bootstrapped/regtested on x86_64-linux and i686-linux, committed to trunk.
>
> 2021-09-17  Jakub Jelinek  <jakub@redhat.com>
>
> gcc/c-family/
>         * c-omp.c (c_finish_omp_atomic): Avoid creating
>         TARGET_EXPR if test is true, use create_tmp_var_raw instead of
>         create_tmp_var and add a zero initializer to TARGET_EXPRs that
>         had NULL initializer.  When omitting operands after v = x,
>         use type of v rather than type of x.  Fix type of vtmp
>         TARGET_EXPR.
> gcc/c/
>         * c-parser.c (c_parser_omp_atomic): Reject atomic swap if capture
>         is true.
> gcc/cp/
>         * cp-tree.h (finish_omp_atomic): Add r and weak arguments.
>         * parser.c (cp_parser_omp_atomic): Update function comment for
>         OpenMP 5.1 atomics, parse OpenMP 5.1 atomics and fail, compare and
>         weak clauses.
>         * semantics.c (finish_omp_atomic): Add r and weak arguments, handle
>         them, handle COND_EXPRs.
>         * pt.c (tsubst_expr): Adjust for COND_EXPR forms that
>         finish_omp_atomic can now produce.
> gcc/testsuite/
>         * c-c++-common/gomp/atomic-18.c: Expect same diagnostics in C++ as in
>         C.
>         * c-c++-common/gomp/atomic-25.c: Drop c effective target.
>         * c-c++-common/gomp/atomic-26.c: Likewise.
>         * c-c++-common/gomp/atomic-27.c: Likewise.
>         * c-c++-common/gomp/atomic-28.c: Likewise.
>         * c-c++-common/gomp/atomic-29.c: Likewise.
>         * c-c++-common/gomp/atomic-30.c: Likewise.  Adjust expected diagnostics
>         for C++ when it differs from C.
>         (foo): Change return type from double to void.
>         * g++.dg/gomp/atomic-5.C: Adjust expected diagnostics wording.
>         * g++.dg/gomp/atomic-20.C: New test.
> libgomp/
>         * testsuite/libgomp.c-c++-common/atomic-19.c: Drop c effective target.
>         Use /* */ comments instead of //.
>         * testsuite/libgomp.c-c++-common/atomic-20.c: Likewise.
>         * testsuite/libgomp.c-c++-common/atomic-21.c: Likewise.

This test fails on i686 and x86-64 with -m32 -mfpmath=sse:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102571

>         * testsuite/libgomp.c++/atomic-16.C: New test.
>         * testsuite/libgomp.c++/atomic-17.C: New test.
>

H.J.

      reply	other threads:[~2021-10-02 22:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-17  9:31 Jakub Jelinek
2021-10-02 22:58 ` H.J. Lu [this message]

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=CAMe9rOpfaykbrsnaBALN6947JwouzfgmOQBet0UQLzo1X5AWXw@mail.gmail.com \
    --to=hjl.tools@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=tobias@codesourcery.com \
    /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).