public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/99137] New: ICE in gimplify_scan_omp_clauses, at gimplify.c:9833
@ 2021-02-17 18:06 gscfq@t-online.de
  2021-02-17 18:11 ` [Bug c/99137] " jakub at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: gscfq@t-online.de @ 2021-02-17 18:06 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 99137
           Summary: ICE in gimplify_scan_omp_clauses, at gimplify.c:9833
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gscfq@t-online.de
  Target Milestone: ---

Affects versions down to at least r5 :


$ cat z1.c
void f ()
{
  #pragma acc parallel async(1,2)
  ;
}


$ gcc-11-20210214 -c z1.c -fopenacc
z1.c: In function 'f':
z1.c:3:31: internal compiler error: in gimplify_expr, at gimplify.c:14854
    3 |   #pragma acc parallel async(1,2)
      |                               ^
0x8fe7b1 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc/gimplify.c:14854
0x8f5ecf gimplify_scan_omp_clauses
        ../../gcc/gimplify.c:9833
0x8fa488 gimplify_omp_workshare
        ../../gcc/gimplify.c:13248
0x8fb1ba gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc/gimplify.c:14599
0x8fe8d8 gimplify_stmt(tree_node**, gimple**)
        ../../gcc/gimplify.c:6876
0x8fee31 gimplify_bind_expr
        ../../gcc/gimplify.c:1421
0x8fc9d2 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc/gimplify.c:14271
0x8fe8d8 gimplify_stmt(tree_node**, gimple**)
        ../../gcc/gimplify.c:6876
0x8ff8fd gimplify_body(tree_node*, bool)
        ../../gcc/gimplify.c:15306
0x8ffd5f gimplify_function_tree(tree_node*)
        ../../gcc/gimplify.c:15460
0x79cb67 cgraph_node::analyze()
        ../../gcc/cgraphunit.c:670
0x79f4a7 analyze_functions
        ../../gcc/cgraphunit.c:1233
0x79fdfd symbol_table::finalize_compilation_unit()
        ../../gcc/cgraphunit.c:2511

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

* [Bug c/99137] ICE in gimplify_scan_omp_clauses, at gimplify.c:9833
  2021-02-17 18:06 [Bug c/99137] New: ICE in gimplify_scan_omp_clauses, at gimplify.c:9833 gscfq@t-online.de
@ 2021-02-17 18:11 ` jakub at gcc dot gnu.org
  2021-02-18  9:36 ` tschwinge at gcc dot gnu.org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-02-17 18:11 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2021-02-17
                 CC|                            |burnus at gcc dot gnu.org,
                   |                            |jakub at gcc dot gnu.org,
                   |                            |tschwinge at gcc dot gnu.org
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Not a regression, ICEs since r5-6458-g41dbbb3789850dfea98dd8984f69806284f87b6e
when -fopenacc support has been introduced.

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

* [Bug c/99137] ICE in gimplify_scan_omp_clauses, at gimplify.c:9833
  2021-02-17 18:06 [Bug c/99137] New: ICE in gimplify_scan_omp_clauses, at gimplify.c:9833 gscfq@t-online.de
  2021-02-17 18:11 ` [Bug c/99137] " jakub at gcc dot gnu.org
@ 2021-02-18  9:36 ` tschwinge at gcc dot gnu.org
  2021-02-18  9:44 ` jakub at gcc dot gnu.org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: tschwinge at gcc dot gnu.org @ 2021-02-18  9:36 UTC (permalink / raw)
  To: gcc-bugs

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

Thomas Schwinge <tschwinge at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|openmp                      |openacc
             Target|x86_64-pc-linux-gnu         |

--- Comment #2 from Thomas Schwinge <tschwinge at gcc dot gnu.org> ---
First need to clarify if this is really 'ice-on-invalid-code' or maybe
'ice-on-valid-code'?  This depends on interpretation of the comma: is 'async(1,
2)' an invalid list, or is this a C/C++ comma operator, where '1, 2' simply
evaluates to '2'?

There are other clauses that do take a list (for example: 'wait(1, 2)'), so I
would assume that the intention is not that different clauses have different
behavior regarding interpretation of the comma, so indeed 'async(1, 2)' should
be rejected at parse-time.  I have however not yet looked up what the OpenACC
specification says about this.

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

* [Bug c/99137] ICE in gimplify_scan_omp_clauses, at gimplify.c:9833
  2021-02-17 18:06 [Bug c/99137] New: ICE in gimplify_scan_omp_clauses, at gimplify.c:9833 gscfq@t-online.de
  2021-02-17 18:11 ` [Bug c/99137] " jakub at gcc dot gnu.org
  2021-02-18  9:36 ` tschwinge at gcc dot gnu.org
@ 2021-02-18  9:44 ` jakub at gcc dot gnu.org
  2021-02-18  9:58 ` tschwinge at gcc dot gnu.org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-02-18  9:44 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
ice-on-invalid-code is when an error should be reported and instead of that the
compiler crashes.
ice-on-valid-code is when the code should compile without errors (perhaps with
warnings, and not considering warnings promoted to errors) but the compiler
crashes on it instead.
I have no idea what OpenACC says about this if anything, in OpenMP we've
clarified that in clauses all the expressions in the grammar except a few
explicitly mentioned cases are assignment expressions and so commas should
appear there only nested, like schedule(static, (1, 2)) is valid, while
schedule(static, 1, 2) is invalid.
"Each of the expressions used in the OpenMP syntax inside of the clauses must
be a valid assignment-expression of the base language unless otherwise
specified."

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

* [Bug c/99137] ICE in gimplify_scan_omp_clauses, at gimplify.c:9833
  2021-02-17 18:06 [Bug c/99137] New: ICE in gimplify_scan_omp_clauses, at gimplify.c:9833 gscfq@t-online.de
                   ` (2 preceding siblings ...)
  2021-02-18  9:44 ` jakub at gcc dot gnu.org
@ 2021-02-18  9:58 ` tschwinge at gcc dot gnu.org
  2021-02-19 15:08 ` burnus at gcc dot gnu.org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: tschwinge at gcc dot gnu.org @ 2021-02-18  9:58 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Thomas Schwinge <tschwinge at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #3)
> ice-on-invalid-code is when an error should be reported and instead of that
> the compiler crashes.
> ice-on-valid-code is when the code should compile without errors (perhaps
> with warnings, and not considering warnings promoted to errors) but the
> compiler crashes on it instead.

Sure, I understand that.  ICE is certainly bad, but I did wonder if this is
'ice-on-invalid-code' (should get error diagnostic instead of ICE), or
'ice-on-valid-code' (should accept this code; 'async(1, 2)' evaluates to
'async(2)').

> I have no idea what OpenACC says about this if anything

I've filed <https://github.com/OpenACC/openacc-spec/issues/354> "What does
'async(1, 2)' mean?" (only visible to members of OpenACC GitHub).

> in OpenMP [...]

Thanks, that makes much sense to me.

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

* [Bug c/99137] ICE in gimplify_scan_omp_clauses, at gimplify.c:9833
  2021-02-17 18:06 [Bug c/99137] New: ICE in gimplify_scan_omp_clauses, at gimplify.c:9833 gscfq@t-online.de
                   ` (3 preceding siblings ...)
  2021-02-18  9:58 ` tschwinge at gcc dot gnu.org
@ 2021-02-19 15:08 ` burnus at gcc dot gnu.org
  2021-03-05 10:42 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: burnus at gcc dot gnu.org @ 2021-02-19 15:08 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Iff it is decided that it is invalid code, the following patch rejects it:
https://gcc.gnu.org/pipermail/gcc-patches/2021-February/565576.html

(I forgot to reload the PR before posting.)

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

* [Bug c/99137] ICE in gimplify_scan_omp_clauses, at gimplify.c:9833
  2021-02-17 18:06 [Bug c/99137] New: ICE in gimplify_scan_omp_clauses, at gimplify.c:9833 gscfq@t-online.de
                   ` (4 preceding siblings ...)
  2021-02-19 15:08 ` burnus at gcc dot gnu.org
@ 2021-03-05 10:42 ` cvs-commit at gcc dot gnu.org
  2021-03-06 10:21 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-03-05 10:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tobias Burnus <burnus@gcc.gnu.org>:

https://gcc.gnu.org/g:6ddedd3efa3fe482f76a4037521a06b3ac9f2a8b

commit r11-7520-g6ddedd3efa3fe482f76a4037521a06b3ac9f2a8b
Author: Tobias Burnus <tobias@codesourcery.com>
Date:   Fri Mar 5 11:41:44 2021 +0100

    OpenACC: C/C++ - fix async parsing [PR99137]

    gcc/c/ChangeLog:

            PR c/99137
            * c-parser.c (c_parser_oacc_clause_async): Reject comma
expressions.

    gcc/cp/ChangeLog:

            PR c/99137
            * parser.c (cp_parser_oacc_clause_async): Reject comma expressions.

    gcc/testsuite/ChangeLog:

            PR c/99137
            * c-c++-common/goacc/asyncwait-1.c: Update dg-error; add
            additional test.

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

* [Bug c/99137] ICE in gimplify_scan_omp_clauses, at gimplify.c:9833
  2021-02-17 18:06 [Bug c/99137] New: ICE in gimplify_scan_omp_clauses, at gimplify.c:9833 gscfq@t-online.de
                   ` (5 preceding siblings ...)
  2021-03-05 10:42 ` cvs-commit at gcc dot gnu.org
@ 2021-03-06 10:21 ` cvs-commit at gcc dot gnu.org
  2021-03-06 10:51 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-03-06 10:21 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Tobias Burnus
<burnus@gcc.gnu.org>:

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

commit r10-9419-ged8fede89a705b031d3123c502717d7bc8b29320
Author: Tobias Burnus <tobias@codesourcery.com>
Date:   Fri Mar 5 11:41:44 2021 +0100

    OpenACC: C/C++ - fix async parsing [PR99137]

    gcc/c/ChangeLog:

            PR c/99137
            * c-parser.c (c_parser_oacc_clause_async): Reject comma
expressions.

    gcc/cp/ChangeLog:

            PR c/99137
            * parser.c (cp_parser_oacc_clause_async): Reject comma expressions.

    gcc/testsuite/ChangeLog:

            PR c/99137
            * c-c++-common/goacc/asyncwait-1.c: Update dg-error; add
            additional test.

    (cherry picked from commit 6ddedd3efa3fe482f76a4037521a06b3ac9f2a8b)

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

* [Bug c/99137] ICE in gimplify_scan_omp_clauses, at gimplify.c:9833
  2021-02-17 18:06 [Bug c/99137] New: ICE in gimplify_scan_omp_clauses, at gimplify.c:9833 gscfq@t-online.de
                   ` (6 preceding siblings ...)
  2021-03-06 10:21 ` cvs-commit at gcc dot gnu.org
@ 2021-03-06 10:51 ` cvs-commit at gcc dot gnu.org
  2021-03-06 10:51 ` burnus at gcc dot gnu.org
  2021-07-01  9:36 ` tschwinge at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-03-06 10:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-9 branch has been updated by Tobias Burnus
<burnus@gcc.gnu.org>:

https://gcc.gnu.org/g:47a0284fe7d4c996cc054c13e196ee3983025fb3

commit r9-9270-g47a0284fe7d4c996cc054c13e196ee3983025fb3
Author: Tobias Burnus <tobias@codesourcery.com>
Date:   Fri Mar 5 11:41:44 2021 +0100

    OpenACC: C/C++ - fix async parsing [PR99137]

    gcc/c/ChangeLog:

            PR c/99137
            * c-parser.c (c_parser_oacc_clause_async): Reject comma
expressions.

    gcc/cp/ChangeLog:

            PR c/99137
            * parser.c (cp_parser_oacc_clause_async): Reject comma expressions.

    gcc/testsuite/ChangeLog:

            PR c/99137
            * c-c++-common/goacc/asyncwait-1.c: Update dg-error; add
            additional test.

    (cherry picked from commit 6ddedd3efa3fe482f76a4037521a06b3ac9f2a8b)

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

* [Bug c/99137] ICE in gimplify_scan_omp_clauses, at gimplify.c:9833
  2021-02-17 18:06 [Bug c/99137] New: ICE in gimplify_scan_omp_clauses, at gimplify.c:9833 gscfq@t-online.de
                   ` (7 preceding siblings ...)
  2021-03-06 10:51 ` cvs-commit at gcc dot gnu.org
@ 2021-03-06 10:51 ` burnus at gcc dot gnu.org
  2021-07-01  9:36 ` tschwinge at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: burnus at gcc dot gnu.org @ 2021-03-06 10:51 UTC (permalink / raw)
  To: gcc-bugs

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

Tobias Burnus <burnus at gcc dot gnu.org> changed:

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

--- Comment #9 from Tobias Burnus <burnus at gcc dot gnu.org> ---
FIXED on mainline (GCC 11), GCC 10 and GCC 9.

Thanks for the report!

As mentioned in the patch review at
  https://gcc.gnu.org/pipermail/gcc-patches/2021-March/566298.html
the issue was discussed in a OpenACC spec meeting (Issue 354) and it was agreed
but not yet voted on to use the OpenMP wording (valid assignment-expression).

When writing that patch, I tried to find likewise issues with other clauses.
Unless I missed one in 'gcc' or 'g++', it seems as if only 'async' was
affected.

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

* [Bug c/99137] ICE in gimplify_scan_omp_clauses, at gimplify.c:9833
  2021-02-17 18:06 [Bug c/99137] New: ICE in gimplify_scan_omp_clauses, at gimplify.c:9833 gscfq@t-online.de
                   ` (8 preceding siblings ...)
  2021-03-06 10:51 ` burnus at gcc dot gnu.org
@ 2021-07-01  9:36 ` tschwinge at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: tschwinge at gcc dot gnu.org @ 2021-07-01  9:36 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Thomas Schwinge <tschwinge at gcc dot gnu.org> ---
*** Bug 87912 has been marked as a duplicate of this bug. ***

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

end of thread, other threads:[~2021-07-01  9:36 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-17 18:06 [Bug c/99137] New: ICE in gimplify_scan_omp_clauses, at gimplify.c:9833 gscfq@t-online.de
2021-02-17 18:11 ` [Bug c/99137] " jakub at gcc dot gnu.org
2021-02-18  9:36 ` tschwinge at gcc dot gnu.org
2021-02-18  9:44 ` jakub at gcc dot gnu.org
2021-02-18  9:58 ` tschwinge at gcc dot gnu.org
2021-02-19 15:08 ` burnus at gcc dot gnu.org
2021-03-05 10:42 ` cvs-commit at gcc dot gnu.org
2021-03-06 10:21 ` cvs-commit at gcc dot gnu.org
2021-03-06 10:51 ` cvs-commit at gcc dot gnu.org
2021-03-06 10:51 ` burnus at gcc dot gnu.org
2021-07-01  9:36 ` tschwinge 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).