Commit 3ff29913 by Jan Hubicka Committed by Jan Hubicka

re PR middle-end/64922 (runtime error: member call on misaligned address for type 'struct _Rep')

	PR middle-end/64922
	* ipa-prop.c (update_indirect_edges_after_inlining): Correctly update
	edges that become speculative.

From-SVN: r220423
parent de3aebff
2015-02-04 Jan Hubicka <hubicka@ucw.cz>
PR middle-end/64922
* ipa-prop.c (update_indirect_edges_after_inlining): Correctly update
edges that become speculative.
2015-02-04 Jakub Jelinek <jakub@redhat.com> 2015-02-04 Jakub Jelinek <jakub@redhat.com>
* dwarf2out.c (is_fortran): Also return true for DW_LANG_Fortran03 * dwarf2out.c (is_fortran): Also return true for DW_LANG_Fortran03
......
...@@ -3075,6 +3075,7 @@ update_indirect_edges_after_inlining (struct cgraph_edge *cs, ...@@ -3075,6 +3075,7 @@ update_indirect_edges_after_inlining (struct cgraph_edge *cs,
struct cgraph_indirect_call_info *ici = ie->indirect_info; struct cgraph_indirect_call_info *ici = ie->indirect_info;
struct ipa_jump_func *jfunc; struct ipa_jump_func *jfunc;
int param_index; int param_index;
cgraph_node *spec_target = NULL;
next_ie = ie->next_callee; next_ie = ie->next_callee;
...@@ -3091,6 +3092,14 @@ update_indirect_edges_after_inlining (struct cgraph_edge *cs, ...@@ -3091,6 +3092,14 @@ update_indirect_edges_after_inlining (struct cgraph_edge *cs,
param_index = ici->param_index; param_index = ici->param_index;
jfunc = ipa_get_ith_jump_func (top, param_index); jfunc = ipa_get_ith_jump_func (top, param_index);
if (ie->speculative)
{
struct cgraph_edge *de;
struct ipa_ref *ref;
ie->speculative_call_info (de, ie, ref);
spec_target = de->callee;
}
if (!opt_for_fn (node->decl, flag_indirect_inlining)) if (!opt_for_fn (node->decl, flag_indirect_inlining))
new_direct_edge = NULL; new_direct_edge = NULL;
else if (ici->polymorphic) else if (ici->polymorphic)
...@@ -3103,11 +3112,13 @@ update_indirect_edges_after_inlining (struct cgraph_edge *cs, ...@@ -3103,11 +3112,13 @@ update_indirect_edges_after_inlining (struct cgraph_edge *cs,
new_direct_edge = try_make_edge_direct_simple_call (ie, jfunc, new_direct_edge = try_make_edge_direct_simple_call (ie, jfunc,
new_root_info); new_root_info);
/* If speculation was removed, then we need to do nothing. */ /* If speculation was removed, then we need to do nothing. */
if (new_direct_edge && new_direct_edge != ie) if (new_direct_edge && new_direct_edge != ie
&& new_direct_edge->callee == spec_target)
{ {
new_direct_edge->indirect_inlining_edge = 1; new_direct_edge->indirect_inlining_edge = 1;
top = IPA_EDGE_REF (cs); top = IPA_EDGE_REF (cs);
res = true; res = true;
continue;
} }
else if (new_direct_edge) else if (new_direct_edge)
{ {
...@@ -3123,9 +3134,13 @@ update_indirect_edges_after_inlining (struct cgraph_edge *cs, ...@@ -3123,9 +3134,13 @@ update_indirect_edges_after_inlining (struct cgraph_edge *cs,
res = true; res = true;
} }
top = IPA_EDGE_REF (cs); top = IPA_EDGE_REF (cs);
/* If speculative edge was introduced we still need to update
call info of the indirect edge. */
if (!new_direct_edge->speculative)
continue;
} }
else if (jfunc->type == IPA_JF_PASS_THROUGH if (jfunc->type == IPA_JF_PASS_THROUGH
&& ipa_get_jf_pass_through_operation (jfunc) == NOP_EXPR) && ipa_get_jf_pass_through_operation (jfunc) == NOP_EXPR)
{ {
if ((ici->agg_contents if ((ici->agg_contents
&& !ipa_get_jf_pass_through_agg_preserved (jfunc)) && !ipa_get_jf_pass_through_agg_preserved (jfunc))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment