4ec9d09623
As discussed in https://sourceware.org/bugzilla/show_bug.cgi?id=26987 , for very large bounds (which don't fit into HOST_WIDE_INT) GCC emits invalid DWARF. In DWARF2, DW_AT_{lower,upper}_bound were constant reference class. In DWARF3 they are block constant reference and the Static and Dynamic Properties of Types chapter says: "For a block, the value is interpreted as a DWARF expression; evaluation of the expression yields the value of the attribute." In DWARF4/5 they are constant exprloc reference class. Now, for add_AT_wide we use DW_FORM_data16 (valid in constant class) when -gdwarf-5, but otherwise just use DW_FORM_block1, which is not constant class, but block. For DWARF3 this means emitting clearly invalid DWARF, because the DW_FORM_block1 should contain a DWARF expression, not random bytes containing the constant directly. For DWARF2/DWARF4/5 it could be considered a GNU extension, but a very badly designed one when it means something different in DWARF3. The following patch uses add_AT_wide only if we know we'll be using DW_FORM_data16, and otherwise wastes 2 extra bytes and emits in there DW_OP_implicit_value <size> before the constant. 2020-12-03 Jakub Jelinek <jakub@redhat.com> * dwarf2out.c (add_scalar_info): Only use add_AT_wide for 128-bit constants and only in dwarf-5 or later, where DW_FORM_data16 is available. Otherwise use DW_FORM_block*/DW_FORM_exprloc with DW_OP_implicit_value to describe the constant. |
||
---|---|---|
config | ||
contrib | ||
fixincludes | ||
gcc | ||
gnattools | ||
gotools | ||
include | ||
INSTALL | ||
intl | ||
libada | ||
libatomic | ||
libbacktrace | ||
libcc1 | ||
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.