http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60146
Volker Reichelt <reichelt at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Known to work| |4.7.0 Keywords| |ice-on-valid-code Last reconfirmed| |2014-02-14 CC| |reichelt at gcc dot gnu.org Ever confirmed|0 |1 Summary|Regression: ICE when |[4.8/4.9 Regression] ICE |compiling this code with |when compiling this code |-fopenmp |with -fopenmp Known to fail| |4.8.0, 4.9.0 --- Comment #1 from Volker Reichelt <reichelt at gcc dot gnu.org> --- Confirmed. ICEs since GCC 4.8.0. Reduced testcase: ========================================== int foo() { return 0; } template<typename T> void bar() { #pragma omp parallel for for (T i = foo(); i < 8; ++i) {} } void baz() { bar<int>(); } ========================================== bug.cc: In instantiation of 'void bar() [with T = int]': bug.cc:11:12: required from here bug.cc:6:3: internal compiler error: Segmentation fault for (T i = foo(); i < 8; ++i) {} ^ 0xba523f crash_signal ../../gcc/gcc/toplev.c:337 0x733640 contains_struct_check ../../gcc/gcc/tree.h:2822 0x733640 finish_omp_for(unsigned int, tree_code, tree_node*, tree_node*, tree_node*, tree_node*, tree_node*, tree_node*, tree_node*) ../../gcc/gcc/cp/semantics.c:6434 0x613325 tsubst_expr ../../gcc/gcc/cp/pt.c:13637 0x61250c tsubst_expr ../../gcc/gcc/cp/pt.c:13586 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.]