https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100859
Bug ID: 100859 Summary: ICE in tsubst_omp_clauses, at cp/pt.c:17520 Product: gcc Version: 12.0 Status: UNCONFIRMED Keywords: openmp Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: asolokha at gmx dot com Target Milestone: --- g++-12.0.0-alpha20210530 snapshot (g:a0a7adeea31918deefb053a9a15257af94aecfaf) ICEs when compiling the following testcase, reduced from test/OpenMP/task_ast_print.cpp from the clang 12.0.0 test suite, w/ -fopenmp: struct S1 { S1 () {} }; template <typename T> class S7 { protected: T c[10]; public: S7 () { #pragma omp task affinity (iterator (i = 0 : 10 : 1): c[i]) for (int k = 0; k < 1; ++k) ; } }; struct S8 : public S7<S1> { S8 () : S7<S1> () {} }; % g++-12.0.0 -fopenmp -c jhbrjcts.cpp jhbrjcts.cpp: In instantiation of 'S7<T>::S7() [with T = S1]': jhbrjcts.cpp:19:19: required from here jhbrjcts.cpp:12:9: internal compiler error: in tsubst_omp_clauses, at cp/pt.c:17520 12 | #pragma omp task affinity (iterator (i = 0 : 10 : 1): c[i]) | ^~~ 0x6b8a81 tsubst_omp_clauses /var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210530/work/gcc-12-20210530/gcc/cp/pt.c:17520 0xab7392 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool) /var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210530/work/gcc-12-20210530/gcc/cp/pt.c:18720 0xab726e tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool) /var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210530/work/gcc-12-20210530/gcc/cp/pt.c:18507 0xab7eb2 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool) /var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210530/work/gcc-12-20210530/gcc/cp/pt.c:18142 0xab7eb2 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool) /var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210530/work/gcc-12-20210530/gcc/cp/pt.c:18156 0xab726e tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool) /var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210530/work/gcc-12-20210530/gcc/cp/pt.c:18507 0xabd308 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool) /var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210530/work/gcc-12-20210530/gcc/cp/pt.c:18142 0xabd308 instantiate_body /var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210530/work/gcc-12-20210530/gcc/cp/pt.c:25843 0xabe502 instantiate_decl(tree_node*, bool, bool) /var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210530/work/gcc-12-20210530/gcc/cp/pt.c:26137 0xae36ab instantiate_pending_templates(int) /var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210530/work/gcc-12-20210530/gcc/cp/pt.c:26216 0x9a4d7b c_parse_final_cleanups() /var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210530/work/gcc-12-20210530/gcc/cp/decl2.c:4966