Commit 9f3f7d13 by Richard Guenther Committed by Richard Biener

cgraph.c (cgraph_create_edge): Check for NULL call_stmt before calling stmt_can_throw_external.

2009-10-09  Richard Guenther  <rguenther@suse.de>

	* cgraph.c (cgraph_create_edge): Check for NULL call_stmt
	before calling stmt_can_throw_external.

From-SVN: r152587
parent af2efb2b
2009-10-09 Richard Guenther <rguenther@suse.de>
* cgraph.c (cgraph_create_edge): Check for NULL call_stmt
before calling stmt_can_throw_external.
2009-10-09 Eric Botcazou <ebotcazou@adacore.com> 2009-10-09 Eric Botcazou <ebotcazou@adacore.com>
PR tree-optimization/40071 PR tree-optimization/40071
...@@ -822,9 +822,9 @@ cgraph_create_edge (struct cgraph_node *caller, struct cgraph_node *callee, ...@@ -822,9 +822,9 @@ cgraph_create_edge (struct cgraph_node *caller, struct cgraph_node *callee,
if (call_stmt) if (call_stmt)
{ {
#ifdef ENABLE_CHECKING #ifdef ENABLE_CHECKING
/* This is rather pricely check possibly trigerring construction of call stmt /* This is rather pricely check possibly trigerring construction of
hashtable. */ call stmt hashtable. */
gcc_assert (!cgraph_edge (caller, call_stmt)); gcc_assert (!cgraph_edge (caller, call_stmt));
#endif #endif
gcc_assert (is_gimple_call (call_stmt)); gcc_assert (is_gimple_call (call_stmt));
...@@ -847,7 +847,8 @@ cgraph_create_edge (struct cgraph_node *caller, struct cgraph_node *callee, ...@@ -847,7 +847,8 @@ cgraph_create_edge (struct cgraph_node *caller, struct cgraph_node *callee,
edge->callee = callee; edge->callee = callee;
edge->call_stmt = call_stmt; edge->call_stmt = call_stmt;
push_cfun (DECL_STRUCT_FUNCTION (caller->decl)); push_cfun (DECL_STRUCT_FUNCTION (caller->decl));
edge->can_throw_external = stmt_can_throw_external (call_stmt); edge->can_throw_external
= call_stmt ? stmt_can_throw_external (call_stmt) : false;
pop_cfun (); pop_cfun ();
edge->prev_caller = NULL; edge->prev_caller = NULL;
edge->next_caller = callee->callers; edge->next_caller = callee->callers;
......
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