addS EAF_NOT_RETURNED_DIRECTLY
authorJan Hubicka <hubicka@ucw.cz>
Tue, 2 Nov 2021 17:43:17 +0000 (18:43 +0100)
committerJan Hubicka <hubicka@ucw.cz>
Tue, 2 Nov 2021 17:43:17 +0000 (18:43 +0100)
commitf19791565d7ed31c2a895fc29b772c2c7ed390e8
tree1334d1fbd58ccb987f4fce867b7840758601d8f5
parentc33a5cc9e7f1475108892abb147f9382ecbaec12
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.
gcc/ipa-modref.c
gcc/testsuite/g++.dg/ipa/modref-1.C
gcc/testsuite/gcc.dg/tree-ssa/modref-10.c [new file with mode: 0644]
gcc/tree-core.h
gcc/tree-ssa-structalias.c