mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-12-19 09:05:17 +08:00
008e7397da
Commonize the three paths to produce constraints for function call and makes it more flexible, so we can implement new features more easily. Main idea is to not special case pure and const since we can now describe all of pure/const via their EAF flags (implicit_const_eaf_flags and implicit_pure_eaf_flags) and info on existence of global memory loads/stores in function which is readily available in the modref tree. While rewriting the function, I dropped some of optimizations in the way we generate constraints. Some of them we may want to add back, but I think the constraint solver should be fast to get rid of them quickly, so it looks like bit of premature optimization. We now always produce one additional PTA variable (callescape) for things that escape into function call and thus can be stored to parameters or global memory (if modified). This is no longer the same as global escape in case function is not reading global memory. It is also not same as call use, since we now understand the fact that interposable functions may use parameter in a way that is not releavnt for PTA (so we can not optimize out stores initializing the memory, but we can be safe about fact that pointers stored does not escape). Compared to previous code we now handle correctly EAF_NOT_RETURNED in all cases (previously we did so only when all parameters had the flag) and also handle NOCLOBBER in more cases (since we make difference between global escape and call escape). Because I commonized code handling args and static chains, we could now easily extend modref to also track flags for static chain and return slot which I plan to do next. Otherwise I put some effort into producing constraints that produce similar solutions as before (so it is harder to debug differences). For example if global memory is written one can simply move callescape to escape rather then making everything escape by its own constraints, but it affects ipa-pta testcases. gcc/ChangeLog: * ipa-modref-tree.h (modref_tree::global_access_p): New member function. * ipa-modref.c: (implicint_const_eaf_flags,implicit_pure_eaf_flags, ignore_stores_eaf_flags): Move to ipa-modref.h (remove_useless_eaf_flags): Remove early exit on NOCLOBBER. (modref_summary::global_memory_read_p): New member function. (modref_summary::global_memory_written_p): New member function. * ipa-modref.h (modref_summary::global_memory_read_p, modref_summary::global_memory_written_p): Declare. (implicint_const_eaf_flags,implicit_pure_eaf_flags, ignore_stores_eaf_flags): move here. * tree-ssa-structalias.c: Include ipa-modref-tree.h, ipa-modref.h and attr-fnspec.h. (handle_rhs_call): Rewrite. (handle_call_arg): New function. (determine_global_memory_access): New function. (handle_const_call): Remove (handle_pure_call): Remove (find_func_aliases_for_call): Update use of handle_rhs_call. (compute_points_to_sets): Handle global memory acccesses selectively gcc/testsuite/ChangeLog: * gcc.dg/torture/ssa-pta-fn-1.c: Fix template; add noipa. * gcc.dg/tree-ssa/pta-callused.c: Fix template. |
||
---|---|---|
c++tools | ||
config | ||
contrib | ||
fixincludes | ||
gcc | ||
gnattools | ||
gotools | ||
include | ||
INSTALL | ||
intl | ||
libada | ||
libatomic | ||
libbacktrace | ||
libcc1 | ||
libcody | ||
libcpp | ||
libdecnumber | ||
libffi | ||
libgcc | ||
libgfortran | ||
libgo | ||
libgomp | ||
libiberty | ||
libitm | ||
libobjc | ||
liboffloadmic | ||
libphobos | ||
libquadmath | ||
libsanitizer | ||
libssp | ||
libstdc++-v3 | ||
libvtv | ||
lto-plugin | ||
maintainer-scripts | ||
zlib | ||
.dir-locals.el | ||
.gitattributes | ||
.gitignore | ||
ABOUT-NLS | ||
ar-lib | ||
ChangeLog | ||
ChangeLog.jit | ||
ChangeLog.tree-ssa | ||
compile | ||
config-ml.in | ||
config.guess | ||
config.rpath | ||
config.sub | ||
configure | ||
configure.ac | ||
COPYING | ||
COPYING3 | ||
COPYING3.LIB | ||
COPYING.LIB | ||
COPYING.RUNTIME | ||
depcomp | ||
install-sh | ||
libtool-ldflags | ||
libtool.m4 | ||
lt~obsolete.m4 | ||
ltgcc.m4 | ||
ltmain.sh | ||
ltoptions.m4 | ||
ltsugar.m4 | ||
ltversion.m4 | ||
MAINTAINERS | ||
Makefile.def | ||
Makefile.in | ||
Makefile.tpl | ||
missing | ||
mkdep | ||
mkinstalldirs | ||
move-if-change | ||
multilib.am | ||
README | ||
symlink-tree | ||
test-driver | ||
ylwrap |
This directory contains the GNU Compiler Collection (GCC). The GNU Compiler Collection is free software. See the files whose names start with COPYING for copying permission. The manuals, and some of the runtime libraries, are under different terms; see the individual source files for details. The directory INSTALL contains copies of the installation information as HTML and plain text. The source of this information is gcc/doc/install.texi. The installation information includes details of what is included in the GCC sources and what files GCC installs. See the file gcc/doc/gcc.texi (together with other files that it includes) for usage and porting information. An online readable version of the manual is in the files gcc/doc/gcc.info*. See http://gcc.gnu.org/bugs/ for how to report bugs usefully. Copyright years on GCC source files may be listed using range notation, e.g., 1987-2012, indicating that every year in the range, inclusive, is a copyrightable year that could otherwise be listed individually.