public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/94593] New: [OpenMP] c-c++-common/gomp/requires-1.c: Missing diagnostic, test-case issues
@ 2020-04-14 12:06 burnus at gcc dot gnu.org
  2020-04-14 15:04 ` [Bug middle-end/94593] " jakub at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: burnus at gcc dot gnu.org @ 2020-04-14 12:06 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 94593
           Summary: [OpenMP] c-c++-common/gomp/requires-1.c: Missing
                    diagnostic, test-case issues
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Keywords: openmp
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: burnus at gcc dot gnu.org
  Target Milestone: ---

The test case c-c++-common/gomp/requires-1.c compiles with gcc/g++ -fopenmp.
But …

Just that it does not get forgotten:

The last pragma:
  #pragma omp requries atomic_default_mem_order(seq_cst)

s/requrires/requires/

Additionally, CLANG rightly complains:
  error: Only one unified_shared_memory clause can appear on a requires
directive in a single translation unit

And I think clang-10 also rightly complains about the last two #pragmas:
  error: unexpected OpenMP directive '#pragma omp requires

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug middle-end/94593] [OpenMP] c-c++-common/gomp/requires-1.c: Missing diagnostic, test-case issues
  2020-04-14 12:06 [Bug middle-end/94593] New: [OpenMP] c-c++-common/gomp/requires-1.c: Missing diagnostic, test-case issues burnus at gcc dot gnu.org
@ 2020-04-14 15:04 ` jakub at gcc dot gnu.org
  2020-04-14 15:21 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-04-14 15:04 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I'll fix up the testcase.
gcc diagnoses the #pragma omp requries too, but only with -Wall or
-Wunknown-pragmas (intentionally, because it wants to ignore unknown pragmas).

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug middle-end/94593] [OpenMP] c-c++-common/gomp/requires-1.c: Missing diagnostic, test-case issues
  2020-04-14 12:06 [Bug middle-end/94593] New: [OpenMP] c-c++-common/gomp/requires-1.c: Missing diagnostic, test-case issues burnus at gcc dot gnu.org
  2020-04-14 15:04 ` [Bug middle-end/94593] " jakub at gcc dot gnu.org
@ 2020-04-14 15:21 ` jakub at gcc dot gnu.org
  2020-04-14 18:57 ` [Bug c/94593] " jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-04-14 15:21 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
error: Only one unified_shared_memory clause can appear on a requires directive
in a single translation unit
is incorrect, dunno where they took it from.
The same clause can't appear multiple times on the same directive and only one
atomic_default_mem_order can appear in a TU etc., but nothing says you can't
have #pragma omp requires unified_shared_memory
#pragma omp requires unified_shared_memory
#pragma omp requires unified_shared_memory
#pragma omp requires unified_shared_memory
#pragma omp requires unified_shared_memory
Though, there is a restriction which we don't diagnose, namely that #pragma omp
requires can only appear at file or namespace scope (in C/C++).

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c/94593] [OpenMP] c-c++-common/gomp/requires-1.c: Missing diagnostic, test-case issues
  2020-04-14 12:06 [Bug middle-end/94593] New: [OpenMP] c-c++-common/gomp/requires-1.c: Missing diagnostic, test-case issues burnus at gcc dot gnu.org
  2020-04-14 15:04 ` [Bug middle-end/94593] " jakub at gcc dot gnu.org
  2020-04-14 15:21 ` jakub at gcc dot gnu.org
@ 2020-04-14 18:57 ` jakub at gcc dot gnu.org
  2020-04-15  8:01 ` cvs-commit at gcc dot gnu.org
  2020-04-15  8:03 ` jakub at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-04-14 18:57 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2020-04-14
             Status|UNCONFIRMED                 |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |jakub at gcc dot gnu.org

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 48272
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48272&action=edit
gcc10-pr94593.patch

Untested fix.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c/94593] [OpenMP] c-c++-common/gomp/requires-1.c: Missing diagnostic, test-case issues
  2020-04-14 12:06 [Bug middle-end/94593] New: [OpenMP] c-c++-common/gomp/requires-1.c: Missing diagnostic, test-case issues burnus at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2020-04-14 18:57 ` [Bug c/94593] " jakub at gcc dot gnu.org
@ 2020-04-15  8:01 ` cvs-commit at gcc dot gnu.org
  2020-04-15  8:03 ` jakub at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-04-15  8:01 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:2dc9294c3c7c81a6d5e1d4dedf58fea87bbadde6

commit r10-7731-g2dc9294c3c7c81a6d5e1d4dedf58fea87bbadde6
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Wed Apr 15 09:59:14 2020 +0200

    openmp: Reject requires directives not at file or namespace scope [PR94593]

    This change started with a bugreport about a typo in one requires testcase
    (diagnosed with -Wunknown-pragmas only), but following discussion lead to
    noting that we do not diagnose restriction that requires directives in
    C/C++ may only appear at file or namespace scope; and several our tests
    violated that.

    2020-04-15  Jakub Jelinek  <jakub@redhat.com>

            PR c/94593
            * c-parser.c (c_parser_pragma) <case PRAGMA_OMP_REQUIRES>: Reject
            requires directive when not at file scope.

            * parser.c (cp_parser_pragma) <case PRAGMA_OMP_REQUIRES>: Reject
            requires directive when not at file or namespace scope.

            * c-c++-common/gomp/requires-1.c: Fix a typo, requries -> requires.
            Move directives to file scope.
            (i): Remove.
            * c-c++-common/gomp/requires-2.c: Move directives to file scope.
            (i, foo): Remove.
            * c-c++-common/gomp/requires-4.c: Move directives to file scope.
            * c-c++-common/gomp/atomic-19.c: Move requires directive to file
scope.
            * c-c++-common/gomp/atomic-20.c: Likewise.
            * c-c++-common/gomp/atomic-21.c: Likewise.
            * c-c++-common/gomp/atomic-22.c: Likewise.
            * gcc.dg/gomp/requires-1.c: New test.
            * g++.dg/gomp/requires-1.C: New test.
            * g++.dg/gomp/requires-2.C: New test.
            * g++.dg/gomp/atomic-18.C: Move requires directive to file scope.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c/94593] [OpenMP] c-c++-common/gomp/requires-1.c: Missing diagnostic, test-case issues
  2020-04-14 12:06 [Bug middle-end/94593] New: [OpenMP] c-c++-common/gomp/requires-1.c: Missing diagnostic, test-case issues burnus at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2020-04-15  8:01 ` cvs-commit at gcc dot gnu.org
@ 2020-04-15  8:03 ` jakub at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-04-15  8:03 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-04-15  8:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-14 12:06 [Bug middle-end/94593] New: [OpenMP] c-c++-common/gomp/requires-1.c: Missing diagnostic, test-case issues burnus at gcc dot gnu.org
2020-04-14 15:04 ` [Bug middle-end/94593] " jakub at gcc dot gnu.org
2020-04-14 15:21 ` jakub at gcc dot gnu.org
2020-04-14 18:57 ` [Bug c/94593] " jakub at gcc dot gnu.org
2020-04-15  8:01 ` cvs-commit at gcc dot gnu.org
2020-04-15  8:03 ` jakub at gcc dot gnu.org

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).