http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60198
Bug ID: 60198 Summary: ICE with _Cilk_spawn in expression within template function Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: reichelt at gcc dot gnu.org The following valid(?) code snippet (compiled with "-fcilkplus") triggers an ICE on trunk: =========================================== template<typename T> int foo() { int i = (_Cilk_spawn foo<T>()) + 0; return i; } template int foo<int>(); =========================================== bug.cc: In instantiation of 'int foo() [with T = int]': bug.cc:7:23: required from here bug.cc:3:31: internal compiler error: in tsubst_copy, at cp/pt.c:12887 int i = (_Cilk_spawn foo<T>()) + 0; ^ 0x62a933 tsubst_copy ../../gcc/gcc/cp/pt.c:12887 0x607956 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool) ../../gcc/gcc/cp/pt.c:15110 0x608fda tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool) ../../gcc/gcc/cp/pt.c:14188 0x6115c6 tsubst_expr ../../gcc/gcc/cp/pt.c:13812 0x61435d tsubst_expr ../../gcc/gcc/cp/pt.c:13327 0x611093 tsubst_expr ../../gcc/gcc/cp/pt.c:13219 0x61208c tsubst_expr ../../gcc/gcc/cp/pt.c:13424 0x60f2a9 instantiate_decl(tree_node*, int, bool) ../../gcc/gcc/cp/pt.c:19690 0x64d8c7 instantiate_pending_templates(int) ../../gcc/gcc/cp/pt.c:19806 0x688bed cp_write_global_declarations() ../../gcc/gcc/cp/decl2.c:4148 Please submit a full bug report, [etc.]