From e977dd5edbcc3a3b88c3bd7efa1026c845af7487 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Wed, 23 Sep 2020 23:06:05 +0200 Subject: 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. --- gcc/ipa-pure-const.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'gcc/ipa-pure-const.c') 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) -- cgit v1.1