Skip to content
Snippets Groups Projects
  1. Oct 04, 2024
    • Nathaniel Shead's avatar
      c++: Return the underlying decl rather than the USING_DECL from update_binding [PR116913] · 6a1e1091
      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: default avatarNathaniel Shead <nathanieloshead@gmail.com>
      6a1e1091
    • Richard Biener's avatar
      Relax gcc.dg/vect/pr65947-8.c · 7fb65266
      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.
      7fb65266
    • Jonathan Wakely's avatar
      libstdc++: Replace implicit lambda capture of 'this' [PR116964] · f135278f
      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.
      f135278f
    • Richard Biener's avatar
      tree-optimization/99856 - fix testcase · a96ebb2c
      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.
      a96ebb2c
    • Sam James's avatar
      testsuite: fix two newly-running -Wstringop-overflow test directives · 0fae1550
      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.
      0fae1550
    • Sam James's avatar
      testsuite: add missing braces around dejagnu directives · a2b7a6fe
      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.
      a2b7a6fe
    • Georg-Johann Lay's avatar
      testsuite - Fix gcc.c-torture/execute/ieee/pr108540-1.c · a0cc6941
      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.
      a0cc6941
    • Gerald Pfeifer's avatar
      doc: Drop GCC 2.6 ABI change note for H8/h8300-hms · 186be7f3
      Gerald Pfeifer authored
      gcc:
      	PR target/69374
      	* doc/install.texi (Specific) <h8300-hms>: Drop GCC 2.6
      	ABI change note.
      186be7f3
    • Sam James's avatar
      gcc: fix typo in gimplify · 4f0026c2
      Sam James authored
      gcc/ChangeLog:
      
      	* gimplify.cc (gimple_add_init_for_auto_var): Fix 'variable' typo.
      4f0026c2
    • Sam James's avatar
      testsuite: gnat.dg: fix dg-do directive syntax · 68d88d9b
      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.
      68d88d9b
    • Jason Merrill's avatar
      c++: record template specialization hash · 5dad738c
      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: default avatarRichard Biener <rguenther@suse.de>
      5dad738c
    • GCC Administrator's avatar
      Daily bump. · e175fb38
      GCC Administrator authored
      e175fb38
  2. Oct 03, 2024
    • Jason Merrill's avatar
      c++: free garbage vec in coerce_template_parms · d77f073c
      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: default avatarRichard Biener <rguenther@suse.de>
      d77f073c
    • Eric Botcazou's avatar
      Aarch64: Define WIDEST_HARDWARE_FP_SIZE · 547219f4
      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.
      547219f4
    • Jason Merrill's avatar
      Revert "c++: free garbage vec in coerce_template_parms" · fe33530e
      Jason Merrill authored
      This broke bootstrap, improving.
      
      This reverts commit 5b08ae50.
      fe33530e
    • Jason Merrill's avatar
      c++: -Wdeprecated enables later standard deprecations · dca2b479
      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.
      dca2b479
    • Jason Merrill's avatar
      c++: add -Wdeprecated-literal-operator [CWG2521] · b6ff52a9
      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.
      b6ff52a9
    • Jason Merrill's avatar
      c++: free garbage vec in coerce_template_parms · 5b08ae50
      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: default avatarRichard Biener <rguenther@suse.de>
      5b08ae50
    • Georg-Johann Lay's avatar
      AVR: Make gcc.dg/c23-stdarg-9.c work. · 8d63d87c
      Georg-Johann Lay authored
      gcc/testsuite/
      	* gcc.dg/c23-stdarg-9.c (struct S) [AVR]: Only use int a[500].
      8d63d87c
    • Jonathan Wakely's avatar
      libstdc++: Make Unicode utils work with Parallel Mode · 0d9d6872
      Jonathan Wakely authored
      libstdc++-v3/ChangeLog:
      
      	* include/bits/unicode.h (__unicode::__is_incb_linker): Use
      	_GLIBCXX_STD_A namespace for std::find.
      0d9d6872
    • Jonathan Wakely's avatar
      libstdc++: Fix -Wdeprecated-declarations warning for Parallel Mode [PR116944] · 7754a8b7
      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.
      7754a8b7
    • Jonathan Wakely's avatar
      libstdc++: Fix some warnings seen during bootstrap · 28911f62
      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.
      28911f62
    • Richard Biener's avatar
      Restore aarch64 bootstrap · 34670dee
      Richard Biener authored
      This zero-initializes vec_init to avoid a bogus maybe-uninitialized
      diagnostic.
      
      	* tree-vect-loop.cc (vectorizable_induction): Initialize
      	vec_init.
      34670dee
    • Andrew Pinski's avatar
      aarch64: Fix early ra for -fno-delete-dead-exceptions [PR116927] · edec4bfc
      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: default avatarAndrew Pinski <quic_apinski@quicinc.com>
      edec4bfc
    • François Dumont's avatar
      libstdc++: [_Hashtable] Fix some implementation inconsistencies · ccb6e08a
      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: default avatarJonathan Wakely <jwakely@redhat.com>
      ccb6e08a
    • David Malcolm's avatar
      diagnostics: support SARIF 2.2 output, undocumented for now [PR116301] · caef7002
      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: default avatarDavid Malcolm <dmalcolm@redhat.com>
      caef7002
    • GCC Administrator's avatar
      Daily bump. · 1d091178
      GCC Administrator authored
      1d091178
  3. Oct 02, 2024
    • Andrew Pinski's avatar
      phiopt: Fix VCE moving by rewriting it into cast [PR116098] · 1f619fe2
      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: default avatarAndrew Pinski <quic_apinski@quicinc.com>
      1f619fe2
    • Georg-Johann Lay's avatar
      testsuite/52641 - Make gcc.dg/strict-flex-array-3.c work on int != 32 bits. · 77c3ef08
      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.
      77c3ef08
    • Georg-Johann Lay's avatar
      AVR: Make gcc.dg/pr113596.c work. · 524b9c2e
      Georg-Johann Lay authored
      gcc/testsuite/
      	* gcc.dg/pr113596.c: Require less memory so it works on AVR.
      524b9c2e
    • Georg-Johann Lay's avatar
      testsuite/52641 - Require int32 for gcc.dg/pr93820-2.c. · 5bf78cf0
      Georg-Johann Lay authored
      	PR testsuite/52641
      gcc/testsuite/
      	* gcc.dg/pr93820-2.c: Add dg-require-effective-target int32.
      5bf78cf0
    • Georg-Johann Lay's avatar
      testsuite/52641 - Fix gcc.dg/signbit-6.c for int != 32-bit targets. · 875a1df8
      Georg-Johann Lay authored
      	PR testsuite/52641
      gcc/testsuite/
      	* gcc.dg/signbit-6.c (main): Initialize a[0] and b[0]
      	with INT32_MIN (instead of with INT_MIN).
      875a1df8
    • Victor Do Nascimento's avatar
      middle-end: Fix ifcvt predicate generation for masked function calls · 4d9e473d
      Victor Do Nascimento authored
      Up until now, due to a latent bug in the code for the ifcvt pass,
      irrespective of the branch taken in a conditional statement, the
      original condition for the if statement was used in masking the
      function call.
      
      Thus, for code such as:
      
        if (a[i] > limit)
          b[i] = fixed_const;
        else
          b[i] = fn (a[i]);
      
      we would generate the following (wrong) if-converted tree code:
      
        _1 = a[i_1];
        _2 = _1 > limit;
        _3 = .MASK_CALL (fn, _1, _2);
        cstore_4 = _2 ? fixed_const : _3;
      
      as opposed to the correct expected sequence:
      
        _1 = a[i_1];
        _2 = _1 > limit;
        _3 = ~_2;
        _4 = .MASK_CALL (fn, _1, _3);
        cstore_5 = _2 ? fixed_const : _4;
      
      This patch ensures that the correct predicate mask generation is
      carried out such that, upon autovectorization, the correct vector
      lanes are selected in the vectorized function call.
      
      gcc/ChangeLog:
      
      	* tree-if-conv.cc (predicate_statements): Fix handling of
      	predicated function calls.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.dg/vect/vect-fncall-mask.c: New.
      4d9e473d
    • Andre Vieira's avatar
      arm: Prevent ICE when doloop dec_set is not PLUS expr · 4e11ad7c
      Andre Vieira authored
      This patch refactors and fixes an issue where arm_mve_dlstp_check_dec_counter
      was making an assumption about the form of what a candidate for a dec_insn
      should be, which caused an ICE.
      This dec_insn is the instruction that decreases the loop counter inside a
      decrementing loop and we expect it to have the following form:
      (set (reg CONDCOUNT)
           (plus (reg CONDCOUNT)
                 (const_int)))
      
      Where CONDCOUNT is the loop counter, and const int is the negative constant
      used to decrement it.
      
      This patch also improves our search for a valid dec_insn.  Before this patch
      we'd only look for a dec_insn inside the loop header if the loop latch was
      empty.  We now also search the loop header if the loop latch is not empty but
      the last instruction is not a valid dec_insn.  This could potentially be improved
      to search all instructions inside the loop latch.
      
      gcc/ChangeLog:
      
      	* config/arm/arm.cc (check_dec_insn): New helper function containing
      	code hoisted from...
      	(arm_mve_dlstp_check_dec_counter): ... here. Use check_dec_insn to
      	check the validity of the candidate dec_insn.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.target/arm/mve/dlstp-loop-form.c: New test.
      4e11ad7c
    • Simon Martin's avatar
      c++: Fix regression introduced by r15-3796 [PR116722] · 3a528386
      Simon Martin authored
      Jason pointed out that the fix I made for PR116722 via r15-3796
      introduces a regression when running constexpr-dynamic10.C with
      -fimplicit-constexpr.
      
      The problem is that my change makes us leave cxx_eval_call_expression
      early, and bypass the call to cxx_eval_thunk_call (through a recursive
      call to cxx_eval_call_expression) that used to emit an error for that
      testcase with -fimplicit-constexpr.
      
      This patch emits the error if !ctx->quiet before bailing out because the
      {con,de}structor belongs to a class with virtual bases.
      
      	PR c++/116722
      
      gcc/cp/ChangeLog:
      
      	* constexpr.cc (cxx_bind_parameters_in_call): When !ctx->quiet,
      	emit error before bailing out due to a call to {con,de}structor
      	for a class with virtual bases.
      3a528386
    • Richard Biener's avatar
      Replace another missed iterative_hash_object · dafbfdb0
      Richard Biener authored
      I missed one that's actually hit quite a lot, hashing of the canonical
      type TYPE_HASH.
      
      gcc/cp/
      	* pt.cc (iterative_hash_template_arg): Use iterative_hash_hashval_t
      	to hash TYPE_HASH.
      dafbfdb0
    • Filip Kastl's avatar
      gimple ssa: Don't use __builtin_popcount in switch exp transform [PR116616] · ffc389cb
      Filip Kastl authored
      
      Switch exponential transformation in the switch conversion pass
      currently generates
      
      tmp1 = __builtin_popcount (var);
      tmp2 = tmp1 == 1;
      
      when inserting code to determine if var is power of two.  If the target
      doesn't support expanding the builtin as special instructions switch
      conversion relies on this whole pattern being expanded as bitmagic.
      However, it is possible that other GIMPLE optimizations move the two
      statements of the pattern apart.  In that case the builtin becomes a
      libgcc call in the final binary.  The call is slow and in case of
      freestanding programs can result in linking error (this bug was
      originally found while compiling Linux kernel).
      
      This patch modifies switch conversion to insert the bitmagic
      (var ^ (var - 1)) > (var - 1) instead of the builtin.
      
      gcc/ChangeLog:
      
      	PR tree-optimization/116616
      	* tree-switch-conversion.cc (can_pow2p): Remove this function.
      	(gen_pow2p): Generate bitmagic instead of a builtin.  Remove the
      	TYPE parameter.
      	(switch_conversion::is_exp_index_transform_viable): Don't call
      	can_pow2p.
      	(switch_conversion::exp_index_transform): Call gen_pow2p without
      	the TYPE parameter.
      	* tree-switch-conversion.h: Remove
      	m_exp_index_transform_pow2p_type.
      
      gcc/testsuite/ChangeLog:
      
      	PR tree-optimization/116616
      	* gcc.target/i386/switch-exp-transform-1.c: Don't test for
      	presence of the POPCOUNT internal fn call.
      
      Signed-off-by: default avatarFilip Kastl <fkastl@suse.cz>
      ffc389cb
    • Richard Biener's avatar
      Speedup iterative_hash_template_arg · 842fbfa1
      Richard Biener authored
      Using iterative_hash_object is expensive compared to using
      iterative_hash_hashval_t which is fit for integer sized values.
      The following reduces the number of perf cycles spent in
      iterative_hash_template_arg and iterative_hash combined by 20%.
      
      gcc/cp/
      	* pt.cc (iterative_hash_template_arg): Avoid using
      	iterative_hash_object.
      842fbfa1
    • Richard Biener's avatar
      Adjust gcc.dg/vect/slp-12a.c · 77c5e4ad
      Richard Biener authored
      We can now SLP the loop.  There's PR116583 tracking that this still
      fails for VLA vectors when load-lanes doesn't support a group of
      size 8.  We can't express this right now so the testcase keeps
      FAILing for aarch64 with SVE (but passes now for riscv).
      
      	* gcc.dg/vect/slp-12a.c: Adjust.
      77c5e4ad
    • Richard Biener's avatar
      Adjust expectation for gcc.dg/vect/slp-19c.c · 32b99dad
      Richard Biener authored
      We can now vectorize the first loop with SLP when using V2SImode
      vectors since then we can handle the non-power-of-two interleaving.
      We can also SLP the second loop reliably now after adding induction
      support for VLA vectors.
      
      	* gcc.dg/vect/slp-19c.c: Adjust expectation.
      32b99dad
Loading