[Bug c++/81154] OpenMP with shared variable in a template class crash

2017-09-16 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81154

--- Comment #8 from Jakub Jelinek  ---
Author: jakub
Date: Sat Sep 16 18:31:58 2017
New Revision: 252878

URL: https://gcc.gnu.org/viewcvs?rev=252878=gcc=rev
Log:
Backported from mainline
2017-06-21  Jakub Jelinek  

PR c++/81154
* semantics.c (handle_omp_array_sections_1, finish_omp_clauses):
Complain about t not being a variable if t is OVERLOAD even
when processing_template_decl.

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

Added:
branches/gcc-5-branch/gcc/testsuite/g++.dg/gomp/pr81154.C
Modified:
branches/gcc-5-branch/gcc/cp/ChangeLog
branches/gcc-5-branch/gcc/cp/semantics.c
branches/gcc-5-branch/gcc/testsuite/ChangeLog

[Bug c++/81154] OpenMP with shared variable in a template class crash

2017-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81154

Jakub Jelinek  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #7 from Jakub Jelinek  ---
Fixed.

[Bug c++/81154] OpenMP with shared variable in a template class crash

2017-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81154

--- Comment #6 from Jakub Jelinek  ---
Author: jakub
Date: Thu Jun 22 11:34:39 2017
New Revision: 249539

URL: https://gcc.gnu.org/viewcvs?rev=249539=gcc=rev
Log:
Backported from mainline
2017-06-21  Jakub Jelinek  

PR c++/81154
* semantics.c (handle_omp_array_sections_1, finish_omp_clauses):
Complain about t not being a variable if t is OVERLOAD even
when processing_template_decl.

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

Modified:
branches/gcc-6-branch/gcc/cp/ChangeLog
branches/gcc-6-branch/gcc/testsuite/ChangeLog

[Bug c++/81154] OpenMP with shared variable in a template class crash

2017-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81154

--- Comment #5 from Jakub Jelinek  ---
Fixed for 7.2+ so far.

[Bug c++/81154] OpenMP with shared variable in a template class crash

2017-06-21 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81154

--- Comment #4 from Jakub Jelinek  ---
Author: jakub
Date: Wed Jun 21 22:22:05 2017
New Revision: 249483

URL: https://gcc.gnu.org/viewcvs?rev=249483=gcc=rev
Log:
PR c++/81154
* semantics.c (handle_omp_array_sections_1, finish_omp_clauses):
Complain about t not being a variable if t is OVERLOAD even
when processing_template_decl.

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

Added:
branches/gcc-7-branch/gcc/testsuite/g++.dg/gomp/pr81154.C
Modified:
branches/gcc-7-branch/gcc/cp/ChangeLog
branches/gcc-7-branch/gcc/cp/semantics.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug c++/81154] OpenMP with shared variable in a template class crash

2017-06-21 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81154

--- Comment #3 from Jakub Jelinek  ---
Author: jakub
Date: Wed Jun 21 18:30:32 2017
New Revision: 249467

URL: https://gcc.gnu.org/viewcvs?rev=249467=gcc=rev
Log:
PR c++/81154
* semantics.c (handle_omp_array_sections_1, finish_omp_clauses):
Complain about t not being a variable if t is OVERLOAD even
when processing_template_decl.

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

Added:
trunk/gcc/testsuite/g++.dg/gomp/pr81154.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/semantics.c
trunk/gcc/testsuite/ChangeLog

[Bug c++/81154] OpenMP with shared variable in a template class crash

2017-06-21 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81154

Jakub Jelinek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2017-06-21
   Assignee|unassigned at gcc dot gnu.org  |jakub at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #2 from Jakub Jelinek  ---
Created attachment 41602
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41602=edit
gcc8-pr81154.patch

Untested fix.

[Bug c++/81154] OpenMP with shared variable in a template class crash

2017-06-21 Thread mplaneta at os dot inf.tu-dresden.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81154

mplaneta at os dot inf.tu-dresden.de changed:

   What|Removed |Added

 CC||mplaneta at os dot 
inf.tu-dresden.
   ||de

--- Comment #1 from mplaneta at os dot inf.tu-dresden.de ---
The log:

$ gcc a.cpp -fopenmp
a.cpp: In instantiation of ‘double C::overlap_prob(T) const [with T = int]’:
a.cpp:21:29:   required from here
a.cpp:8:9: internal compiler error: in tsubst_copy, at cp/pt.c:14634
 #pragma omp parallel for reduction(+:overlap_prob)
 ^~~
0x612260 tsubst_copy
/dev/shm/schmaik/gcc-7.1.0/gcc/cp/pt.c:14634
0x61bf4e tsubst_copy
/dev/shm/schmaik/gcc-7.1.0/gcc/cp/pt.c:14433
0x61bf4e tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
/dev/shm/schmaik/gcc-7.1.0/gcc/cp/pt.c:17930
0x6107d7 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
/dev/shm/schmaik/gcc-7.1.0/gcc/cp/pt.c:16468
0x6118a2 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
/dev/shm/schmaik/gcc-7.1.0/gcc/cp/pt.c:15704
0x6118a2 tsubst_omp_clause_decl
/dev/shm/schmaik/gcc-7.1.0/gcc/cp/pt.c:15098
0x614f83 tsubst_omp_clauses
/dev/shm/schmaik/gcc-7.1.0/gcc/cp/pt.c:15196
0x610101 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
/dev/shm/schmaik/gcc-7.1.0/gcc/cp/pt.c:16126
0x610685 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
/dev/shm/schmaik/gcc-7.1.0/gcc/cp/pt.c:15719
0x61051b tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
/dev/shm/schmaik/gcc-7.1.0/gcc/cp/pt.c:15945
0x60ecb2 instantiate_decl(tree_node*, bool, bool)
/dev/shm/schmaik/gcc-7.1.0/gcc/cp/pt.c:22897
0x62c5fb instantiate_pending_templates(int)
/dev/shm/schmaik/gcc-7.1.0/gcc/cp/pt.c:23018
0x64c2d0 c_parse_final_cleanups()
/dev/shm/schmaik/gcc-7.1.0/gcc/cp/decl2.c:4526
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.