aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-alias.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2021-11-19 18:09:13 +0100
committerJan Hubicka <jh@suse.cz>2021-11-19 18:09:13 +0100
commitada63d56beb0e535d35b165b55f85e29a0b36929 (patch)
treeb809bfa4f6a962e625f2c437130a2eb60e0ba7d4 /gcc/tree-ssa-alias.c
parent16137fbb9256ef365dd498d39024eb33de1a4cd8 (diff)
downloadgcc-ada63d56beb0e535d35b165b55f85e29a0b36929.zip
gcc-ada63d56beb0e535d35b165b55f85e29a0b36929.tar.gz
gcc-ada63d56beb0e535d35b165b55f85e29a0b36929.tar.bz2
Use modref even for nested functions in ref_maybe_used_by_call_p_1
Remove test for function not having call chain guarding modref use in ref_maybe_used_by_call_p_1. It never made sense since modref treats call chain accesses explicitly. It was however copied from earlier check for ECF_CONST (which seems dubious too, but I would like to discuss it independelty). This enables us to detect that memory pointed to static chain (or parts of it) are unused by the function. lto-bootstrapped-regtested all lanugages on x86_64-linux. gcc/ChangeLog: 2021-11-19 Jan Hubicka <hubicka@ucw.cz> * tree-ssa-alias.c (ref_maybe_used_by_call_p_1): Do not guard modref by !gimple_call_chain. gcc/testsuite/ChangeLog: 2021-11-19 Jan Hubicka <hubicka@ucw.cz> * gcc.dg/tree-ssa/modref-dse-6.c: New test.
Diffstat (limited to 'gcc/tree-ssa-alias.c')
-rw-r--r--gcc/tree-ssa-alias.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c
index 02bbc87..cd6a0b2 100644
--- a/gcc/tree-ssa-alias.c
+++ b/gcc/tree-ssa-alias.c
@@ -2755,7 +2755,7 @@ ref_maybe_used_by_call_p_1 (gcall *call, ao_ref *ref, bool tbaa_p)
callee = gimple_call_fndecl (call);
- if (!gimple_call_chain (call) && callee != NULL_TREE)
+ if (callee != NULL_TREE)
{
struct cgraph_node *node = cgraph_node::get (callee);
/* We can not safely optimize based on summary of calle if it does