aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-pure-const.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2020-09-23 23:06:05 +0200
committerJan Hubicka <jh@suse.cz>2020-09-23 23:06:05 +0200
commite977dd5edbcc3a3b88c3bd7efa1026c845af7487 (patch)
tree6603e18a37391e417b8b2c1e3821f747bf039c3d /gcc/ipa-pure-const.c
parente92779db3304bc96a6b861f87c5edde8dd4d4030 (diff)
downloadgcc-e977dd5edbcc3a3b88c3bd7efa1026c845af7487.zip
gcc-e977dd5edbcc3a3b88c3bd7efa1026c845af7487.tar.gz
gcc-e977dd5edbcc3a3b88c3bd7efa1026c845af7487.tar.bz2
Cleanup modref interfaces.
* ipa-fnsummary.c (refs_local_or_readonly_memory_p): New function. (points_to_local_or_readonly_memory_p): New function. * ipa-fnsummary.h (refs_local_or_readonly_memory_p): Declare. (points_to_local_or_readonly_memory_p): Declare. * ipa-modref.c (record_access_p): Use refs_local_or_readonly_memory_p. * ipa-pure-const.c (check_op): Likewise. * gcc.dg/tree-ssa/local-pure-const.c: Update template.
Diffstat (limited to 'gcc/ipa-pure-const.c')
-rw-r--r--gcc/ipa-pure-const.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/gcc/ipa-pure-const.c b/gcc/ipa-pure-const.c
index 564c662..bdbccd0 100644
--- a/gcc/ipa-pure-const.c
+++ b/gcc/ipa-pure-const.c
@@ -381,13 +381,11 @@ check_op (funct_state local, tree t, bool checking_write)
fprintf (dump_file, " Volatile indirect ref is not const/pure\n");
return;
}
- else if (t
- && (INDIRECT_REF_P (t) || TREE_CODE (t) == MEM_REF)
- && TREE_CODE (TREE_OPERAND (t, 0)) == SSA_NAME
- && !ptr_deref_may_alias_global_p (TREE_OPERAND (t, 0)))
+ else if (refs_local_or_readonly_memory_p (t))
{
if (dump_file)
- fprintf (dump_file, " Indirect ref to local memory is OK\n");
+ fprintf (dump_file, " Indirect ref to local or readonly "
+ "memory is OK\n");
return;
}
else if (checking_write)