summaryrefslogtreecommitdiff
path: root/gcc/ipa-reference.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2015-12-09 19:29:38 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2015-12-09 19:29:38 +0000
commitb39960e1bf9defe8409541c113d4da6cc2a091a2 (patch)
tree4d484ae9a9e235802ede77e2da1d0a8cf358608a /gcc/ipa-reference.c
parent195e39f39002977c5d3c437aadd893762efb890a (diff)
downloadgcc-b39960e1bf9defe8409541c113d4da6cc2a091a2.tar.gz
PR ipa/61886
PR middle-end/25140 * ipa-reference.c (ipa_reference_get_not_read_global, ipa_reference_get_not_read_global): Fix WRT aliases. (is_improper): Break out from ... (is_proper_for_analysis): ... here; fix WRT aliases. (analyze_function, generate_summary, ipa_reference_write_optimization_summary, ipa_reference_read_optimization_summary): Use ipa_reference_var_uid. * ipa-refrence.h (ipa_reference_var_uid): New inline. * tree-ssa-alias.c: Revert my accidental previous commit. (ref_maybe_used_by_call_p_1, call_may_clobber_ref_p_1): Use ipa_reference_var_uid. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231471 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-reference.c')
-rw-r--r--gcc/ipa-reference.c36
1 files changed, 26 insertions, 10 deletions
diff --git a/gcc/ipa-reference.c b/gcc/ipa-reference.c
index be98cdc5893..7d7f4ac2309 100644
--- a/gcc/ipa-reference.c
+++ b/gcc/ipa-reference.c
@@ -174,14 +174,22 @@ set_reference_optimization_summary (struct cgraph_node *node,
bitmap
ipa_reference_get_not_read_global (struct cgraph_node *fn)
{
- if (!opt_for_fn (fn->decl, flag_ipa_reference)
- || !opt_for_fn (current_function_decl, flag_ipa_reference))
+ if (!opt_for_fn (current_function_decl, flag_ipa_reference))
return NULL;
+
+ enum availability avail;
+ struct cgraph_node *fn2 = fn->function_symbol (&avail);
ipa_reference_optimization_summary_t info =
- get_reference_optimization_summary (fn->function_symbol (NULL));
- if (info)
+ get_reference_optimization_summary (fn2);
+
+ if (info
+ && (avail >= AVAIL_AVAILABLE
+ || (avail == AVAIL_INTERPOSABLE
+ && flags_from_decl_or_type (fn->decl) & ECF_LEAF))
+ && opt_for_fn (fn2->decl, flag_ipa_reference))
return info->statics_not_read;
- else if (flags_from_decl_or_type (fn->decl) & ECF_LEAF)
+ else if (avail == AVAIL_NOT_AVAILABLE
+ && flags_from_decl_or_type (fn->decl) & ECF_LEAF)
return all_module_statics;
else
return NULL;
@@ -195,14 +203,22 @@ ipa_reference_get_not_read_global (struct cgraph_node *fn)
bitmap
ipa_reference_get_not_written_global (struct cgraph_node *fn)
{
- if (!opt_for_fn (fn->decl, flag_ipa_reference)
- || !opt_for_fn (current_function_decl, flag_ipa_reference))
+ if (!opt_for_fn (current_function_decl, flag_ipa_reference))
return NULL;
+
+ enum availability avail;
+ struct cgraph_node *fn2 = fn->function_symbol (&avail);
ipa_reference_optimization_summary_t info =
- get_reference_optimization_summary (fn);
- if (info)
+ get_reference_optimization_summary (fn2);
+
+ if (info
+ && (avail >= AVAIL_AVAILABLE
+ || (avail == AVAIL_INTERPOSABLE
+ && flags_from_decl_or_type (fn->decl) & ECF_LEAF))
+ && opt_for_fn (fn2->decl, flag_ipa_reference))
return info->statics_not_written;
- else if (flags_from_decl_or_type (fn->decl) & ECF_LEAF)
+ else if (avail == AVAIL_NOT_AVAILABLE
+ && flags_from_decl_or_type (fn->decl) & ECF_LEAF)
return all_module_statics;
else
return NULL;