- Oct 04, 2024
-
-
Tsung Chun Lin authored
From 8b3c5ebe8aacbcc4ddf1be8dea9a555e7e1bcc39 Mon Sep 17 00:00:00 2001 From: Jim Lin <jim@andestech.com> Date: Fri, 4 Oct 2024 14:48:12 +0800 Subject: [PATCH] RISC-V/libgcc: Fix incorrect .cfi_offset for saving ra in __riscv_save_[0-3] on ilp32e. libgcc/ChangeLog: * config/riscv/save-restore.S: Fix .cfi_offset for saving ra in __riscv_save_[0-3] on ilp32e.
-
Patrick Palka authored
This implements the following small LWG issues: 3848. adjacent_view, adjacent_transform_view and slide_view missing base accessor 3851. chunk_view::inner-iterator missing custom iter_move and iter_swap 3947. Unexpected constraints on adjacent_transform_view::base() 4001. iota_view should provide empty 4012. common_view::begin/end are missing the simple-view check 4013. lazy_split_view::outer-iterator::value_type should not provide default constructor 4035. single_view should provide empty 4053. Unary call to std::views::repeat does not decay the argument 4054. Repeating a repeat_view should repeat the view libstdc++-v3/ChangeLog: * include/std/ranges (single_view::empty): Define as per LWG 4035. (iota_view::empty): Define as per LWG 4001. (lazy_split_view::_OuterIter::value_type): Remove default constructor and make other constructor private as per LWG 4013. (common_view::begin): Disable non-const overload for simple views as per LWG 4012. (common_view::end): Likewise. (adjacent_view::base): Define as per LWG 3848. (adjacent_transform_view::base): Likewise. (chunk_view::_InnerIter::iter_move): Define as per LWG 3851. (chunk_view::_InnerIter::itep_swap): Likewise. (slide_view::base): Define as per LWG 3848. (repeat_view): Adjust deduction guide as per LWG 4053. (_Repeat::operator()): Adjust single-parameter overload as per LWG 4054. * testsuite/std/ranges/adaptors/adjacent/1.cc: Verify existence of base member function. * testsuite/std/ranges/adaptors/adjacent_transform/1.cc: Likewise. * testsuite/std/ranges/adaptors/chunk/1.cc: Test LWG 3851 example. * testsuite/std/ranges/adaptors/slide/1.cc: Verify existence of base member function. * testsuite/std/ranges/iota/iota_view.cc: Test LWG 4001 example. * testsuite/std/ranges/repeat/1.cc: Test LWG 4053/4054 examples. Reviewed-by:
Jonathan Wakely <jwakely@redhat.com>
-
Jakub Jelinek authored
The CWG2521 changes adjusted the unevalstr1.C test but didn't adjust unevalstr2.C test, which now FAILs in C++23 mode. The intent in both of those tests was to test the separate (now deprecated) syntax, so instead of removing the space between closing " and _ I've adjusted the testcase to expect those 17 extra warnings. And I've also adjusted the unevalstr1.C testcase to do the same, when it is removed from C++29 or whatever, that can be just guarded by #if. But it is actually useful to also test the UDL variant without space between closing " and _, so I've added new test coverage for that too to both tests. 2024-10-04 Jakub Jelinek <jakub@redhat.com> * g++.dg/cpp26/unevalstr1.C: Revert the 2024-10-03 changes, instead expect extra warnings. Add another set of tests without space between " and _. * g++.dg/cpp26/unevalstr2.C: Expect extra warnings for C++23. Add another set of tests without space between " and _.
-
Kyrylo Tkachov authored
I'd like to use a value of 64 bytes for the L1 cache size for Armv9-A generic tuning. As described in g:9a99559a this value is used to set the std::hardware_destructive_interference_size value which we want to be not overly large when running concurrent applications on large core-count systems. The generic value for Armv8-A systems and the port baseline is 256 bytes because that's what the A64FX CPU has, as set de-facto in aarch64_override_options_internal. But for Armv9-A CPUs as far as I know there isn't anything larger than 64 bytes, so we should be able to use the smaller value here and reduce the size of concurrent structs that use std::hardware_destructive_interference_size to pad their fields. Bootstrapped and tested on aarch64-none-linux-gnu. Signed-off-by:
Kyrylo Tkachov <ktkachov@nvidia.com> * config/aarch64/tuning_models/generic_armv9_a.h (generic_armv9a_prefetch_tune): Define. (generic_armv9_a_tunings): Use the above.
-
Jonathan Wakely authored
Some of these are due to no longer using #pragma GCC system_header in libstdc++ headers, some have been failing for longer and weren't noticed. libstdc++-v3/ChangeLog: * include/parallel/algobase.h (search): Use sequential algorithm for constant evaluation. * include/parallel/algorithmfwd.h (search): Add _GLIBCXX20_CONSTEXPR. * include/parallel/multiway_merge.h: Remove stray semi-colon. * include/parallel/multiseq_selection.h: Add diagnostic pragmas for -Wlong-long warning. * include/parallel/quicksort.h: Likewise. * include/parallel/random_number.h: Likewise. * include/parallel/settings.h: Likewise. * include/parallel/workstealing.h: Replace ++ and -- on volatile variables. * testsuite/17_intro/names.cc: Skip names defined by <tr1/random>. * testsuite/20_util/pair/dangling_ref.cc: Skip test if Parallel Mode is enabled. * testsuite/20_util/tuple/dangling_ref.cc: Likewise.
-
Andre Vieira authored
This patch restores missed optimizations for armv8.1-m.main targets that were missed when the generation of csinc, csinv and csneg were enabled for the same with patch series containing: commit c2bb84be Author: Sudi Das <sudi.das@arm.com> Date: Fri Sep 18 15:47:46 2020 +0100 [PATCH 2/5][Arm] New pattern for CSINV instructions The original patch series makes use of the "noce" machinery to transform RTL into patterns that later match the Armv8.1-M Mainline, by getting the target hook TARGET_HAVE_CONDITIONAL_EXECUTION, to return FALSE for such targets prior to reload_completed. The same machinery however was transforming other RTL patterns which were later on causing the "ce" pass post reload_completed to no longer optimize conditional execution opportunities, which was causing the regression observed in PR target/116444, a regression of 'testsuite/gcc.target/arm/thumb-ifcvt-2.c' when ran for an Armv8.1-M Mainline target. This patch implements the target hook TARGET_NOCE_CONVERSION_PROFITABLE_P to only allow "noce" to generate patterns that match CSINV, CSINC and CSNEG. Thus ensuring that the early "ce" passes do not ruin things for later ones. gcc/ChangeLog: PR target/116444 * config/arm/arm-protos.h (arm_noce_conversion_profitable_p): New declaration. * config/arm/arm.cc (arm_is_v81m_cond_insn): New helper function used in ... (arm_noce_conversion_profitable_p): ... here. New function to implement ... (TARGET_NOCE_PROFITABLE_P): ... this target hook. New define.
-
Richard Biener authored
The following fixes the order of decrementing the SLP mode and the dumping. * tree-vect-loop.cc (vect_analyze_loop_2): Derement 'slp' before dumping which stage we're starting.
-
Jakub Jelinek authored
The PR notes that the new pch_save/pch_restore methods I've added recently invoke UB if either m_classification_history.address () or m_push_list.address () is NULL (which can happen if those vectors are empty (and in the pch_save case nothing has been pushed into them before either). While the corresponding length is necessarily 0, fwrite (NULL, something, 0, f) or fread (NULL, something, 0, f) still invoke UB. The following patch fixes that by not calling fwrite/fread if the corresponding length is 0. 2024-10-04 Jakub Jelinek <jakub@redhat.com> PR pch/116936 * diagnostic.cc (diagnostic_option_classifier::pch_save): Only call fwrite if corresponding length is non-zero. (diagnostic_option_classifier::pch_restore): Only call fread if corresponding length is non-zero.
-
Jakub Jelinek authored
i386: Fix up ix86_expand_int_compare with TImode comparisons of SUBREGs from V8{H,B}Fmode against zero [PR116921] The following testcase ICEs, because the ix86_expand_int_compare optimization to use {,v}ptest assumes there are instructions for all 16-byte vector modes. That isn't the case, we only have one for V16QI, V8HI, V4SI, V2DI, V1TI, V4SF and V2DF, not for V8HF nor V8BF. The following patch fixes that by using the V8HI instruction instead for those 2 modes. tmp can't be a SUBREG, because it is SUBREG_REG of another SUBREG, so we don't need to worry about gen_lowpart failing. 2024-10-04 Jakub Jelinek <jakub@redhat.com> PR target/116921 * config/i386/i386-expand.cc (ix86_expand_int_compare): Add a SUBREG to V8HImode from V8HFmode or V8BFmode before generating a ptest. * gcc.target/i386/pr116921.c: New test.
-
Jakub Jelinek authored
While *minmax<mode>3_1 correctly uses if (MEM_P (operands[1])) operands[1] = force_reg (<MODE>mode, operands[1]); to ensure operands[1] is not a MEM, *minmax<mode>3_2 does it wrongly by calling force_reg but ignoring its return value. The following borderingly obvious patch fixes that. Didn't find similar other errors in the backend with force_reg calls. 2024-10-04 Jakub Jelinek <jakub@redhat.com> PR target/116925 * config/i386/sse.md (*minmax<mode>3_2): Assign force_reg result back to operands[2] instead of throwing it away. * g++.target/i386/avx-pr116925.C: New test.
-
Nathaniel Shead authored
[temp.arg.nontype] changed in C++11 to allow naming internal-linkage variables and functions. We currently already handle internal-linkage functions, but variables were missed; this patch updates this. PR c++/113266 PR c++/116911 gcc/cp/ChangeLog: * parser.cc (cp_parser_template_argument): Allow internal-linkage variables since C++11. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/nontype6.C: New test. Signed-off-by:
Nathaniel Shead <nathanieloshead@gmail.com>
-
Nathaniel Shead authored
Users of pushdecl assume that the returned decl will be a possibly updated decl matching the one that was passed in. My r15-3910 change broke this since in some cases we would now return USING_DECLs; this patch fixes the situation. PR c++/116913 gcc/cp/ChangeLog: * name-lookup.cc (update_binding): Return the strip_using'd old decl rather than the binding. gcc/testsuite/ChangeLog: * g++.dg/lookup/using70.C: New test. Signed-off-by:
Nathaniel Shead <nathanieloshead@gmail.com>
-
Richard Biener authored
When failing using forced SLP we do not print the non-SLP failure mode which reads slightly different. Massage the expectation a bit. * gcc.dg/vect/pr65947-8.c: Adjust.
-
Jonathan Wakely authored
C++20 deprecates implicit capture of 'this', so change [=] to [this] for all lambda expressions in <shared_mutex>. This only shows up on targets where _GLIBCXX_USE_PTHREAD_RWLOCK_T is not defined, as we have an alternative implementation of shared mutexes in that case. libstdc++-v3/ChangeLog: PR libstdc++/116964 * include/std/shared_mutex (__shared_mutex_cv): Use [this] for lambda captures. (shared_timed_mutex) [!_GLIBCXX_USE_PTHREAD_RWLOCK_T]: Likewise.
-
Richard Biener authored
When making the testcase use aligned accesses I botched up the copy&paste. Fixed. PR tree-optimization/99856 * gcc.dg/vect/pr99856.c: Fix copy&paste errors.
-
Sam James authored
This didn't show up until the previous commit which fixed the directive syntax. The indexing was off for the notes. gcc/testsuite/ChangeLog: * gcc.dg/Wstringop-overflow-79.c: Fix index for notes. * gcc.dg/Wstringop-overflow-80.c: Ditto.
-
Sam James authored
gcc/testsuite/ChangeLog: * c-c++-common/analyzer/flex-without-call-summaries.c: Add missing brace. * c-c++-common/analyzer/malloc-callbacks.c: Ditto. * gcc.dg/Wstringop-overflow-79.c: Ditto. * gcc.dg/Wstringop-overflow-80.c: Ditto.
-
Georg-Johann Lay authored
PR testsuite/108540 gcc/testsuite/ * gcc.c-torture/execute/ieee/pr108540-1.c: Un-preprocess __SIZE_TYPE__ and __INT64_TYPE__. * gcc.c-torture/execute/ieee/pr108540-1.x: New file, requires double64.
-
Gerald Pfeifer authored
gcc: PR target/69374 * doc/install.texi (Specific) <h8300-hms>: Drop GCC 2.6 ABI change note.
-
Sam James authored
gcc/ChangeLog: * gimplify.cc (gimple_add_init_for_auto_var): Fix 'variable' typo.
-
Sam James authored
Fix incorrect use of '[' rather than '{' in 'dg-...' directives. gcc/testsuite/ChangeLog: * gnat.dg/pack13.adb: Fix 'dg-...' directive syntax. * gnat.dg/size_attribute.adb: Ditto. * gnat.dg/subp_elim_errors.adb: Ditto.
-
Jason Merrill authored
A lot of compile time of template-heavy code is spent in re-hashing hashtable elements upon expansion. The following records the hash in the hash element. This speeds up C++20 compilation of stdc++.h by about 25% for about a 0.1% increase in memory usage. With the hash value in the entry, we don't need to pass it separately to the find functions. Adding default arguments to the spec and hash fields simplifies spec_entry initialization and avoids problems from hash starting with an indeterminate value. gcc/cp/ChangeLog: * cp-tree.h (spec_entry::hash): New member. * pt.cc (spec_hasher::hash): Set it and return it. (maybe_process_partial_specialization): Clear it when changing tmpl/args. (lookup_template_class): Likewise, don't pass hash to find. (retrieve_specialization): Set it, don't pass hash to find. (register_specialization): Don't pass hash to find. (reregister_specialization): Likewise. (match_mergeable_specialization): Likewise. (add_mergeable_specialization): Likewise. Co-authored-by:
Richard Biener <rguenther@suse.de>
-
GCC Administrator authored
-
- Oct 03, 2024
-
-
Jason Merrill authored
coerce_template_parms can create two different vecs for the inner template arguments, new_inner_args and (potentially) the result of expand_template_argument_pack. One or the other, or possibly both, end up being garbage: in the typical case, the expanded vec is garbage because it's only used as the source for convert_template_argument. In some dependent cases, the new vec is garbage because we decide to return the original args instead. In these cases, ggc_free the garbage vec to reduce the memory overhead of overload resolution. gcc/cp/ChangeLog: * pt.cc (coerce_template_parms): Free garbage vecs. Co-authored-by:
Richard Biener <rguenther@suse.de>
-
Eric Botcazou authored
The macro is documented like this in the internal manual: -- Macro: WIDEST_HARDWARE_FP_SIZE A C expression for the size in bits of the widest floating-point format supported by the hardware. If you define this macro, you must specify a value less than or equal to mode precision of the mode used for C type 'long double' (from hook 'targetm.c.mode_for_floating_type' with argument 'TI_LONG_DOUBLE_TYPE'). If you do not define this macro, mode precision of the mode used for C type 'long double' is the default. AArch64 uses 128-bit TFmode for long double but, as far as I know, no FPU implemented in hardware supports it. gcc/ * config/aarch64/aarch64.h (WIDEST_HARDWARE_FP_SIZE): Define to 64. gcc/testsuite/ * gnat.dg/specs/size_clause6.ads: New test.
-
Jason Merrill authored
This broke bootstrap, improving. This reverts commit 5b08ae50.
-
Jason Merrill authored
By default -Wdeprecated warns about deprecations in the active standard. When specified explicitly, let's also warn about deprecations in later standards. gcc/c-family/ChangeLog: * c-opts.cc (c_common_post_options): Explicit -Wdeprecated enables deprecations from later standards. gcc/ChangeLog: * doc/invoke.texi: Explicit -Wdeprecated enables more warnings.
-
Jason Merrill authored
C++23 CWG issue 2521 (https://wg21.link/cwg2521) deprecates user-defined literal operators declared with the optional space between "" and the suffix. Many testcases used that syntax; I removed the space from most of them, and added C++23 warning tests to a few. CWG 2521 gcc/ChangeLog: * doc/invoke.texi: Document -Wdeprecated-literal-operator. gcc/c-family/ChangeLog: * c.opt: Add -Wdeprecated-literal-operator. * c-opts.cc (c_common_post_options): Default on in C++23. * c.opt.urls: Regenerate. gcc/cp/ChangeLog: * parser.cc (location_between): New. (cp_parser_operator): Handle -Wdeprecated-literal-operator. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/udlit-string-literal.h * g++.dg/cpp0x/Wliteral-suffix2.C * g++.dg/cpp0x/constexpr-55708.C * g++.dg/cpp0x/gnu_fext-numeric-literals.C * g++.dg/cpp0x/gnu_fno-ext-numeric-literals.C * g++.dg/cpp0x/pr51420.C * g++.dg/cpp0x/pr60209-neg.C * g++.dg/cpp0x/pr60209.C * g++.dg/cpp0x/pr61038.C * g++.dg/cpp0x/std_fext-numeric-literals.C * g++.dg/cpp0x/std_fno-ext-numeric-literals.C * g++.dg/cpp0x/udlit-addr.C * g++.dg/cpp0x/udlit-args-neg.C * g++.dg/cpp0x/udlit-args.C * g++.dg/cpp0x/udlit-args2.C * g++.dg/cpp0x/udlit-clink-neg.C * g++.dg/cpp0x/udlit-concat-neg.C * g++.dg/cpp0x/udlit-concat.C * g++.dg/cpp0x/udlit-constexpr.C * g++.dg/cpp0x/udlit-cpp98-neg.C * g++.dg/cpp0x/udlit-declare-neg.C * g++.dg/cpp0x/udlit-embed-quote.C * g++.dg/cpp0x/udlit-extended-id-1.C * g++.dg/cpp0x/udlit-extended-id-3.C * g++.dg/cpp0x/udlit-extern-c.C * g++.dg/cpp0x/udlit-friend.C * g++.dg/cpp0x/udlit-general.C * g++.dg/cpp0x/udlit-implicit-conv-neg-char8_t.C * g++.dg/cpp0x/udlit-implicit-conv-neg.C * g++.dg/cpp0x/udlit-inline.C * g++.dg/cpp0x/udlit-mangle.C * g++.dg/cpp0x/udlit-member-neg.C * g++.dg/cpp0x/udlit-namespace.C * g++.dg/cpp0x/udlit-nofunc-neg.C * g++.dg/cpp0x/udlit-nonempty-str-neg.C * g++.dg/cpp0x/udlit-nosuffix-neg.C * g++.dg/cpp0x/udlit-nounder-neg.C * g++.dg/cpp0x/udlit-operator-neg.C * g++.dg/cpp0x/udlit-overflow-neg.C * g++.dg/cpp0x/udlit-overflow.C * g++.dg/cpp0x/udlit-preproc-neg.C * g++.dg/cpp0x/udlit-raw-length.C * g++.dg/cpp0x/udlit-raw-op-string-neg.C * g++.dg/cpp0x/udlit-raw-op.C * g++.dg/cpp0x/udlit-raw-str.C * g++.dg/cpp0x/udlit-resolve-char8_t.C * g++.dg/cpp0x/udlit-resolve.C * g++.dg/cpp0x/udlit-shadow-neg.C * g++.dg/cpp0x/udlit-string-length.C * g++.dg/cpp0x/udlit-suffix-neg.C * g++.dg/cpp0x/udlit-template.C * g++.dg/cpp0x/udlit-tmpl-arg-neg.C * g++.dg/cpp0x/udlit-tmpl-arg-neg2.C * g++.dg/cpp0x/udlit-tmpl-arg.C * g++.dg/cpp0x/udlit-tmpl-parms-neg.C * g++.dg/cpp0x/udlit-tmpl-parms.C * g++.dg/cpp1y/pr57640.C * g++.dg/cpp1y/pr88872.C * g++.dg/cpp26/unevalstr1.C * g++.dg/cpp2a/concepts-pr60391.C * g++.dg/cpp2a/consteval-prop21.C * g++.dg/cpp2a/nontype-class6.C * g++.dg/cpp2a/udlit-class-nttp-ctad-neg.C * g++.dg/cpp2a/udlit-class-nttp-ctad-neg2.C * g++.dg/cpp2a/udlit-class-nttp-ctad.C * g++.dg/cpp2a/udlit-class-nttp-neg.C * g++.dg/cpp2a/udlit-class-nttp-neg2.C * g++.dg/cpp2a/udlit-class-nttp.C * g++.dg/ext/is_convertible2.C * g++.dg/lookup/pr87269.C * g++.dg/cpp0x/udlit_system_header: Adjust for C++23 deprecated operator "" _suffix. * g++.dg/DRs/dr2521.C: New test.
-
Jason Merrill authored
coerce_template_parms can create two different vecs for the inner template arguments, new_inner_args and (potentially) the result of expand_template_argument_pack. One or the other, or possibly both, end up being garbage: in the typical case, the expanded vec is garbage because it's only used as the source for convert_template_argument. In some dependent cases, the new vec is garbage because we decide to return the original args instead. In these cases, ggc_free the garbage vec to reduce the memory overhead of overload resolution. gcc/cp/ChangeLog: * pt.cc (struct free_if_changed_proxy): New. (coerce_template_parms): Use it. Co-authored-by:
Richard Biener <rguenther@suse.de>
-
Georg-Johann Lay authored
gcc/testsuite/ * gcc.dg/c23-stdarg-9.c (struct S) [AVR]: Only use int a[500].
-
Jonathan Wakely authored
libstdc++-v3/ChangeLog: * include/bits/unicode.h (__unicode::__is_incb_linker): Use _GLIBCXX_STD_A namespace for std::find.
-
Jonathan Wakely authored
The pragmas to disable warnings need to be moved before the first use of the deprecated classes. libstdc++-v3/ChangeLog: PR libstdc++/116944 * include/parallel/base.h: Move diagnostic pragmas earlier.
-
Jonathan Wakely authored
libstdc++-v3/ChangeLog: * include/bits/locale_facets_nonio.tcc (money_put::__do_get): Ignore -Wformat warning for __ibm128 arguments. * include/tr1/tuple (ignore): Ignore -Wunused warning.
-
Richard Biener authored
This zero-initializes vec_init to avoid a bogus maybe-uninitialized diagnostic. * tree-vect-loop.cc (vectorizable_induction): Initialize vec_init.
-
Andrew Pinski authored
Early-RA was considering throwing instructions as being dead and removing them even if -fno-delete-dead-exceptions was in use. This fixes that oversight. Built and tested for aarch64-linux-gnu. PR target/116927 gcc/ChangeLog: * config/aarch64/aarch64-early-ra.cc (early_ra::is_dead_insn): Insns that throw are not dead with -fno-delete-dead-exceptions. gcc/testsuite/ChangeLog: * g++.dg/torture/pr116927-1.C: New test. Signed-off-by:
Andrew Pinski <quic_apinski@quicinc.com>
-
François Dumont authored
Get rid of the different usages of the mutable keyword except in _Prime_rehash_policy where it is preserved for abi compatibility reason. Fix comment to explain that we need the computation of bucket index noexcept to be able to rehash the container when needed. For Standard instantiations through std::unordered_xxx containers we already force caching of hash code when hash functor is not noexcep so it is guarantied. The static_assert purpose in _Hashtable on _M_bucket_index is thus limited to usages of _Hashtable with exotic _Hashtable_traits. libstdc++-v3/ChangeLog: * include/bits/hashtable_policy.h (_NodeBuilder<>::_S_build): Remove const qualification on _NodeGenerator instance. (_ReuseOrAllocNode<>::operator()(_Args&&...)): Remove const qualification. (_ReuseOrAllocNode<>::_M_nodes): Remove mutable. (_Insert_base<>::_M_insert_range): Remove _NodeGetter const qualification. (_Hash_code_base<>::_M_bucket_index(const _Hash_node_value<>&, size_t)): Simplify noexcept declaration, we already static_assert that _RangeHash functor is noexcept. * include/bits/hashtable.h: Rework comments. Remove const qualifier on _NodeGenerator& arguments. Reviewed-by:
Jonathan Wakely <jwakely@redhat.com>
-
David Malcolm authored
GCC currently supports outputting SARIF v2.1.0 Version 2.2 of the SARIF spec is not yet official, but the draft has already gained features we might might want to use. This patch extends the SARIF output code to accept a enum sarif_version parameter internally, representing 2.1.0 or a prerelease of 2.2 The patch updates the SARIF output selftests so that they are run for all such versions. I hope to expose this "properly" via the mechanism described in comment #13 of PR116613. In the meantime, the patch adds a new -fdiagnostics-format=sarif-file-2.2-prerelease for use by the DejaGnu testsuite, deliberately left undocumented for now. The copy of the 2.2 draft schema in the testsuite was downloaded from https://raw.githubusercontent.com/oasis-tcs/sarif-spec/refs/tags/2.2-prerelease-2024-08-08/sarif-2.2/schema/sarif-2-2.schema.json The patch adds support for capturing related locations within an ICE notification for SARIF 2.2 onwards, thus capturing "include chain" information for SARIF-based reports of ICEs that occur within a header; see https://github.com/oasis-tcs/sarif-spec/issues/540 The patch does *not* add support for the "scannedFile" role, leaving it to followup work; see https://github.com/oasis-tcs/sarif-spec/issues/459 gcc/ChangeLog: PR other/116301 * common.opt (sarif-file-2.2-prerelease): New value for -fdiagnostics-format=. * diagnostic-format-sarif.cc (sarif_location_manager::sarif_location_manager): Move initialization of m_related_locations_arr here from sarif_result's ctor. (sarif_location_manager::add_related_location): Implement for base class, taking sarif_result's implementation. Add "builder" param. (sarif_location_manager::m_related_locations_arr): Move here from class sarif_result. (class sarif_result): Move m_related_locations_arr field and add_related_location vfunc to class sarif_location_manager. (sarif_builder::get_version): New accessor. (sarif_builder::m_version): New field. (sarif_invocation::add_notification_for_ice): Call process_worklist on the notification for SARIF 2.2 and later. (sarif_location_manager::process_worklist_item): Pass builder to calls to add_related_location. (sarif_result::on_nested_diagnostic): Likewise. (sarif_result::on_diagram): Likewise. (sarif_ice_notification::add_related_location): Add builder param. For SARIF 2.2 and later chain up to base class impl so that notifications get related locations. (sarif_builder::sarif_builder): Add "version" param. (SARIF_SCHEMA): Delete in favor of... (sarif_version_to_url): New function. (SARIF_VERSION): Delete in favor of... (sarif_version_to_property): New function. (make_top_level_object): Update to use m_version for "$schema" and "version". (sarif_output_format::sarif_output_format): Add "version" param. (sarif_stream_output_format::sarif_stream_output_format): Likewise. (sarif_file_output_format::sarif_file_output_format): Likewise. (diagnostic_output_format_init_sarif_stderr): Likewise. (diagnostic_output_format_init_sarif_file): Likewise. (diagnostic_output_format_init_sarif_stream): Likewise. (selftest::test_sarif_diagnostic_context): Likewise. (selftest::test_make_location_object): Likewise. (selftest::test_simple_log): Likewise. Update schema and version tests accordingly. (selftest::test_simple_log_2): Add "version" param. (selftest::test_message_with_embedded_link): Likewise. (selftest::run_tests_per_version): New, based on the for_each_line_table_case calls in... (selftest::diagnostic_format_sarif_cc_tests): Add loop over sarif versions. Replace for_each_line_table_case calls with one call to run_tests_per_version. * diagnostic-format-sarif.h: Include "diagnostic-format.h". (enum class sarif_version): New. (diagnostic_output_format_init_sarif_stderr): Move to here from diagnostic-format.h. Add "version" param. (diagnostic_output_format_init_sarif_file): Likewise. (diagnostic_output_format_init_sarif_stream): Likewise. * diagnostic-format.h: Include "diagnostic.h". (diagnostic_output_format_init_sarif_stderr): Move from here to diagnostic-format-sarif.h. * diagnostic.cc: Define INCLUDE_MEMORY. Include "diagnostic-format-sarif.h". (diagnostic_output_format_init): Pass sarif_version::v2_1_0 to existing SARIF options. Add case DIAGNOSTICS_OUTPUT_FORMAT_SARIF_FILE_2_2_PRERELEASE. * diagnostic.h (enum diagnostics_output_format): Add DIAGNOSTICS_OUTPUT_FORMAT_SARIF_FILE_2_2_PRERELEASE. gcc/testsuite/ChangeLog: PR other/116301 * gcc.dg/plugin/crash-test-ice-in-header-sarif-2.1.c: New test. * gcc.dg/plugin/crash-test-ice-in-header-sarif-2.2.c: New test. * gcc.dg/plugin/crash-test-ice-in-header-sarif-2_1.py: Support script for new test. * gcc.dg/plugin/crash-test-ice-in-header-sarif-2_2.py: Likewise. * gcc.dg/plugin/crash-test-ice-in-header.h: New header. * gcc.dg/plugin/plugin.exp: Add the new tests. * lib/sarif-schema-2.2-prerelease-2024-08-08.json: New schema file. * lib/scansarif.exp (verify-sarif-file): Add optional argument for specifying which version of the schema to validate against, supporting "2.1" and "2.2", defaulting to the former. Update the test name to capture the version of the schema tested against. Signed-off-by:
David Malcolm <dmalcolm@redhat.com>
-
GCC Administrator authored
-
- Oct 02, 2024
-
-
Andrew Pinski authored
Phiopt match_and_simplify might move a well defined VCE assign statement from being conditional to being uncondtitional; that VCE might no longer being defined. It will need a rewrite into a cast instead. This adds the rewriting code to move_stmt for the VCE case. This is enough to fix the issue at hand. It should also be using rewrite_to_defined_overflow but first I need to move the check to see a rewrite is needed into its own function and that is causing issues (see https://gcc.gnu.org/pipermail/gcc-patches/2024-September/663938.html ). Plus this version is easiest to backport. Bootstrapped and tested on x86_64-linux-gnu. PR tree-optimization/116098 gcc/ChangeLog: * tree-ssa-phiopt.cc (move_stmt): Rewrite VCEs from integer to integer types to case. gcc/testsuite/ChangeLog: * c-c++-common/torture/pr116098-2.c: New test. * g++.dg/torture/pr116098-1.C: New test. Signed-off-by:
Andrew Pinski <quic_apinski@quicinc.com>
-
Georg-Johann Lay authored
PR testsuite/52641 gcc/testsuite/ * gcc.dg/strict-flex-array-3.c (expect) [AVR]: Use custom version due to AVR-LibC limitations. (stuff): Use __SIZEOF_INT__ instead of hard-coded values.
-