Commit 71fb4f92 by Jan Hubicka Committed by Jan Hubicka

cgraph.c (cgraph_set_nothrow_flag_1): Update cgraph after setting the nothrow flag.

	* cgraph.c (cgraph_set_nothrow_flag_1): Update cgraph after
	setting the nothrow flag.
	* ipa-reference.c (propagate): Skip aliases.
	* ipa-pure-const.c (propagate_pure_const): Skip aliases.
	(propagate_nothrow): Skip aliases; do not update cgraph.
	(local_pure_const): Do not update cgraph.
	* tree-profile.c (tree_profiling): Do fixup_cfg.

From-SVN: r174929
parent 106fcf8f
2011-06-10 Jan Hubicka <jh@suse.cz> 2011-06-10 Jan Hubicka <jh@suse.cz>
* cgraph.c (cgraph_set_nothrow_flag_1): Update cgraph after
setting the nothrow flag.
* ipa-reference.c (propagate): Skip aliases.
* ipa-pure-const.c (propagate_pure_const): Skip aliases.
(propagate_nothrow): Skip aliases; do not update cgraph.
(local_pure_const): Do not update cgraph.
* tree-profile.c (tree_profiling): Do fixup_cfg.
2011-06-10 Jan Hubicka <jh@suse.cz>
* ipa.c (cgraph_non_local_node_p_1): Break out from ...; * ipa.c (cgraph_non_local_node_p_1): Break out from ...;
(cgraph_local_node_p): ... here; handle aliases. (cgraph_local_node_p): ... here; handle aliases.
(has_addr_references_p): Break out from ...; (has_addr_references_p): Break out from ...;
......
...@@ -2681,7 +2681,13 @@ cgraph_make_node_local (struct cgraph_node *node) ...@@ -2681,7 +2681,13 @@ cgraph_make_node_local (struct cgraph_node *node)
static bool static bool
cgraph_set_nothrow_flag_1 (struct cgraph_node *node, void *data) cgraph_set_nothrow_flag_1 (struct cgraph_node *node, void *data)
{ {
struct cgraph_edge *e;
TREE_NOTHROW (node->decl) = data != NULL; TREE_NOTHROW (node->decl) = data != NULL;
if (data != NULL)
for (e = node->callers; e; e = e->next_caller)
e->can_throw_external = false;
return false; return false;
} }
......
...@@ -1116,6 +1116,9 @@ propagate_pure_const (void) ...@@ -1116,6 +1116,9 @@ propagate_pure_const (void)
int count = 0; int count = 0;
node = order[i]; node = order[i];
if (node->alias)
continue;
if (dump_file && (dump_flags & TDF_DETAILS)) if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, "Starting cycle\n"); fprintf (dump_file, "Starting cycle\n");
...@@ -1383,6 +1386,9 @@ propagate_nothrow (void) ...@@ -1383,6 +1386,9 @@ propagate_nothrow (void)
bool can_throw = false; bool can_throw = false;
node = order[i]; node = order[i];
if (node->alias)
continue;
/* Find the worst state for any node in the cycle. */ /* Find the worst state for any node in the cycle. */
w = node; w = node;
while (w) while (w)
...@@ -1430,10 +1436,7 @@ propagate_nothrow (void) ...@@ -1430,10 +1436,7 @@ propagate_nothrow (void)
funct_state w_l = get_function_state (w); funct_state w_l = get_function_state (w);
if (!can_throw && !TREE_NOTHROW (w->decl)) if (!can_throw && !TREE_NOTHROW (w->decl))
{ {
struct cgraph_edge *e;
cgraph_set_nothrow_flag (w, true); cgraph_set_nothrow_flag (w, true);
for (e = w->callers; e; e = e->next_caller)
e->can_throw_external = false;
if (dump_file) if (dump_file)
fprintf (dump_file, "Function found to be nothrow: %s\n", fprintf (dump_file, "Function found to be nothrow: %s\n",
cgraph_node_name (w)); cgraph_node_name (w));
...@@ -1640,11 +1643,7 @@ local_pure_const (void) ...@@ -1640,11 +1643,7 @@ local_pure_const (void)
} }
if (!l->can_throw && !TREE_NOTHROW (current_function_decl)) if (!l->can_throw && !TREE_NOTHROW (current_function_decl))
{ {
struct cgraph_edge *e;
cgraph_set_nothrow_flag (node, true); cgraph_set_nothrow_flag (node, true);
for (e = node->callers; e; e = e->next_caller)
e->can_throw_external = false;
changed = true; changed = true;
if (dump_file) if (dump_file)
fprintf (dump_file, "Function found to be nothrow: %s\n", fprintf (dump_file, "Function found to be nothrow: %s\n",
......
...@@ -645,6 +645,8 @@ propagate (void) ...@@ -645,6 +645,8 @@ propagate (void)
struct ipa_dfs_info * w_info; struct ipa_dfs_info * w_info;
node = order[i]; node = order[i];
if (node->alias)
continue;
node_info = get_reference_vars_info (node); node_info = get_reference_vars_info (node);
gcc_assert (node_info); gcc_assert (node_info);
...@@ -802,6 +804,8 @@ propagate (void) ...@@ -802,6 +804,8 @@ propagate (void)
struct ipa_dfs_info * w_info; struct ipa_dfs_info * w_info;
node = order[i]; node = order[i];
if (node->alias)
continue;
node_info = get_reference_vars_info (node); node_info = get_reference_vars_info (node);
node_g = &node_info->global; node_g = &node_info->global;
node_l = &node_info->local; node_l = &node_info->local;
...@@ -885,7 +889,7 @@ propagate (void) ...@@ -885,7 +889,7 @@ propagate (void)
ipa_reference_global_vars_info_t node_g; ipa_reference_global_vars_info_t node_g;
ipa_reference_optimization_summary_t opt; ipa_reference_optimization_summary_t opt;
if (!node->analyzed) if (!node->analyzed || node->alias)
continue; continue;
node_info = get_reference_vars_info (node); node_info = get_reference_vars_info (node);
......
...@@ -470,8 +470,7 @@ tree_profiling (void) ...@@ -470,8 +470,7 @@ tree_profiling (void)
for (node = cgraph_nodes; node; node = node->next) for (node = cgraph_nodes; node; node = node->next)
{ {
if (!node->analyzed if (!node->analyzed
|| !gimple_has_body_p (node->decl) || !gimple_has_body_p (node->decl))
|| !(!node->clone_of || node->decl != node->clone_of->decl))
continue; continue;
/* Don't profile functions produced for builtin stuff. */ /* Don't profile functions produced for builtin stuff. */
...@@ -485,6 +484,8 @@ tree_profiling (void) ...@@ -485,6 +484,8 @@ tree_profiling (void)
/* Re-set global shared temporary variable for edge-counters. */ /* Re-set global shared temporary variable for edge-counters. */
gcov_type_tmp_var = NULL_TREE; gcov_type_tmp_var = NULL_TREE;
/* Local pure-const may imply need to fixup the cfg. */
execute_fixup_cfg ();
branch_prob (); branch_prob ();
if (! flag_branch_probabilities if (! flag_branch_probabilities
......
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