http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51694
Jan Hubicka <hubicka at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hubicka at gcc dot gnu.org AssignedTo|unassigned at gcc dot |hubicka at gcc dot gnu.org |gnu.org | --- Comment #2 from Jan Hubicka <hubicka at gcc dot gnu.org> 2012-01-06 11:46:55 UTC --- This is the usual argument count mismatch. Foo is called only with one argument, but we don't do bound check when handling indirect call logic. The patch also disable logic in ipa-inline propagatic across uninlinable calls. We can not do that correctly + we will never inline the call anyway. I am testing the attached patch. Honza Index: ipa-cp.c =================================================================== *** ipa-cp.c (revision 182949) --- ipa-cp.c (working copy) *************** ipa_get_indirect_edge_target (struct cgr *** 1112,1118 **** if (!ie->indirect_info->polymorphic) { ! tree t = VEC_index (tree, known_vals, param_index); if (t && TREE_CODE (t) == ADDR_EXPR && TREE_CODE (TREE_OPERAND (t, 0)) == FUNCTION_DECL) --- 1112,1119 ---- if (!ie->indirect_info->polymorphic) { ! tree t = (VEC_length (tree, known_vals) > param_index ! ? VEC_index (tree, known_vals, param_index) : NULL); if (t && TREE_CODE (t) == ADDR_EXPR && TREE_CODE (TREE_OPERAND (t, 0)) == FUNCTION_DECL) *************** ipa_get_indirect_edge_target (struct cgr *** 1126,1132 **** otr_type = ie->indirect_info->otr_type; t = VEC_index (tree, known_vals, param_index); ! if (!t && known_binfos) t = VEC_index (tree, known_binfos, param_index); if (!t) return NULL_TREE; --- 1127,1133 ---- otr_type = ie->indirect_info->otr_type; t = VEC_index (tree, known_vals, param_index); ! if (!t && known_binfos && VEC_length (tree, known_binfos) > param_index) t = VEC_index (tree, known_binfos, param_index); if (!t) return NULL_TREE; Index: ipa-inline-analysis.c =================================================================== *** ipa-inline-analysis.c (revision 182949) --- ipa-inline-analysis.c (working copy) *************** evaluate_properties_for_edge (struct cgr *** 728,733 **** --- 728,734 ---- *known_binfos_ptr = NULL; if (ipa_node_params_vector + && !e->call_stmt_cannot_inline_p && ((clause_ptr && info->conds) || known_vals_ptr || known_binfos_ptr)) { struct ipa_node_params *parms_info;