1. Sep 02, 2022
    • Jonathan Wakely's avatar
      libstdc++: Add specializations for some variable templates · 33005a4b
      Jonathan Wakely authored
      This avoids having to instantiate a class template when we can detect
      the true cases easily with a partial specialization.
      
      libstdc++-v3/ChangeLog:
      
      	* include/std/type_traits (is_lvalue_reference_v)
      	(is_rvalue_reference_v, is_reference_v, is_const_v)
      	(is_volatile_v): Define using partial specializations instead
      	of instantiating class templates.
      33005a4b
    • Jonathan Wakely's avatar
      libstdc++: Use built-ins for some variable templates · cd20d948
      Jonathan Wakely authored
      This avoids having to instantiate a class template that just uses the
      same built-in anyway.
      
      None of the corresponding class templates have any type-completeness
      static assertions, so we're not losing any diagnostics by using the
      built-ins directly.
      
      libstdc++-v3/ChangeLog:
      
      	* include/std/type_traits (is_enum_v, is_class_v, is_union_v)
      	(is_empty_v, is_polymoprhic_v, is_abstract_v, is_final_v)
      	(is_base_of_v, is_aggregate_v): Use built-in directly instead of
      	instantiating class template.
      cd20d948
    • Joseph Myers's avatar
      c: C2x removal of unprototyped functions · 0a4b219d
      Joseph Myers authored
      C2x has completely removed unprototyped functions, so that () now
      means the same as (void) in both function declarations and
      definitions, where previously that change had been made for
      definitions only.  Implement this accordingly.
      
      This is a change where GNU/Linux distribution builders might wish to
      try builds with a -std=gnu2x default to start early on getting old
      code fixed that still has () declarations for functions taking
      arguments, in advance of GCC moving to -std=gnu2x as default maybe in
      GCC 14 or 15; I don't know how much such code is likely to be in
      current use.
      
      Bootstrapped with no regressions for x86_64-pc-linux-gnu.
      
      gcc/c/
      	* c-decl.cc (grokparms): Handle () in a function declaration the
      	same as (void) for C2X.
      
      gcc/testsuite/
      	* gcc.dg/c11-unproto-3.c, gcc.dg/c2x-unproto-3.c,
      	gcc.dg/c2x-unproto-4.c: New tests.
      	* gcc.dg/c2x-old-style-definition-6.c, gcc.dg/c2x-unproto-1.c,
      	gcc.dg/c2x-unproto-2.c: Update for removal of unprototyped
      	functions.
      0a4b219d
    • Richard Sandiford's avatar
      vect: Try to remove single-vector permutes from SLP graph · d2694766
      Richard Sandiford authored
      This patch extends the SLP layout optimisation pass so that it
      tries to remove layout changes that are brought about by permutes
      of existing vectors.  This fixes the bb-slp-pr54400.c regression on
      x86_64 and also means that we can remove the permutes in cases like:
      
      typedef float v4sf __attribute__((vector_size(sizeof(float)*4)));
      
      float __attribute__((noipa))
      f(v4sf v0, v4sf v1)
      {
        return v0[0]*v1[0]+v0[1]*v1[1]+v0[2]*v1[2]+v0[3]*v1[3];
      }
      
      The new test is a simple adaption of bb-slp-pr54400.c, with the
      same style of markup.
      
      gcc/
      	* tree-vect-slp.cc (vect_build_slp_tree_2): When building a
      	VEC_PERM_EXPR of an existing vector, set the SLP_TREE_LANES
      	to the number of vector elements, if that's a known constant.
      	(vect_optimize_slp_pass::is_compatible_layout): Remove associated
      	comment about zero SLP_TREE_LANES.
      	(vect_optimize_slp_pass::start_choosing_layouts): Iterate over
      	all partition members when looking for potential layouts.
      	Handle existing permutes of fixed-length vectors.
      
      gcc/testsuite/
      	* gcc.dg/vect/bb-slp-pr54400.c: Extend to aarch64.
      	* gcc.dg/vect/bb-slp-layout-18.c: New test.
      d2694766
    • Uros Bizjak's avatar
      i386: Fix conversion of move to/from AX_REG into xchg [PR106707] · 5205f5b5
      Uros Bizjak authored
      The conversion of a move pattern where both operands are AX_REG
      should be prevented.
      
      2022-09-01  Uroš Bizjak  <ubizjak@gmail.com>
      
      gcc/ChangeLog:
      
      	PR target/106707
      	* config/i386/i386.md (moves to/from AX_REG into xchg peephole2):
      	Do not convert a move pattern where both operands are AX_REG.
      
      gcc/testsuite/ChangeLog:
      
      	PR target/106707
      	* gcc.target/i386/pr106707.c: New test.
      5205f5b5
    • Aldy Hernandez's avatar
      Convert ranger uses of real_inf to dconst[n]inf. · bb17c503
      Aldy Hernandez authored
      gcc/ChangeLog:
      
      	* range-op-float.cc (build_le): Convert to dconst*inf.
      	(build_ge): Same.
      	* value-range.cc (frange::set_signbit): Same.
      	(frange::normalize_kind): Same.
      	(range_tests_floats): Same.
      	* value-range.h (vrp_val_max): Same.
      	(vrp_val_min): Same.
      	(frange::set_varying): Same.
      bb17c503
    • Aldy Hernandez's avatar
      Add global REAL_VALUE_TYPE infinities to real.*. · 5924b6b2
      Aldy Hernandez authored
      We're starting to abuse the infinity endpoints in the frange code and
      the associated range operators.  Building infinities are rather cheap,
      and we could even inline them, but I think it's best to just not
      recalculate them all the time.
      
      I see about 20 uses of real_inf in the source code, not including the
      backends.  And I'm about to add more :).
      
      gcc/ChangeLog:
      
      	* emit-rtl.cc (init_emit_once): Initialize dconstinf and
      	dconstninf.
      	* real.h: Add dconstinf and dconstninf.
      5924b6b2
  2. Sep 01, 2022
    • Jonathan Wakely's avatar
      libstdc++: Remove FIXME for ICE with remove_cvref_t in requires-expression · 37ff51a9
      Jonathan Wakely authored
      PR c++/99968 is fixed since GCC 12.1 so we can remove the workaround.
      
      libstdc++-v3/ChangeLog:
      
      	* include/std/type_traits (is_scoped_enum): Remove workaround.
      37ff51a9
    • Patrick Palka's avatar
      libstdc++: Implement ranges::adjacent_transform_view from P2321R2 · 0cb8d961
      Patrick Palka authored
      libstdc++-v3/ChangeLog:
      
      	* include/std/ranges (__detail::__unarize): Define.
      	(adjacent_view::_Iterator): Befriend adjacent_transform_view.
      	(adjacent_transform_view): Define.
      	(adjacent_transform_view::_Iterator): Define.
      	(adjacent_transform_view::_Sentinel): Define.
      	(views::__detail::__can_adjacent_transform_view): Define.
      	(views::_AdjacentTransform): Define.
      	(views::adjacent_transform): Define.
      	(views::pairwise_transform): Define.
      	* testsuite/std/ranges/adaptors/adjacent_transform/1.cc: New test.
      0cb8d961
    • Richard Biener's avatar
      Remove cycle checking from compute_control_dep_chain · 47e15513
      Richard Biener authored
      Now that we have DFS_BACK_EDGE marks we can simply avoid walking
      those instead of repeatedly looking for a cycle on the current chain.
      
      	* gimple-predicate-analysis.cc (compute_control_dep_chain):
      	Remove cycle detection, instead avoid walking backedges.
      47e15513
    • Richard Biener's avatar
      Some predicate analysis TLC · e75398ac
      Richard Biener authored
      The following hides some internal details of compute_control_dep_chain.
      
      	* gimple-predicate-analysis.cc (compute_control_dep_chain):
      	New wrapping overload.
      	(uninit_analysis::init_use_preds): Simplify.
      	(uninit_analysis::init_from_phi_def): Likewise.
      e75398ac
    • Jason Merrill's avatar
      c++: set TYPE_STRING_FLAG for char8_t · c5699dd8
      Jason Merrill authored
      While looking at the DWARF handling of char8_t I wondered why we weren't
      setting TREE_STRING_FLAG on it.  I hoped that setting that flag would be an
      easy fix for PR102958, but it doesn't seem to be sufficicent.  But it still
      seems correct.
      
      I also tried setting the flag on char16_t and char32_t, but that broke
      because braced_list_to_string assumes char-sized elements.  Since we don't
      set the flag on wchar_t, I abandoned that idea.
      
      gcc/c-family/ChangeLog:
      
      	* c-common.cc (c_common_nodes_and_builtins): Set TREE_STRING_FLAG on
      	char8_t.
      	(braced_list_to_string): Check for char-sized elements.
      c5699dd8
    • Aldy Hernandez's avatar
      Implement ranger folder for __builtin_signbit. · 0550e306
      Aldy Hernandez authored
      Now that we keep track of the signbit, we can use it to fold __builtin_signbit.
      
      I am assuming I don't have try too hard to get the actual signbit
      number and 1 will do.  Especially, since we're inconsistent in trunk whether
      we fold the builtin or whether we calculate it at runtime.
      
      abulafia:~$ cat a.c
      float nzero = -0.0;
      
      main(){
          printf("0x%x\n", __builtin_signbit(-0.0));
          printf("0x%x\n", __builtin_signbit(nzero));
      }
      abulafia:~$ gcc a.c -w && ./a.out
      0x1
      0x80000000
      
      It is amazing that we've been failing to fold something as simple as
      this:
      
      	if (x > 5.0)
      	  num = __builtin_signbit (x);
      
      It does the right thing now :-P.
      
      gcc/ChangeLog:
      
      	* gimple-range-fold.cc
      	(fold_using_range::range_of_builtin_int_call): Add case for
      	CFN_BUILT_IN_SIGNBIT.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.dg/tree-ssa/vrp-float-signbit-1.c: New test.
      0550e306
    • Aldy Hernandez's avatar
      Add signbit property to frange to better model signed zeros. · e9b0dd2a
      Aldy Hernandez authored
      As discussed here:
      
      	https://gcc.gnu.org/pipermail/gcc-patches/2022-August/600656.html
      
      This adds an frange property to keep track of the sign bit.  We keep
      it updated at all times, but we don't use it make any decisions when
      !HONOR_SIGNED_ZEROS.
      
      With this property we can now query the range for the appropriate sign
      with frange::get_signbit ().  Possible values are yes, no, and unknown.
      
      gcc/ChangeLog:
      
      	* range-op-float.cc (foperator_equal::op1_range): Do not copy sign
      	bit.
      	(foperator_not_equal::op1_range): Same.
      	* value-query.cc (range_query::get_tree_range): Set sign bit.
      	* value-range-pretty-print.cc (vrange_printer::visit): Dump sign bit.
      	* value-range.cc (frange::set_signbit): New.
      	(frange::set): Adjust for sign bit.
      	(frange::normalize_kind): Same.
      	(frange::union_): Remove useless comment.
      	(frange::intersect): Same.
      	(frange::contains_p): Adjust for sign bit.
      	(frange::singleton_p): Same.
      	(frange::verify_range): Same.
      	(range_tests_signbit): New tests.
      	(range_tests_floats): Call range_tests_signbit.
      	* value-range.h (class frange_props): Add signbit
      	(class frange): Same.
      e9b0dd2a
    • Jonathan Wakely's avatar
      libstdc++: Optimize array traits · 0e1b1222
      Jonathan Wakely authored
      Improve compile times by avoiding unnecessary class template
      instantiations.
      
      __is_array_known_bounds and __is_array_unknown_bounds can be defined
      without instantiating extent, by providing partial specializations for
      the true cases.
      
      std::extent can avoid recursing down through a multidimensional array,
      so it stops after providing the result. Previously extent<T[n][m], 0>
      would instantiate extent<T[n], -1u> and extent<T, -2u> as well.
      
      std::is_array_v can use partial specializations to avoid instantiating
      std::is_array, and similarly for std::rank_v and std::extent_v.
      
      std::is_bounded_array_v and std::is_unbounded_array_v can also use
      partial specializations, and then the class templates can be defined in
      terms of the variable templates. This makes sense for these traits,
      because they are new in C++20 and so the variable templates are always
      available, which isn't true in general for C++11 and C++14 traits.
      
      libstdc++-v3/ChangeLog:
      
      	* include/std/type_traits (__is_array_known_bounds): Add partial
      	specialization instead of using std::extent.
      	(__is_array_unknown_bounds): Likewise.
      	(extent): Add partial specializations to stop recursion after
      	the result is found.
      	(is_array_v): Add partial specializations instead of
      	instantiating the class template.
      	(rank_v, extent_v): Likewise.
      	(is_bounded_array_v, is_unbounded_array_v): Likewise.
      	(is_bounded_array, is_unbounded_array): Define in terms of the
      	variable templates.
      0e1b1222
    • Jakub Jelinek's avatar
      Fix up dump_printf_loc format attribute and adjust uses [PR106782] · 953e08fd
      Jakub Jelinek authored
      As discussed on IRC, the r13-2299-g68c61c2d bug only got missed
      because dump_printf_loc had incorrect format attribute and therefore
      almost no -Wformat=* checking was performed on it.
      3, 0 are suitable for function with (whatever, whatever, const char *, va_list)
      arguments, not for (whatever, whatever, const char *, ...), that one should
      use 3, 4.
      
      The following patch fixes that and adjusts all spots to fix warnings.
      In many cases it is just through an ugly cast (for %G casts to gimple *
      from gassign */gphi * and the like and for %p casts to void * from slp_node
      etc.).
      There are 3 spots where the mismatch was worse though, two using %u or %d
      for unsigned HOST_WIDE_INT argument and one %T for enum argument (promoted
      to int).
      
      2022-09-01  Jakub Jelinek  <jakub@redhat.com>
      
      	PR other/106782
      	* dumpfile.h (dump_printf_loc): Use ATTRIBUTE_GCC_DUMP_PRINTF (3, 4)
      	instead of ATTRIBUTE_GCC_DUMP_PRINTF (3, 0).
      	* tree-parloops.cc (parloops_is_slp_reduction): Cast pointers to
      	derived types of gimple to gimple * to avoid -Wformat warnings.
      	* tree-vect-loop-manip.cc (vect_set_loop_condition,
      	vect_update_ivs_after_vectorizer): Likewise.
      	* tree-vect-stmts.cc (vectorizable_load): Likewise.
      	* tree-vect-patterns.cc (vect_split_statement,
      	vect_recog_mulhs_pattern, vect_recog_average_pattern,
      	vect_determine_precisions_from_range,
      	vect_determine_precisions_from_users): Likewise.
      	* gimple-loop-versioning.cc
      	(loop_versioning::analyze_term_using_scevs): Likewise.
      	* tree-vect-slp.cc (vect_build_slp_tree_1): Likewise.
      	(vect_build_slp_tree): Cast slp_tree to void * to avoid
      	-Wformat warnings.
      	(optimize_load_redistribution_1, vect_match_slp_patterns,
      	vect_build_slp_instance, vect_optimize_slp_pass::materialize,
      	vect_optimize_slp_pass::dump, vect_slp_convert_to_external,
      	vect_slp_analyze_node_operations, vect_bb_partition_graph): Likewise.
      	(vect_print_slp_tree): Likewise.  Also use
      	HOST_WIDE_INT_PRINT_UNSIGNED instead of %u.
      	* tree-vect-loop.cc (vect_determine_vectorization_factor,
      	vect_analyze_scalar_cycles_1, vect_analyze_loop_operations,
      	vectorizable_induction, vect_transform_loop): Cast pointers to derived
      	types of gimple to gimple * to avoid -Wformat warnings.
      	(vect_analyze_loop_2): Cast slp_tree to void * to avoid
      	-Wformat warnings.
      	(vect_estimate_min_profitable_iters): Use HOST_WIDE_INT_PRINT_UNSIGNED
      	instead of %d.
      	* tree-vect-slp-patterns.cc (vect_pattern_validate_optab): Use %G
      	instead of %T and STMT_VINFO_STMT (SLP_TREE_REPRESENTATIVE (node))
      	instead of SLP_TREE_DEF_TYPE (node).
      953e08fd
    • Jakub Jelinek's avatar
      libcpp: Add -Winvalid-utf8 warning [PR106655] · 0b8c57ed
      Jakub Jelinek authored
      The following patch introduces a new warning - -Winvalid-utf8 similarly
      to what clang now has - to diagnose invalid UTF-8 byte sequences in
      comments, but not just in those, but also in string/character literals
      and outside of them.
      
      The warning is on by default when explicit -finput-charset=UTF-8 is
      used and C++23 compilation is requested and if -{,W}pedantic or
      -pedantic-errors it is actually a pedwarn.
      
      The reason it is on by default only for -finput-charset=UTF-8 is
      that the sources often are UTF-8, but sometimes could be some ASCII
      compatible single byte encoding where non-ASCII characters only
      appear in comments.  So having the warning off by default
      is IMO desirable.  The C++23 pedantic mode for when the source code
      is UTF-8 is -std=c++23 -pedantic-errors -finput-charset=UTF-8.
      
      2022-09-01  Jakub Jelinek  <jakub@redhat.com>
      
      	PR c++/106655
      libcpp/
      	* include/cpplib.h (struct cpp_options): Implement C++23
      	P2295R6 - Support for UTF-8 as a portable source ...
      0b8c57ed
    • Aldy Hernandez's avatar
      Make frange selftests work on !HONOR_NANS systems. · bdfe0d1c
      Aldy Hernandez authored
      I'm just shuffling the FP self tests here, with no change to existing
      functionality.
      
      If we agree that explicit NANs in the source code with !HONOR_NANS
      should behave any differently, I'm happy to address whatever needs
      fixing, but for now I'd like to unblock the !HONOR_NANS build systems.
      
      I have added an adaptation of a test Jakub suggested we handle in the PR:
      
      void funk(int cond)
      {
        float x;
      
        if (cond)
          x = __builtin_nan ("");
        else
          x = 1.24;
      
        bar(x);
      }
      
      For !HONOR_NANS, the range for the PHI of x_1 is the union of 1.24 and
      NAN which is really 1.24 with a maybe NAN.  This reflects the IL-- the
      presence of the actual NAN.  However, VRP will propagate this because
      it sees the 1.24 and ignores the possibility of a NAN, per
      !HONOR_NANS.  IMO, this is correct.  OTOH, for HONOR_NANS the unknown
      NAN property keeps us from propagating the value.
      
      Is there a reason we don't warn for calls to __builtin_nan when
      !HONOR_NANS?  That makes no sense to me.
      
      	PR tree-optimization/106785
      
      gcc/ChangeLog:
      
      	* value-range.cc (range_tests_nan): Adjust tests for !HONOR_NANS.
      	(range_tests_floats): Same.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.dg/tree-ssa/vrp-float-nan-1.c: New test.
      bdfe0d1c
    • konglin1's avatar
      middle-end: Add MULT_EXPR recognition for cond scalar reduction · ca8f4e8a
      konglin1 authored
      gcc/ChangeLog:
      
      	* tree-if-conv.cc (is_cond_scalar_reduction): Add MULT_EXPR
      	recognition.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.dg/tree-ssa/gen-vect-34.c: New test.
      	* gcc.dg/vect/vect-ifcvt-18.c: New test.
      ca8f4e8a
    • Kewen Lin's avatar
      rs6000/test: Fix typo in pr86731-fwrapv-longlong.c [PR106682] · 023c5b36
      Kewen Lin authored
      Commit r12-2266 updated the scanned assembly content from
      
        "{\mlvx\M|\mlxv\M|\mlxvd2x\M}"
      
      to
      
        "{\mp?lxv\M|\mlxv\M|\mlxvd2x\M}"
      
      for the test case pr86731-fwrapv-longlong.c unexpectedly.
      
      It's meant to update "lxv" to "p?lxv", should leave the
      "lvx" unchanged.  So fix the typo accordingly.
      
      	PR testsuite/106682
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.target/powerpc/pr86731-fwrapv-longlong.c: Fix typo.
      023c5b36
    • Peter Bergner's avatar
      rs6000: Don't ICE when we disassemble an MMA variable [PR101322] · 29850490
      Peter Bergner authored
      When we expand an MMA disassemble built-in with C++ using a pointer that
      is cast to a valid MMA type, the type isn't passed down to the expand
      machinery and we end up using the base type of the pointer which leads to
      an ICE.  This patch enforces we always use the correct MMA type regardless
      of the pointer type being used.
      
      2022-08-31  Peter Bergner  <bergner@linux.ibm.com>
      
      gcc/
      	PR target/101322
      	* config/rs6000/rs6000-builtin.cc (rs6000_gimple_fold_mma_builtin):
      	Enforce the use of a valid MMA pointer type.
      
      gcc/testsuite/
      	PR target/101322
      	* g++.target/powerpc/pr101322.C: New test.
      29850490
    • zhongjuzhe's avatar
      RISC-V: Add vector registers in TARGET_CONDITIONAL_REGISTER_USAGE · e8c83ab9
      zhongjuzhe authored
      gcc/ChangeLog:
      
      	* config/riscv/riscv.cc (riscv_conditional_register_usage): Add vector
      	registers.
      e8c83ab9
    • zhongjuzhe's avatar
      RISC-V: Add csrr vlenb instruction. · 8fe75147
      zhongjuzhe authored
      gcc/ChangeLog:
      
      	* config/riscv/riscv.cc (riscv_const_insns): Add cost of poly_int.
      	(riscv_output_move): Add csrr vlenb assembly.
      	* config/riscv/riscv.md (move_type): Add csrr vlenb type.
      	(ext): New attribute.
      	(ext_enabled): Ditto.
      	(enabled): Ditto.
      8fe75147
    • zhongjuzhe's avatar
      RISC-V: Add RVV constraints. · e8089aff
      zhongjuzhe authored
      gcc/ChangeLog:
      
      	* config/riscv/constraints.md (TARGET_VECTOR ? V_REGS : NO_REGS): Add
      	"vr" constraint.
      	(TARGET_VECTOR ? VD_REGS : NO_REGS): Add "vd" constraint.
      	(TARGET_VECTOR ? VM_REGS : NO_REGS): Add "vm" constraint.
      	(vp): Add poly constraint.
      e8089aff
    • zhongjuzhe's avatar
      RISC-V: Fix comment in riscv.h · 45f12872
      zhongjuzhe authored
      gcc/ChangeLog:
      
      	* config/riscv/riscv.h (enum reg_class): Change vype to vtype.
      45f12872
    • zhongjuzhe's avatar
      RISC-V: Fix riscv_vector_chunks configuration according to TARGET_MIN_VLEN · e9f827d7
      zhongjuzhe authored
      gcc/ChangeLog:
      
      	* config/riscv/riscv.cc (riscv_convert_vector_bits): Change
      	configuration according to TARGET_MIN_VLEN.
      	* config/riscv/riscv.h (UNITS_PER_FP_REG): Fix comment.
      e9f827d7
    • GCC Administrator's avatar
      Daily bump. · 542c60c4
      GCC Administrator authored
      542c60c4
    • Joseph Myers's avatar
      c: C2x attributes fixes and updates · 2eca4ff4
      Joseph Myers authored
      Implement some changes to the currently supported C2x standard
      attributes that have been made to the specification since they were
      first implemented in GCC, and some consequent changes:
      
      * maybe_unused is now supported on labels.  In fact that was already
        accidentally supported in GCC as a result of sharing the
        implementation with __attribute__ ((unused)), but needed to be
        covered in the tests.
      
      * As part of the support for maybe_unused on labels, its
        __has_c_attribute value changed.
      
      * The issue of maybe_unused accidentally being already supported on
        labels showed up the lack of tests for other standard attributes
        being incorrectly applied to labels; add such tests.
      
      * Use of fallthrough or nodiscard attributes on labels already
        properly resulted in a pedwarn.  For the deprecated attribute,
        however, there was only a warning, and the wording "'deprecated'
        attribute ignored for 'void'" included an unhelpful "for 'void'".
        Arrange for the case of the deprecated attribute on a label to be
        checked for separately and result in a pedwarn.  As with
        inappropriate uses of fallthrough (see commit
        6c80b1b5), it seems reasonable for
        this pedwarn to apply regardless of whether [[]] or __attribute__
        was used and regardless of whether C or C++ is being compiled.
      
      * Attributes on case or default labels (the standard syntax supports
        attributes on all kinds of labels) were quietly ignored, whether or
        not appropriate for use in such a context, because they weren't
        passed to decl_attributes at all.  (Note where I'm changing the
        do_case prototype that such a function is actually only defined in
        the C front end, not for C++, despite the declaration being in
        c-common.h.)
      
      * A recent change as part of the editorial review in preparation for
        the C2x CD ballot has changed the __has_c_attribute value for
        fallthrough to 201910 to reflect when that attribute was actually
        voted into the working draft.
      
      Bootstrapped with no regressions for x86_64-pc-linux-gnu.
      
      gcc/c-family/
      	* c-attribs.cc (handle_deprecated_attribute): Check and pedwarn
      	for LABEL_DECL.
      	* c-common.cc (c_add_case_label): Add argument ATTRS.  Call
      	decl_attributes.
      	* c-common.h (do_case, c_add_case_label): Update declarations.
      	* c-lex.cc (c_common_has_attribute): For C, produce a result of
      	201910 for fallthrough and 202106 for maybe_unused.
      
      gcc/c/
      	* c-parser.cc (c_parser_label): Pass attributes to do_case.
      	* c-typeck.cc (do_case): Add argument ATTRS.  Pass it to
      	c_add_case_label.
      
      gcc/testsuite/
      	* gcc.dg/c2x-attr-deprecated-2.c, gcc.dg/c2x-attr-fallthrough-2.c,
      	gcc.dg/c2x-attr-maybe_unused-1.c, gcc.dg/c2x-attr-nodiscard-2.c:
      	Add tests of attributes on labels.
      	* gcc.dg/c2x-has-c-attribute-2.c: Update expected results for
      	maybe_unused and fallthrough.
      2eca4ff4
    • Patrick Palka's avatar
      libstdc++: A few more minor <ranges> cleanups · 26aafae4
      Patrick Palka authored
      libstdc++-v3/ChangeLog:
      
      	* include/bits/ranges_base.h (__advance_fn::operator()): Add
      	parentheses in assert condition to avoid -Wparentheses warning.
      	* include/std/ranges: (take_view::take_view): Uglify 'base'.
      	(take_while_view::take_while_view): Likewise.
      	(elements_view::elements_view): Likewise.
      	(views::_Zip::operator()): Adjust position of [[nodiscard]] for
      	compatibility with -fconcepts-ts.
      	(zip_transform_view::_Sentinel): Uglify 'OtherConst'.
      	(views::_ZipTransform::operator()): Adjust position of
      	[[nodiscard]] for compatibilty with -fconcepts-ts.
      26aafae4
    • Martin Liska's avatar
      hpux removal: regenerate configure files · ad8428c1
      Martin Liska authored
      fixincludes/ChangeLog:
      
      	* configure: Regenerate.
      
      libitm/ChangeLog:
      
      	* configure: Regenerate.
      ad8428c1
    • Martin Liska's avatar
      32-bit PA-RISC with HP-UX: remove deprecated ports · dc832fb3
      Martin Liska authored
      ChangeLog:
      
      	* configure: Regenerate.
      	* configure.ac: Delete hpux9 and hpux10.
      
      config/ChangeLog:
      
      	* mh-pa-hpux10: Removed.
      
      contrib/ChangeLog:
      
      	* config-list.mk: Remove deprecated ports.
      
      contrib/header-tools/ChangeLog:
      
      	* README: Remove deprecated ports.
      	* reduce-headers: Likewise.
      
      gcc/ChangeLog:
      
      	* config.build: Remove deprecated ports.
      	* config.gcc: Likewise.
      	* config.host: Likewise.
      	* configure.ac: Likewise.
      	* configure: Regenerate.
      	* config/pa/pa-hpux10.h: Removed.
      	* config/pa/pa-hpux10.opt: Removed.
      	* config/pa/t-dce-thr: Removed.
      
      gnattools/ChangeLog:
      
      	* configure.ac: Remove deprecated ports.
      	* configure: Regenerate.
      
      libstdc++-v3/ChangeLog:
      
      	* configure: Regenerate.
      	* crossconfig.m4: Remove deprecated ports.
      
      gcc/testsuite/ChangeLog:
      
      	* g++.dg/cpp0x/lambda/lambda-conv.C: Remove useless test.
      	* gcc.c-torture/execute/ieee/hugeval.x: Likewise.
      	* gcc.dg/torture/pr47917.c: Likewise.
      	* lib/target-supports.exp: Likewise.
      
      libgcc/ChangeLog:
      
      	* config.host: Remove hppa.
      
      libitm/ChangeLog:
      
      	* configure: Regenerate.
      
      fixincludes/ChangeLog:
      
      	* configure: Regenerate.
      dc832fb3
    • Jonathan Wakely's avatar
      testsuite: Fix warning regression due to std::string changes [PR106795] · 2dbe2801
      Jonathan Wakely authored
      std::string now has [[nodiscard]] attributes on most members, causing
      -Wunused-result warnings for this test.
      
      gcc/testsuite/ChangeLog:
      
      	PR testsuite/106795
      	* g++.dg/tree-ssa/empty-loop.C: Use -Wno-unused-result.
      2dbe2801
    • Martin Liska's avatar
      Support --disable-fixincludes. · be9dd80f
      Martin Liska authored
      Always install limits.h and syslimits.h header files
      to include folder.
      
      When --disable-fixincludes is used, then no system header files
      are fixed by the tools in fixincludes. Moreover, the fixincludes
      tools are not built any longer.
      
      gcc/ChangeLog:
      
      	* Makefile.in: Always install limits.h and syslimits.h to
      	include folder.
      	* configure.ac: Assign STMP_FIXINC blank if
      	--disable-fixincludes is used.
      	* configure: Regenerate.
      be9dd80f
    • François Dumont's avatar
      libstdc++: [_GLIBCXX_DEBUG] Review nullptr assertion diagnostics · 5f932c9f
      François Dumont authored
      Review null string checks to show:
      _String != nullptr
      
      rather than:
      _String != 0
      
      libstdc++-v3/ChangeLog:
      
      	* include/debug/debug.h: Use nullptr rather than '0' in checks in post-C++11.
      	* include/debug/string: Likewise.
      	* testsuite/21_strings/basic_string/operations/ends_with/char.cc: Use __gnu_test::string.
      	* testsuite/21_strings/basic_string/operations/ends_with/nonnull.cc: Likewise.
      	* testsuite/21_strings/basic_string/operations/ends_with/wchar_t.cc: Likewise.
      	* testsuite/21_strings/basic_string/operations/starts_with/wchar_t.cc: Likewise.
      	* testsuite/21_strings/basic_string/operations/starts_with/nonnull.cc: Likewise.
      	* testsuite/21_strings/basic_string/operations/starts_with/char.cc: Likewise..
      5f932c9f
    • Patrick Palka's avatar
      libstdc++: Implement ranges::adjacent_view from P2321R2 · f956cadc
      Patrick Palka authored
      libstdc++-v3/ChangeLog:
      
      	* include/std/ranges (adjacent_view): Define.
      	(enable_borrowed_range<adjacent_view>): Define.
      	(__detail::__repeated_tuple): Define.
      	(adjacent_view::_Iterator): Define.
      	(adjacent_view::_Sentinel): Define.
      	(views::__detail::__can_adjacent_view): Define.
      	(views::_Adjacent): Define.
      	(views::adjacent): Define.
      	(views::pairwise): Define.
      	* testsuite/std/ranges/adaptors/adjacent/1.cc: New test.
      f956cadc
    • François Dumont's avatar
      libstdc++: [_GLIBCXX_DEBUG] Add backtrace generation on demand · 4d566090
      François Dumont authored
        Add _GLIBCXX_DEBUG_BACKTRACE macro to activate backtrace generation on
      _GLIBCXX_DEBUG assertions. Prerequisite is to have configure the lib with:
      
      --enable-libstdcxx-backtrace=yes
      
      libstdc++-v3/ChangeLog:
      
      	* include/debug/formatter.h
      	[_GLIBCXX_HAVE_STACKTRACE](__glibcxx_backtrace_state): Declare.
      	[_GLIBCXX_HAVE_STACKTRACE](__glibcxx_backtrace_create_state): Declare.
      	[_GLIBCXX_HAVE_STACKTRACE](__glibcxx_backtrace_full_callback): Define.
      	[_GLIBCXX_HAVE_STACKTRACE](__glibcxx_backtrace_error_callback): Define.
      	[_GLIBCXX_HAVE_STACKTRACE](__glibcxx_backtrace_full_func): Define.
      	[_GLIBCXX_HAVE_STACKTRACE](__glibcxx_backtrace_full): Declare.
      	[_GLIBCXX_HAVE_STACKTRACE](_Error_formatter::_M_backtrace_state): New.
      	[_GLIBCXX_HAVE_STACKTRACE](_Error_formatter::_M_backtrace_full): New.
      	* src/c++11/debug.cc [_GLIBCXX_HAVE_STACKTRACE](print_backtrace): New.
      	(_Error_formatter::_M_error()): Adapt.
      	* src/libbacktrace/Makefile.am: Add backtrace.c.
      	* src/libbacktrace/Makefile.in: Regenerate.
      	* src/libbacktrace/backtrace-rename.h (backtrace_full): New.
      	* testsuite/23_containers/vector/debug/assign4_backtrace_neg.cc: New test.
      	* doc/xml/manual/debug_mode.xml: Document _GLIBCXX_DEBUG_BACKTRACE.
      	* doc/xml/manual/using.xml: Likewise.
      4d566090
  3. Aug 31, 2022
    • Richard Sandiford's avatar
      aarch64: Update sizeless tests for recent GNU C changes · de9805c0
      Richard Sandiford authored
      The tests for sizeless SVE types include checks that the types
      are handled for initialisation purposes in the same way as scalars.
      GNU C and C2x now allow scalars to be initialised using empty braces,
      so this patch updates the SVE tests to match.
      
      gcc/testsuite/
      	* gcc.target/aarch64/sve/acle/general-c/gnu_vectors_1.c: Update
      	tests for empty initializers.
      	* gcc.target/aarch64/sve/acle/general-c/gnu_vectors_2.c: Likewise.
      	* gcc.target/aarch64/sve/acle/general-c/sizeless-1.c: Likewise.
      	* gcc.target/aarch64/sve/acle/general-c/sizeless-2.c: Likewise.
      de9805c0
    • Richard Biener's avatar
      Avoid fatal fails in predicate::init_from_control_deps · a8ebd27d
      Richard Biener authored
      When processing USE predicates we can drop from the AND chain,
      when procsssing DEF predicates we can drop from the OR chain.  Do
      that instead of giving up completely.  This also removes cases
      that should never trigger.
      
      	* gimple-predicate-analysis.cc (predicate::init_from_control_deps):
      	Assert the guard_bb isn't empty and has more than one successor.
      	Drop appropriate parts of the predicate when an edge fails to
      	register a predicate.
      	(predicate::dump): Dump empty predicate as TRUE.
      a8ebd27d
    • Patrick Palka's avatar
      libstdc++: Add test for std::con/disjunction's short circuiting · caaf9e66
      Patrick Palka authored
      libstdc++-v3/ChangeLog:
      
      	* testsuite/20_util/logical_traits/requirements/short_circuit.cc: New test.
      caaf9e66
    • Jonathan Wakely's avatar
      libstdc++: Add noexcept-specifier to std::reference_wrapper::operator() · e47df5eb
      Jonathan Wakely authored
      This isn't required by the standard, but there's an LWG issue suggesting
      to add it.
      
      Also use __invoke_result instead of result_of, to match the spec in
      recent standards.
      
      libstdc++-v3/ChangeLog:
      
      	* include/bits/refwrap.h (reference_wrapper::operator()): Add
      	noexcept-specifier and use __invoke_result instead of result_of.
      	* testsuite/20_util/reference_wrapper/invoke-noexcept.cc: New test.
      e47df5eb