aboutsummaryrefslogtreecommitdiff
path: root/contrib
AgeCommit message (Collapse)AuthorFilesLines
4 hoursuninclude: Add lib/gcc/<anything>/include as an possible include dirAndrew Pinski1-2/+3
While running uninclude on PR99912's preprocessed source uninclude didn't uninclude some of the x86_64 target headers. This was because `lib/gcc/<anything>/include` was not noticed as an possible system include dir. It supported `gcc-lib/<anything>/include` though. contrib/ChangeLog: * uninclude: Add `lib/gcc/<anything>/include`.
7 daysDaily bump.GCC Administrator1-0/+5
7 dayscompare_tests: Improve non-unique tests reportChristophe Lyon1-6/+14
If the results include several configurations (schedule of variations), do not report summary lines as duplicates. Indeed with several configurations, it's likely that the results contain the same # of expected passes XXXXX The patch just keeps lines starting with test state prefix to avoid this problem. contrib/ChangeLog: * compare_tests: Improve non-unique tests report when testing several configurations.
9 daysDaily bump.GCC Administrator1-0/+4
10 dayscompare_tests: Report non-unique test namesChristophe Lyon1-1/+25
Test "names" (the string after 'PASS:' or 'FAIL:' etc... is expected to be unique, otherwise this will confuse comparison scripts. This patch displays the lists of non-unique test names in the 'before' and in the 'now' results. contrib/ChangeLog: * compare_tests: Report non-unique test names.
2025-08-18Daily bump.GCC Administrator1-0/+5
2025-08-17MAINTAINERS, contrib: Appease check-MAINTAINERS.py (email order)Filip Kastl1-2/+2
The contrib/check-MAINTAINERS.py script sorts by surname, name, bugzilla handle and email (in this order). Document this. Switch around Andrew Pinski's entries in Contributing under DCO. Pushing as obvious. ChangeLog: * MAINTAINERS: Switch around Andrew Pinski's entries in Contributing under DCO. contrib/ChangeLog: * check-MAINTAINERS.py: Document the way the script sorts entries. Signed-off-by: Filip Kastl <fkastl@suse.cz>
2025-08-08Daily bump.GCC Administrator1-0/+8
2025-08-07contrib/download_prerequisites: Update GMP, MPFR, MPC [PR120237]Tobias Burnus3-9/+9
Download newer versions of GMP, MPFR and MPC (the latest); besides the usual bug fixes and smaller features, MPFR adds new functions for C23, some of which are already used in GCC in the middle (fold-const-call.cc) and in Fortran 2023 for the 'pi' trignonometric functions, if MPFR is new enough. contrib/ChangeLog: PR other/120237 * download_prerequisites: Update to download GMP 6.3.0 (before 6.2.1), MPFR 4.2.2 (before 4.1.0), and MPC 1.3.1 (before 1.2.1). * prerequisites.md5: Update hash. * prerequisites.sha512: Likewise.
2025-07-29Daily bump.GCC Administrator1-0/+5
2025-07-28git_commit.py: add "diagnostics" to bug componentsDavid Malcolm1-0/+1
contrib/ChangeLog * gcc-changelog/git_commit.py: Add "diagnostics" to bug components.
2025-07-26Daily bump.GCC Administrator1-0/+9
2025-07-25diagnostics: introduce namespace diagnostics::pathsDavid Malcolm1-1/+1
Move more diagnostic-specific code from gcc/ to gcc/diagnostics/ No functional change intended. contrib/ChangeLog: * filter-clang-warnings.py: Update for move of diagnostic-path-output.cc to diagnostics/paths-output.cc. gcc/ChangeLog: * Makefile.in (OBJS): Replace lazy-diagnostic-path.o with diagnostics/lazy-paths.o. (OBJS-libcommon): Replace diagnostic-path.o with diagnostics/paths.o, diagnostic-path-output.o with diagnostics/paths-output.o, and selftest-diagnostic-path.o with diagnostics/selftest-paths.o. (EXTRA_BACKEND_OBJS): Replace lazy-diagnostic-path.o with diagnostics/lazy-paths.o. * diagnostic-format-html.cc: Update #include for "diagnostic-path.h" moving to "diagnostics/paths.h", diagnostic_thread_id_t to diagnostics::paths::thread_id_t, diagnostic_event_id_t to diagnostics::paths::event_id_t, diagnostic_path to diagnostics::paths::path, and diagnostic_thread to diagnostics::paths::thread, and diagnostic_event to diagnostics::paths::event. * diagnostic-format-html.h: Likewise. * diagnostic-format-sarif.cc: Likewise. Update PROPERTY_PREFIX for threadFlowLocations from "gcc/diagnostic_event/" to "gcc/diagnostics/paths/event/". * diagnostic-format-text.cc: Likewise. * diagnostic-format-text.h: Likewise. * diagnostic.cc: Likewise. * diagnostic.h: Likewise. * diagnostic-event-id.h: Move to... * diagnostics/event-id.h: ...here, updating header guard. (diagnostics:paths:event_id_t): New typedef. (diagnostic_thread_id_t): Replace with... (diagnostics:paths:thread_id_t): New typedef. * lazy-diagnostic-path.cc: Move to... * diagnostics/lazy-paths.cc: ...here. Update for above changes, lazy_diagnostic_path becomes diagnostics::paths::lazy_path. (lazy_diagnostic_path_cc_tests): Rename to... (diagnostics_lazy_paths_cc_tests): ...this. * lazy-diagnostic-path.h: Move to... * diagnostics/lazy-paths.h: ...here, updating header guard. Update for above changes. * diagnostic-path-output.cc: Move to... * diagnostics/paths-output.cc: ...here. Update for above changes. (diagnostic_path_output_cc_tests): Rename to... (diagnostics_paths_output_cc_tests): ...this. * diagnostic-path.cc: Move to... * diagnostics/paths.cc: ...here. Update for above changes. * diagnostic-path.h: Move to... * diagnostics/paths.h: ...here, updating header guard. Update #include for moving "diagnostic-event-id.h" to "diagnostics/event-id.h". (class diagnostic_event): Convert to... (class diagnostics::paths::event): ...this. (class diagnostic_thread): Convert to... (class diagnostics::paths::thread): ...this. (class diagnostic_path): Convert to... (class diagnostics::paths::path): ...this. * diagnostic-show-locus.cc: Update for above changes. * doc/analyzer.texi: Likewise. * selftest-diagnostic-path.cc: Move to... * diagnostics/selftest-paths.cc: ...here. Update for above changes, and for "selftest-diagnostic-path.h" moving to "diagnostics/selftest-paths.h". * selftest-diagnostic-path.h: Move to... * diagnostics/selftest-paths.h: ...here, updating header guard. Update for above changes. * libgdiagnostics.cc: Update for above changes. * libsarifreplay.cc: Update property prefix for threadFlowLocations from "gcc/diagnostic_event/" to "gcc/diagnostics/paths/event/". * pretty-print-format-impl.h: Update for above changes. * pretty-print.cc: Likewise. * selftest-run-tests.cc (selftest::run_tests): Update for renaming of lazy_diagnostic_path_cc_tests to diagnostics_lazy_paths_cc_tests, and of diagnostic_path_output_cc_tests to diagnostics_paths_output_cc_tests. * selftest.h (lazy_diagnostic_path_cc_tests): Replace decl with... (diagnostics_lazy_paths_cc_tests): ...this. (diagnostic_path_output_cc_tests): Replace decl with... (diagnostics_paths_output_cc_tests): ...this. * simple-diagnostic-path.cc: Clarify that this relates to "tree" and thus shouldn't be in "diagnostics". Update for above changes. * simple-diagnostic-path.h: Likewise. gcc/analyzer/ChangeLog: * access-diagram.cc: Update for changes to diagnostic paths: "diagnostic-path.h" moving to "diagnostics/paths.h", "diagnostic-event-id.h" moving to "diagnostics/event-id.h", diagnostic_event_id_t to diagnostics::paths::event_id_t, diagnostic_path to diagnostics::paths::path, and diagnostic_event to diagnostics::paths::event. * access-diagram.h: Likewise. * analyzer.cc: Likewise. * bounds-checking.cc: Likewise. * call-info.cc: Likewise. * checker-event.cc: Likewise. * checker-event.h: Likewise. * checker-path.cc: Likewise. * checker-path.h: Likewise. * common.h: Likewise. * diagnostic-manager.cc: Likewise. * pending-diagnostic.cc: Likewise. * pending-diagnostic.h: Likewise. * program-point.cc: Likewise. * program-state.cc: Likewise. * region-model.cc: Likewise. * sm-fd.cc: Likewise. * sm-file.cc: Likewise. * sm-malloc.cc: Likewise. * sm-pattern-test.cc: Likewise. * sm-sensitive.cc: Likewise. * sm-signal.cc: Likewise. * sm-taint.cc: Likewise. * varargs.cc: Likewise. gcc/testsuite/ChangeLog: * gcc.dg/plugin/analyzer_gil_plugin.cc: Update #include for "diagnostic-path.h" moving to "diagnostics/paths.h", diagnostic_thread_id_t to diagnostics::paths::thread_id_t, diagnostic_event_id_t to diagnostics::paths::event_id_t, diagnostic_path to diagnostics::paths::path, and diagnostic_thread to diagnostics::paths::thread, and diagnostic_event to diagnostics::paths::event. * gcc.dg/plugin/diagnostic_plugin_test_paths.cc: Likewise. * lib/sarif.py (get_state_graph): Update property prefix for threadFlowLocations from "gcc/diagnostic_event/" to "gcc/diagnostics/paths/event/". * gcc.dg/sarif-output/include-chain-2.h: Update comment. libcpp/ChangeLog: * include/rich-location.h: Replace diagnostic_path with diagnostics::paths::path. Signed-off-by: David Malcolm <dmalcolm@redhat.com>
2025-07-25diagnostics: introduce a "gcc/diagnostics" subdirectoryDavid Malcolm1-1/+1
The "gcc" subdirectory of our source tree currently contains a total of almost 1000 .cc and .h files, enough to hit rate-limiting in some git web UIs, and obscuring the logical relationships between subsystems. In r16-2211-ga5d9debedd2f46 I started introducing a "namespace diagnostics" so it makes sense to move such code into a new "gcc/diagnostics" subdirectory. My intent is for the "diagnostics" namespace/directory to contain shared parts of the diagnostics code that are in libcommon, in particular which don't have knowledge of trees. This patch begins moving of the existing code within "namespace diagnostics" into a new "gcc/diagnostics" subdirectory. No functional change intended. renamed: gcc/diagnostic-digraphs.cc -> gcc/diagnostics/digraphs.cc renamed: gcc/diagnostic-digraphs.h -> gcc/diagnostics/digraphs.h renamed: gcc/diagnostic-state-to-dot.cc -> gcc/diagnostics/state-graphs-to-dot.cc renamed: gcc/diagnostic-state-graphs.cc -> gcc/diagnostics/state-graphs.cc renamed: gcc/diagnostic-state-graphs.h -> gcc/diagnostics/state-graphs.h contrib/ChangeLog: * gcc.doxy (INPUT): Add gcc/diagnostics subdir. gcc/ChangeLog: * Makefile.in (OBJS-libcommon): Rename diagnostic-digraphs.o to diagnostics/digraphs.o. Rename diagnostic-state-graphs.o to diagnostics/state-graphs.o. Rename diagnostic-state-to-dot.o to diagnostics/state-graphs-to-dot.o. (PLUGIN_HEADERS): Add $(srcdir)/diagnostics/*.h. (install-plugin:): Likewise. * configure: Regenerate. * configure.ac (gccdepdir): Add "diagnostics" to directories. * diagnostic-format-html.cc: Update #includes for move of "diagnostic-digraphs.h" to "diagnostics/digraphs.h" and of move of "diagnostic-state-graphs.h" to "diagnostics/state-graphs.h". * diagnostic-format-sarif.cc: Likewise. * diagnostic-path.cc: Likewise for state-graphs.h * diagnostic-digraphs.cc: Move... * diagnostics/digraphs.cc: ...to here. Update #include for renaming of digraphs.h. (selftest::diagnostic_digraphs_cc_tests): Rename to... (selftest::diagnostics_digraphs_cc_tests): ...this. * diagnostic-digraphs.h: Move... * diagnostics/digraphs.h: ...to here, updating header guard. * diagnostic-state-to-dot.cc: Move... * diagnostics/state-graphs-to-dot.cc: ...to here. Update #include of state-graphs.h. * diagnostic-state-graphs.cc: Move... * diagnostics/state-graphs.cc: ...to here. Update #include of state-graphs.h. (selftest::diagnostic_state_graphs_cc_tests): Rename... (selftest::diagnostics_state_graphs_cc_tests): ...to this. * diagnostic-state-graphs.h: Move... * diagnostics/state-graphs.h: ...to here, updating header guard. * libgdiagnostics.cc: Update #includes for move of "diagnostic-digraphs.h" to "diagnostics/digraphs.h" and of move of "diagnostic-state-graphs.h" to "diagnostics/state-graphs.h". * selftest-run-tests.cc (selftest::run_tests): Update for function renamings that reflect file renamings. * selftest.h (selftest::diagnostic_digraphs_cc_tests): Rename to... (selftest::diagnostics_digraphs_cc_tests): ...this. (selftest::diagnostic_state_graphs_cc_tests): Rename... (selftest::diagnostics_state_graphs_cc_tests): ...to this. gcc/analyzer/ChangeLog: * ana-state-to-diagnostic-state.cc: Update #include for move of "diagnostic-state-graphs.h" to "diagnostics/state-graphs.h". * ana-state-to-diagnostic-state.h: Likewise. * checker-event.cc: Likewise. * checker-event.h: Update #include for move of "diagnostic-digraphs.h" to "diagnostics/digraphs.h". * program-state.cc: : Update #include for move of "diagnostic-state-graphs.h" to "diagnostics/state-graphs.h". gcc/testsuite/ChangeLog: * gcc.dg/plugin/diagnostic_plugin_test_graphs.cc: Update #include for move of "diagnostic-digraphs.h" to "diagnostics/digraphs.h". Signed-off-by: David Malcolm <dmalcolm@redhat.com>
2025-07-24Daily bump.GCC Administrator1-0/+5
2025-07-23contrib: add 'zlib' to ignored_prefixesSam James1-0/+1
This fixes the same problem for syncing zlib that H.J. hit for libffi in r12-4561-g25ab851dd333d7. contrib/ChangeLog: PR other/105404 * gcc-changelog/git_commit.py (ignored_prefixes): Add zlib/.
2025-07-17Daily bump.GCC Administrator1-0/+4
2025-07-16contrib: add gcc/text-art to Doxygen inputDavid Malcolm1-1/+1
contrib/ChangeLog: * gcc.doxy (INPUT): Add directory "gcc/text-art". Signed-off-by: David Malcolm <dmalcolm@redhat.com>
2025-07-12Daily bump.GCC Administrator1-0/+5
2025-07-11Stop updating gcc-12 branchRichard Biener1-1/+1
contrib/ * gcc-changelog/git_update_version.py: Stop updating gcc-12 branch.
2025-07-09Daily bump.GCC Administrator1-0/+4
2025-07-08Handle non default git prefix configurationsPierre-Emmanuel Patry1-1/+1
Mklog parses the diff content from prepare-commit-msg hook but fails when git has been configured with mnemonicPrefix. Forcing the default values for the prefixes would set a distinct diff configuration supported by mklog and prevent most failures. contrib/ChangeLog: * prepare-commit-msg: Force default git prefixes. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2025-07-08Daily bump.GCC Administrator1-0/+15
2025-07-07Ignore more clang warnings in contrib/filter-clang-warnings.pyMartin Jambor1-7/+28
in contrib we have a script filter-clang-warnings.py which supposedly filters out uninteresting warnings emitted by clang when it compiles GCC. I'm not sure if anyone else uses it but our internal SUSE testing infrastructure does. Since Martin Liška left, I have mostly ignored the warnings and so they have multiplied. In an effort to improve the situation, I have tried to fix those warnings which I think are worth it and would like to adjust the filtering script so that we get to zero "interesting" warnings again. The changes are the following: 1. Ignore -Woverloaded-shift-op-parentheses warnings. IIUC, those make some sense when << and >> are used for I/O but since that is not the case in GCC they are not really interesting. 2. Ignore -Wunused-function and -Wunneeded-internal-declaration. I think it is OK to occasionally prepare APIs before they are used (and with our LTO we should be able to get rid of them). 3. Ignore -Wvla-cxx-extension and -Wunused-command-line-argument which just don't seem to be useful. 4. Ignore -Wunused-private-field warning in diagnostic-path-output.cc which can only be correct if quite a few functions are removed and looks like it is just not an oversight: gcc/diagnostic-path-output.cc:271:35: warning: private field 'm_logical_loc_mgr' is not used [-Wunused-private-field] 5. Ignore a case in -Wunused-but-set-variable about named_args which is used in a piece of code behind an ifdef in ipa-strub.cc. 6. Adjust the gimple-match and generic-match filters to the fact that we now have multiple such files. 7. Ignore warnings about using memcpy to copy around wide_ints, like the one below. I seem to remember wide-int has undergone fairly rigorous review and TBH I just hope I know what we are doing. gcc/wide-int.h:1198:11: warning: first argument in call to 'memcpy' is a pointer to non-trivially copyable type 'wide_int_storage' [-Wnontrivial-memcall] 8. Ignore -Wc++11-narrowing warning reported in omp-builtins.def when it is included from JIT. The code probably has a bigger issue described in PR 120960. 9. Since the patch number 14 in the original series did not get approved, I assume that private member field m_wanted_type of class element_expected_type_with_indirection in c-family/c-format.cc will get a use sooner or later, so I ignore a warning about it being unused. 10. I have decided to ignore warnings in m2/gm2-compiler-boot about unused stuff (all reported unused stuff are variables). These sources are in the build directory so I assume they are somehow generated and so warnings about unused things are a bit expected and probably not too bad. 11. On the Zulip chat, I have informed Rust folks they have a bunch of -Wunused-private-field cases in the FE. Until they sort it out I'm ignoring these. I might add the missing explicit type-cast case here too if it takes time for the patch I'm posting in this series to reach master. 12. I ignore warning about use of offsetof in libiberty/sha1.c which is apparently only a "C23 extension:" libiberty/sha1.c:239:11: warning: defining a type within 'offsetof' is a C23 extension [-Wc23-extensions] libiberty/sha1.c:460:11: warning: defining a type within 'offsetof' is a C23 extension [-Wc23-extensions] 13. I have enlarged the list of .texi files where warnings somehow got reported. Not sure why that happens. 14. In analyzer/sm.cc there are several "no-op" methods which have named but unused parameters. It seems this is deliberate and so I have filtered the -Wunused-parameter warning for this file. I have also re-arranged the entries in a way which hopefully makes somewhat more sense. Thanks, Martin contrib/ChangeLog: 2025-07-07 Martin Jambor <mjambor@suse.cz> * filter-clang-warnings.py (skip_warning): Also ignore -Woverloaded-shift-op-parentheses, -Wunused-function, -Wunneeded-internal-declaration, -Wvla-cxx-extension', and -Wunused-command-line-argument everywhere and a warning about m_logical_loc_mgr in diagnostic-path-output.cc. Adjust gimple-match and generic-match "filenames." Ignore -Wnontrivial-memcall warnings in wide-int.h, all warnings about unused stuff in files under m2/gm2-compiler-boot, all -Wunused-private-field in rust FE, in analyzer/ana-state-to-diagnostic-state.h and c-family/c-format.cc, all Warnings in avr-mmcu.texi, install.texi and libgccjit.texi and all -Wc23-extensions warnings in libiberty/sha1.c. Ignore -Wunused-parameter in analyzer/sm.cc. Reorder entries.
2025-06-30Daily bump.GCC Administrator1-0/+4
2025-06-29contrib/mklog.py: Fix writing to a global variableFilip Kastl1-0/+1
The last patch of mklog.py put top-level code into function 'main()'. Because of this, writing to global variable 'root' has to be preceded by explicitly declaring 'root' as global. Otherwise the write only has a local effect. Without this change, the '-d' cmdline flag would be broken. Commited as obvious. contrib/ChangeLog: * mklog.py: In 'main()', specify variable 'root' as global. Signed-off-by: Filip Kastl <fkastl@suse.cz>
2025-06-28Daily bump.GCC Administrator1-0/+4
2025-06-26contrib/mklog.py: Add main functionAlex Coplan1-1/+4
This adds a main() function to mklog.py (like e.g. check_GNU_style.py has), which makes it easier to import and invoke from another python script. This is useful when using a wrapper script to set up the python environment. Smoke tested by using the modified mklog.py to generate the ChangeLog for this patch. contrib/ChangeLog: * mklog.py (main): New.
2025-06-24Daily bump.GCC Administrator1-0/+15
2025-06-23libgdiagnostics: sarif-replay: add extra sinks via -fdiagnostics-add-output= ↵David Malcolm2-0/+25
[PR116792,PR116163] This patch refactors the support for -fdiagnostics-add-output=SCHEME from GCC's options parsing so that it is also available to sarif-replay and to other clients of libgdiagnostics. With this users of sarif-replay and other such tools can generate HTML or SARIF as well as text output, using the same -fdiagnostics-add-output=SCHEME as GCC. As a test, the patch adds support for this option to the dg-lint script below "contrib". For example dg-lint can now generate text, html, and sarif output via: LD_LIBRARY_PATH=../build/gcc/ \ ./contrib/dg-lint/dg-lint \ contrib/dg-lint/test-*.c \ -fdiagnostics-add-output=experimental-html:file=dg-lint-tests.html \ -fdiagnostics-add-output=sarif:file=dg-lint-tests.sarif where the HTML output from dg-lint can be seen here: https://dmalcolm.fedorapeople.org/gcc/2025-06-20/dg-lint-tests.html the sarif output here: https://dmalcolm.fedorapeople.org/gcc/2025-06-23/dg-lint-tests.sarif and a screenshot of VS Code viewing the sarif output is here: https://dmalcolm.fedorapeople.org/gcc/2025-06-23/vscode-viewing-dg-lint-sarif-output.png As well as allowing sarif-replay to generate HTML, this patch allows sarif-replay to also generate SARIF. Ideally this would faithfully round-trip all the data, but it's not perfect (which I'm tracking as PR sarif-replay/120792). contrib/ChangeLog: PR other/116792 PR testsuite/116163 PR sarif-replay/120792 * dg-lint/dg-lint: Add -fdiagnostics-add-output. * dg-lint/libgdiagnostics.py: Add diagnostic_manager_add_sink_from_spec. (Manager.add_sink_from_spec): New. gcc/ChangeLog: PR other/116792 PR testsuite/116163 PR sarif-replay/120792 * Makefile.in (OBJS-libcommon): Add diagnostic-output-spec.o. * diagnostic-format-html.cc (html_builder::html_builder): Ensure title is non-empty. * diagnostic-output-spec.cc: New file, taken from material in opts-diagnostic.cc. * diagnostic-output-spec.h: New file. * diagnostic.cc (diagnostic_context::set_main_input_filename): New. * diagnostic.h (diagnostic_context::set_main_input_filename): New decl. * doc/libgdiagnostics/topics/compatibility.rst (LIBGDIAGNOSTICS_ABI_2): New. * doc/libgdiagnostics/topics/diagnostic-manager.rst (diagnostic_manager_add_sink_from_spec): New. (diagnostic_manager_set_analysis_target): New. * libgdiagnostics++.h (manager::add_sink_from_spec): New. (manager::set_analysis_target): New. * libgdiagnostics.cc: Include "diagnostic-output-spec.h". (struct spec_context): New. (diagnostic_manager_add_sink_from_spec): New. (diagnostic_manager_set_analysis_target): New. * libgdiagnostics.h (LIBDIAGNOSTICS_HAVE_diagnostic_manager_add_sink_from_spec): New define. (diagnostic_manager_add_sink_from_spec): New decl. (LIBDIAGNOSTICS_HAVE_diagnostic_manager_set_analysis_target): New define. (diagnostic_manager_set_analysis_target): New decl. * libgdiagnostics.map (LIBGDIAGNOSTICS_ABI_2): New. * libsarifreplay.cc (sarif_replayer::handle_artifact_obj): Looks for "analysisTarget" in roles and call set_analysis_target using the artifact if found. * opts-diagnostic.cc: Refactor, moving material to diagnostic-output-spec.cc. (struct opt_spec_context): New. (handle_OPT_fdiagnostics_add_output_): Use opt_spec_context. (handle_OPT_fdiagnostics_set_output_): Likewise. * sarif-replay.cc: Define INCLUDE_STRING. (struct options): Add m_extra_output_specs. (usage_msg): Add -fdiagnostics-add-output=SCHEME. (str_starts_with): New. (parse_options): Add -fdiagnostics-add-output=SCHEME. (main): Likewise. * selftest-run-tests.cc (selftest::run_tests): Call diagnostic_output_spec_cc_tests rather than opts_diagnostic_cc_tests. * selftest.h (selftest::diagnostic_output_spec_cc_tests): Replace... (selftest::opts_diagnostic_cc_tests): ...this. gcc/testsuite/ChangeLog: PR other/116792 PR testsuite/116163 PR sarif-replay/120792 * sarif-replay.dg/2.1.0-valid/signal-1-check-html.py: New test script. * sarif-replay.dg/2.1.0-valid/signal-1.c.sarif: Add html and sarif generation to options. Invoke the new script to verify that HTML and SARIF is generated. Signed-off-by: David Malcolm <dmalcolm@redhat.com>
2025-06-23contrib: handle GDB's 'unexpected core files' countAndrew Burgess2-3/+8
This commit is for the benefit of GDB, but as the binutils-gdb repository shares the contrib/ directory with gcc, this commit must first be applied to gcc then copied back to binutils-gdb. This commit extends the two scripts contrib/dg-extract-results.{py,sh} to handle GDB's 'unexpected core files' count. This test result type should never appear in GCC, or any other tool that shares the contrib/ directory, so this change should be harmless for others. The 'unexpected core files' count was added to GDB's results by this series: https://inbox.sourceware.org/gdb-patches/20220623183053.172430-1-pedro@palves.net this count is added to the gdb.sum file after all the tests have run, and counts up any core.* files that have appeared. GDB also has a make-check-all.sh script which runs a test with all the different board files that GDB supports. After each test is run the 'unexpected core files' count will be added to that board's results. I'm now trying to use the dg-extract-results.* scripts to merge the results from all the different board files, and the 'unexpected core files' count is confusing these scripts. contrib/ChangeLog: * dg-extract-results.py: Handle GDB's unexpected core file count. * dg-extract-results.sh: Likewise.
2025-05-28Daily bump.GCC Administrator1-0/+5
2025-05-27Enable afdo testing on AMD Zen3+Jan Hubicka1-4/+17
contrib/ChangeLog: * gen_autofdo_event.py: Add support for AMD Zen 3 and later CPUs. gcc/ChangeLog: * config/i386/gcc-auto-profile: regenerate.
2025-05-24Daily bump.GCC Administrator1-0/+4
2025-05-23Add diffsummary.py to contribAndi Kleen1-0/+103
This adds an automatic downloader for the latest test results from the mailing list archive and supports diffing test_summary to it. Useful if you don't want to run your own baseline. contrib/ChangeLog: * diffsummary.py: New file.
2025-05-10Daily bump.GCC Administrator1-0/+4
2025-05-09check_GNU_style: Remove literal prefixTorbjörn SVENSSON1-1/+3
The path "b/binutils/dwarf.c" should be printed as binutils/dwarf.c", not "inutils/dwarf.c". contrib/ChangeLog: * check_GNU_style_lib.py: Remove literal prefix. Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
2025-05-02Daily bump.GCC Administrator1-0/+4
2025-05-02config-list.mk: Update FreeBSD targets to version 13Gerald Pfeifer1-4/+4
contrib: * config-list.mk: Update FreeBSD targets to version 13.
2025-04-27Daily bump.GCC Administrator1-0/+4
2025-04-26Add m32c*-*-* to the list of obsolete targetsIain Buclaw1-1/+1
This patch marks m32c*-*-* targets obsolete in GCC 16. The target has not had a maintainer since GCC 9, and fails to compile even the simplest of functions since GCC 8 (reported in PR83670). contrib/ChangeLog: * config-list.mk: Add m32c*-*-* to the list of obsoleted targets. gcc/ChangeLog: * config.gcc (LIST): --enable-obsolete for m32c-elf.
2025-04-26Daily bump.GCC Administrator1-0/+4
2025-04-25Update gennews for GCC 15.Jakub Jelinek1-0/+1
2025-04-25 Jakub Jelinek <jakub@redhat.com> * gennews (files): Add files for GCC 15.
2025-04-18Daily bump.GCC Administrator1-0/+5
2025-04-17Update crontab and git_update_version.pyJakub Jelinek1-2/+2
2025-04-17 Jakub Jelinek <jakub@redhat.com> maintainer-scripts/ * crontab: Snapshots from trunk are now GCC 16 related. Add GCC 15 snapshots from the respective branch. contrib/ * gcc-changelog/git_update_version.py (active_refs): Add releases/gcc-15.
2025-04-12Daily bump.GCC Administrator1-0/+9
2025-04-11libstdc++: Implement debug format for strings and characters formatters ↵Tomasz Kamiński3-5/+4368
[PR109162] This patch implements part P2286R8 that specified debug (escaped) format for the strings and characters sequences. This include both handling of the '?' format specifier and set_debug_format member. To indicate partial support we define __glibcxx_format_ranges macro value 1, without defining __cpp_lib_format_ranges. We provide two separate escaping routines depending on the literal encoding for the corresponding character types. If the character encoding is Unicode, we follow the specification for the standard (__format::__write_escaped_unicode). For other encodings, we escape only characters in range [0x00, 0x80), interpreting them as ASCII values: [0x00, 0x20), 0x7f and '\t', '\r', '\n', '\\', '"', '\'' are escaped. We assume every character outside this range is printable (__format::_write_escaped_ascii). In particular we do not yet implement special handling of shift sequences. For Unicode escaping a new __unicode::__escape_edges table is introduced, that encodes information if character belongs to General_Category that is escaped by the standard (Control or Other). This table is generated from DerivedGeneralCategory.txt provided by Unicode. Only boolean flag is preserved to reduce the number of entries. The additional rules for escaping are handled by __format::__should_escape_unicode. When width or precision is specified, we emit escaped string to the temporary buffer and format the resulting string according to the format spec. For characters use a fixed size stack buffer, for which a new _Fixedbuf_sink is introduced. For strings, we use _Str_sink and to avoid allocations, we compute the estimated size of (possibly truncated) input, and if it is larger than width field we print directly. PR libstdc++/109162 contrib/ChangeLog: * unicode/README: Mentioned DerivedGeneralCategory.txt. * unicode/gen_libstdcxx_unicode_data.py: Generation __escape_edges table from DerivedGeneralCategory.txt. Update file name in comments. * unicode/DerivedGeneralCategory.txt: Copy of file distributed by Unicode Consortium. libstdc++-v3/ChangeLog: * include/bits/chrono_io.h (__detail::_Widen): Moved to std/format file. * include/bits/unicode-data.h: Regnerate. * include/bits/unicode.h (__unicode::_Utf_iterator::_M_units) (__unicode::__should_escape_category): Define. * include/std/format (_GLIBCXX_WIDEN_, _GLIBCXX_WIDEN): Copied from include/bits/chrono_io.h. (__format::_Widen): Moved from include/bits/chrono_io.h. (__format::_Term_char, __format::_Escapes, __format::_Separators) (__format::__should_escape_ascii, __format::__should_escape_unicode) (__format::__write_escape_seq, __format::__write_escaped_char) (__format::__write_escaped_acii, __format::__write_escaped_unicode) (__format::__write_escaped): Define. (__formatter_str::_S_trunc): Extracted truncation of character sequences. (__formatter_str::format): Handle _Pres_esc. (__formatter_int::_M_do_parse) [__glibcxx_format_ranges]: Parse '?'. (__formatter_int::_M_format_character_escaped): Define. (formatter<_CharT, _CharT>::format, formatter<char, wchar_t>::format): Handle _Pres_esc. (__formatter_str::set_debug_format, formatter<...>::set_debug_format) Guard with __glibcxx_format_ranges. (__format::_Fixedbuf_sink): Define. * testsuite/23_containers/vector/bool/format.cc: Use __format::_Widen and remove unnecessary <chrono> include. * testsuite/std/format/debug.cc: New test. * testsuite/std/format/debug_nonunicode.cc: New test. * testsuite/std/format/parse_ctx.cc (escaped_strings_supported): Define to true if __glibcxx_format_ranges is defined. * testsuite/std/format/string.cc (escaped_strings_supported): Define to true if __glibcxx_format_ranges is defined. Reviewed-by: Jonathan Wakely <jwakely@redhat.com> Signed-off-by: Tomasz Kamiński <tkaminsk@redhat.com>
2025-03-28Daily bump.GCC Administrator1-0/+8
2025-03-27contrib: add dg-lint and libgdiagnostics.py [PR116163]David Malcolm4-0/+703
Changed in v2: - eliminated COMMON_MISSPELLINGS in favor of retesting with a regexp that adds underscores - add a list of KNOWN_DIRECTIVES, and complain if we see a directive that isn't in the list - various refactorings to reduce the nesting within the script - skip more kinds of file ('README', 'Makefile.am', 'Makefile.in', 'gen_directive_tests') - keep track of the number of files scanned and report it and the end with a note This patch adds a new dg-lint subdirectory below contrib, containing a "dg-lint" script for detecting common mistakes made in our DejaGnu tests. Specifically, DejaGnu's dg.exp's dg-get-options has a regexp for detecting dg- directives https://git.savannah.gnu.org/gitweb/?p=dejagnu.git;a=blob;f=lib/dg.exp here's the current: set tmp [grep $prog "{\[ \t\]\+dg-\[-a-z\]\+\[ \t\]\+.*\[ \t\]\+}" line] which if I'm reading it right requires a "{", then one or more tab/space chars, then a "dg-" directive name, then one of more tab/space characters, then anything (for arguments to the directive), then one of more tab/space character, then a "}". There are numerous places in our testsuite which look like attempts to use a directive, but which don't match this regexp. The script warns about such places, along with a list of misspelled directives (currently just "dg_options" for "dg-options"), and a warning if a dg-do appears after a dg-require-* (as per https://gcc.gnu.org/onlinedocs/gccint/Directives.html "This directive must appear after any dg-do directive in the test and before any dg-additional-sources directive." for dg-require-effective-target. dg-lint uses libgdiagnostics to report its results; the patch adds a new libgdiagnostics.py script below contrib/dg-lint. This uses Python's ctypes module to expose libgdianostics.so to Python via FFI. Hence the warnings have colorization, quote the pertinent parts of the tested file, can have fix-it hints, etc. Here's the output from the tests, run from the top-level directory: $ LD_LIBRARY_PATH=../build/gcc/ ./contrib/dg-lint/dg-lint contrib/dg-lint/test-*.c contrib/dg-lint/test-1.c:6:6: warning: misspelled directive: 'dg_final'; did you mean 'dg-final'? 6 | /* { dg_final { scan_assembler_times "vmsumudm" 2 } } */ | ^~~~~~~~ | dg-final contrib/dg-lint/test-1.c:15:4: warning: directive 'dg-output-file' appears not to match dg.exp's regexp 15 | dg-output-file "m4.out" | ^~~~~~~~~~~~~~ contrib/dg-lint/test-1.c:18:4: warning: directive 'dg-output-file' appears not to match dg.exp's regexp 18 | dg-output-file "m4.out" } | ^~~~~~~~~~~~~~ contrib/dg-lint/test-1.c:21:6: warning: directive 'dg-output-file' appears not to match dg.exp's regexp 21 | { dg-output-file "m4.out" | ^~~~~~~~~~~~~~ contrib/dg-lint/test-1.c:24:5: warning: directive 'dg-output-file' appears not to match dg.exp's regexp 24 | {dg-output-file "m4.out"} | ^~~~~~~~~~~~~~ contrib/dg-lint/test-1.c:27:6: warning: directive 'dg-output-file' appears not to match dg.exp's regexp 27 | { dg-output-file, "m4.out" } | ^~~~~~~~~~~~~~ contrib/dg-lint/test-2.c:4:6: warning: 'dg-do' after 'dg-require-effective-target' 4 | /* { dg-do compile } */ | ^~~~~ contrib/dg-lint/test-2.c:3:6: note: 'dg-require-effective-target' was here 3 | /* { dg-require-effective-target c++11 } */ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ I don't yet have a way to verify these tests (clearly we can't use DejaGnu for this). These Python bindings could be used by other projects, but so far I only implemented what I needed for dg-lint. Running the test on the GCC source tree finds dozens of issues, which followup patches address. Tested with Python 3.8 contrib/ChangeLog: PR testsuite/116163 * dg-lint/dg-lint: New file. * dg-lint/libgdiagnostics.py: New file. * dg-lint/test-1.c: New file. * dg-lint/test-2.c: New file. Signed-off-by: David Malcolm <dmalcolm@redhat.com>
2025-03-18Daily bump.GCC Administrator1-0/+4