Go to file
Jakub Jelinek 430dca620f cfgrtl: Fix up locus comparison in unique_locus_on_edge_between_p [PR104237]
The testcase in the PR (not included for the testsuite because we don't
have an (easy) way to -fcompare-debug LTO, we'd need 2 compilations/linking,
one with -g and one with -g0 and -fdump-rtl-final= at the end of lto1
and compare that) has different code generation for -g vs. -g0.

The difference appears during expansion, where we have a goto_locus
that is at -O0 compared to the INSN_LOCATION of the previous and next insn
across an edge.  With -g0 the locations are equal and so no nop is added.
With -g the locations aren't equal and so a nop is added holding that
location.

The reason for the different location is in the way how we stream in
locations by lto1.
We have lto_location_cache::apply_location_cache that is called with some
set of expanded locations, qsorts them, creates location_t's for those
and remembers the last expanded location.
lto_location_cache::input_location_and_block when read in expanded_location
is equal to the last expanded location just reuses the last location_t
(or adds/changes/removes LOCATION_BLOCK in it), when it is not queues
it for next apply_location_cache.  Now, when streaming in -g input, we can
see extra locations that don't appear with -g0, and if we are unlucky
enough, those can be sorted last during apply_location_cache and affect
what locations are used from the single entry cache next.
In particular, second apply_location_cache with non-empty loc_cache in
the testcase has 14 locations with -g0 and 16 with -g and those 2 extra
ones sort both last (they are the same).  The last one from -g0 then
appears to be input_location_and_block sourced again, for -g0 triggers
the single entry cache, while for -g it doesn't and so apply_location_cache
will create for it another location_t with the same content.

The following patch fixes it by comparing everything we care about the
location instead (well, better in addition) to a simple location_t ==
location_t check.  I think we don't care about the sysp flag for debug
info...

2022-01-28  Jakub Jelinek  <jakub@redhat.com>

	PR lto/104237
	* cfgrtl.cc (loc_equal): New function.
	(unique_locus_on_edge_between_p): Use it.
2022-01-28 11:48:18 +01:00
c++tools
config
contrib Daily bump. 2022-01-28 00:16:32 +00:00
fixincludes Fix glitch in entry for vxworks_posix_open 2022-01-17 13:23:40 +00:00
gcc cfgrtl: Fix up locus comparison in unique_locus_on_edge_between_p [PR104237] 2022-01-28 11:48:18 +01:00
gnattools
gotools
include
INSTALL
intl
libada
libatomic Daily bump. 2022-01-25 00:16:27 +00:00
libbacktrace
libcc1
libcody
libcpp Daily bump. 2022-01-25 00:16:27 +00:00
libdecnumber
libffi
libgcc Daily bump. 2022-01-26 00:16:38 +00:00
libgfortran Daily bump. 2022-01-27 00:16:29 +00:00
libgo runtime: build panic32.go on amd64p32 2022-01-20 19:06:50 -08:00
libgomp Daily bump. 2022-01-28 00:16:32 +00:00
libiberty Daily bump. 2022-01-16 00:16:26 +00:00
libitm
libobjc
liboffloadmic
libphobos
libquadmath Daily bump. 2022-01-12 00:16:39 +00:00
libsanitizer
libssp
libstdc++-v3 Daily bump. 2022-01-28 00:16:32 +00:00
libvtv
lto-plugin
maintainer-scripts
zlib
.dir-locals.el
.gitattributes
.gitignore
ABOUT-NLS
ar-lib
ChangeLog Daily bump. 2022-01-26 00:16:38 +00:00
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 MAINTAINERS: adjust requested email address 2022-01-20 13:40:42 +01:00
Makefile.def Revert "Fix PR 67102: Add libstdc++ dependancy to libffi" [PR67102] 2022-01-25 18:46:21 +01:00
Makefile.in Revert "Fix PR 67102: Add libstdc++ dependancy to libffi" [PR67102] 2022-01-25 18:46:21 +01:00
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.