public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/101731] New: ICE in cp_parser_skip_to_pragma_eol, at cp/parser.c:4055
@ 2021-08-02 18:46 gscfq@t-online.de
  2021-08-02 19:52 ` [Bug c++/101731] " pinskia at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: gscfq@t-online.de @ 2021-08-02 18:46 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 101731
           Summary: ICE in cp_parser_skip_to_pragma_eol, at
                    cp/parser.c:4055
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gscfq@t-online.de
  Target Milestone: ---

Started with r7 :


$ cat z1.cc
#pragma acc routine
int f (int a());


$ g++-12-20210801 -c z1.cc -fopenacc
z1.cc:2:1: error: expected '#pragma acc' clause at end of input
    2 | int f (int a());
      | ^~~
z1.cc:2:1: internal compiler error: in cp_parser_skip_to_pragma_eol, at
cp/parser.c:4055
0x894a09 cp_parser_skip_to_pragma_eol
        ../../gcc/cp/parser.c:4055
0x8c3601 cp_parser_oacc_all_clauses
        ../../gcc/cp/parser.c:39055
0x8c5bfe cp_parser_late_parsing_oacc_routine
        ../../gcc/cp/parser.c:45202
0x8c5bfe cp_parser_late_return_type_opt
        ../../gcc/cp/parser.c:23580
0x8c5bfe cp_parser_direct_declarator
        ../../gcc/cp/parser.c:22687
0x8c5bfe cp_parser_declarator
        ../../gcc/cp/parser.c:22489
0x8df9b3 cp_parser_init_declarator
        ../../gcc/cp/parser.c:21989
0x8b84ca cp_parser_simple_declaration
        ../../gcc/cp/parser.c:14887
0x8e728e cp_parser_declaration
        ../../gcc/cp/parser.c:14592
0x8b190b cp_parser_oacc_routine
        ../../gcc/cp/parser.c:45163
0x8b190b cp_parser_pragma
        ../../gcc/cp/parser.c:45951
0x8e7eb5 cp_parser_translation_unit
        ../../gcc/cp/parser.c:4960
0x8e7eb5 c_parse_file()
        ../../gcc/cp/parser.c:46179
0xa674d2 c_common_parse_file()
        ../../gcc/c-family/c-opts.c:1223

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

* [Bug c++/101731] ICE in cp_parser_skip_to_pragma_eol, at cp/parser.c:4055
  2021-08-02 18:46 [Bug c++/101731] New: ICE in cp_parser_skip_to_pragma_eol, at cp/parser.c:4055 gscfq@t-online.de
@ 2021-08-02 19:52 ` pinskia at gcc dot gnu.org
  2021-08-05 19:41 ` [Bug c++/101731] [9/10/11/12 Regression] " pinskia at gcc dot gnu.org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-02 19:52 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=96257

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Related to PR 96257.

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

* [Bug c++/101731] [9/10/11/12 Regression] ICE in cp_parser_skip_to_pragma_eol, at cp/parser.c:4055
  2021-08-02 18:46 [Bug c++/101731] New: ICE in cp_parser_skip_to_pragma_eol, at cp/parser.c:4055 gscfq@t-online.de
  2021-08-02 19:52 ` [Bug c++/101731] " pinskia at gcc dot gnu.org
@ 2021-08-05 19:41 ` pinskia at gcc dot gnu.org
  2021-08-05 19:42 ` pinskia at gcc dot gnu.org
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-05 19:41 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |error-recovery,
                   |                            |ice-on-invalid-code
            Summary|ICE in                      |[9/10/11/12 Regression] ICE
                   |cp_parser_skip_to_pragma_eo |in
                   |l, at cp/parser.c:4055      |cp_parser_skip_to_pragma_eo
                   |                            |l, at cp/parser.c:4055
      Known to fail|                            |7.1.0
      Known to work|                            |6.1.0, 6.4.0
   Target Milestone|---                         |9.5

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

* [Bug c++/101731] [9/10/11/12 Regression] ICE in cp_parser_skip_to_pragma_eol, at cp/parser.c:4055
  2021-08-02 18:46 [Bug c++/101731] New: ICE in cp_parser_skip_to_pragma_eol, at cp/parser.c:4055 gscfq@t-online.de
  2021-08-02 19:52 ` [Bug c++/101731] " pinskia at gcc dot gnu.org
  2021-08-05 19:41 ` [Bug c++/101731] [9/10/11/12 Regression] " pinskia at gcc dot gnu.org
@ 2021-08-05 19:42 ` pinskia at gcc dot gnu.org
  2021-08-05 19:55 ` pinskia at gcc dot gnu.org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-05 19:42 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2021-08-05
     Ever confirmed|0                           |1

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
GCC 6.1.0 just errored out without an ICE:
<source>:2:9: error: '#pragma acc routine' not followed by a function
declaration or definition

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

* [Bug c++/101731] [9/10/11/12 Regression] ICE in cp_parser_skip_to_pragma_eol, at cp/parser.c:4055
  2021-08-02 18:46 [Bug c++/101731] New: ICE in cp_parser_skip_to_pragma_eol, at cp/parser.c:4055 gscfq@t-online.de
                   ` (2 preceding siblings ...)
  2021-08-05 19:42 ` pinskia at gcc dot gnu.org
@ 2021-08-05 19:55 ` pinskia at gcc dot gnu.org
  2021-11-19 15:06 ` jakub at gcc dot gnu.org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-05 19:55 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
This is most likely caused by r7-2434.

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

* [Bug c++/101731] [9/10/11/12 Regression] ICE in cp_parser_skip_to_pragma_eol, at cp/parser.c:4055
  2021-08-02 18:46 [Bug c++/101731] New: ICE in cp_parser_skip_to_pragma_eol, at cp/parser.c:4055 gscfq@t-online.de
                   ` (3 preceding siblings ...)
  2021-08-05 19:55 ` pinskia at gcc dot gnu.org
@ 2021-11-19 15:06 ` jakub at gcc dot gnu.org
  2021-11-22 16:07 ` cvs-commit at gcc dot gnu.org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-11-19 15:06 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

This brings the OpenACC handling closer to OpenMP, where fndecl_seen is set at
the end of the *late_parsing* rather than in the function that finalizes it.

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

* [Bug c++/101731] [9/10/11/12 Regression] ICE in cp_parser_skip_to_pragma_eol, at cp/parser.c:4055
  2021-08-02 18:46 [Bug c++/101731] New: ICE in cp_parser_skip_to_pragma_eol, at cp/parser.c:4055 gscfq@t-online.de
                   ` (4 preceding siblings ...)
  2021-11-19 15:06 ` jakub at gcc dot gnu.org
@ 2021-11-22 16:07 ` cvs-commit at gcc dot gnu.org
  2021-11-22 16:08 ` [Bug c++/101731] [9/10/11 " jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-11-22 16:07 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 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:1aedb3920a45bfe75db4514502b4e7f83e108f63

commit r12-5451-g1aedb3920a45bfe75db4514502b4e7f83e108f63
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Mon Nov 22 17:06:12 2021 +0100

    openacc: Fix up C++ #pragma acc routine handling [PR101731]

    The following testcase ICEs because two function declarations are nested in
    each other and the acc routine handling code isn't prepared to put the
    pragma on both.

    The fix is similar to what #pragma omp declare {simd,variant} does,
    in particular set the fndecl_seen flag already in cp_parser_late_parsing*
    when we encounter it rather than only after we finalize it.

    In cp_finalize_oacc_routine I had to move the fndecl_seen diagnostics to
    non-FUNCTION_DECL block, because for FUNCTION_DECLs the flag is already
    known to be set from cp_parser_late_parsing_oacc_routine, but can't be
    removed altogether, because that regresses quality of 2 goacc/routine-5.c
    diagnostics - we drop "a single " from the
    '#pragma acc routine' not immediately followed by a single function
declaration or definition
    diagnostic say on
     #pragma acc routine
     int foo (), b;
    if we drop it altogether.

    2021-11-22  Jakub Jelinek  <jakub@redhat.com>

            PR c++/101731
            * parser.c (cp_parser_late_parsing_oacc_routine): Set
            parser->oacc_routine->fndecl_seen here, rather than ...
            (cp_finalize_oacc_routine): ... here.  Don't error if
            parser->oacc_routine->fndecl_seen is set for FUNCTION_DECLs.

            * c-c++-common/goacc/routine-6.c: New test.

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

* [Bug c++/101731] [9/10/11 Regression] ICE in cp_parser_skip_to_pragma_eol, at cp/parser.c:4055
  2021-08-02 18:46 [Bug c++/101731] New: ICE in cp_parser_skip_to_pragma_eol, at cp/parser.c:4055 gscfq@t-online.de
                   ` (5 preceding siblings ...)
  2021-11-22 16:07 ` cvs-commit at gcc dot gnu.org
@ 2021-11-22 16:08 ` jakub at gcc dot gnu.org
  2022-01-21 13:57 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-11-22 16:08 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[9/10/11/12 Regression] ICE |[9/10/11 Regression] ICE in
                   |in                          |cp_parser_skip_to_pragma_eo
                   |cp_parser_skip_to_pragma_eo |l, at cp/parser.c:4055
                   |l, at cp/parser.c:4055      |

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed on the trunk so far.

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

* [Bug c++/101731] [9/10/11 Regression] ICE in cp_parser_skip_to_pragma_eol, at cp/parser.c:4055
  2021-08-02 18:46 [Bug c++/101731] New: ICE in cp_parser_skip_to_pragma_eol, at cp/parser.c:4055 gscfq@t-online.de
                   ` (6 preceding siblings ...)
  2021-11-22 16:08 ` [Bug c++/101731] [9/10/11 " jakub at gcc dot gnu.org
@ 2022-01-21 13:57 ` rguenth at gcc dot gnu.org
  2022-05-27  9:45 ` [Bug c++/101731] [10/11 " rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-01-21 13:57 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P4

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

* [Bug c++/101731] [10/11 Regression] ICE in cp_parser_skip_to_pragma_eol, at cp/parser.c:4055
  2021-08-02 18:46 [Bug c++/101731] New: ICE in cp_parser_skip_to_pragma_eol, at cp/parser.c:4055 gscfq@t-online.de
                   ` (7 preceding siblings ...)
  2022-01-21 13:57 ` rguenth at gcc dot gnu.org
@ 2022-05-27  9:45 ` rguenth at gcc dot gnu.org
  2022-06-28 10:45 ` jakub at gcc dot gnu.org
  2023-07-07 10:40 ` [Bug c++/101731] [11 " rguenth at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-05-27  9:45 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|9.5                         |10.4

--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 9 branch is being closed

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

* [Bug c++/101731] [10/11 Regression] ICE in cp_parser_skip_to_pragma_eol, at cp/parser.c:4055
  2021-08-02 18:46 [Bug c++/101731] New: ICE in cp_parser_skip_to_pragma_eol, at cp/parser.c:4055 gscfq@t-online.de
                   ` (8 preceding siblings ...)
  2022-05-27  9:45 ` [Bug c++/101731] [10/11 " rguenth at gcc dot gnu.org
@ 2022-06-28 10:45 ` jakub at gcc dot gnu.org
  2023-07-07 10:40 ` [Bug c++/101731] [11 " rguenth at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-06-28 10:45 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|10.4                        |10.5

--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 10.4 is being released, retargeting bugs to GCC 10.5.

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

* [Bug c++/101731] [11 Regression] ICE in cp_parser_skip_to_pragma_eol, at cp/parser.c:4055
  2021-08-02 18:46 [Bug c++/101731] New: ICE in cp_parser_skip_to_pragma_eol, at cp/parser.c:4055 gscfq@t-online.de
                   ` (9 preceding siblings ...)
  2022-06-28 10:45 ` jakub at gcc dot gnu.org
@ 2023-07-07 10:40 ` rguenth at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-07-07 10:40 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|10.5                        |11.5

--- Comment #9 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 10 branch is being closed.

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

end of thread, other threads:[~2023-07-07 10:40 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-02 18:46 [Bug c++/101731] New: ICE in cp_parser_skip_to_pragma_eol, at cp/parser.c:4055 gscfq@t-online.de
2021-08-02 19:52 ` [Bug c++/101731] " pinskia at gcc dot gnu.org
2021-08-05 19:41 ` [Bug c++/101731] [9/10/11/12 Regression] " pinskia at gcc dot gnu.org
2021-08-05 19:42 ` pinskia at gcc dot gnu.org
2021-08-05 19:55 ` pinskia at gcc dot gnu.org
2021-11-19 15:06 ` jakub at gcc dot gnu.org
2021-11-22 16:07 ` cvs-commit at gcc dot gnu.org
2021-11-22 16:08 ` [Bug c++/101731] [9/10/11 " jakub at gcc dot gnu.org
2022-01-21 13:57 ` rguenth at gcc dot gnu.org
2022-05-27  9:45 ` [Bug c++/101731] [10/11 " rguenth at gcc dot gnu.org
2022-06-28 10:45 ` jakub at gcc dot gnu.org
2023-07-07 10:40 ` [Bug c++/101731] [11 " rguenth 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).