error in compiling cilk plus with gcc-4.7
문제
I get the following error
main.c:107:2: internal compiler error: in extract_for_fields, at cilk-spawn.c:1857
}
and the relevant lines are:
cilk_for (index = 0; table_name[index]!=NULL; ++index )
{
/* some work*/
}
Line 107
corresponds to the closing braces of cilk_for loop.
Any help is appreciated!
해결책 2
What I did above was not a valid cilk_for
loop because the cilk_for
loop must test the control variable. Also one must be able to predict how many time the loop will run and in this case this is not possible. So the correct version for this will be
int count=0;
while(table_name[count]!=NULL)
count++;
cilk_for (index = 0; index!=count; ++index )
{
/* some work*/
}
다른 팁
Try building with no optimization (omit any optimization flags, or use -O0
explicitely).
If that helps, you can try and see if -O1
(some optimization) works, then -O2
, and so on.
If you're lucky, you can figure out that way which optimization is causing the problem, and then simply disable that optimization with some -fno-foo
flag.
제휴하지 않습니다 StackOverflow