9b8741c98f
IPA-SRA already contains a check to figure out that an otherwise dead parameter is actually required because of non-call exceptions, but it is not present at the equivalent spot where SRA figures out whether the return statement is used for anything useful. This patch adds that condition there. Unfortunately, even though this patch should be good enough for any normal (I'd even say reasonable) use of the compiler, it hints that when the user manually switches all sorts of DCE, IPA-SRA would probably leave behind problematic statements manipulating what originally were return values, just like it does for parameters (PR 93385). Fixing this properly might unfortunately be a separate issue from the mentioned bug because the LHS of a call is changed during call redirection and the caller often is not a clone. But I'll see what I can do. Meanwhile, the patch below has been bootstrapped and tested on x86_64. gcc/ChangeLog: 2021-01-18 Martin Jambor <mjambor@suse.cz> PR ipa/98690 * ipa-sra.c (ssa_name_only_returned_p): New parameter fun. Check whether non-call exceptions allow removal of a statement. (isra_analyze_call): Pass the appropriate function to ssa_name_only_returned_p. gcc/testsuite/ChangeLog: 2021-01-18 Martin Jambor <mjambor@suse.cz> PR ipa/98690 * g++.dg/ipa/pr98690.C: New test. |
||
---|---|---|
c++tools | ||
config | ||
contrib | ||
fixincludes | ||
gcc | ||
gnattools | ||
gotools | ||
include | ||
INSTALL | ||
intl | ||
libada | ||
libatomic | ||
libbacktrace | ||
libcc1 | ||
libcody | ||
libcpp | ||
libdecnumber | ||
libffi | ||
libgcc | ||
libgfortran | ||
libgo | ||
libgomp | ||
libhsail-rt | ||
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.