GCC plugin: 'internal compiler error' in passes.c -
i have been writing gcc inter procedural plugin have insert gimple statements @ points in program. after perform data flow analysis on complete program. when done analysis removing newly inserted gimple statements.
my analysis getting completed before exiting following message generated:
internal compiler error: in execute_ipa_pass_list, @ passes.c:1817
this surely because of insertion of gimple statements, if don't won't error message.
could me out , explain problem , how fix it?
this happens when gcc code contains assertion turns out false.
the line 1817 in passes.c (which part of gcc sources, in gcc sub-directory of gcc source tree) has piece of code looks like:
gcc_assert (some_condition);
in case, some_condition false, compiler expects true (this why author of code wrote assertion in first place).
you did in plugin made false, , need fix it.
what did wrong? depends. open passes.c , find line, , see checking. in copy of gcc, relevant function reads:
void execute_ipa_pass_list (struct opt_pass *pass) { { /* assertion. */ gcc_assert (!current_function_decl); /* assertion. */ gcc_assert (!cfun); /* assertion. */ gcc_assert (pass->type == simple_ipa_pass || pass->type == ipa_pass); if (execute_one_pass (pass) && pass->sub) { if (pass->sub->type == gimple_pass) { invoke_plugin_callbacks (plugin_early_gimple_passes_start, null); do_per_function_toporder ((void (*)(void *))execute_pass_list, pass->sub); invoke_plugin_callbacks (plugin_early_gimple_passes_end, null); } else if (pass->sub->type == simple_ipa_pass || pass->sub->type == ipa_pass) execute_ipa_pass_list (pass->sub); else gcc_unreachable (); } /* assertion. */ gcc_assert (!current_function_decl); cgraph_process_new_functions (); pass = pass->next; } while (pass); } there 4 gcc_assert statements. plugin caused 1 of them become false. i.e. messed 1 of variables:
current_function_decl cfun pass->type this what's wrong.
Comments
Post a Comment