Watch
1
Fork
You've already forked gcc
0
forked from gcc/gcc
Mirror of the gcc repository for submitting merge requests.
  • C++ 30.8%
  • C 30.2%
  • Ada 14.3%
  • D 6.1%
  • Go 5.6%
  • Other 12.5%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Lewis Hyatt 4c85f7cf58
lto: Support #pragma GCC diagnostic [PR80922] [PR106823] [PR107936]
After the previous changes in this series, the LTO front end always has an
appropriate linemap structure for interpreting diagnostic pragmas, so it is
straightforward to implement them, as is done here.

The pragmas are streamed out in each linemap section; since all locations
from a given linemap section will be contiguous in the reconstructed
linemap, they are automatically ordered properly for the existing diagnostic
pragma infrastructure to work as-is.

One wrinkle is that a single function may have been streamed out in multiple
sections. (For example, an inline function will be streamed out in all
partitions that need it.) In this case, when merging them, LTO keeps only
one of the sections, as directed by the linker resolution, so the diagnostic
pragmas that will be in force (in case they were not the same for the
different translation units) will be whichever were applicable to the
section LTO decided to keep.

gcc/ChangeLog:

	PR middle-end/80922
	PR middle-end/106823
	PR lto/107936
	* lto-streamer-in.cc (lto_create_loc_map): Process diagnostic
	pragmas from the linemap sections.
	* lto-streamer-out.cc (location_output::produce_linemap_section):
	Stream diagnostic pragmas into the linemap section.

gcc/testsuite/ChangeLog:

	PR middle-end/80922
	PR middle-end/106823
	PR lto/107936
	* gcc.dg/lto/pr106823_0.c: New test.
	* gcc.dg/lto/pr107936_0.c: New test.
	* gcc.dg/lto/pr107936_1.c: New test.
	* gcc.dg/lto/pr80922-1_0.c: New test.
	* gcc.dg/lto/pr80922-1_1.c: New test.
	* gcc.dg/lto/pr80922-2_0.c: New test.
	* gcc.dg/lto/pr80922-2_1.c: New test.
	* gcc.dg/lto/pr80922-2_2.c: New test.
2026-07-17 08:46:45 -04:00
.forgejo forge: Add a prototype CODEOWNERS file 2026-06-05 17:58:58 +01:00
.github
c++tools Daily bump. 2026-06-30 00:16:45 +00:00
config Daily bump. 2026-07-13 00:16:29 +00:00
contrib build: testsuite: Generate effective targets from auto-host.h 2026-07-17 09:53:34 +02:00
fixincludes Daily bump. 2026-06-30 00:16:45 +00:00
gcc lto: Support #pragma GCC diagnostic [PR80922] [PR106823] [PR107936] 2026-07-17 08:46:45 -04:00
gnattools Daily bump. 2026-06-30 00:16:45 +00:00
gotools Daily bump. 2026-06-30 00:16:45 +00:00
include Daily bump. 2026-07-01 00:16:44 +00:00
INSTALL
libada Daily bump. 2026-06-30 00:16:45 +00:00
libatomic Daily bump. 2026-06-30 00:16:45 +00:00
libbacktrace Daily bump. 2026-07-07 00:16:36 +00:00
libcc1 Daily bump. 2026-06-30 00:16:45 +00:00
libcody Daily bump. 2026-05-31 00:16:35 +00:00
libcpp libcpp: Preparation for LTO linemap changes 2026-07-17 08:33:42 -04:00
libdecnumber Daily bump. 2026-05-31 00:16:35 +00:00
libffi Daily bump. 2026-06-18 00:16:35 +00:00
libga68 Daily bump. 2026-05-31 00:16:35 +00:00
libgcc Daily bump. 2026-07-12 00:16:27 +00:00
libgcobol Daily bump. 2026-07-17 00:16:39 +00:00
libgfortran Daily bump. 2026-07-16 00:16:40 +00:00
libgm2 Daily bump. 2026-07-10 00:16:35 +00:00
libgo libgo: cmd/go: use 'gcloud storage cp' instead of 'gsutil cp' 2026-05-02 16:21:35 -07:00
libgomp openmp: Add OMPT variant of GOMP_has_masked_thread_num 2026-07-17 12:42:47 +02:00
libgrust Daily bump. 2026-06-30 00:16:45 +00:00
libiberty Daily bump. 2026-07-02 00:16:40 +00:00
libitm Daily bump. 2026-07-10 00:16:35 +00:00
libobjc Daily bump. 2026-06-30 00:16:45 +00:00
libphobos Daily bump. 2026-07-11 00:16:37 +00:00
libquadmath Daily bump. 2026-06-30 00:16:45 +00:00
libsanitizer Daily bump. 2026-06-30 00:16:45 +00:00
libssp Daily bump. 2026-07-04 00:16:37 +00:00
libstdc++-v3 libstdc++: Use __FLT_EVAL_METHOD__ to enable test for piecewise distributions. 2026-07-17 12:25:15 +02:00
libvtv Daily bump. 2026-06-30 00:16:45 +00:00
lto-plugin Daily bump. 2026-06-30 00:16:45 +00:00
maintainer-scripts Daily bump. 2026-04-23 00:16:32 +00:00
zlib Daily bump. 2025-12-30 00:16:33 +00:00
.b4-config
.dir-locals.el
.editorconfig editorconfig: Add rules for yaml/yml files. 2026-07-07 11:02:11 +01:00
.gitattributes
.gitignore Rust: Move 'libformat_parser' build into the GCC build directory 2025-08-05 16:36:43 +02:00
ABOUT-NLS
ar-lib
ChangeLog Daily bump. 2026-07-17 00:16:39 +00:00
ChangeLog.jit
ChangeLog.tree-ssa
compile
config-ml.in toplevel: Unbreak Ada build [PR123490] 2026-01-10 11:36:25 +01:00
config.guess
config.rpath
config.sub
configure build: Preserve all *_FOR_TARGET environment variables if already set. 2026-07-11 22:45:55 -06:00
configure.ac s390: Remove -m31 support 2026-07-09 09:28:12 +02:00
COPYING
COPYING.LIB
COPYING.RUNTIME
COPYING3
COPYING3.LIB
depcomp
install-sh
libtool-ldflags
libtool.m4 build: Cherry-pick libtool.m4 support for GNU ld *_sol2 emulations 2025-12-29 12:09:35 +01:00
ltgcc.m4
ltmain.sh ltmain.sh: allow more flags at link-time 2024-09-25 19:05:24 +01:00
ltoptions.m4
ltsugar.m4
ltversion.m4
lt~obsolete.m4
MAINTAINERS MAINTAINERS: Add myself to write after approval 2026-07-16 16:51:02 +01:00
MAINTAINERS.yml MAINTAINERS: Add myself to write after approval 2026-07-16 16:51:02 +01:00
Makefile.def toplevel: Fix typos in build files 2026-05-30 19:49:31 +05:30
Makefile.in toplevel: Fix typos in build files 2026-05-30 19:49:31 +05:30
Makefile.tpl toplevel: Fix typos in build files 2026-05-30 19:49:31 +05:30
missing
mkdep
mkinstalldirs
move-if-change
multilib.am
README
SECURITY.txt a68: top-level misc files 2025-11-30 01:52:24 +01:00
symlink-tree bugzilla: remove gcc-bugs@ mailing list address 2026-01-09 11:10:38 +01:00
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.