![]() make_forwarders_with_degenerate_phis causes a -fcompare-debug failure on the following testcase. The problem is that on: # iftmp.4_8 = PHI <&D.2582(6), &D.2583(4), &D.2582(7), &D.2583(5)> the exact DECL_UIDs are different between -g and -g0 (which is ok, with -g the decls can have larger gaps in between the uids), which means iterative_hash_expr is different and because there are 2 pairs of edges with matching phi arguments, the function processes them in different orders. The following patch fixes it by using the iterative_hash_expr order only to determine which arguments are the same, then replaces the hashes with the minimum dest_idx in the set of matching arguments and qsorts again (which makes it stable for -fcompare-debug) and only splits edges etc. on that stable order. As a small optimization, if no arguments are equal, it doesn't do the second qsort and continues, and if all arguments of the PHI are constants or SSA_NAMEs (I think that is a pretty common case for many PHIs), then it doesn't do the second qsort either, because in that case the hash values will be stable, only computed from the constant values or SSA_NAME_VERSIONs. 2021-12-29 Jakub Jelinek <jakub@redhat.com> PR debug/103742 * tree-ssa-dce.c (make_forwarders_with_degenerate_phis): If any phi argument is not CONSTANT_CLASS_P or SSA_NAME and any arguments are equal, change second from hash value to lowest dest_idx from the edges which have equal argument and resort to ensure -fcompare-debug stability. * g++.dg/opt/pr103742.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 | ||
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 | ||
COPYING.LIB | ||
COPYING.RUNTIME | ||
COPYING3 | ||
COPYING3.LIB | ||
depcomp | ||
install-sh | ||
libtool-ldflags | ||
libtool.m4 | ||
ltgcc.m4 | ||
ltmain.sh | ||
ltoptions.m4 | ||
ltsugar.m4 | ||
ltversion.m4 | ||
lt~obsolete.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.