Commit f2906a8e by Richard Guenther Committed by Richard Biener

re PR tree-optimization/51012 (ICE: in fold_convert_loc, at fold-const.c:1897…

re PR tree-optimization/51012 (ICE: in fold_convert_loc, at fold-const.c:1897 with -fno-early-inlining and passing incompatible function ptr)

2011-11-08  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/51012
	* ipa-prop.c (update_indirect_edges_after_inlining): Fixup
	non-inlinable state.
	* cgraph.c (cgraph_make_edge_direct): Likewise.

	* gcc.dg/pr51012-1.c: New testcase.
	* gcc.dg/pr51012-2.c: Likewise.

From-SVN: r181166
parent a5952633
2011-11-08 Richard Guenther <rguenther@suse.de>
PR tree-optimization/51012
* ipa-prop.c (update_indirect_edges_after_inlining): Fixup
non-inlinable state.
* cgraph.c (cgraph_make_edge_direct): Likewise.
2011-11-08 Eric Botcazou <ebotcazou@adacore.com> 2011-11-08 Eric Botcazou <ebotcazou@adacore.com>
PR rtl-optimization/47698 PR rtl-optimization/47698
...@@ -1184,6 +1184,13 @@ cgraph_make_edge_direct (struct cgraph_edge *edge, struct cgraph_node *callee) ...@@ -1184,6 +1184,13 @@ cgraph_make_edge_direct (struct cgraph_edge *edge, struct cgraph_node *callee)
/* Insert to callers list of the new callee. */ /* Insert to callers list of the new callee. */
cgraph_set_edge_callee (edge, callee); cgraph_set_edge_callee (edge, callee);
if (edge->call_stmt
&& !gimple_check_call_matching_types (edge->call_stmt, callee->decl))
{
gimple_call_set_cannot_inline (edge->call_stmt, true);
edge->call_stmt_cannot_inline_p = true;
}
/* We need to re-determine the inlining status of the edge. */ /* We need to re-determine the inlining status of the edge. */
initialize_inline_failed (edge); initialize_inline_failed (edge);
} }
......
...@@ -1905,6 +1905,13 @@ update_indirect_edges_after_inlining (struct cgraph_edge *cs, ...@@ -1905,6 +1905,13 @@ update_indirect_edges_after_inlining (struct cgraph_edge *cs,
if (new_direct_edge) if (new_direct_edge)
{ {
new_direct_edge->indirect_inlining_edge = 1; new_direct_edge->indirect_inlining_edge = 1;
if (new_direct_edge->call_stmt
&& !gimple_check_call_matching_types (new_direct_edge->call_stmt,
new_direct_edge->callee->decl))
{
gimple_call_set_cannot_inline (new_direct_edge->call_stmt, true);
new_direct_edge->call_stmt_cannot_inline_p = true;
}
if (new_edges) if (new_edges)
{ {
VEC_safe_push (cgraph_edge_p, heap, *new_edges, VEC_safe_push (cgraph_edge_p, heap, *new_edges,
......
2011-11-08 Richard Guenther <rguenther@suse.de> 2011-11-08 Richard Guenther <rguenther@suse.de>
PR tree-optimization/51012
* gcc.dg/pr51012-1.c: New testcase.
* gcc.dg/pr51012-2.c: Likewise.
2011-11-08 Richard Guenther <rguenther@suse.de>
PR middle-end/51010 PR middle-end/51010
* c-c++-common/uninit-pr51010.c: New testcase. * c-c++-common/uninit-pr51010.c: New testcase.
......
/* { dg-do compile } */
/* { dg-options "-O2 -fno-early-inlining -fno-ipa-cp" } */
float baz (void)
{
return 0;
}
static inline int bar (int (*ibaz) (void))
{
return ibaz ();
}
void foo (void)
{
bar((int (*)(void))baz);
}
/* { dg-do compile } */
/* { dg-options "-O2 -fno-early-inlining" } */
float baz (void)
{
return 0;
}
static inline int bar (int (*ibaz) (void))
{
return ibaz ();
}
void foo (void)
{
bar((int (*)(void))baz);
}
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