public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/101759] New: #pragma omp declare simd/variant or oacc routine parsing bug
@ 2021-08-03 17:31 jakub at gcc dot gnu.org
  2021-08-03 17:31 ` [Bug c++/101759] " jakub at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-08-03 17:31 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 101759
           Summary: #pragma omp declare simd/variant or oacc routine
                    parsing bug
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jakub at gcc dot gnu.org
  Target Milestone: ---

#pragma omp declare simd
int foo (int x = []() { extern int bar (int); return 1; }());
int corge (int = 1);
#pragma omp declare variant (corge) match (user={condition(true)})
int baz (int x = []() { extern int qux (int); return 1; }());
is incorrectly rejected with -fopenmp and
#pragma acc routine
int foo (int x = []() { extern int bar (int); return 1; }());
with -fopenacc.

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

* [Bug c++/101759] #pragma omp declare simd/variant or oacc routine parsing bug
  2021-08-03 17:31 [Bug c++/101759] New: #pragma omp declare simd/variant or oacc routine parsing bug jakub at gcc dot gnu.org
@ 2021-08-03 17:31 ` jakub at gcc dot gnu.org
  2021-08-03 17:40 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-08-03 17:31 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |jakub at gcc dot gnu.org
   Last reconfirmed|                            |2021-08-03
     Ever confirmed|0                           |1
           Keywords|                            |openacc, openmp,
                   |                            |rejects-valid

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

* [Bug c++/101759] #pragma omp declare simd/variant or oacc routine parsing bug
  2021-08-03 17:31 [Bug c++/101759] New: #pragma omp declare simd/variant or oacc routine parsing bug jakub at gcc dot gnu.org
  2021-08-03 17:31 ` [Bug c++/101759] " jakub at gcc dot gnu.org
@ 2021-08-03 17:40 ` jakub at gcc dot gnu.org
  2021-08-04  9:56 ` cvs-commit at gcc dot gnu.org
  2021-08-12 22:55 ` cvs-commit at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-08-03 17:40 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 51252
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51252&action=edit
gcc12-pr101759.patch

Untested fix.

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

* [Bug c++/101759] #pragma omp declare simd/variant or oacc routine parsing bug
  2021-08-03 17:31 [Bug c++/101759] New: #pragma omp declare simd/variant or oacc routine parsing bug jakub at gcc dot gnu.org
  2021-08-03 17:31 ` [Bug c++/101759] " jakub at gcc dot gnu.org
  2021-08-03 17:40 ` jakub at gcc dot gnu.org
@ 2021-08-04  9:56 ` cvs-commit at gcc dot gnu.org
  2021-08-12 22:55 ` cvs-commit at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-08-04  9:56 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 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:af31cab04770f7a1a1da069415ab62ca2ef54fc4

commit r12-2726-gaf31cab04770f7a1a1da069415ab62ca2ef54fc4
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Wed Aug 4 11:53:48 2021 +0200

    c++: Fix up #pragma omp declare {simd,variant} and acc routine parsing

    When parsing default arguments, we need to temporarily clear
parser->omp_declare_simd
    and parser->oacc_routine, otherwise it can clash with further declarations
    inside of e.g. lambdas inside of those default arguments.

    2021-08-04  Jakub Jelinek  <jakub@redhat.com>

            PR c++/101759
            * parser.c (cp_parser_default_argument): Temporarily override
            parser->omp_declare_simd and parser->oacc_routine to NULL.

            * g++.dg/gomp/pr101759.C: New test.
            * g++.dg/goacc/pr101759.C: New test.

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

* [Bug c++/101759] #pragma omp declare simd/variant or oacc routine parsing bug
  2021-08-03 17:31 [Bug c++/101759] New: #pragma omp declare simd/variant or oacc routine parsing bug jakub at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2021-08-04  9:56 ` cvs-commit at gcc dot gnu.org
@ 2021-08-12 22:55 ` cvs-commit at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-08-12 22:55 UTC (permalink / raw)
  To: gcc-bugs

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

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

https://gcc.gnu.org/g:dd345961831980e3103411d61bba249efa2ee720

commit r11-8859-gdd345961831980e3103411d61bba249efa2ee720
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Wed Aug 4 11:53:48 2021 +0200

    c++: Fix up #pragma omp declare {simd,variant} and acc routine parsing

    When parsing default arguments, we need to temporarily clear
parser->omp_declare_simd
    and parser->oacc_routine, otherwise it can clash with further declarations
    inside of e.g. lambdas inside of those default arguments.

    2021-08-04  Jakub Jelinek  <jakub@redhat.com>

            PR c++/101759
            * parser.c (cp_parser_default_argument): Temporarily override
            parser->omp_declare_simd and parser->oacc_routine to NULL.

            * g++.dg/gomp/pr101759.C: New test.
            * g++.dg/goacc/pr101759.C: New test.

    (cherry picked from commit af31cab04770f7a1a1da069415ab62ca2ef54fc4)

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

end of thread, other threads:[~2021-08-12 22:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-03 17:31 [Bug c++/101759] New: #pragma omp declare simd/variant or oacc routine parsing bug jakub at gcc dot gnu.org
2021-08-03 17:31 ` [Bug c++/101759] " jakub at gcc dot gnu.org
2021-08-03 17:40 ` jakub at gcc dot gnu.org
2021-08-04  9:56 ` cvs-commit at gcc dot gnu.org
2021-08-12 22:55 ` cvs-commit 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).