aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-structalias.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2021-11-02 18:43:17 +0100
committerJan Hubicka <hubicka@ucw.cz>2021-11-02 18:43:17 +0100
commitf19791565d7ed31c2a895fc29b772c2c7ed390e8 (patch)
tree1334d1fbd58ccb987f4fce867b7840758601d8f5 /gcc/tree-ssa-structalias.c
parentc33a5cc9e7f1475108892abb147f9382ecbaec12 (diff)
downloadgcc-f19791565d7ed31c2a895fc29b772c2c7ed390e8.zip
gcc-f19791565d7ed31c2a895fc29b772c2c7ed390e8.tar.gz
gcc-f19791565d7ed31c2a895fc29b772c2c7ed390e8.tar.bz2
addS EAF_NOT_RETURNED_DIRECTLY
addS EAF_NOT_RETURNED_DIRECTLY which works similarly as EAF_NODIRECTESCAPE. Values pointed to by a given argument may be returned but not the argument itself. This helps PTA quite noticeably because we mostly care about tracking points to which given memory location can escape. gcc/ChangeLog: * tree-core.h (EAF_NOT_RETURNED_DIRECTLY): New flag. (EAF_NOREAD): Renumber. * ipa-modref.c (dump_eaf_flags): Dump EAF_NOT_RETURNED_DIRECTLY. (remove_useless_eaf_flags): Handle EAF_NOT_RETURNED_DIRECTLY (deref_flags): Likewise. (modref_lattice::init): Likewise. (modref_lattice::merge): Likewise. (merge_call_lhs_flags): Likewise. (analyze_ssa_name_flags): Likewise. (modref_merge_call_site_flags): Likewise. * tree-ssa-structalias.c (handle_call_arg): Likewise. gcc/testsuite/ChangeLog: * g++.dg/ipa/modref-1.C: Update template. * gcc.dg/tree-ssa/modref-10.c: New test.
Diffstat (limited to 'gcc/tree-ssa-structalias.c')
-rw-r--r--gcc/tree-ssa-structalias.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c
index 99072df..5f24c01 100644
--- a/gcc/tree-ssa-structalias.c
+++ b/gcc/tree-ssa-structalias.c
@@ -4082,8 +4082,16 @@ handle_call_arg (gcall *stmt, tree arg, vec<ce_s> *results, int flags,
{
struct constraint_expr cexpr;
cexpr.var = tem->id;
- cexpr.type = SCALAR;
- cexpr.offset = 0;
+ if (flags & EAF_NOT_RETURNED_DIRECTLY)
+ {
+ cexpr.type = DEREF;
+ cexpr.offset = UNKNOWN_OFFSET;
+ }
+ else
+ {
+ cexpr.type = SCALAR;
+ cexpr.offset = 0;
+ }
results->safe_push (cexpr);
}