GCC modified for the FreeChainXenon project
Find a file
Nathaniel Shead dd9d14f7d5 c++: Defer emitting inline variables [PR113708]
Inline variables are vague-linkage, and may or may not need to be
emitted in any TU that they are part of, similarly to e.g. template
instantiations.

Currently 'import_export_decl' assumes that inline variables have
already been emitted when it comes to end-of-TU processing, and so
crashes when importing non-trivially-initialised variables from a
module, as they have not yet been finalised.

This patch fixes this by ensuring that inline variables are always
deferred till end-of-TU processing, unifying the behaviour for module
and non-module code.

	PR c++/113708

gcc/cp/ChangeLog:

	* decl.cc (make_rtl_for_nonlocal_decl): Defer inline variables.
	* decl2.cc (import_export_decl): Support inline variables.

gcc/testsuite/ChangeLog:

	* g++.dg/debug/dwarf2/inline-var-1.C: Reference 'a' to ensure it
	is emitted.
	* g++.dg/debug/dwarf2/inline-var-3.C: Likewise.
	* g++.dg/modules/init-7_a.H: New test.
	* g++.dg/modules/init-7_b.C: New test.

Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
2024-02-15 06:07:50 +11:00
.github
c++tools Update copyright years. 2024-01-03 12:19:35 +01:00
config Daily bump. 2024-01-12 00:17:54 +00:00
contrib Daily bump. 2024-02-06 00:18:46 +00:00
fixincludes
gcc c++: Defer emitting inline variables [PR113708] 2024-02-15 06:07:50 +11:00
gnattools Update Copyright year in ChangeLog files 2024-01-03 11:35:18 +01:00
gotools
include Daily bump. 2024-01-14 00:17:47 +00:00
INSTALL
libada Update copyright years. 2024-01-03 12:19:35 +01:00
libatomic Daily bump. 2024-02-04 00:16:59 +00:00
libbacktrace Update copyright years. 2024-01-05 08:54:28 +01:00
libcc1 Daily bump. 2024-02-10 00:17:14 +00:00
libcody Update Copyright year in ChangeLog files 2024-01-03 11:35:18 +01:00
libcpp Daily bump. 2024-02-02 00:18:18 +00:00
libdecnumber Update copyright years. 2024-01-03 12:19:35 +01:00
libffi
libgcc Daily bump. 2024-02-14 00:17:32 +00:00
libgfortran Fortran: Implement read_x for UTF-8 encoded files. 2024-02-14 07:57:53 -08:00
libgm2 Daily bump. 2024-02-14 00:17:32 +00:00
libgo libgo: bump libgo version for GCC 14 release 2024-02-05 11:28:30 -08:00
libgomp Daily bump. 2024-02-13 00:17:51 +00:00
libgrust Daily bump. 2024-01-17 00:21:29 +00:00
libiberty Daily bump. 2024-02-13 00:17:51 +00:00
libitm Daily bump. 2024-02-06 00:18:46 +00:00
libobjc Update copyright years. 2024-01-03 12:19:35 +01:00
libphobos Daily bump. 2024-02-13 00:17:51 +00:00
libquadmath Daily bump. 2024-01-04 00:18:45 +00:00
libsanitizer Daily bump. 2024-02-07 00:18:31 +00:00
libssp Daily bump. 2024-02-07 00:18:31 +00:00
libstdc++-v3 libstdc++: C++ item p2442 is version 1 only 2024-02-14 02:30:25 +01:00
libvtv Update copyright years. 2024-01-03 12:19:35 +01:00
lto-plugin Update copyright years. 2024-01-03 12:19:35 +01:00
maintainer-scripts
zlib
.dir-locals.el
.gitattributes
.gitignore
ABOUT-NLS
ar-lib
ChangeLog Daily bump. 2024-02-11 00:17:01 +00:00
ChangeLog.jit
ChangeLog.tree-ssa
compile
config-ml.in
config.guess
config.rpath
config.sub
configure build: Add libgrust as compilation modules 2023-12-14 13:58:57 +01:00
configure.ac build: Add libgrust as compilation modules 2023-12-14 13:58:57 +01:00
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 Add Myself to Write After Approval and DCO List 2024-02-10 12:49:29 -06:00
Makefile.def gccrs: Fix missing build dependency 2024-01-16 16:23:02 +01:00
Makefile.in gccrs: Fix missing build dependency 2024-01-16 16:23:02 +01:00
Makefile.tpl Pass GUILE down to subdirectories 2024-01-09 08:02:31 -07:00
missing
mkdep
mkinstalldirs
move-if-change
multilib.am
README
SECURITY.txt SECURITY.txt: Drop "exploitable" in reference to hardening issues 2024-01-09 10:49:01 -05:00
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.