Skip to content
Snippets Groups Projects
  1. Aug 28, 2024
    • Jonathan Wakely's avatar
      libstdc++: Fix -Wunused-parameter warnings in Networking TS headers · 51b0fef4
      Jonathan Wakely authored
      libstdc++-v3/ChangeLog:
      
      	* include/experimental/io_context: Remove name of unused
      	parameter.
      	* include/experimental/socket: Add [[maybe_unused]] attribute.
      51b0fef4
    • Jonathan Wakely's avatar
      libstdc++: Fix -Wunused-variable warning in <format> · 0e2b3dba
      Jonathan Wakely authored
      libstdc++-v3/ChangeLog:
      
      	* include/std/format (format_parse_context::check_dynamic_spec):
      	Add [[maybe_unused]] attribute and comment.
      0e2b3dba
    • Jonathan Wakely's avatar
      libstdc++: Remove unused typedef in <ranges> · a59f1cc3
      Jonathan Wakely authored
      This local typedef should have been removed in r14-6199-g45630fbcf7875b.
      
      libstdc++-v3/ChangeLog:
      
      	* include/std/ranges (to): Remove unused typedef.
      a59f1cc3
    • Jonathan Wakely's avatar
      doc: Add Dhruv Matani to Contributors · 9740a1b0
      Jonathan Wakely authored
      gcc/ChangeLog:
      
      	* doc/contrib.texi (Contributors): Add Dhruv Matani.
      9740a1b0
    • Kim Gräsman's avatar
      libstdc++: Fix @file for target-specific opt_random.h · c2ad7b2d
      Kim Gräsman authored
      A few of these files self-identified as ext/random.tcc, update to use
      the actual basename.
      
      libstdc++-v3/ChangeLog:
      
      	* config/cpu/aarch64/opt/ext/opt_random.h: Improve doxygen file
      	docs.
      	* config/cpu/i486/opt/ext/opt_random.h: Likewise.
      c2ad7b2d
    • Kim Gräsman's avatar
      libstdc++: Fix @headername for bits/cpp_type_traits.h · f6ed7a61
      Kim Gräsman authored
      There is no file ext/type_traits, point it to ext/type_traits.h instead.
      
      libstdc++-v3/ChangeLog:
      
      	* include/bits/cpp_type_traits.h: Improve doxygen file docs.
      f6ed7a61
    • Georg-Johann Lay's avatar
      AVR: Overhaul the avr-ifelse RTL optimization pass. · 898f013e
      Georg-Johann Lay authored
      Mini-pass avr-ifelse realizes optimizations that replace two cbranch
      insns with one comparison and two branches.  This patch adds the
      following improvements:
      
      - The right operand of the comparisons may also be REGs.
        Formerly only CONST_INT was handled.
      
      - The RTX code of the first comparison in no more restricted
        to (effectively) EQ.
      
      - When the second cbranch is located in the fallthrough path
        of the first cbranch, then difficult (expensive) comparisons
        can always be avoided.  This may require to swap the branch
        targets.  (When the second cbranch is located after the target
        label of the first one, then getting rid of difficult branches
        would require to reorder blocks.)
      
      - The code has been cleaned up:  avr_rest_of_handle_ifelse() now
        just scans the insn stream for optimization candidates.  The code
        that actually performs the transformation has been outsourced to
        the new function avr_optimize_2ifelse().
      
      - The code to find a better representation for reg-const_int comparisons
        has been split into two parts:  First try to find codes such that the
        right-hand sides of the comparisons are the same (avr_2comparisons_rhs).
        When this succeeds then one comparison can serve two branches, and
        that function tries to get rid of difficult branches.  This is always
        possible when the second cbranch is located in the fallthrough path
        of the first one.
      
      Some final notes on why we don't use compare-elim:  1) The two cbranch
      insns may come with different scratch operands depending on the chosen
      constraint alternatives.  There are cases where the outgoing comparison
      requires a scratch but only one incoming cbranch has one.  2) Avoiding
      difficult branches can be achieved by rewiring basic blocks.
      compare-elim doesn't do that; it doesn't even know the costs of the
      branch codes.  3)  avr_2comparisons_rhs() may de-canonicalize a
      comparison to achieve its goal.  compare-elim doesn't know how to do
      that.  4) There are more reasons, see for example the commit message
      and discussion for PR115830.
      
      avr_2comparisons_rhs tries to decompose the interval as given by some
      [u]intN_t into three intervals using the new Ranges struct that
      implemens set operations on finite unions of intervals.
      Sadly, value-range.h is not well suited for that, and writing a
      wrapper around it that avoids all corner case ICEs would be more
      laborious than struct Ranges.
      
      gcc/
      	* config/avr/avr.cc (INCLUDE_VECTOR): Define it.
      	(cfganal.h): Include it.
      	(Ranges): New struct.
      	(avr_2comparisons_rhs, avr_redundant_compare_regs)
      	(avr_strict_signed_p, avr_strict_unsigned_p): New static functions.
      	(avr_redundant_compare): Overhaul: Allow more cases.
      	(avr_optimize_2ifelse): New static function, outsourced from...
      	(avr_rest_of_handle_ifelse): ...this method.
      gcc/testsuite/
      	* gcc.target/avr/torture/ifelse-c.h: New file.
      	* gcc.target/avr/torture/ifelse-d.h: New file.
      	* gcc.target/avr/torture/ifelse-q.h: New file.
      	* gcc.target/avr/torture/ifelse-r.h: New file.
      	* gcc.target/avr/torture/ifelse-c-i8.c: New test.
      	* gcc.target/avr/torture/ifelse-d-i8.c: New test.
      	* gcc.target/avr/torture/ifelse-q-i8.c: New test.
      	* gcc.target/avr/torture/ifelse-r-i8.c: New test.
      	* gcc.target/avr/torture/ifelse-c-i16.c: New test.
      	* gcc.target/avr/torture/ifelse-d-i16.c: New test.
      	* gcc.target/avr/torture/ifelse-q-i16.c: New test.
      	* gcc.target/avr/torture/ifelse-r-i16.c: New test.
      	* gcc.target/avr/torture/ifelse-c-u16.c: New test.
      	* gcc.target/avr/torture/ifelse-d-u16.c: New test.
      	* gcc.target/avr/torture/ifelse-q-u16.c: New test.
      	* gcc.target/avr/torture/ifelse-r-u16.c: New test.
      898f013e
    • Joseph Myers's avatar
      Add gcc ka.po · 6661944a
      Joseph Myers authored
      	* ka.po: New file.
      6661944a
    • Marek Polacek's avatar
      c++: ICE with ()-init and TARGET_EXPR eliding [PR116424] · 15f857af
      Marek Polacek authored
      Here we crash on a cp_gimplify_expr/TARGET_EXPR assert:
      
            gcc_checking_assert (!TARGET_EXPR_ELIDING_P (*expr_p)
                                 || !TREE_ADDRESSABLE (TREE_TYPE (*expr_p)));
      
      We cannot elide the TARGET_EXPR because we're taking its address.
      
      It is set as eliding in massage_init_elt.  I've tried to not set
      TARGET_EXPR_ELIDING_P when the context is not direct-initialization.
      That didn't work: even when it's not direct-initialization now, it
      can become one later, for instance, after split_nonconstant_init.
      One problem is that replace_placeholders_for_class_temp_r will replace
      placeholders in non-eliding TARGET_EXPRs with the slot, but if we then
      elide the TARGET_EXPR, we end up with a "stray" VAR_DECL and crash.
      (Only some TARGET_EXPRs are handled by replace_decl.)
      
      I thought I'd have to go back to
      <https://gcc.gnu.org/pipermail/gcc-patches/2024-May/651163.html> but
      then I realized that this problem occurrs only with ()-init but not
      {}-init.  With {}-init, there is no problem, because we are clearing
      TARGET_EXPR_ELIDING_P in process_init_constructor_record:
      
             /* We can't actually elide the temporary when initializing a
                potentially-overlapping field from a function that returns by
                value.  */
             if (ce->index
                 && TREE_CODE (next) == TARGET_EXPR
                 && unsafe_copy_elision_p (ce->index, next))
               TARGET_EXPR_ELIDING_P (next) = false;
      
      But that does not happen for ()-init because we have no ce->index.
      ()-init doesn't allow brace elision so we don't really reshape them.
      
      But I can just move the clearing a few lines down and then it handles
      both ()-init and {}-init.
      
      	PR c++/116424
      
      gcc/cp/ChangeLog:
      
      	* typeck2.cc (process_init_constructor_record): Move the clearing of
      	TARGET_EXPR_ELIDING_P down.
      
      gcc/testsuite/ChangeLog:
      
      	* g++.dg/cpp2a/paren-init38.C: New test.
      15f857af
    • Richard Sandiford's avatar
      aarch64: Assume zero gather/scatter set-up cost for -mtune=generic · abeeccef
      Richard Sandiford authored
      generic_vector_cost is not currently used by any SVE target
      by default; it has to be specifically selected by -mtune=generic.
      Its SVE costing has historically been somewhat idealised, since
      it predated any actual SVE cores.  This seems like a useful
      tradition to continue, at least for testing purposes.
      
      The ideal case is that gathers and scatters do not induce a specific
      one-off overhead.  This patch therefore sets the gather/scatter init
      costs to zero.
      
      This patch is necessary to switch -mtune=generic over to the
      "new" vector costs.
      
      gcc/
      	* config/aarch64/tuning_models/generic.h (generic_sve_vector_cost):
      	Set gather_load_x32_init_cost and gather_load_x64_init_cost to 0.
      abeeccef
    • Richard Sandiford's avatar
      aarch64: Fix gather x32/x64 selection · 3e27ea26
      Richard Sandiford authored
      The SVE gather and scatter costs are classified based on whether
      they do 4 loads per 128 bits (x32) or 2 loads per 128 bits (x64).
      The number after the "x" refers to the number of bits in each
      "container".
      
      However, the test for which to use was based on the element size
      rather than the container size.  This meant that we'd use the
      overly conservative x32 costs for VNx2SI gathers.  VNx2SI gathers
      are really .D gathers in which the upper half of each extension
      result is ignored.
      
      This patch is necessary to switch -mtune=generic over to the
      "new" vector costs.
      
      gcc/
      	* config/aarch64/aarch64.cc (aarch64_detect_vector_stmt_subtype)
      	(aarch64_vector_costs::add_stmt_cost): Use the x64 cost rather
      	than x32 cost for all VNx2 modes.
      3e27ea26
    • Richard Sandiford's avatar
      aarch64: Add a test for zeroing <64bits>x2_t structures · 035c196c
      Richard Sandiford authored
      g:8d6c6fbc improved the code
      generated for functions like:
      
        void test_s8 (int8x8x2_t *ptr) { *ptr = (int8x8x2_t) {}; }
      
      Previously we would load zero from the constant pool, whereas
      now we just use "stp xzr, xzr".  This patch adds a test for
      this improvement.
      
      gcc/testsuite/
      	* gcc.target/aarch64/struct_zero.c: New test.
      035c196c
    • Richard Sandiford's avatar
      Tweak documentation of ASM_INPUT_P · 3c9338b5
      Richard Sandiford authored
      The documentation of ASM_INPUT_P implied that the flag has no
      effect on ASM_EXPRs that have operands (and which therefore must be
      extended asms).  In fact we require ASM_INPUT_P to be false for all
      extended asms.
      
      gcc/
      	* tree.h (ASM_INPUT_P): Fix documentation.
      3c9338b5
    • Francois-Xavier Coudert's avatar
      Libquadmath: update doc for some constants · bdcd30e4
      Francois-Xavier Coudert authored
      libquadmath/ChangeLog:
      
      	* libquadmath.texi (M_LOG2Eq, M_LOG10Eq, M_1_PIq,
      	M_2_PIq, M_2_SQRTPIq, M_SQRT1_2q): Adjust descriptioni
      	of these constants.
      bdcd30e4
    • Filip Kastl's avatar
      gimple ssa: switchconv: Use __builtin_popcount and support more types in exp transform [PR116355] · 1c4b9826
      Filip Kastl authored
      
      The gen_pow2p function generates (a & -a) == a as a fallback for
      POPCOUNT (a) == 1.  Not only is the bitmagic not equivalent to
      POPCOUNT (a) == 1 but it also introduces UB (consider signed
      a = INT_MIN).
      
      This patch rewrites gen_pow2p to always use __builtin_popcount instead.
      This means that what the end result GIMPLE code is gets decided by an
      already existing machinery in a later pass.  That is a cleaner solution
      I think.  This existing machinery also uses a ^ (a - 1) > a - 1 which is
      the correct bitmagic.
      
      While rewriting gen_pow2p I had to add logic for converting the
      operand's type to a type that __builtin_popcount accepts.  I naturally
      also added this logic to gen_log2.  Thanks to this, exponential index
      transform gains the capability to handle all operand types with
      precision at most that of long long int.
      
      gcc/ChangeLog:
      
      	PR tree-optimization/116355
      	* tree-switch-conversion.cc (can_log2): Add capability to
      	suggest converting the operand to a different type.
      	(gen_log2): Add capability to generate a conversion in case the
      	operand is of a type incompatible with the logarithm operation.
      	(can_pow2p): New function.
      	(gen_pow2p): Rewrite to use __builtin_popcount instead of
      	manually inserting an internal fn call or bitmagic.  Also add
      	capability to generate a conversion.
      	(switch_conversion::is_exp_index_transform_viable): Call
      	can_pow2p.  Store types suggested by can_log2 and gen_log2.
      	(switch_conversion::exp_index_transform): Params of gen_pow2p
      	and gen_log2 changed so update their calls.
      	* tree-switch-conversion.h: Add m_exp_index_transform_log2_type
      	and m_exp_index_transform_pow2p_type to switch_conversion class
      	to track type conversions needed to generate the "is power of 2"
      	and logarithm operations.
      
      gcc/testsuite/ChangeLog:
      
      	PR tree-optimization/116355
      	* gcc.target/i386/switch-exp-transform-1.c: Don't test for
      	presence of POPCOUNT internal fn after switch conversion.  Test
      	for it after __builtin_popcount has had a chance to get
      	expanded.
      	* gcc.target/i386/switch-exp-transform-3.c: Also test char and
      	short.
      
      Signed-off-by: default avatarFilip Kastl <fkastl@suse.cz>
      1c4b9826
    • Jason Merrill's avatar
      libstdc++: avoid -Wsign-compare · 4246cf4f
      Jason Merrill authored
      -Wsign-compare complained about these comparisons between (unsigned) size_t
      and (signed) streamsize, or between (unsigned) native_handle_type
      and (signed) -1.  Fixed by adding casts to unify the types.
      
      libstdc++-v3/ChangeLog:
      
      	* include/std/istream: Add cast to avoid -Wsign-compare.
      	* include/std/stacktrace: Likewise.
      4246cf4f
    • Alex Coplan's avatar
      testsuite: Add scan-ltrans-rtl* for use in dg-final [PR116140] · 3f51f0dc
      Alex Coplan authored
      This extends the scan-ltrans-tree* helpers to create RTL variants.  This
      is needed to check the behaviour of an RTL pass under LTO.
      
      gcc/ChangeLog:
      
      	PR libstdc++/116140
      	* doc/sourcebuild.texi: Document ltrans-rtl value of kind for
      	scan-<kind>-dump*.
      
      gcc/testsuite/ChangeLog:
      
      	PR libstdc++/116140
      	* lib/scanltranstree.exp (scan-ltrans-rtl-dump): New.
      	(scan-ltrans-rtl-dump-not): New.
      	(scan-ltrans-rtl-dump-dem): New.
      	(scan-ltrans-rtl-dump-dem-not): New.
      	(scan-ltrans-rtl-dump-times): New.
      3f51f0dc
    • Richard Biener's avatar
      Add debug overload for slp_instance · 2c0b574a
      Richard Biener authored
      I found it helpful to be able to print a whole SLP instance from gdb.
      
      	* tree-vect-slp.cc (debug): Add overload for slp_instance.
      2c0b574a
    • Richard Biener's avatar
      Fix leak of SLP nodes when building store interleaving · 04065d8c
      Richard Biener authored
      The following fixes a leak of the discovered single-lane store
      SLP nodes from which we only use their children.  This uncovers
      a latent reference counting issue in the interleaving build where
      we fail to increment their reference count.
      
      	* tree-vect-slp.cc (vect_build_slp_store_interleaving):
      	Fix reference counting.
      	(vect_build_slp_instance): Release rhs_nodes.
      04065d8c
    • Richard Biener's avatar
      Split out vect_build_slp_store_interleaving · ad895a28
      Richard Biener authored
      This splits out SLP store interleaving into a separate function.
      
      	* tree-vect-slp.cc (vect_build_slp_store_interleaving): Split
      	out from ...
      	(vect_build_slp_instance): Here.
      ad895a28
    • Jason Merrill's avatar
      c++: add missing -Wc++??-extensions checks · 7f4f1bb2
      Jason Merrill authored
      The pedwarns for each of these features should be silenced by
      the appropriate -Wno-c++??-extensions.
      
      The handle_pragma_diagnostic_impl change is necessary so that we handle
      -Wc++23-extensions early so it's available to interpret_float while lexing.
      
      gcc/c-family/ChangeLog:
      
      	* c-pragma.cc (handle_pragma_diagnostic_impl): Also handle
      	-Wc++23-extensions early.
      	* c-lex.cc (interpret_float): Use -Wc++23-extensions for extended
      	floating point literal pedwarn.
      
      gcc/cp/ChangeLog:
      
      	* parser.cc (cp_parser_simple_type_specifier): Use
      	-Wc++20-extensions for auto parameter pedwarn.
      	* pt.cc (do_decl_instantiation, do_type_instantiation): Use
      	-Wc++11-extensions for 'extern template'.
      
      gcc/testsuite/ChangeLog:
      
      	* g++.dg/cpp0x/extern_template-7.C: New test.
      	* g++.dg/cpp23/ext-floating19.C: New test.
      	* g++.dg/cpp2a/abbrev-fn1.C: New test.
      7f4f1bb2
    • Tobias Burnus's avatar
      libgomp: Add interop types and routines to OpenMP's headers and module · 0beac1db
      Tobias Burnus authored
      This commit adds OpenMP 5.1+'s interop enumeration, type and routine
      declarations to the C/C++ header file and, new in OpenMP TR13, also to
      the Fortran module and omp_lib.h header file.
      
      While a stub implementation is provided, only with foreign runtime
      support by the libgomp GPU plugins and with the 'interop' directive,
      this becomes really useful.
      
      libgomp/ChangeLog:
      
      	* fortran.c (omp_get_interop_str_, omp_get_interop_name_,
      	omp_get_interop_type_desc_, omp_get_interop_rc_desc_): Add.
      	* libgomp.map (GOMP_5.1.3): New; add interop routines.
      	* omp.h.in: Add interop typedefs, enum and prototypes.
      	(__GOMP_DEFAULT_NULL): Define.
      	(omp_target_memcpy_async, omp_target_memcpy_rect_async):
      	Use it for the optional depend argument.
      	* omp_lib.f90.in: Add paramters and interfaces for interop.
      	* omp_lib.h.in: Likewise; move F90 '&' to column 81 for
      	-ffree-length-80.
      	* target.c (omp_get_num_interop_properties, omp_get_interop_int,
      	omp_get_interop_ptr, omp_get_interop_str, omp_get_interop_name,
      	omp_get_interop_type_desc, omp_get_interop_rc_desc): Add.
      	* config/gcn/target.c (omp_get_num_interop_properties,
      	omp_get_interop_int, omp_get_interop_ptr, omp_get_interop_str,
      	omp_get_interop_name, omp_get_interop_type_desc,
      	omp_get_interop_rc_desc): Add.
      	* config/nvptx/target.c (omp_get_num_interop_properties,
      	omp_get_interop_int, omp_get_interop_ptr, omp_get_interop_str,
      	omp_get_interop_name, omp_get_interop_type_desc,
      	omp_get_interop_rc_desc): Add.
      	* testsuite/libgomp.c-c++-common/interop-routines-1.c: New test.
      	* testsuite/libgomp.c-c++-common/interop-routines-2.c: New test.
      	* testsuite/libgomp.fortran/interop-routines-1.F90: New test.
      	* testsuite/libgomp.fortran/interop-routines-2.F90: New test.
      	* testsuite/libgomp.fortran/interop-routines-3.F: New test.
      	* testsuite/libgomp.fortran/interop-routines-4.F: New test.
      	* testsuite/libgomp.fortran/interop-routines-5.F: New test.
      	* testsuite/libgomp.fortran/interop-routines-6.F: New test.
      	* testsuite/libgomp.fortran/interop-routines-7.F90: New test.
      0beac1db
    • Jason Merrill's avatar
      libstdc++: fix testcase regexp · 7bd2a2f9
      Jason Merrill authored
      The unescaped * broke the match.
      
      libstdc++-v3/ChangeLog:
      
      	* testsuite/20_util/default_delete/void_neg.cc: Fix regexp quoting.
      7bd2a2f9
    • Jason Merrill's avatar
      libstdc++: avoid -Wzero-as-null-pointer-constant · 28f94bf9
      Jason Merrill authored
      libstdc++-v3/ChangeLog:
      
      	* include/std/coroutine (coroutine_handle): Use nullptr instead of
      	0 as initializer for _M_fr_ptr.
      28f94bf9
    • Jason Merrill's avatar
      libstdc++: add missing return · 5974da3d
      Jason Merrill authored
      The return seems to have been lost in the r15-1858 RAII overhaul.
      
      libstdc++-v3/ChangeLog:
      
      	* include/bits/stl_uninitialized.h (__uninitialized_move_copy): Add
      	missing return.
      5974da3d
    • Jason Merrill's avatar
      libstdc++: remove extra semicolons · 7b500fa3
      Jason Merrill authored
      The semicolons after each macro invocation here end up following the closing
      brace of a function, leading to -Wextra-semi pedwarns.
      
      libstdc++-v3/ChangeLog:
      
      	* include/decimal/decimal.h (_DEFINE_DECIMAL_BINARY_OP_WITH_INT):
      	Remove redundant semicolons.
      7b500fa3
    • Pan Li's avatar
      Test: Move pr116278 run test to dg/torture [NFC] · 3178786c
      Pan Li authored
      
      Move the run test of pr116278 to dg/torture and leave the risc-v the
      asm check under risc-v part.
      
      	PR target/116278
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.target/riscv/pr116278-run-1.c: Take compile instead of run.
      	* gcc.target/riscv/pr116278-run-2.c: Ditto.
      	* gcc.dg/torture/pr116278-run-1.c: New test.
      	* gcc.dg/torture/pr116278-run-2.c: New test.
      
      Signed-off-by: default avatarPan Li <pan2.li@intel.com>
      3178786c
    • Pan Li's avatar
      Vect: Reconcile the const_int operand type of unsigned .SAT_ADD · 6dccd571
      Pan Li authored
      
      The .SAT_ADD has 2 operand, when one of the operand may be INTEGER_CST.
      For example _1 = .SAT_ADD (_2, 9) comes from below sample code.
      
      Form 3:
        #define DEF_VEC_SAT_U_ADD_IMM_FMT_3(T, IMM)                          \
        T __attribute__((noinline))                                          \
        vec_sat_u_add_imm##IMM##_##T##_fmt_3 (T *out, T *in, unsigned limit) \
        {                                                                    \
          unsigned i;                                                        \
          T ret;                                                             \
          for (i = 0; i < limit; i++)                                        \
            {                                                                \
              out[i] = __builtin_add_overflow (in[i], IMM, &ret) ? -1 : ret; \
            }                                                                \
        }
      
      DEF_VEC_SAT_U_ADD_IMM_FMT_3(uint64_t, 9)
      
      It will fail to vectorize as the vectorizable_call will check the
      operands is type_compatiable but the imm will be (const_int 9) with
      the SImode, which is different from _2 (DImode).  Aka:
      
      uint64_t _1;
      uint64_t _2;
      _1 = .SAT_ADD (_2, 9);
      
      This patch would like to reconcile the imm operand to the operand type
      mode of _2 by fold_convert to make the vectorizable_call happy.
      
      The below test suites are passed for this patch:
      1. The rv64gcv fully regression tests.
      2. The x86 bootstrap tests.
      3. The x86 fully regression tests.
      
      gcc/ChangeLog:
      
      	* tree-vect-patterns.cc (vect_recog_sat_add_pattern): Add fold
      	convert for const_int to the type of operand 0.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.target/riscv/rvv/autovec/vec_sat_arith.h: Add test helper macros.
      	* gcc.target/riscv/rvv/autovec/binop/vec_sat_u_add_imm_reconcile-1.c: New test.
      	* gcc.target/riscv/rvv/autovec/binop/vec_sat_u_add_imm_reconcile-10.c: New test.
      	* gcc.target/riscv/rvv/autovec/binop/vec_sat_u_add_imm_reconcile-11.c: New test.
      	* gcc.target/riscv/rvv/autovec/binop/vec_sat_u_add_imm_reconcile-12.c: New test.
      	* gcc.target/riscv/rvv/autovec/binop/vec_sat_u_add_imm_reconcile-13.c: New test.
      	* gcc.target/riscv/rvv/autovec/binop/vec_sat_u_add_imm_reconcile-14.c: New test.
      	* gcc.target/riscv/rvv/autovec/binop/vec_sat_u_add_imm_reconcile-15.c: New test.
      	* gcc.target/riscv/rvv/autovec/binop/vec_sat_u_add_imm_reconcile-2.c: New test.
      	* gcc.target/riscv/rvv/autovec/binop/vec_sat_u_add_imm_reconcile-3.c: New test.
      	* gcc.target/riscv/rvv/autovec/binop/vec_sat_u_add_imm_reconcile-4.c: New test.
      	* gcc.target/riscv/rvv/autovec/binop/vec_sat_u_add_imm_reconcile-5.c: New test.
      	* gcc.target/riscv/rvv/autovec/binop/vec_sat_u_add_imm_reconcile-6.c: New test.
      	* gcc.target/riscv/rvv/autovec/binop/vec_sat_u_add_imm_reconcile-7.c: New test.
      	* gcc.target/riscv/rvv/autovec/binop/vec_sat_u_add_imm_reconcile-8.c: New test.
      	* gcc.target/riscv/rvv/autovec/binop/vec_sat_u_add_imm_reconcile-9.c: New test.
      
      Signed-off-by: default avatarPan Li <pan2.li@intel.com>
      6dccd571
    • Kito Cheng's avatar
      RISC-V: Add missing mode_idx for vrol and vror · 3cde331e
      Kito Cheng authored
      We add pattern for vector rotate, but seems like we forgot adding
      mode_idx which used in AVL propgation (riscv-avlprop.cc).
      
      gcc/ChangeLog:
      
      	* config/riscv/vector.md (mode_idx): Add vrol and vror.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.target/riscv/rvv/autovec/rotr.c: New.
      3cde331e
    • Pan Li's avatar
      Match: Support form 1 for scalar signed integer .SAT_ADD · fe5f652b
      Pan Li authored
      
      This patch would like to support the form 1 of the scalar signed
      integer .SAT_ADD.  Aka below example:
      
      Form 1:
        #define DEF_SAT_S_ADD_FMT_1(T, UT, MIN, MAX) \
        T __attribute__((noinline))                  \
        sat_s_add_##T##_fmt_1 (T x, T y)             \
        {                                            \
          T sum = (UT)x + (UT)y;                     \
          return (x ^ y) < 0                         \
            ? sum                                    \
            : (sum ^ x) >= 0                         \
              ? sum                                  \
              : x < 0 ? MIN : MAX;                   \
        }
      
      DEF_SAT_S_ADD_FMT_1(int64_t, uint64_t, INT64_MIN, INT64_MAX)
      
      We can tell the difference before and after this patch if backend
      implemented the ssadd<m>3 pattern similar as below.
      
      Before this patch:
         4   │ __attribute__((noinline))
         5   │ int64_t sat_s_add_int64_t_fmt_1 (int64_t x, int64_t y)
         6   │ {
         7   │   int64_t sum;
         8   │   long unsigned int x.0_1;
         9   │   long unsigned int y.1_2;
        10   │   long unsigned int _3;
        11   │   long int _4;
        12   │   long int _5;
        13   │   int64_t _6;
        14   │   _Bool _11;
        15   │   long int _12;
        16   │   long int _13;
        17   │   long int _14;
        18   │   long int _16;
        19   │   long int _17;
        20   │
        21   │ ;;   basic block 2, loop depth 0
        22   │ ;;    pred:       ENTRY
        23   │   x.0_1 = (long unsigned int) x_7(D);
        24   │   y.1_2 = (long unsigned int) y_8(D);
        25   │   _3 = x.0_1 + y.1_2;
        26   │   sum_9 = (int64_t) _3;
        27   │   _4 = x_7(D) ^ y_8(D);
        28   │   _5 = x_7(D) ^ sum_9;
        29   │   _17 = ~_4;
        30   │   _16 = _5 & _17;
        31   │   if (_16 < 0)
        32   │     goto <bb 3>; [41.00%]
        33   │   else
        34   │     goto <bb 4>; [59.00%]
        35   │ ;;    succ:       3
        36   │ ;;                4
        37   │
        38   │ ;;   basic block 3, loop depth 0
        39   │ ;;    pred:       2
        40   │   _11 = x_7(D) < 0;
        41   │   _12 = (long int) _11;
        42   │   _13 = -_12;
        43   │   _14 = _13 ^ 9223372036854775807;
        44   │ ;;    succ:       4
        45   │
        46   │ ;;   basic block 4, loop depth 0
        47   │ ;;    pred:       2
        48   │ ;;                3
        49   │   # _6 = PHI <sum_9(2), _14(3)>
        50   │   return _6;
        51   │ ;;    succ:       EXIT
        52   │
        53   │ }
      
      After this patch:
         4   │ __attribute__((noinline))
         5   │ int64_t sat_s_add_int64_t_fmt_1 (int64_t x, int64_t y)
         6   │ {
         7   │   int64_t _4;
         8   │
         9   │ ;;   basic block 2, loop depth 0
        10   │ ;;    pred:       ENTRY
        11   │   _4 = .SAT_ADD (x_5(D), y_6(D)); [tail call]
        12   │   return _4;
        13   │ ;;    succ:       EXIT
        14   │
        15   │ }
      
      The below test suites are passed for this patch.
      * The rv64gcv fully regression test.
      * The x86 bootstrap test.
      * The x86 fully regression test.
      
      gcc/ChangeLog:
      
      	* match.pd: Add the matching for signed .SAT_ADD.
      	* tree-ssa-math-opts.cc (gimple_signed_integer_sat_add): Add new
      	matching func decl.
      	(match_unsigned_saturation_add): Try signed .SAT_ADD and rename
      	to ...
      	(match_saturation_add): ... here.
      	(math_opts_dom_walker::after_dom_children): Update the above renamed
      	func from caller.
      
      Signed-off-by: default avatarPan Li <pan2.li@intel.com>
      fe5f652b
    • Joern Rennecke's avatar
      Fix PR testsuite/116271, gcc.dg/vect/tsvc/vect-tsvc-s176.c fails · beb94f59
      Joern Rennecke authored
      gcc/testsuite:
      	PR testsuite/116271
      	* gcc.dg/vect/tsvc/vect-tsvc-s176.c [TRUNCATE_TEST]: Make sure
      	that m stays the same as the loop bound of the middle loop.
      	* gcc.dg/vect/tsvc/tsvc.h (get_expected_result) <s176> [TRUNCATE_TEST]:
      	Adjust expected value.
      beb94f59
    • Pan Li's avatar
      RISC-V: Add testcases for unsigned scalar .SAT_SUB IMM form 4 · 3989e31d
      Pan Li authored
      
      This patch would like to add test cases for the unsigned scalar
      .SAT_SUB IMM form 4.  Aka:
      
      Form 4:
        #define DEF_SAT_U_SUB_IMM_FMT_4(T, IMM) \
        T __attribute__((noinline))             \
        sat_u_sub_imm##IMM##_##T##_fmt_4 (T x)  \
        {                                       \
          return x > (T)IMM ? x - (T)IMM : 0;   \
        }
      
      DEF_SAT_U_SUB_IMM_FMT_4(uint64_t, 23)
      
      The below test is passed for this patch.
      * The rv64gcv regression test.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.target/riscv/sat_arith.h: Add test helper macros.
      	* gcc.target/riscv/sat_u_sub_imm-13.c: New test.
      	* gcc.target/riscv/sat_u_sub_imm-13_1.c: New test.
      	* gcc.target/riscv/sat_u_sub_imm-13_2.c: New test.
      	* gcc.target/riscv/sat_u_sub_imm-14.c: New test.
      	* gcc.target/riscv/sat_u_sub_imm-14_1.c: New test.
      	* gcc.target/riscv/sat_u_sub_imm-14_2.c: New test.
      	* gcc.target/riscv/sat_u_sub_imm-15.c: New test.
      	* gcc.target/riscv/sat_u_sub_imm-15_1.c: New test.
      	* gcc.target/riscv/sat_u_sub_imm-15_2.c: New test.
      	* gcc.target/riscv/sat_u_sub_imm-16.c: New test.
      	* gcc.target/riscv/sat_u_sub_imm-run-13.c: New test.
      	* gcc.target/riscv/sat_u_sub_imm-run-14.c: New test.
      	* gcc.target/riscv/sat_u_sub_imm-run-15.c: New test.
      	* gcc.target/riscv/sat_u_sub_imm-run-16.c: New test.
      
      Signed-off-by: default avatarPan Li <pan2.li@intel.com>
      3989e31d
    • Pan Li's avatar
      RISC-V: Add testcases for unsigned scalar .SAT_SUB IMM form 3 · cb0b8b62
      Pan Li authored
      
      This patch would like to add test cases for the unsigned scalar
      .SAT_SUB IMM form 3.  Aka:
      
      Form 3:
        #define DEF_SAT_U_SUB_IMM_FMT_3(T, IMM) \
        T __attribute__((noinline))             \
        sat_u_sub_imm##IMM##_##T##_fmt_3 (T y)  \
        {                                       \
          return (T)IMM > y ? (T)IMM - y : 0;   \
        }
      
      DEF_SAT_U_SUB_IMM_FMT_3(uint64_t, 23)
      
      The below test is passed for this patch.
      * The rv64gcv regression test.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.target/riscv/sat_arith.h: Add test helper macros.
      	* gcc.target/riscv/sat_u_sub_imm-10.c: New test.
      	* gcc.target/riscv/sat_u_sub_imm-10_1.c: New test.
      	* gcc.target/riscv/sat_u_sub_imm-10_2.c: New test.
      	* gcc.target/riscv/sat_u_sub_imm-11.c: New test.
      	* gcc.target/riscv/sat_u_sub_imm-11_1.c: New test.
      	* gcc.target/riscv/sat_u_sub_imm-11_2.c: New test.
      	* gcc.target/riscv/sat_u_sub_imm-12.c: New test.
      	* gcc.target/riscv/sat_u_sub_imm-9.c: New test.
      	* gcc.target/riscv/sat_u_sub_imm-9_1.c: New test.
      	* gcc.target/riscv/sat_u_sub_imm-9_2.c: New test.
      	* gcc.target/riscv/sat_u_sub_imm-run-10.c: New test.
      	* gcc.target/riscv/sat_u_sub_imm-run-11.c: New test.
      	* gcc.target/riscv/sat_u_sub_imm-run-12.c: New test.
      	* gcc.target/riscv/sat_u_sub_imm-run-9.c: New test.
      
      Signed-off-by: default avatarPan Li <pan2.li@intel.com>
      cb0b8b62
    • GCC Administrator's avatar
      Daily bump. · ef84d2fe
      GCC Administrator authored
      ef84d2fe
  2. Aug 27, 2024
    • Andi Kleen's avatar
      Fix test failing on sparc · ffb00a0d
      Andi Kleen authored
      SPARC does not support vectorizing conditions, which this test relies
      on. Use vect_condition as effective target.
      
      Committed as obvious.
      
      PR testsuite/116500
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.dg/vect/vect-switch-ifcvt-1.c: Use vect_condition to
      	check if vectorizing conditions is supported for target.
      ffb00a0d
    • Joseph Myers's avatar
      Update gcc zh_CN.po · 48032f28
      Joseph Myers authored
      	* zh_CN.po: Update.
      48032f28
    • Arsen Arsenović's avatar
      c++/coroutines: fix actor cases not being added to the current switch [PR109867] · ff0cba20
      Arsen Arsenović authored
      
      Previously, we were building and inserting case_labels manually, which
      led to them not being added into the currently running switch via
      c_add_case_label.  This led to false diagnostics that the user could not
      act on.
      
      	PR c++/109867
      
      gcc/cp/ChangeLog:
      
      	* coroutines.cc (expand_one_await_expression): Replace uses of
      	build_case_label with finish_case_label.
      	(build_actor_fn): Ditto.
      	(create_anon_label_with_ctx): Remove now-unused function.
      
      gcc/testsuite/ChangeLog:
      
      	* g++.dg/coroutines/torture/pr109867.C: New test.
      
      Reviewed-by: default avatarIain Sandoe <iain@sandoe.co.uk>
      ff0cba20
    • Andreas Schwab's avatar
      m68k: Accept ASHIFT like MULT in address operand · a83e519a
      Andreas Schwab authored
      When LRA pulls an address operand out of a MEM it caninoicalizes a
      containing MULT into ASHIFT.  Adjust the address decomposer to recognize
      this form.
      
      	PR target/116413
      	* config/m68k/m68k.cc (m68k_decompose_index): Accept ASHIFT like
      	MULT.
      	(m68k_rtx_costs) [PLUS]: Likewise.
      	(m68k_legitimize_address): Likewise.
      a83e519a
    • Simon Martin's avatar
      c++: Don't show constructor internal name in error message [PR105483] · 02dff52c
      Simon Martin authored
      We mention 'X::__ct' instead of 'X::X' in the "names the constructor,
      not the type" error for this invalid code:
      
      === cut here ===
      struct X {};
      void g () {
        X::X x;
      }
      === cut here ===
      
      The problem is that we use %<%T::%D%> to build the error message, while
      %qE does exactly what we need since we have DECL_CONSTRUCTOR_P. This is
      what this patch does.
      
      It also skips until the end of the statement and returns error_mark_node
      for this and the preceding if block, to avoid emitting extra (useless)
      errors.
      
      	PR c++/105483
      
      gcc/cp/ChangeLog:
      
      	* parser.cc (cp_parser_expression_statement): Use %qE instead of
      	incorrect %<%T::%D%>. Skip to end of statement and return
      	error_mark_node in case of error.
      
      gcc/testsuite/ChangeLog:
      
      	* g++.dg/parse/error36.C: Adjust test expectation.
      	* g++.dg/tc1/dr147.C: Likewise.
      	* g++.old-deja/g++.other/typename1.C: Likewise.
      	* g++.dg/diagnostic/pr105483.C: New test.
      02dff52c
    • Patrick O'Neill's avatar
      RISC-V: Move helper functions above expand_const_vector · 691f682f
      Patrick O'Neill authored
      
      These subroutines will be used in expand_const_vector in a future patch.
      Relocate so expand_const_vector can use them.
      
      gcc/ChangeLog:
      
      	* config/riscv/riscv-v.cc (expand_vector_init_insert_elems): Relocate.
      	(expand_vector_init_trailing_same_elem): Ditto.
      
      Signed-off-by: default avatarPatrick O'Neill <patrick@rivosinc.com>
      691f682f
Loading