public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/101516] New: [10/11/12 Regression] ICE in finish_omp_reduction_clause, at cp/semantics.c:6075
@ 2021-07-19 17:29 gscfq@t-online.de
  2021-07-20  9:45 ` [Bug c++/101516] " rguenth at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: gscfq@t-online.de @ 2021-07-19 17:29 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 101516
           Summary: [10/11/12 Regression] ICE in
                    finish_omp_reduction_clause, at cp/semantics.c:6075
           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 r10 between 20191006 and 20191013 :


$ cat z1.cc
template <typename T> void foo (T, T[], T *, int, int (& v)[], int *)
{
  #pragma omp parallel reduction (+:v) allocate(v)
  ;
}
void test ()
  {
  long x;
  long y[] {};
  long * z;
  int u;
  int v[4];
  int * w;
  foo (x, y, z, u, v, w);
}


$ g++-12-20210718 -c z1.cc -fopenmp
z1.cc: In instantiation of 'void foo(T, T*, T*, int, int (&)[], int*) [with T =
long int]':
z1.cc:14:7:   required from here
z1.cc:3:11: internal compiler error: Segmentation fault
    3 |   #pragma omp parallel reduction (+:v) allocate(v)
      |           ^~~
0xd6d5af crash_signal
        ../../gcc/toplev.c:328
0xa9bbdf size_binop_loc(unsigned int, tree_code, tree_node*, tree_node*)
        ../../gcc/fold-const.c:1897
0x87082d finish_omp_reduction_clause
        ../../gcc/cp/semantics.c:6075
0x87082d finish_omp_clauses(tree_node*, c_omp_region_type)
        ../../gcc/cp/semantics.c:8597
0x846fe0 tsubst_omp_clauses
        ../../gcc/cp/pt.c:17555
0x841f9a tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc/cp/pt.c:18669
0x841f47 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc/cp/pt.c:18479
0x8367d1 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc/cp/pt.c:25869
0x8367d1 instantiate_body
        ../../gcc/cp/pt.c:25869
0x837789 instantiate_decl(tree_node*, bool, bool)
        ../../gcc/cp/pt.c:26162
0x85152b instantiate_pending_templates(int)
        ../../gcc/cp/pt.c:26241
0x765822 c_parse_final_cleanups()
        ../../gcc/cp/decl2.c:4991

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

* [Bug c++/101516] [10/11/12 Regression] ICE in finish_omp_reduction_clause, at cp/semantics.c:6075
  2021-07-19 17:29 [Bug c++/101516] New: [10/11/12 Regression] ICE in finish_omp_reduction_clause, at cp/semantics.c:6075 gscfq@t-online.de
@ 2021-07-20  9:45 ` rguenth at gcc dot gnu.org
  2021-07-20 11:50 ` [Bug c++/101516] [9/10/11/12 " jakub at gcc dot gnu.org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-07-20  9:45 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

* [Bug c++/101516] [9/10/11/12 Regression] ICE in finish_omp_reduction_clause, at cp/semantics.c:6075
  2021-07-19 17:29 [Bug c++/101516] New: [10/11/12 Regression] ICE in finish_omp_reduction_clause, at cp/semantics.c:6075 gscfq@t-online.de
  2021-07-20  9:45 ` [Bug c++/101516] " rguenth at gcc dot gnu.org
@ 2021-07-20 11:50 ` jakub at gcc dot gnu.org
  2021-07-20 11:50 ` jakub at gcc dot gnu.org
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-07-20 11:50 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[10/11/12 Regression] ICE   |[9/10/11/12 Regression] ICE
                   |in                          |in
                   |finish_omp_reduction_clause |finish_omp_reduction_clause
                   |, at cp/semantics.c:6075    |, at cp/semantics.c:6075
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Reduced testcase:
void
foo (int (&v) [])
{
  #pragma omp parallel reduction (+:v)
  ;
}
Started with r6-3899-gd9a6bd32adc40a7e1e5c72692a330f14453ad7f0
The allocate clause there isn't really needed, but with it it will be rejected
when it wasn't supported.

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

* [Bug c++/101516] [9/10/11/12 Regression] ICE in finish_omp_reduction_clause, at cp/semantics.c:6075
  2021-07-19 17:29 [Bug c++/101516] New: [10/11/12 Regression] ICE in finish_omp_reduction_clause, at cp/semantics.c:6075 gscfq@t-online.de
  2021-07-20  9:45 ` [Bug c++/101516] " rguenth at gcc dot gnu.org
  2021-07-20 11:50 ` [Bug c++/101516] [9/10/11/12 " jakub at gcc dot gnu.org
@ 2021-07-20 11:50 ` jakub at gcc dot gnu.org
  2021-07-20 12:02 ` jakub at gcc dot gnu.org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-07-20 11:50 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Target Milestone|10.4                        |9.5
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2021-07-20
           Assignee|unassigned at gcc dot gnu.org      |jakub at gcc dot gnu.org

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

* [Bug c++/101516] [9/10/11/12 Regression] ICE in finish_omp_reduction_clause, at cp/semantics.c:6075
  2021-07-19 17:29 [Bug c++/101516] New: [10/11/12 Regression] ICE in finish_omp_reduction_clause, at cp/semantics.c:6075 gscfq@t-online.de
                   ` (2 preceding siblings ...)
  2021-07-20 11:50 ` jakub at gcc dot gnu.org
@ 2021-07-20 12:02 ` jakub at gcc dot gnu.org
  2021-07-20 12:02 ` jakub at gcc dot gnu.org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-07-20 12:02 UTC (permalink / raw)
  To: gcc-bugs

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

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

Untested fix.

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

* [Bug c++/101516] [9/10/11/12 Regression] ICE in finish_omp_reduction_clause, at cp/semantics.c:6075
  2021-07-19 17:29 [Bug c++/101516] New: [10/11/12 Regression] ICE in finish_omp_reduction_clause, at cp/semantics.c:6075 gscfq@t-online.de
                   ` (3 preceding siblings ...)
  2021-07-20 12:02 ` jakub at gcc dot gnu.org
@ 2021-07-20 12:02 ` jakub at gcc dot gnu.org
  2021-07-21  7:40 ` 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-07-20 12:02 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-invalid-code
           Priority|P3                          |P2

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

* [Bug c++/101516] [9/10/11/12 Regression] ICE in finish_omp_reduction_clause, at cp/semantics.c:6075
  2021-07-19 17:29 [Bug c++/101516] New: [10/11/12 Regression] ICE in finish_omp_reduction_clause, at cp/semantics.c:6075 gscfq@t-online.de
                   ` (4 preceding siblings ...)
  2021-07-20 12:02 ` jakub at gcc dot gnu.org
@ 2021-07-21  7:40 ` cvs-commit at gcc dot gnu.org
  2021-07-21  8:22 ` cvs-commit 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-07-21  7:40 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 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:aea199f96cf116ba4c81426207acde371556610c

commit r12-2432-gaea199f96cf116ba4c81426207acde371556610c
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Wed Jul 21 09:38:59 2021 +0200

    c++: Ensure OpenMP reduction with reference type references complete type
[PR101516]

    The following testcase ICEs because we haven't verified if reduction decl
    has reference type that TREE_TYPE of the reference is a complete type,
    require_complete_type on the decl doesn't ensure that.

    2021-07-21  Jakub Jelinek  <jakub@redhat.com>

            PR c++/101516
            * semantics.c (finish_omp_reduction_clause): Also call
            complete_type_or_else and return true if it fails.

            * g++.dg/gomp/pr101516.C: New test.

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

* [Bug c++/101516] [9/10/11/12 Regression] ICE in finish_omp_reduction_clause, at cp/semantics.c:6075
  2021-07-19 17:29 [Bug c++/101516] New: [10/11/12 Regression] ICE in finish_omp_reduction_clause, at cp/semantics.c:6075 gscfq@t-online.de
                   ` (5 preceding siblings ...)
  2021-07-21  7:40 ` cvs-commit at gcc dot gnu.org
@ 2021-07-21  8:22 ` cvs-commit at gcc dot gnu.org
  2021-07-21  8:28 ` [Bug c++/101516] [9/10 " jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-07-21  8:22 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 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:ae2ce6aadbfd211162b4232e413f9fc2ba873cb4

commit r11-8791-gae2ce6aadbfd211162b4232e413f9fc2ba873cb4
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Wed Jul 21 09:38:59 2021 +0200

    c++: Ensure OpenMP reduction with reference type references complete type
[PR101516]

    The following testcase ICEs because we haven't verified if reduction decl
    has reference type that TREE_TYPE of the reference is a complete type,
    require_complete_type on the decl doesn't ensure that.

    2021-07-21  Jakub Jelinek  <jakub@redhat.com>

            PR c++/101516
            * semantics.c (finish_omp_reduction_clause): Also call
            complete_type_or_else and return true if it fails.

            * g++.dg/gomp/pr101516.C: New test.

    (cherry picked from commit aea199f96cf116ba4c81426207acde371556610c)

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

* [Bug c++/101516] [9/10 Regression] ICE in finish_omp_reduction_clause, at cp/semantics.c:6075
  2021-07-19 17:29 [Bug c++/101516] New: [10/11/12 Regression] ICE in finish_omp_reduction_clause, at cp/semantics.c:6075 gscfq@t-online.de
                   ` (6 preceding siblings ...)
  2021-07-21  8:22 ` cvs-commit at gcc dot gnu.org
@ 2021-07-21  8:28 ` jakub at gcc dot gnu.org
  2022-05-10  8:20 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-07-21  8:28 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[9/10/11/12 Regression] ICE |[9/10 Regression] ICE in
                   |in                          |finish_omp_reduction_clause
                   |finish_omp_reduction_clause |, at cp/semantics.c:6075
                   |, at cp/semantics.c:6075    |

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed for 11.2 and trunk so far.

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

* [Bug c++/101516] [9/10 Regression] ICE in finish_omp_reduction_clause, at cp/semantics.c:6075
  2021-07-19 17:29 [Bug c++/101516] New: [10/11/12 Regression] ICE in finish_omp_reduction_clause, at cp/semantics.c:6075 gscfq@t-online.de
                   ` (7 preceding siblings ...)
  2021-07-21  8:28 ` [Bug c++/101516] [9/10 " jakub at gcc dot gnu.org
@ 2022-05-10  8:20 ` cvs-commit at gcc dot gnu.org
  2022-05-11  6:21 ` cvs-commit at gcc dot gnu.org
  2022-05-11  6:36 ` jakub at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-05-10  8:20 UTC (permalink / raw)
  To: gcc-bugs

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

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

https://gcc.gnu.org/g:17a947ee50f8b8e01022a31bc69729f2dc563dd8

commit r10-10636-g17a947ee50f8b8e01022a31bc69729f2dc563dd8
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Wed Jul 21 09:38:59 2021 +0200

    c++: Ensure OpenMP reduction with reference type references complete type
[PR101516]

    The following testcase ICEs because we haven't verified if reduction decl
    has reference type that TREE_TYPE of the reference is a complete type,
    require_complete_type on the decl doesn't ensure that.

    2021-07-21  Jakub Jelinek  <jakub@redhat.com>

            PR c++/101516
            * semantics.c (finish_omp_reduction_clause): Also call
            complete_type_or_else and return true if it fails.

            * g++.dg/gomp/pr101516.C: New test.

    (cherry picked from commit aea199f96cf116ba4c81426207acde371556610c)

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

* [Bug c++/101516] [9/10 Regression] ICE in finish_omp_reduction_clause, at cp/semantics.c:6075
  2021-07-19 17:29 [Bug c++/101516] New: [10/11/12 Regression] ICE in finish_omp_reduction_clause, at cp/semantics.c:6075 gscfq@t-online.de
                   ` (8 preceding siblings ...)
  2022-05-10  8:20 ` cvs-commit at gcc dot gnu.org
@ 2022-05-11  6:21 ` cvs-commit at gcc dot gnu.org
  2022-05-11  6:36 ` jakub at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-05-11  6:21 UTC (permalink / raw)
  To: gcc-bugs

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

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

https://gcc.gnu.org/g:36eef10e03247077cf3e4d2478d00eb0e8fc87d7

commit r9-10093-g36eef10e03247077cf3e4d2478d00eb0e8fc87d7
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Wed Jul 21 09:38:59 2021 +0200

    c++: Ensure OpenMP reduction with reference type references complete type
[PR101516]

    The following testcase ICEs because we haven't verified if reduction decl
    has reference type that TREE_TYPE of the reference is a complete type,
    require_complete_type on the decl doesn't ensure that.

    2021-07-21  Jakub Jelinek  <jakub@redhat.com>

            PR c++/101516
            * semantics.c (finish_omp_reduction_clause): Also call
            complete_type_or_else and return true if it fails.

            * g++.dg/gomp/pr101516.C: New test.

    (cherry picked from commit aea199f96cf116ba4c81426207acde371556610c)

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

* [Bug c++/101516] [9/10 Regression] ICE in finish_omp_reduction_clause, at cp/semantics.c:6075
  2021-07-19 17:29 [Bug c++/101516] New: [10/11/12 Regression] ICE in finish_omp_reduction_clause, at cp/semantics.c:6075 gscfq@t-online.de
                   ` (9 preceding siblings ...)
  2022-05-11  6:21 ` cvs-commit at gcc dot gnu.org
@ 2022-05-11  6:36 ` jakub at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-05-11  6:36 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

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

end of thread, other threads:[~2022-05-11  6:36 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-19 17:29 [Bug c++/101516] New: [10/11/12 Regression] ICE in finish_omp_reduction_clause, at cp/semantics.c:6075 gscfq@t-online.de
2021-07-20  9:45 ` [Bug c++/101516] " rguenth at gcc dot gnu.org
2021-07-20 11:50 ` [Bug c++/101516] [9/10/11/12 " jakub at gcc dot gnu.org
2021-07-20 11:50 ` jakub at gcc dot gnu.org
2021-07-20 12:02 ` jakub at gcc dot gnu.org
2021-07-20 12:02 ` jakub at gcc dot gnu.org
2021-07-21  7:40 ` cvs-commit at gcc dot gnu.org
2021-07-21  8:22 ` cvs-commit at gcc dot gnu.org
2021-07-21  8:28 ` [Bug c++/101516] [9/10 " jakub at gcc dot gnu.org
2022-05-10  8:20 ` cvs-commit at gcc dot gnu.org
2022-05-11  6:21 ` cvs-commit at gcc dot gnu.org
2022-05-11  6:36 ` 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).