summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-alias.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2019-10-24 16:19:40 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2019-10-24 14:19:40 +0000
commitabebffc609506176f8ba3f64533e15ece49446c0 (patch)
treeaca17ebbb9e91c9a33b1ce8a655285725218d089 /gcc/tree-ssa-alias.c
parent39a6e72a9e0889180783c2e8810042503b511b11 (diff)
ipa-reference.c (ipa_reference_optimization_summary_d): Rename statics_not_read and statics_not_written to statics_read and...
* ipa-reference.c (ipa_reference_optimization_summary_d): Rename statics_not_read and statics_not_written to statics_read and statics_written respectively. (no_module_statics): New static var. (ipa_reference_get_not_read_global): Rename to ... (ipa_reference_get_read_global): ... this. (ipa_reference_get_not_written_global): Rename to ... (ipa_reference_get_written_global): ... this. (dump_static_vars_set_to_file): Dump no_module_statics. (copy_static_var_set): Add for propagation parameter. (ipa_init): Initialize no_module_statics. (ipa_ref_opt_summary_t::duplicate): Update. (ipa_ref_opt_summary_t::remove): Update. (propagate): Update. (write_node_summary_p): Look correctly for bitmap differences. (ipa_reference_write_optimization_summary): Update. (ipa_reference_read_optimization_summary): Update. * ipa-reference.h (ipa_reference_get_not_read_global): Rename to ... (ipa_reference_get_read_global): ... this. (ipa_reference_get_not_written_global): Rename to ... (ipa_reference_get_written_global): ... this. * tree-ssa-alias.c (ref_maybe_used_by_call_p_1): Update. (call_may_clobber_ref_p_1): Update. From-SVN: r277403
Diffstat (limited to 'gcc/tree-ssa-alias.c')
-rw-r--r--gcc/tree-ssa-alias.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c
index 4cfe3e2b437..8c63e3bf5a9 100644
--- a/gcc/tree-ssa-alias.c
+++ b/gcc/tree-ssa-alias.c
@@ -2529,14 +2529,16 @@ ref_maybe_used_by_call_p_1 (gcall *call, ao_ref *ref, bool tbaa_p)
if (callee != NULL_TREE && VAR_P (base) && TREE_STATIC (base))
{
struct cgraph_node *node = cgraph_node::get (callee);
- bitmap not_read;
+ bitmap read;
+ int id;
/* FIXME: Callee can be an OMP builtin that does not have a call graph
node yet. We should enforce that there are nodes for all decls in the
IL and remove this check instead. */
if (node
- && (not_read = ipa_reference_get_not_read_global (node))
- && bitmap_bit_p (not_read, ipa_reference_var_uid (base)))
+ && (id = ipa_reference_var_uid (base)) != -1
+ && (read = ipa_reference_get_read_global (node))
+ && !bitmap_bit_p (read, id))
goto process_args;
}
@@ -2924,11 +2926,13 @@ call_may_clobber_ref_p_1 (gcall *call, ao_ref *ref)
if (callee != NULL_TREE && VAR_P (base) && TREE_STATIC (base))
{
struct cgraph_node *node = cgraph_node::get (callee);
- bitmap not_written;
+ bitmap written;
+ int id;
if (node
- && (not_written = ipa_reference_get_not_written_global (node))
- && bitmap_bit_p (not_written, ipa_reference_var_uid (base)))
+ && (id = ipa_reference_var_uid (base)) != -1
+ && (written = ipa_reference_get_written_global (node))
+ && !bitmap_bit_p (written, id))
return false;
}