Go to file
Matthew Malcomson fdc5359fb6 [mid-end] Add notes to dataflow insn info when re-emitting (PR92410)
In scheduling passes, notes are removed with `remove_notes` before the
scheduling is done, and added back in with `reemit_notes` once the
scheduling has been decided.

This process leaves the notes in the RTL chain with different insn uid's
than were there before.  Having different UID's (larger than the
previous ones) means that DF_INSN_INFO_GET(insn) will access outside of
the allocated array.

This has been seen in the `regstat_bb_compute_calls_crossed` function.
This patch adds an assert to the `regstat_bb_compute_calls_crossed`
function so that bad accesses here are caught instead of going
unnoticed, and then avoids the problem.

We avoid the problem by ensuring that new notes added by `reemit_notes` have an
insn record given to them.  This is done by adding a call to
`df_insn_create_insn_record` on each note added in `reemit_notes`.
`df_insn_create_insn_record` leaves this new record zeroed out, which appears
to be fine for notes (e.g. `df_bb_refs_record` already does not set
anything except the luid for notes, and notes have no dataflow information to
record).

We add the testcase that Martin found here
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92410#c2 .
This testcase fails with the "regstat.c" change, and then succeeds with the
"haifa-sched.c" change.

There is a similar problem with labels, that the `gcc_assert` catches
when running regression tests in gcc.dg/fold-eqandshift-1.c and
gcc.c-torture/compile/pr32482.c.
This is due to the `cfg_layout_finalize` call in `bb-reorder.c` emitting
new labels, and these labels not having a dataflow df_insn_info member.

We solve this by manually calling `df_recompute_luids` on each basic
block once this pass has finished.

Testing done:
  Ran regression tests on aarch64-none-linux-gnu cross compiler.
  Bootstrapped and ran tests on aarch64-none-linux-gnu native.

gcc/ChangeLog:

2019-12-09  Matthew Malcomson  <matthew.malcomson@arm.com>

	PR middle-end/92410
	* bb-reorder.c (pass_reorder_blocks::execute): Recompute
	dataflow luids once basic blocks have been reordered.
	* haifa-sched.c (reemit_notes): Create df insn record for each
	new note.
	* regstat.c (regstat_bb_compute_calls_crossed): Assert every
	insn has an insn record before trying to use it.

gcc/testsuite/ChangeLog:

2019-12-09  Matthew Malcomson  <matthew.malcomson@arm.com>

	PR middle-end/92410
	* gcc.dg/torture/pr92410.c: New test.

From-SVN: r279124
2019-12-09 12:03:53 +00:00
INSTALL
config [ARM/FDPIC v6 02/24] [ARM] FDPIC: Handle arm*-*-uclinuxfdpiceabi in configure scripts 2019-09-10 09:37:00 +02:00
contrib Fix @multitable handling in texi2pod.pl 2019-12-07 09:57:04 +00:00
fixincludes [Darwin, fixincludes] Fix PR83531 2019-08-18 18:54:13 +00:00
gcc [mid-end] Add notes to dataflow insn info when re-emitting (PR92410) 2019-12-09 12:03:53 +00:00
gnattools PR81878: fix --disable-bootstrap --enable-languages=ada 2018-11-20 00:07:47 +00:00
gotools libgo: update to Go 1.13beta1 release 2019-09-06 18:12:46 +00:00
include [PATCH] Fix slowness in demangler 2019-11-16 10:14:14 -07:00
intl iconv.m4 (AM_ICONV_LINK): Don't overwrite CPPFLAGS. 2018-11-07 15:41:21 -07:00
libada libada: Respect `--enable-version-specific-runtime-libs' 2019-10-01 19:14:11 +00:00
libatomic Regenerate `configure' scripts for `uclinuxfdpiceabi' libtool.m4 update 2019-09-27 21:24:42 +00:00
libbacktrace * edtest.c (test1): Add noclone attribute. 2019-12-05 03:56:40 +00:00
libcc1 typeck2.c (build_functional_cast): Add location_t parameter and use it. 2019-12-05 08:59:24 +00:00
libcpp Support UTF-8 character constants for C2x. 2019-11-14 20:18:33 +00:00
libdecnumber Update copyright years. 2019-01-01 13:31:55 +01:00
libffi Regenerate `configure' scripts for `uclinuxfdpiceabi' libtool.m4 update 2019-09-27 21:24:42 +00:00
libgcc libgcc: Dont define __do_global_dtors_aux if it will be empty 2019-12-09 11:41:07 +00:00
libgfortran re PR libfortran/90374 (Fortran 2018: Support d0.d, e0.d, es0.d, en0.d, g0.d and ew.d e0 edit descriptors for output) 2019-12-01 22:29:43 +00:00
libgo re PR go/92861 (Passes relative time to sem_timedwait on GNU/Hurd) 2019-12-09 03:43:33 +00:00
libgomp [PR92511] More testing for OpenACC "present" subarrays 2019-12-09 12:40:36 +01:00
libhsail-rt Regenerate `configure' scripts for `uclinuxfdpiceabi' libtool.m4 update 2019-09-27 21:24:42 +00:00
libiberty Fix read buffer overflow in split_directories 2019-12-06 15:20:06 -07:00
libitm musl: Fix invalid tls model in libgomp and libitm PR91938 2019-12-03 11:13:38 +00:00
libobjc Unbreak objc build – with --enable-maintainer-mode 2019-11-26 21:16:30 +01:00
liboffloadmic Regenerate `liboffloadmic/plugin/configure' for r275564 ("[ARM/FDPIC v6 02/24] [ARM] FDPIC... 2019-10-01 19:57:44 +00:00
libphobos Regenerate `configure' scripts for `uclinuxfdpiceabi' libtool.m4 update 2019-09-27 21:24:42 +00:00
libquadmath Regenerate `configure' scripts for `uclinuxfdpiceabi' libtool.m4 update 2019-09-27 21:24:42 +00:00
libsanitizer re PR sanitizer/92154 (new glibc breaks arm bootstrap due to libsanitizer) 2019-11-26 10:08:31 +01:00
libssp Regenerate `configure' scripts for `uclinuxfdpiceabi' libtool.m4 update 2019-09-27 21:24:42 +00:00
libstdc++-v3 libstdc++: Improve testing for path::operator+=(const string&) 2019-12-09 09:59:00 +00:00
libvtv Regenerate `configure' scripts for `uclinuxfdpiceabi' libtool.m4 update 2019-09-27 21:24:42 +00:00
lto-plugin Regenerate `configure' scripts for `uclinuxfdpiceabi' libtool.m4 update 2019-09-27 21:24:42 +00:00
maintainer-scripts Switch gcc ftp URL's to https 2019-11-20 22:24:48 +02:00
zlib Regenerate `configure' scripts for `uclinuxfdpiceabi' libtool.m4 update 2019-09-27 21:24:42 +00:00
.dir-locals.el
.gitattributes * .gitattributes: Also check ChangeLog whitespace. 2019-10-21 23:12:04 -04:00
.gitignore Add .clangd and compile_commands.json to .gitignore. 2019-08-28 19:33:28 +00:00
ABOUT-NLS
COPYING
COPYING.LIB
COPYING.RUNTIME
COPYING3
COPYING3.LIB
ChangeLog PR 92463 - Cleanups due to minimum MPFR version bump to 3.1.0 2019-11-27 10:16:24 +01:00
ChangeLog.jit
ChangeLog.tree-ssa
MAINTAINERS Remove my name from AArch64 port maintainers 2019-11-20 09:29:13 +00:00
Makefile.def Sync top-level change from gdb 2019-06-15 21:32:03 +00:00
Makefile.in Makefile.tpl (HOST_EXPORTS): Add CXX_FOR_BUILD. 2019-08-23 15:37:22 -06:00
Makefile.tpl Makefile.tpl (HOST_EXPORTS): Add CXX_FOR_BUILD. 2019-08-23 15:37:22 -06:00
README
ar-lib Update GCC to autoconf 2.69, automake 1.15.1 (PR bootstrap/82856). 2018-10-31 17:03:16 +00:00
compile
config-ml.in Add D front-end, libphobos library, and D2 testsuite. 2018-10-28 19:51:47 +00:00
config.guess Update config.sub and config.guess. 2019-09-09 11:14:32 +02:00
config.rpath
config.sub Update config.sub and config.guess. 2019-09-09 11:14:32 +02:00
configure PR 92463 - Cleanups due to minimum MPFR version bump to 3.1.0 2019-11-27 10:16:24 +01:00
configure.ac PR 92463 - Cleanups due to minimum MPFR version bump to 3.1.0 2019-11-27 10:16:24 +01:00
depcomp
install-sh
libtool-ldflags
libtool.m4 [ARM/FDPIC v6 02/24] [ARM] FDPIC: Handle arm*-*-uclinuxfdpiceabi in configure scripts 2019-09-10 09:37:00 +02:00
ltgcc.m4
ltmain.sh libtool.m4: Sort output of 'find' to enable deterministic builds. 2018-07-05 13:13:45 -06:00
ltoptions.m4
ltsugar.m4
ltversion.m4
lt~obsolete.m4
missing
mkdep
mkinstalldirs
move-if-change
multilib.am Update GCC to autoconf 2.69, automake 1.15.1 (PR bootstrap/82856). 2018-10-31 17:03:16 +00:00
symlink-tree
test-driver Update GCC to autoconf 2.69, automake 1.15.1 (PR bootstrap/82856). 2018-10-31 17:03:16 +00:00
ylwrap

README

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.