Find a file
Jan Hubicka 53ba8d6695 inter-procedural value range propagation
implement very basic propapgation of return value ranges from VRP
pass.  This helps std::vector's push_back since we work out value range of
allocated block.  This propagates only within single translation unit.  I hoped
we will also do the propagation at WPA stage, but that needs more work on
ipa-cp side.

I also added code auto-detecting return_nonnull and corresponding -Wsuggest-attribute.

gcc/ChangeLog:

	* cgraph.cc (add_detected_attribute_1): New function.
	(cgraph_node::add_detected_attribute): Likewise.
	* cgraph.h (cgraph_node::add_detected_attribute): Declare.
	* common.opt: Add -Wsuggest-attribute=returns_nonnull.
	* doc/invoke.texi: Document new flag.
	* gimple-range-fold.cc (fold_using_range::range_of_call):
	Use known reutrn value ranges.
	* ipa-prop.cc (struct ipa_return_value_summary): New type.
	(class ipa_return_value_sum_t): New type.
	(ipa_return_value_sum): New summary.
	(ipa_record_return_value_range): New function.
	(ipa_return_value_range): New function.
	* ipa-prop.h (ipa_return_value_range): Declare.
	(ipa_record_return_value_range): Declare.
	* ipa-pure-const.cc (warn_function_returns_nonnull): New funcion.
	* ipa-utils.h (warn_function_returns_nonnull): Declare.
	* symbol-summary.h: Fix comment.
	* tree-vrp.cc (execute_ranger_vrp): Record return values.

gcc/testsuite/ChangeLog:

	* g++.dg/ipa/devirt-2.C: Add noipa attribute to prevent ipa-vrp.
	* g++.dg/ipa/devirt-7.C: Disable ipa-vrp.
	* g++.dg/ipa/ipa-icf-2.C: Disable ipa-vrp.
	* g++.dg/ipa/ipa-icf-3.C: Disable ipa-vrp.
	* g++.dg/ipa/ivinline-1.C: Disable ipa-vrp.
	* g++.dg/ipa/ivinline-3.C: Disable ipa-vrp.
	* g++.dg/ipa/ivinline-5.C: Disable ipa-vrp.
	* g++.dg/ipa/ivinline-8.C: Disable ipa-vrp.
	* g++.dg/ipa/nothrow-1.C: Disable ipa-vrp.
	* g++.dg/ipa/pure-const-1.C: Disable ipa-vrp.
	* g++.dg/ipa/pure-const-2.C: Disable ipa-vrp.
	* g++.dg/lto/inline-crossmodule-1_0.C: Disable ipa-vrp.
	* gcc.c-torture/compile/pr106433.c: Add noipa attribute to prevent ipa-vrp.
	* gcc.c-torture/execute/frame-address.c: Likewise.
	* gcc.dg/vla-1.c: Add noipa attribute to prevent ipa-vrp.
	* gcc.dg/ipa/fopt-info-inline-1.c: Disable ipa-vrp.
	* gcc.dg/ipa/ipa-icf-25.c: Disable ipa-vrp.
	* gcc.dg/ipa/ipa-icf-38.c: Disable ipa-vrp.
	* gcc.dg/ipa/pure-const-1.c: Disable ipa-vrp.
	* gcc.dg/ipa/remref-0.c: Add noipa attribute to prevent ipa-vrp.
	* gcc.dg/tree-prof/time-profiler-1.c: Disable ipa-vrp.
	* gcc.dg/tree-prof/time-profiler-2.c: Disable ipa-vrp.
	* gcc.dg/tree-ssa/pr110269.c: Disable ipa-vrp.
	* gcc.dg/tree-ssa/pr20701.c: Disable ipa-vrp.
	* gcc.dg/tree-ssa/vrp05.c: Disable ipa-vrp.
	* gcc.dg/tree-ssa/return-value-range-1.c: New test.
2023-11-20 19:37:45 +01:00
.github Minor formatting fix for newly-added file from previous commit 2023-11-01 19:28:56 -04:00
c++tools Daily bump. 2023-06-23 00:16:38 +00:00
config Daily bump. 2023-11-14 12:23:39 +00:00
contrib Daily bump. 2023-11-15 00:16:41 +00:00
fixincludes Daily bump. 2023-10-31 00:17:32 +00:00
gcc inter-procedural value range propagation 2023-11-20 19:37:45 +01:00
gnattools Daily bump. 2023-04-26 00:17:46 +00:00
gotools Daily bump. 2023-11-04 00:16:45 +00:00
include Daily bump. 2023-11-08 00:17:35 +00:00
INSTALL
libada Daily bump. 2023-08-08 00:17:37 +00:00
libatomic Daily bump. 2023-11-14 12:23:39 +00:00
libbacktrace Daily bump. 2023-10-23 00:16:43 +00:00
libcc1 Daily bump. 2023-11-17 00:17:33 +00:00
libcody Daily bump. 2023-06-16 00:17:18 +00:00
libcpp Daily bump. 2023-11-20 00:17:10 +00:00
libdecnumber Daily bump. 2023-06-16 00:17:18 +00:00
libffi Daily bump. 2023-10-27 00:17:12 +00:00
libgcc Daily bump. 2023-11-19 00:17:38 +00:00
libgfortran Daily bump. 2023-11-09 00:17:25 +00:00
libgm2 Daily bump. 2023-11-14 12:23:39 +00:00
libgo syscall: add missing type conversion 2023-10-23 14:03:10 -07:00
libgomp Daily bump. 2023-11-16 00:17:42 +00:00
libiberty Daily bump. 2023-11-16 00:17:42 +00:00
libitm Daily bump. 2023-10-23 00:16:43 +00:00
libobjc Daily bump. 2023-10-23 00:16:43 +00:00
libphobos Daily bump. 2023-11-03 00:16:58 +00:00
libquadmath Daily bump. 2023-10-24 00:17:34 +00:00
libsanitizer Daily bump. 2023-11-19 00:17:38 +00:00
libssp Daily bump. 2023-10-23 00:16:43 +00:00
libstdc++-v3 Daily bump. 2023-11-19 00:17:38 +00:00
libvtv Daily bump. 2023-10-23 00:16:43 +00:00
lto-plugin Daily bump. 2023-10-23 00:16:43 +00:00
maintainer-scripts Daily bump. 2023-11-14 12:23:39 +00:00
zlib Daily bump. 2023-10-23 00:16:43 +00:00
.dir-locals.el
.gitattributes
.gitignore *: add modern gettext 2023-11-14 00:47:11 +01:00
ABOUT-NLS
ar-lib
ChangeLog Daily bump. 2023-11-20 00:17:10 +00:00
ChangeLog.jit
ChangeLog.tree-ssa
compile
config-ml.in LoongArch: Reimplement multilib build option handling. 2023-09-15 10:42:12 +08:00
config.guess
config.rpath
config.sub
configure *: add modern gettext 2023-11-14 00:47:11 +01:00
configure.ac *: add modern gettext 2023-11-14 00:47:11 +01:00
COPYING
COPYING.LIB
COPYING.RUNTIME
COPYING3
COPYING3.LIB
depcomp
install-sh
libtool-ldflags
libtool.m4 Config,Darwin: Allow for configuring Darwin to use embedded runpath. 2023-10-22 19:30:02 +01:00
ltgcc.m4
ltmain.sh
ltoptions.m4
ltsugar.m4
ltversion.m4
lt~obsolete.m4
MAINTAINERS MAINTAINERS: Update my email address. 2023-11-18 23:30:35 +01:00
Makefile.def *: add modern gettext 2023-11-14 00:47:11 +01:00
Makefile.in Makefile.tpl: Avoid race condition in generating site.exp from the top level 2023-11-19 11:07:09 -05:00
Makefile.tpl Makefile.tpl: Avoid race condition in generating site.exp from the top level 2023-11-19 11:07:09 -05:00
missing
mkdep
mkinstalldirs
move-if-change
multilib.am
README
SECURITY.txt secpol: consistent indentation 2023-10-05 12:00:39 -04:00
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.