Commit db09f943 by Martin Jambor Committed by Martin Jambor

re PR middle-end/46823 (ICE: edge points to wrong declaration)

2011-01-14  Martin Jambor  <mjambor@suse.cz>

	PR middle-end/46823
	* tree-inline.c (expand_call_inline): Get fndecl from call graph edge.

From-SVN: r168778
parent 642d2873
2011-01-14 Martin Jambor <mjambor@suse.cz>
PR middle-end/46823
* tree-inline.c (expand_call_inline): Get fndecl from call graph edge.
2011-01-13 Anatoly Sokolov <aesok@post.ru> 2011-01-13 Anatoly Sokolov <aesok@post.ru>
* config/xtensa/xtensa.h (XTENSA_LIBCALL_VALUE, LIBCALL_VALUE, * config/xtensa/xtensa.h (XTENSA_LIBCALL_VALUE, LIBCALL_VALUE,
......
...@@ -3783,14 +3783,19 @@ expand_call_inline (basic_block bb, gimple stmt, copy_body_data *id) ...@@ -3783,14 +3783,19 @@ expand_call_inline (basic_block bb, gimple stmt, copy_body_data *id)
if (gimple_code (stmt) != GIMPLE_CALL) if (gimple_code (stmt) != GIMPLE_CALL)
goto egress; goto egress;
/* Objective C and fortran still calls tree_rest_of_compilation directly.
Kill this check once this is fixed. */
if (!id->dst_node->analyzed)
goto egress;
cg_edge = cgraph_edge (id->dst_node, stmt);
gcc_checking_assert (cg_edge);
/* First, see if we can figure out what function is being called. /* First, see if we can figure out what function is being called.
If we cannot, then there is no hope of inlining the function. */ If we cannot, then there is no hope of inlining the function. */
fn = gimple_call_fndecl (stmt); if (cg_edge->indirect_unknown_callee)
if (!fn)
goto egress; goto egress;
fn = cg_edge->callee->decl;
/* Turn forward declarations into real ones. */ gcc_checking_assert (fn);
fn = cgraph_node (fn)->decl;
/* If FN is a declaration of a function in a nested scope that was /* If FN is a declaration of a function in a nested scope that was
globally declared inline, we don't set its DECL_INITIAL. globally declared inline, we don't set its DECL_INITIAL.
...@@ -3804,13 +3809,6 @@ expand_call_inline (basic_block bb, gimple stmt, copy_body_data *id) ...@@ -3804,13 +3809,6 @@ expand_call_inline (basic_block bb, gimple stmt, copy_body_data *id)
&& gimple_has_body_p (DECL_ABSTRACT_ORIGIN (fn))) && gimple_has_body_p (DECL_ABSTRACT_ORIGIN (fn)))
fn = DECL_ABSTRACT_ORIGIN (fn); fn = DECL_ABSTRACT_ORIGIN (fn);
/* Objective C and fortran still calls tree_rest_of_compilation directly.
Kill this check once this is fixed. */
if (!id->dst_node->analyzed)
goto egress;
cg_edge = cgraph_edge (id->dst_node, stmt);
/* First check that inlining isn't simply forbidden in this case. */ /* First check that inlining isn't simply forbidden in this case. */
if (inline_forbidden_into_p (cg_edge->caller->decl, cg_edge->callee->decl)) if (inline_forbidden_into_p (cg_edge->caller->decl, cg_edge->callee->decl))
goto egress; goto egress;
......
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