b83604c75f
PR debug/98751 reports an issue in which most of libgccjit's tests fails in DWARF 5 handling with `.Ldebug_loc2' is already defined" asm errors. The bogus label is being emitted at the 3rd in-process iteration, at: 31673 ASM_OUTPUT_LABEL (asm_out_file, loc_section_label); which on the initial iteration emits: 145 │ .Ldebug_loc0: on the 2nd iteration: 145 │ .Ldebug_loc1: and on the 3rd iteration: 145 │ .Ldebug_loc2: which is a duplicate of a label emitted earlier: 138 │ .section .debug_loclists,"",@progbits 139 │ .long .Ldebug_loc3-.Ldebug_loc2 140 │ .Ldebug_loc2: 141 │ .value 0x5 142 │ .byte 0x8 143 │ .byte 0 144 │ .long 0 145 │ .Ldebug_loc2: The issue seems to be that init_sections_and_labels creates the label ASM_GENERATE_INTERNAL_LABEL (loc_section_label, DEBUG_LOC_SECTION_LABEL, generation); where "generation" is a static local to init_sections_and_labels that increments, and thus eventually hits the duplicate value. It appears that this value is intended to be either 0 or 1, but in the libgccjit case the compilation code can be invoked an arbitrary number of times in-process, and hence can eventually lead to a label name collision. This patch adds code to dwarf2out_c_finalize (called by toplev::finalize in libgccjit) to reset the generation counts, fixing the issue. gcc/ChangeLog: PR debug/98751 * dwarf2out.c (output_line_info): Rename static variable "generation", moving it out of the function to... (output_line_info_generation): New. (init_sections_and_labels): Likewise, renaming the variable to... (init_sections_and_labels_generation): New. (dwarf2out_c_finalize): Reset the new variables. |
||
---|---|---|
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.