public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/98185] New: [9/10/11 Regression] ICE in cp_genericize_r, at cp/cp-gimplify.c:1240
@ 2020-12-07 17:55 gscfq@t-online.de
  2020-12-08  5:31 ` [Bug c++/98185] " marxin at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: gscfq@t-online.de @ 2020-12-07 17:55 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 98185
           Summary: [9/10/11 Regression] ICE in cp_genericize_r, at
                    cp/cp-gimplify.c:1240
           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: ---

Using testfile gcc/testsuite/c-c++-common/gomp/master-combined-1.c
Affects g++ versions down to r9 (gcc-11 accepts it) :


$ g++-8           -c master-combined-1.c -fopenmp-simd
$ g++-11-20201206 -c master-combined-1.c -fopenmp
$
$ g++-11-20201206 -c master-combined-1.c -fopenmp-simd
master-combined-1.c: In function 'void foo(int*)':
master-combined-1.c:31:1: internal compiler error: tree check: expected
omp_clause, have <invalid tree code> in cp_genericize_r, at
cp/cp-gimplify.c:1240
   31 | }
      | ^
0x64d58a tree_check_failed(tree_node const*, char const*, int, char const*,
...)
        ../../gcc/tree.c:9810
0x726b75 tree_check(tree_node*, char const*, int, char const*, tree_code)
        ../../gcc/tree.h:3335
0x726b75 cp_genericize_r
        ../../gcc/cp/cp-gimplify.c:1240
0x12ccfb3 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*))
        ../../gcc/tree.c:12095
0x724b6d cp_genericize_r
        ../../gcc/cp/cp-gimplify.c:1474
0x12ccfb3 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*))
        ../../gcc/tree.c:12095
0x726115 cp_genericize_r
        ../../gcc/cp/cp-gimplify.c:1166
0x12ccfb3 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*))
        ../../gcc/tree.c:12095
0x723468 cp_genericize_tree
        ../../gcc/cp/cp-gimplify.c:1592
0x7236e6 cp_genericize(tree_node*)
        ../../gcc/cp/cp-gimplify.c:1738
0x779627 finish_function(bool)
        ../../gcc/cp/decl.c:17268
0x856e5e cp_parser_function_definition_after_declarator
        ../../gcc/cp/parser.c:29546
0x858015 cp_parser_function_definition_from_specifiers_and_declarator
        ../../gcc/cp/parser.c:29459
0x858015 cp_parser_init_declarator
        ../../gcc/cp/parser.c:21175
0x832f4a cp_parser_simple_declaration
        ../../gcc/cp/parser.c:13995
0x8609e2 cp_parser_declaration
        ../../gcc/cp/parser.c:13692
0x8613c8 cp_parser_translation_unit
        ../../gcc/cp/parser.c:4806
0x8613c8 c_parse_file()
        ../../gcc/cp/parser.c:44681
0x9d7862 c_common_parse_file()
        ../../gcc/c-family/c-opts.c:1211

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

* [Bug c++/98185] [9/10/11 Regression] ICE in cp_genericize_r, at cp/cp-gimplify.c:1240
  2020-12-07 17:55 [Bug c++/98185] New: [9/10/11 Regression] ICE in cp_genericize_r, at cp/cp-gimplify.c:1240 gscfq@t-online.de
@ 2020-12-08  5:31 ` marxin at gcc dot gnu.org
  2020-12-08  7:21 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-12-08  5:31 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2020-12-08
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |WAITING
                 CC|                            |marxin at gcc dot gnu.org

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
I can't see the ICE. Moreover, g++ rejects the code:

g++
/home/marxin/Programming/gcc/gcc/testsuite/c-c++-common/gomp/master-combined-1.c
-c -fopenmp-simd
/home/marxin/Programming/gcc/gcc/testsuite/c-c++-common/gomp/master-combined-1.c:
In function ‘void foo(int*)’:
/home/marxin/Programming/gcc/gcc/testsuite/c-c++-common/gomp/master-combined-1.c:26:3:
error: ‘v’ not specified in enclosing ‘parallel’
   26 |   for (i = 0; i < 64; i++)
      |   ^~~
/home/marxin/Programming/gcc/gcc/testsuite/c-c++-common/gomp/master-combined-1.c:25:11:
note: enclosing ‘parallel’
   25 |   #pragma omp parallel master taskloop simd reduction (+:v)
default(none) firstprivate(a)
      |           ^~~
/home/marxin/Programming/gcc/gcc/testsuite/c-c++-common/gomp/master-combined-1.c:27:13:
error: ‘a’ not specified in enclosing ‘parallel’
   27 |     v += a[i];
      |             ^
/home/marxin/Programming/gcc/gcc/testsuite/c-c++-common/gomp/master-combined-1.c:25:11:
note: enclosing ‘parallel’
   25 |   #pragma omp parallel master taskloop simd reduction (+:v)
default(none) firstprivate(a)
      |           ^~~
/home/marxin/Programming/gcc/gcc/testsuite/c-c++-common/gomp/master-combined-1.c:29:3:
error: ‘w’ not specified in enclosing ‘parallel’
   29 |   for (j = 0; j < 1; j++)
      |   ^~~
/home/marxin/Programming/gcc/gcc/testsuite/c-c++-common/gomp/master-combined-1.c:28:11:
note: enclosing ‘parallel’
   28 |   #pragma omp parallel master taskloop simd collapse(2) reduction (+:w)
default(none) firstprivate(a)
      |           ^~~
/home/marxin/Programming/gcc/gcc/testsuite/c-c++-common/gomp/master-combined-1.c:31:15:
error: ‘a’ not specified in enclosing ‘parallel’
   31 |       w += a[i];
      |               ^
/home/marxin/Programming/gcc/gcc/testsuite/c-c++-common/gomp/master-combined-1.c:28:11:
note: enclosing ‘parallel’
   28 |   #pragma omp parallel master taskloop simd collapse(2) reduction (+:w)
default(none) firstprivate(a)
      |           ^~~

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

* [Bug c++/98185] [9/10/11 Regression] ICE in cp_genericize_r, at cp/cp-gimplify.c:1240
  2020-12-07 17:55 [Bug c++/98185] New: [9/10/11 Regression] ICE in cp_genericize_r, at cp/cp-gimplify.c:1240 gscfq@t-online.de
  2020-12-08  5:31 ` [Bug c++/98185] " marxin at gcc dot gnu.org
@ 2020-12-08  7:21 ` rguenth at gcc dot gnu.org
  2020-12-08  9:29 ` gscfq@t-online.de
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-12-08  7:21 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |9.4

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

* [Bug c++/98185] [9/10/11 Regression] ICE in cp_genericize_r, at cp/cp-gimplify.c:1240
  2020-12-07 17:55 [Bug c++/98185] New: [9/10/11 Regression] ICE in cp_genericize_r, at cp/cp-gimplify.c:1240 gscfq@t-online.de
  2020-12-08  5:31 ` [Bug c++/98185] " marxin at gcc dot gnu.org
  2020-12-08  7:21 ` rguenth at gcc dot gnu.org
@ 2020-12-08  9:29 ` gscfq@t-online.de
  2020-12-08  9:34 ` marxin at gcc dot gnu.org
  2020-12-08 10:00 ` jakub at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: gscfq@t-online.de @ 2020-12-08  9:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from G. Steinmetz <gscfq@t-online.de> ---

Hmm, trying to provide some reductions along different paths :
(iff there is no g++/gcc ICE, this PR can be closed then)
(will eventually retry with some future snapshots)


$ cat z1.C
void
foo (int *a)
{
  #pragma omp parallel master default(none) private (k)
}


$ cat z2.C
void
foo (int *a)
{
  int i, j, k, u = 0, v = 0, w = 0, x = 0, y = 0, z = 0;
 z += a[i];
  #pragma omp parallel master taskloop reduction (+:u) default(none)
firstprivate(a)
}


$ cat z3.C
void bar (int *);
void
foo (int *a)
{
  int i, j, k, u = 0, v = 0, w = 0, x = 0, y = 0, z = 0;
  {
 z += a[i];
  }
  #pragma omp parallel master taskloop reduction (+:u) default(none)
firstprivate(a)
}


$ cat z4.C
void
foo (int *a)
{
  int i, j, k, u = 0, v = 0, w = 0, x = 0, y = 0, z = 0;
  {
    for (i = 0; i < 64; i++)
      for (i = 0; i < 64; ++i)
 z += a[i];
  }
  #pragma omp parallel master taskloop reduction (+:u) default(none)
firstprivate(a)
}


Yields :

z1.C:5:1: internal compiler error: Segmentation fault, in cp_genericize_r at
cp/cp-gimplify.c:1240
z1.C:5:1: internal compiler error: tree check: expected omp_clause, have
<invalid tree code> in cp_genericize_r, at cp/cp-gimplify.c:1240
z2.C:7:1: internal compiler error: Segmentation fault, in cp_fold at
cp/cp-gimplify.c:2223
z3.C:9:85: internal compiler error: in gimplify_scan_omp_clauses, at
gimplify.c:9983
z3.C:10:1: internal compiler error: tree check: expected omp_clause, have
<invalid tree code> in cp_genericize_r, at cp/cp-gimplify.c:1240
z4.C:11:1: internal compiler error: in tsi_link_after, at tree-iterator.c:193

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

* [Bug c++/98185] [9/10/11 Regression] ICE in cp_genericize_r, at cp/cp-gimplify.c:1240
  2020-12-07 17:55 [Bug c++/98185] New: [9/10/11 Regression] ICE in cp_genericize_r, at cp/cp-gimplify.c:1240 gscfq@t-online.de
                   ` (2 preceding siblings ...)
  2020-12-08  9:29 ` gscfq@t-online.de
@ 2020-12-08  9:34 ` marxin at gcc dot gnu.org
  2020-12-08 10:00 ` jakub at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-12-08  9:34 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

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

--- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> ---
Confirmed for the test-cases. I guess Jakub will take a look.

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

* [Bug c++/98185] [9/10/11 Regression] ICE in cp_genericize_r, at cp/cp-gimplify.c:1240
  2020-12-07 17:55 [Bug c++/98185] New: [9/10/11 Regression] ICE in cp_genericize_r, at cp/cp-gimplify.c:1240 gscfq@t-online.de
                   ` (3 preceding siblings ...)
  2020-12-08  9:34 ` marxin at gcc dot gnu.org
@ 2020-12-08 10:00 ` jakub at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-12-08 10:00 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Dup too.

*** This bug has been marked as a duplicate of bug 98187 ***

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

end of thread, other threads:[~2020-12-08 10:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-07 17:55 [Bug c++/98185] New: [9/10/11 Regression] ICE in cp_genericize_r, at cp/cp-gimplify.c:1240 gscfq@t-online.de
2020-12-08  5:31 ` [Bug c++/98185] " marxin at gcc dot gnu.org
2020-12-08  7:21 ` rguenth at gcc dot gnu.org
2020-12-08  9:29 ` gscfq@t-online.de
2020-12-08  9:34 ` marxin at gcc dot gnu.org
2020-12-08 10:00 ` 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).