2017-01-12 64 views
0

[修正] - 在评论内部编译错误C++的Cilk加

给出解释[更新,错误画面]
使用gcc/5.4.0编译时,我得到一个编译错误。以下是报告的错误:

internal compiler error: in lower_stmt, at gimple-low.c:397 cilk_spawn m_sparsify_graph_helper__(mdl, n_pa, n_ch, score2beat);

以下是导致代码片段错误:

void m_sparsify_graph_helper__(MDL mdl, set_type pa, set_type ch, std::vector<double> score2beat) { 
     //cilk::reducer<cilk::op_list_append<RNode_>> rlist; 
     //"rlist" - defined in the class as a private variable 

     if (ch == 0) { return; } 

     set_type n_ch = ch; 

     // Some more code -- which I am very sure is not causing error 

     int lsb = n_ - 1; 
     for (; lsb >= 0; --lsb) { if (in_set(pa, lsb)) { break; } } 

     if (lsb == n_ - 1) { return; } 

     set_type n_pa = set_add(pa, lsb + 1); 
     int n_pa_sz = set_size(n_pa); 
     if (n_pa_sz >= n_) { return; } 

     BitCombination comb(n_pa, n_pa_sz, n_); 

     for (;;) { 
      n_pa = comb.data(); 
      // If cilk_spawn keyword removed it compiles fine. 
      cilk_spawn m_sparsify_graph_helper__(mdl, n_pa, n_ch, score2beat); 
      if (!comb.next() || in_set(n_pa, n_ - 1)) { break; } 
     } 

    }// m_sparsify_graph_helper__ 

我以为这是一个编译器错误,但我想知道什么是规避这种错误的方式,让代码执行警告和错误免费。

错误截图: Error scrrenshot

+0

无论源代码是否有效,ICE始终是编译器错误。报告。 –

+0

这就是所有关于内部错误的说法吗? –

+0

@TrevorHickey添加了完整的错误截图。 – letsBeePolite

回答

0

看来报告的错误在GCC 6.X释放冰释前嫌。如果您遇到类似问题,请尝试在最新版本的GCC上重现错误,以确认它是否早期被报告并纠正或不纠正。