Skip to content
Snippets Groups Projects
  1. Aug 24, 2023
    • Richard Biener's avatar
      debug/111080 - avoid outputting debug info for unused restrict qualified type · bd2c4d6d
      Richard Biener authored
      The following applies some maintainance with respect to type qualifiers
      and kinds added by later DWARF standards to prune_unused_types_walk.
      The particular case in the bug is not handling (thus marking required)
      all restrict qualified type DIEs.  I've found more DW_TAG_*_type that
      are unhandled, looked up the DWARF docs and added them as well based
      on common sense.
      
      	PR debug/111080
      	* dwarf2out.cc (prune_unused_types_walk): Handle
      	DW_TAG_restrict_type, DW_TAG_shared_type, DW_TAG_atomic_type,
      	DW_TAG_immutable_type, DW_TAG_coarray_type, DW_TAG_unspecified_type
      	and DW_TAG_dynamic_type as to only output them when referenced.
      
      	* gcc.dg/debug/dwarf2/pr111080.c: New testcase.
      bd2c4d6d
    • liuhongt's avatar
      Adjust GCC V13 to GCC 13.1 in diagnotic. · 0a888650
      liuhongt authored
      gcc/ChangeLog:
      
      	* config/i386/i386.cc (ix86_invalid_conversion): Adjust GCC
      	V13 to GCC 13.1.
      0a888650
    • liuhongt's avatar
      Fix target_clone ("arch=graniterapids-d") and target_clone ("arch=arrowlake-s") · afe15e97
      liuhongt authored
      Both "graniterapid-d" and "graniterapids" are attached with
      PROCESSOR_GRANITERAPID in processor_alias_table but mapped to
      different __cpu_subtype in get_intel_cpu.
      
      And get_builtin_code_for_version will try to match the first
      PROCESSOR_GRANITERAPIDS in processor_alias_table which maps to
      "granitepraids" here.
      
      861      else if (new_target->arch_specified && new_target->arch > 0)
      1862        for (i = 0; i < pta_size; i++)
      1863          if (processor_alias_table[i].processor == new_target->arch)
      1864            {
      1865              const pta *arch_info = &processor_alias_table[i];
      1866              switch (arch_info->priority)
      1867                {
      1868                default:
      1869                  arg_str = arch_info->name;
      
      This mismatch makes dispatch_function_versions check the preidcate
      of__builtin_cpu_is ("graniterapids") for "graniterapids-d" and causes
      the issue.
      The patch explicitly adds PROCESSOR_ARROWLAKE_S and
      PROCESSOR_GRANITERAPIDS_D to make a distinction.
      
      For "alderlake","raptorlake", "meteorlake" they share same isa, cost,
      tuning, and mapped to the same __cpu_type/__cpu_subtype in
      get_intel_cpu, so no need to add PROCESSOR_RAPTORLAKE and others.
      
      gcc/ChangeLog:
      
      	* common/config/i386/i386-common.cc (processor_names): Add new
      	member graniterapids-s and arrowlake-s.
      	* config/i386/i386-options.cc (processor_alias_table): Update
      	table with PROCESSOR_ARROWLAKE_S and
      	PROCESSOR_GRANITERAPIDS_D.
      	(m_GRANITERAPID_D): New macro.
      	(m_ARROWLAKE_S): Ditto.
      	(m_CORE_AVX512): Add m_GRANITERAPIDS_D.
      	(processor_cost_table): Add icelake_cost for
      	PROCESSOR_GRANITERAPIDS_D and alderlake_cost for
      	PROCESSOR_ARROWLAKE_S.
      	* config/i386/x86-tune.def: Hanlde m_ARROWLAKE_S same as
      	m_ARROWLAKE.
      	* config/i386/i386.h (enum processor_type): Add new member
      	PROCESSOR_GRANITERAPIDS_D and PROCESSOR_ARROWLAKE_S.
      	* config/i386/i386-c.cc (ix86_target_macros_internal): Handle
      	PROCESSOR_GRANITERAPIDS_D and PROCESSOR_ARROWLAKE_S
      afe15e97
    • Hans-Peter Nilsson's avatar
      testsuite: Xfail gcc.dg/tree-ssa/update-threading.c for CRIS, PR110628 · 0c2633dd
      Hans-Peter Nilsson authored
      	* gcc.dg/tree-ssa/update-threading.c: Xfail for cris-*-*.
      0c2633dd
    • GCC Administrator's avatar
      Daily bump. · 4e27ba6e
      GCC Administrator authored
      4e27ba6e
  2. Aug 23, 2023
    • Jivan Hakobyan's avatar
      Improve quality of code from LRA register elimination · 6619b3d4
      Jivan Hakobyan authored
      This is primarily Jivan's work, I'm mostly responsible for the write-up and
      coordinating with Vlad on a few questions.
      
      On targets with limitations on immediates usable in arithmetic instructions,
      LRA's register elimination phase can construct fairly poor code.
      
      This example (from the GCC testsuite) illustrates the problem well.
      
      int  consume (void *);
      int foo (void) {
        int x[1000000];
        return consume (x + 1000);
      }
      
      If you compile on riscv64-linux-gnu with "-O2 -march=rv64gc -mabi=lp64d", then
      you'll get this code (up to the call to consume()).
      
              .cfi_startproc
              li      t0,-4001792
              li      a0,-3997696
              li      a5,4001792
              addi    sp,sp,-16
              .cfi_def_cfa_offset 16
              addi    t0,t0,1792
              addi    a0,a0,1696
              addi    a5,a5,-1792
              sd      ra,8(sp)
              add     a5,a5,a0
              add     sp,sp,t0
              .cfi_def_cfa_offset 4000016
              .cfi_offset 1, -8
              add     a0,a5,sp
              call    consume
      
      Of particular interest is the value in a0 when we call consume. We compute that
      horribly inefficiently.   If we back-substitute from the final assignment to a0
      we get...
      
      a0 = a5 + sp
      a0 = a5 + (sp + t0)
      a0 = (a5 + a0) + (sp + t0)
      a0 = ((a5 - 1792) + a0) + (sp + t0)
      a0 = ((a5 - 1792) + (a0 + 1696)) + (sp + t0)
      a0 = ((a5 - 1792) + (a0 + 1696)) + (sp + (t0 + 1792))
      a0 = (a5 + (a0 + 1696)) + (sp + t0)  // removed offsetting terms
      a0 = (a5 + (a0 + 1696)) + ((sp - 16) + t0)
      a0 = (4001792 + (a0 + 1696)) + ((sp - 16) + t0)
      a0 = (4001792 + (-3997696 + 1696)) + ((sp - 16) + t0)
      a0 = (4001792 + (-3997696 + 1696)) + ((sp - 16) + -4001792)
      a0 = (-3997696 + 1696) + (sp -16) // removed offsetting terms
      a0 = sp - 3990616
      
      That's a pretty convoluted way to compute sp - 3990616.
      
      Something like this would be notably better (not great, but we need both the
      stack adjustment and the address of the object to pass to consume):
      
         addi sp,sp,-16
         sd ra,8(sp)
         li t0,-4001792
         addi t0,t0,1792
         add sp,sp,t0
         li a0,4096
         addi a0,a0,-96
         add a0,sp,a0
         call consume
      
      The problem is LRA's elimination code is not handling the case where we have
      (plus (reg1) (reg2) where reg1 is an eliminable register and reg2 has a known
      equivalency, particularly a constant.
      
      If we can determine that reg2 is equivalent to a constant and treat (plus
      (reg1) (reg2)) in the same way we'd treat (plus (reg1) (const_int)) then we can
      get the desired code.
      
      This eliminates about 19b instructions, or roughly 1% for deepsjeng on rv64.
      There are improvements elsewhere, but they're relatively small.  This may
      ultimately lessen the value of Manolis's fold-mem-offsets patch.  So we'll have
      to evaluate that again once he posts a new version.
      
      Bootstrapped and regression tested on x86_64 as well as bootstrapped on rv64.
      Earlier versions have been tested against spec2017.  Pre-approved by Vlad in a
      private email conversation (thanks Vlad!).
      
      Committed to the trunk,
      
      gcc/
      	* lra-eliminations.cc (eliminate_regs_in_insn): Use equivalences to
      	to help simplify code further.
      6619b3d4
    • Harald Anlauf's avatar
      Fortran: improve diagnostic message for COMMON with automatic object [PR32986] · 829c0c06
      Harald Anlauf authored
      gcc/fortran/ChangeLog:
      
      	PR fortran/32986
      	* resolve.cc (is_non_constant_shape_array): Add forward declaration.
      	(resolve_common_vars): Diagnose automatic array object in COMMON.
      	(resolve_symbol): Prevent confusing follow-on error.
      
      gcc/testsuite/ChangeLog:
      
      	PR fortran/32986
      	* gfortran.dg/common_28.f90: New test.
      829c0c06
    • Andrew MacLeod's avatar
      Phi analyzer - Initialize with range instead of a tree. · 0cfc9c95
      Andrew MacLeod authored
      Rangers PHI analyzer currently only allows a single initializer to a group.
      This patch changes that to use an inialization range, which is
      cumulative of all integer constants, plus a single symbolic value.
      There is no other change to group functionality.
      
      This patch also changes the way PHI groups are printed so they show up in the
      listing as they are encountered, rather than as a list at the end.  It
      was more difficult to see what was going on previously.
      
      	PR tree-optimization/110918 - Initialize with range instead of a tree.
      	gcc/
      	* gimple-range-fold.cc (fold_using_range::range_of_phi): Tweak output.
      	* gimple-range-phi.cc (phi_group::phi_group): Remove unused members.
      	Initialize using a range instead of value and edge.
      	(phi_group::calculate_using_modifier): Use initializer value and
      	process for relations after trying for iteration convergence.
      	(phi_group::refine_using_relation): Use initializer range.
      	(phi_group::dump): Rework the dump output.
      	(phi_analyzer::process_phi): Allow multiple constant initilizers.
      	Dump groups immediately as created.
      	(phi_analyzer::dump): Tweak output.
      	* gimple-range-phi.h (phi_group::phi_group): Adjust prototype.
      	(phi_group::initial_value): Delete.
      	(phi_group::refine_using_relation): Adjust prototype.
      	(phi_group::m_initial_value): Delete.
      	(phi_group::m_initial_edge): Delete.
      	(phi_group::m_vr): Use int_range_max.
      	* tree-vrp.cc (execute_ranger_vrp): Don't dump phi groups.
      
      	gcc/testsuite/
      	* gcc.dg/pr102983.c: Adjust output expectations.
      	* gcc.dg/pr110918.c: New.
      0cfc9c95
    • Andrew MacLeod's avatar
      Don't process phi groups with one phi. · e5f83a20
      Andrew MacLeod authored
      The phi analyzer should not create a phi group containing a single phi.
      
      	* gimple-range-phi.cc (phi_analyzer::operator[]): Return NULL if
      	no group was created.
      	(phi_analyzer::process_phi): Do not create groups of one phi node.
      e5f83a20
    • Richard Earnshaw's avatar
      rtl: use rtx_code for gen_ccmp_first and gen_ccmp_next · bf64392d
      Richard Earnshaw authored
      Now that we have a forward declaration of rtx_code in coretypes.h, we
      can adjust these hooks to take rtx_code arguments rather than an int.
      
      gcc/ChangeLog:
      
      	* target.def (gen_ccmp_first, gen_ccmp_next): Use rtx_code for
      	CODE, CMP_CODE and BIT_CODE arguments.
      	* config/aarch64/aarch64.cc (aarch64_gen_ccmp_first): Likewise.
      	(aarch64_gen_ccmp_next): Likewise.
      	* doc/tm.texi: Regenerated.
      bf64392d
    • Richard Earnshaw's avatar
      rtl: Forward declare rtx_code · 3e086a12
      Richard Earnshaw authored
      Now that we require C++ 11, we can safely forward declare rtx_code
      so that we can use it in target hooks.
      
      gcc/ChangeLog
      	* coretypes.h (rtx_code): Add forward declaration.
      	* rtl.h (rtx_code): Make compatible with forward declaration.
      3e086a12
    • Uros Bizjak's avatar
      i386: Fix register spill failure with concat RTX [PR111010] · 94a25d3d
      Uros Bizjak authored
      Disable (=&r,m,m) alternative for 32-bit targets. The combination of two
      memory operands (possibly with complex addressing mode), early clobbered
      output, frame pointer and PIC registers uses too much registers on
      a register constrained 32-bit target.
      
      Also merge two similar patterns using DWIH mode iterator.
      
      	PR target/111010
      
      gcc/ChangeLog:
      
      	* config/i386/i386.md (*concat<any_or_plus:mode><dwi>3_3):
      	Merge pattern from *concatditi3_3 and *concatsidi3_3 using
      	DWIH mode iterator.  Disable (=&r,m,m) alternative for
      	32-bit targets.
      	(*concat<any_or_plus:mode><dwi>3_3): Disable (=&r,m,m)
      	alternative for 32-bit targets.
      94a25d3d
    • Zhangjin Liao's avatar
      [PATCH] RISC-V:add a more appropriate type attribute · 18befd6f
      Zhangjin Liao authored
      Due to the more accurate type attribute added to the clz, ctz, and pcnt
      operations in https://github.com/gcc-mirror/gcc/commit/07e2576d6f3 the
      same type attribute should be used here.
      
      gcc/ChangeLog:
      
      	* config/riscv/bitmanip.md (*<bitmanip_optab>disi2_sext): Add a more
      	appropriate type attribute.
      18befd6f
    • Lehua Ding's avatar
      RISC-V: Add conditional unary neg/abs/not autovec patterns · 92f2ec41
      Lehua Ding authored
      Hi,
      
      This patch add conditional unary neg/abs/not autovec patterns to RISC-V backend.
      For this C code:
      
      void
      test_3 (float *__restrict a, float *__restrict b, int *__restrict pred, int n)
      {
        for (int i = 0; i < n; i += 1)
          {
            a[i] = pred[i] ? __builtin_fabsf (b[i]) : a[i];
          }
      }
      
      Before this patch:
              ...
              vsetvli a7,zero,e32,m1,ta,ma
              vfabs.v v2,v2
              vmerge.vvm      v1,v1,v2,v0
              ...
      
      After this patch:
              ...
              vsetvli	a7,zero,e32,m1,ta,mu
              vfabs.v	v1,v2,v0.t
              ...
      
      For int neg/not and FP neg patterns, Defining the corresponding cond_xxx paterns
      is enough.
      For the FP abs pattern, We need to change the definition of `abs<mode>2` and
      `@vcond_mask_<mode><vm>` pattern from define_expand to define_insn_and_split
      in order to fuse them into a new pattern `*cond_abs<mode>` at the combine pass.
      A fusion process similar to the one below:
      
      (insn 30 29 31 4 (set (reg:RVVM1SF 152 [ vect_iftmp.15 ])
              (abs:RVVM1SF (reg:RVVM1SF 137 [ vect__6.14 ]))) "float.c":15:56 discrim 1 12799 {absrvvm1sf2}
           (expr_list:REG_DEAD (reg:RVVM1SF 137 [ vect__6.14 ])
              (nil)))
      
      (insn 31 30 32 4 (set (reg:RVVM1SF 140 [ vect_iftmp.19 ])
              (if_then_else:RVVM1SF (reg:RVVMF32BI 136 [ mask__27.11 ])
                  (reg:RVVM1SF 152 [ vect_iftmp.15 ])
                  (reg:RVVM1SF 139 [ vect_iftmp.18 ]))) 12707 {vcond_mask_rvvm1sfrvvmf32bi}
           (expr_list:REG_DEAD (reg:RVVM1SF 152 [ vect_iftmp.15 ])
              (expr_list:REG_DEAD (reg:RVVM1SF 139 [ vect_iftmp.18 ])
                  (expr_list:REG_DEAD (reg:RVVMF32BI 136 [ mask__27.11 ])
                      (nil)))))
      ==>
      
      (insn 31 30 32 4 (set (reg:RVVM1SF 140 [ vect_iftmp.19 ])
              (if_then_else:RVVM1SF (reg:RVVMF32BI 136 [ mask__27.11 ])
                  (abs:RVVM1SF (reg:RVVM1SF 137 [ vect__6.14 ]))
                  (reg:RVVM1SF 139 [ vect_iftmp.18 ]))) 13444 {*cond_absrvvm1sf}
           (expr_list:REG_DEAD (reg:RVVM1SF 137 [ vect__6.14 ])
              (expr_list:REG_DEAD (reg:RVVMF32BI 136 [ mask__27.11 ])
                  (expr_list:REG_DEAD (reg:RVVM1SF 139 [ vect_iftmp.18 ])
                      (nil)))))
      
      Best,
      Lehua
      
      gcc/ChangeLog:
      
      	* config/riscv/autovec-opt.md (*cond_abs<mode>): New combine pattern.
      	(*copysign<mode>_neg): Ditto.
      	* config/riscv/autovec.md (@vcond_mask_<mode><vm>): Adjust.
      	(<optab><mode>2): Ditto.
      	(cond_<optab><mode>): New.
      	(cond_len_<optab><mode>): Ditto.
      	* config/riscv/riscv-protos.h (enum insn_type): New.
      	(expand_cond_len_unop): New helper func.
      	* config/riscv/riscv-v.cc (shuffle_merge_patterns): Adjust.
      	(expand_cond_len_unop): New helper func.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.target/riscv/rvv/autovec/cond/cond_unary-1.c: New test.
      	* gcc.target/riscv/rvv/autovec/cond/cond_unary-2.c: New test.
      	* gcc.target/riscv/rvv/autovec/cond/cond_unary-3.c: New test.
      	* gcc.target/riscv/rvv/autovec/cond/cond_unary-4.c: New test.
      	* gcc.target/riscv/rvv/autovec/cond/cond_unary-5.c: New test.
      	* gcc.target/riscv/rvv/autovec/cond/cond_unary-6.c: New test.
      	* gcc.target/riscv/rvv/autovec/cond/cond_unary-7.c: New test.
      	* gcc.target/riscv/rvv/autovec/cond/cond_unary-8.c: New test.
      	* gcc.target/riscv/rvv/autovec/cond/cond_unary_run-1.c: New test.
      	* gcc.target/riscv/rvv/autovec/cond/cond_unary_run-2.c: New test.
      	* gcc.target/riscv/rvv/autovec/cond/cond_unary_run-3.c: New test.
      	* gcc.target/riscv/rvv/autovec/cond/cond_unary_run-4.c: New test.
      	* gcc.target/riscv/rvv/autovec/cond/cond_unary_run-5.c: New test.
      	* gcc.target/riscv/rvv/autovec/cond/cond_unary_run-6.c: New test.
      	* gcc.target/riscv/rvv/autovec/cond/cond_unary_run-7.c: New test.
      	* gcc.target/riscv/rvv/autovec/cond/cond_unary_run-8.c: New test.
      92f2ec41
    • Jan Hubicka's avatar
      Fix handling of static exists in loop_ch · 936a1233
      Jan Hubicka authored
      This patch fixes wrong return value in should_duplicate_loop_header_p.
      Doing so uncovered suboptimal decisions on some jump threading testcases
      where we choose to stop duplicating just before basic block that has zero
      cost and duplicating so would be always a win.
      
      This is because the heuristics trying to choose right point to duplicate
      all winning blocks and to get loop to be do_while did not account
      zero_cost blocks in all cases.  The patch simplifies the logic by
      simply remembering zero cost blocks and handling them last after
      the right stopping point is chosen.
      
      gcc/ChangeLog:
      
      	* tree-ssa-loop-ch.cc (enum ch_decision): Fix comment.
      	(should_duplicate_loop_header_p): Fix return value for static exits.
      	(ch_base::copy_headers): Improve handling of ch_possible_zero_cost.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.dg/tree-ssa/copy-headers-9.c: Update template.
      936a1233
    • Jan Hubicka's avatar
      Add testcase for PR110940 · 7a2e232f
      Jan Hubicka authored
      gcc/testsuite/ChangeLog:
      	PR middle-end/110940
      	* gcc.c-torture/compile/pr110940.c: New test.
      7a2e232f
    • Lulu Cheng's avatar
      libffi: Backport of LoongArch support for libffi. · 4beacf3c
      Lulu Cheng authored
      This is a backport of <https://github.com/libffi/libffi/commit/f259a6f6de>,
      and contains modifications to commit 5a4774cd4d, as well as the LoongArch
      schema portion of commit ee22ecbd11. This is needed for libgo.
      
      libffi/ChangeLog:
      
      	PR libffi/108682
      	* configure.host: Add LoongArch support.
      	* Makefile.am: Likewise.
      	* Makefile.in: Regenerate.
      	* src/loongarch64/ffi.c: New file.
      	* src/loongarch64/ffitarget.h: New file.
      	* src/loongarch64/sysv.S: New file.
      4beacf3c
    • Kewen Lin's avatar
      vect: Move VMAT_GATHER_SCATTER handlings from final loop nest · af3820d1
      Kewen Lin authored
      Like r14-3317 which moves the handlings on memory access
      type VMAT_GATHER_SCATTER in vectorizable_load final loop
      nest, this one is to deal with vectorizable_store side.
      
      gcc/ChangeLog:
      
      	* tree-vect-stmts.cc (vectorizable_store): Move the handlings on
      	VMAT_GATHER_SCATTER in the final loop nest to its own loop,
      	and update the final nest accordingly.
      af3820d1
    • Kewen Lin's avatar
      vect: Move VMAT_LOAD_STORE_LANES handlings from final loop nest · 69a0c51e
      Kewen Lin authored
      Like commit r14-3214 which moves the handlings on memory
      access type VMAT_LOAD_STORE_LANES in vectorizable_load
      final loop nest, this one is to deal with the function
      vectorizable_store.
      
      gcc/ChangeLog:
      
      	* tree-vect-stmts.cc (vectorizable_store): Move the handlings on
      	VMAT_LOAD_STORE_LANES in the final loop nest to its own loop,
      	and update the final nest accordingly.
      69a0c51e
    • Kewen Lin's avatar
      vect: Remove some manual release in vectorizable_store · 82d5c726
      Kewen Lin authored
      To avoid some duplicates in some follow-up patches on
      function vectorizable_store, this patch is to adjust some
      existing vec with auto_vec and remove some manual release
      invocation.  Also refactor a bit and remove some uesless
      codes.
      
      gcc/ChangeLog:
      
      	* tree-vect-stmts.cc (vectorizable_store): Remove vec oprnds,
      	adjust vec result_chain, vec_oprnd with auto_vec, and adjust
      	gvec_oprnds with auto_delete_vec.
      82d5c726
    • François Dumont's avatar
      libstdc++: Fix tests relying on operator new/delete overload · 2aa8ebc0
      François Dumont authored
      Fix tests that are checking for an expected allocation plan. They are failing if
      an allocation is taking place outside the test main.
      
      libstdc++-v3/ChangeLog
      
      	* testsuite/util/replacement_memory_operators.h
      	(counter::scope): New, capture and reset counter count at construction and
      	restore it at destruction.
      	(counter::check_new): Add scope instantiation.
      	* testsuite/23_containers/unordered_map/96088.cc (main):
      	Add counter::scope instantiation.
      	* testsuite/23_containers/unordered_multimap/96088.cc (main): Likewise.
      	* testsuite/23_containers/unordered_multiset/96088.cc (main): Likewise.
      	* testsuite/23_containers/unordered_set/96088.cc (main): Likewise.
      	* testsuite/ext/malloc_allocator/deallocate_local.cc (main): Likewise.
      	* testsuite/ext/new_allocator/deallocate_local.cc (main): Likewise.
      	* testsuite/ext/throw_allocator/deallocate_local.cc (main): Likewise.
      	* testsuite/ext/pool_allocator/allocate_chunk.cc (started): New global.
      	(operator new(size_t)): Check started.
      	(main): Set/Unset started.
      	* testsuite/17_intro/no_library_allocation.cc: New test case.
      2aa8ebc0
    • Juzhe-Zhong's avatar
      RISC-V: Fix potential ICE of global vsetvl elimination · 3beef5e6
      Juzhe-Zhong authored
      Committed for following VSETVL refactor patch to make V2 patch easier to review.
      gcc/ChangeLog:
      
      	* config/riscv/riscv-vsetvl.cc
      	(pass_vsetvl::global_eliminate_vsetvl_insn): Fix potential ICE.
      3beef5e6
    • Juzhe-Zhong's avatar
      RISC-V: Fix VTYPE fuse rule bug · 29487eb2
      Juzhe-Zhong authored
      This bug is exposed after refactor patch.
      Separate it and commited.
      
      gcc/ChangeLog:
      
      	* config/riscv/riscv-vsetvl.cc (ge_sew_ratio_unavailable_p):
      	Fix fuse rule bug.
      	* config/riscv/riscv-vsetvl.def (DEF_SEW_LMUL_FUSE_RULE): Ditto.
      29487eb2
    • Juzhe-Zhong's avatar
      RISC-V: Fix gather_load_run-12.c test · 5f3c8075
      Juzhe-Zhong authored
      FAIL: gcc.target/riscv/rvv/autovec/gather-scatter/gather_load_run-12.c
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.target/riscv/rvv/autovec/gather-scatter/gather_load_run-12.c:
      	Add vsetvli asm.
      5f3c8075
    • Juzhe-Zhong's avatar
      RISC-V: Add attribute to vtype change only vsetvl · ea1eb12a
      Juzhe-Zhong authored
      This patch is prepare patch for VSETVL PASS.
      
      Commited.
      
      gcc/ChangeLog:
      
      	* config/riscv/vector.md: Add attribute.
      ea1eb12a
    • Juzhe-Zhong's avatar
      RISC-V: Adapt live-1.c testcase · d18296e8
      Juzhe-Zhong authored
      Commited.
      
      Fix failures:
      
      FAIL: gcc.target/riscv/rvv/autovec/partial/live-1.c scan-tree-dump-times optimized ".VEC_EXTRACT" 10
      FAIL: gcc.target/riscv/rvv/autovec/partial/live-1.c scan-tree-dump-times optimized ".VEC_EXTRACT" 10
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.target/riscv/rvv/autovec/partial/live-1.c: Adapt test.
      d18296e8
    • GCC Administrator's avatar
      Daily bump. · 6cd85273
      GCC Administrator authored
      6cd85273
  3. Aug 22, 2023
    • Juzhe-Zhong's avatar
      RISC-V: Clang format riscv-vsetvl.cc[NFC] · 10a7d31d
      Juzhe-Zhong authored
      Commited.
      
      gcc/ChangeLog:
      
      	* config/riscv/riscv-vsetvl.cc (change_insn): Clang format.
      	(vector_infos_manager::all_same_ratio_p): Ditto.
      	(vector_infos_manager::all_same_avl_p): Ditto.
      	(pass_vsetvl::refine_vsetvls): Ditto.
      	(pass_vsetvl::cleanup_vsetvls): Ditto.
      	(pass_vsetvl::commit_vsetvls): Ditto.
      	(pass_vsetvl::local_eliminate_vsetvl_insn): Ditto.
      	(pass_vsetvl::global_eliminate_vsetvl_insn): Ditto.
      	(pass_vsetvl::compute_probabilities): Ditto.
      10a7d31d
    • Juzhe-Zhong's avatar
      RISC-V: Add riscv-vsetvl.def to t-riscv · b817bfad
      Juzhe-Zhong authored
      This patch will be backport to GCC 13 and commit to trunk.
      gcc/ChangeLog:
      
      	* config/riscv/t-riscv: Add riscv-vsetvl.def
      b817bfad
    • Francois-Xavier Coudert's avatar
      libgomp, testsuite: Do not call nonstandard functions · 0ccfbe64
      Francois-Xavier Coudert authored
      The following functions are not standard, and not always available
      (e.g., on darwin). They should not be called unless available: gamma,
      gammaf, scalb, scalbf, significand, and significandf.
      
      libgomp/ChangeLog:
      
      	* testsuite/lib/libgomp.exp: Add effective target.
      	* testsuite/libgomp.c/simd-math-1.c: Avoid calling nonstandard
      	functions.
      0ccfbe64
    • David Malcolm's avatar
      analyzer: reimplement kf_strlen [PR105899] · 3242fb53
      David Malcolm authored
      
      Reimplement kf_strlen in terms of the new string scanning
      implementation, sharing strlen's implementation with
      __analyzer_get_strlen.
      
      gcc/analyzer/ChangeLog:
      	PR analyzer/105899
      	* kf-analyzer.cc (class kf_analyzer_get_strlen): Move to kf.cc.
      	(register_known_analyzer_functions): Use make_kf_strlen.
      	* kf.cc (class kf_strlen::impl_call_pre): Replace with
      	implementation of kf_analyzer_get_strlen from kf-analyzer.cc.
      	Handle "UNKNOWN" return from check_for_null_terminated_string_arg
      	by falling back to a conjured svalue.
      	(make_kf_strlen): New.
      	(register_known_functions): Use make_kf_strlen.
      	* known-function-manager.h (make_kf_strlen): New decl.
      
      gcc/testsuite/ChangeLog:
      	PR analyzer/105899
      	* gcc.dg/analyzer/null-terminated-strings-1.c: Update expected
      	results on symbolic values.
      	* gcc.dg/analyzer/strlen-1.c: New test.
      
      Signed-off-by: default avatarDavid Malcolm <dmalcolm@redhat.com>
      3242fb53
    • Jason Merrill's avatar
      c++: maybe_substitute_reqs_for fix · f40d24cd
      Jason Merrill authored
      While working on PR109751 I found that maybe_substitute_reqs_for was doing
      the wrong thing for a non-template friend, substituting in the template args
      of the scope's original template rather than those of the instantiation.
      This didn't end up being necessary to fix the PR, but it's still an
      improvement.
      
      gcc/cp/ChangeLog:
      
      	* pt.cc (outer_template_args): Handle non-template argument.
      	* constraint.cc (maybe_substitute_reqs_for): Pass decl to it.
      	* cp-tree.h (outer_template_args): Adjust.
      f40d24cd
    • Jason Merrill's avatar
      c++: constrained hidden friends [PR109751] · 810bcc00
      Jason Merrill authored
      r13-4035 avoided a problem with overloading of constrained hidden friends by
      checking satisfaction, but checking satisfaction early is inconsistent with
      the usual late checking and can lead to hard errors, so let's not do that
      after all.
      
      We were wrongly treating the different instantiations of the same friend
      template as the same function because maybe_substitute_reqs_for was failing
      to actually substitute in the case of a non-template friend.  But we don't
      actually need to do the substitution anyway, because [temp.friend] says that
      such a friend can't be the same as any other declaration.
      
      After fixing that, instead of a redefinition error we got an ambiguous
      overload error, fixed by allowing constrained hidden friends to coexist
      until overload resolution, at which point they probably won't be in the same
      ADL overload set anyway.
      
      And we avoid mangling collisions by following the proposed mangling for
      these friends as a member function with an extra 'F' before the name.  I
      demangle this by just adding [friend] to the name of the function because
      it's not feasible to reconstruct the actual scope of the function since the
      mangling ABI doesn't distinguish between class and namespace scopes.
      
      	PR c++/109751
      
      gcc/cp/ChangeLog:
      
      	* cp-tree.h (member_like_constrained_friend_p): Declare.
      	* decl.cc (member_like_constrained_friend_p): New.
      	(function_requirements_equivalent_p): Check it.
      	(duplicate_decls): Check it.
      	(grokfndecl): Check friend template constraints.
      	* mangle.cc (decl_mangling_context): Check it.
      	(write_unqualified_name): Check it.
      	* pt.cc (uses_outer_template_parms_in_constraints): Fix for friends.
      	(tsubst_friend_function): Don't check satisfaction.
      
      include/ChangeLog:
      
      	* demangle.h (enum demangle_component_type): Add
      	DEMANGLE_COMPONENT_FRIEND.
      
      libiberty/ChangeLog:
      
      	* cp-demangle.c (d_make_comp): Handle DEMANGLE_COMPONENT_FRIEND.
      	(d_count_templates_scopes): Likewise.
      	(d_print_comp_inner): Likewise.
      	(d_unqualified_name): Handle member-like friend mangling.
      	* testsuite/demangle-expected: Add test.
      
      gcc/testsuite/ChangeLog:
      
      	* g++.dg/cpp2a/concepts-friend11.C: Now works.  Add template.
      	* g++.dg/cpp2a/concepts-friend15.C: New test.
      810bcc00
    • Vineet Gupta's avatar
      RISC-V: output Autovec params explicitly in --help ... · 3571cc93
      Vineet Gupta authored
      
      ... otherwise user has no clue what -param to actually change
      
      gcc/ChangeLog:
      	* config/riscv/riscv.opt: Add --param names
      	riscv-autovec-preference and riscv-autovec-lmul
      
      Signed-off-by: default avatarVineet Gupta <vineetg@rivosinc.com>
      3571cc93
    • Raphael Moreira Zinsly's avatar
      RISC-V: Add multiarch support on riscv-linux-gnu · 47f95bc4
      Raphael Moreira Zinsly authored
      This adds multiarch support to the RISC-V port so that bootstraps work with
      Debian out-of-the-box.  Without this patch the stage1 compiler is unable to
      find headers/libraries when building the stage1 runtime.
      
      This is functionally (and possibly textually) equivalent to Debian's fix for
      the same problem.
      
      gcc/
      	* config/riscv/t-linux: Add MULTIARCH_DIRNAME.
      47f95bc4
    • Tobias Burnus's avatar
      OpenMP: Handle 'all' as category in defaultmap · 0698c9fd
      Tobias Burnus authored
      Both, specifying no category and specifying 'all', implies
      that the implicit-behavior applies to all categories.
      
      gcc/c/ChangeLog:
      
      	* c-parser.cc (c_parser_omp_clause_defaultmap): Parse
      	'all' as category.
      
      gcc/cp/ChangeLog:
      
      	* parser.cc (cp_parser_omp_clause_defaultmap): Parse
      	'all' as category.
      
      gcc/fortran/ChangeLog:
      
      	* gfortran.h (enum gfc_omp_defaultmap_category):
      	Add OMP_DEFAULTMAP_CAT_ALL.
      	* openmp.cc (gfc_match_omp_clauses): Parse
      	'all' as category.
      	* trans-openmp.cc (gfc_trans_omp_clauses): Handle it.
      
      gcc/ChangeLog:
      
      	* tree-core.h (enum omp_clause_defaultmap_kind): Add
      	OMP_CLAUSE_DEFAULTMAP_CATEGORY_ALL.
      	* gimplify.cc (gimplify_scan_omp_clauses): Handle it.
      	* tree-pretty-print.cc (dump_omp_clause): Likewise.
      
      libgomp/ChangeLog:
      
      	* libgomp.texi (OpenMP 5.2 status): Add depobj with
      	destroy-var argument as 'N'. Mark defaultmap with
      	'all' category as 'Y'.
      
      gcc/testsuite/ChangeLog:
      
      	* gfortran.dg/gomp/defaultmap-1.f90: Update dg-error.
      	* c-c++-common/gomp/defaultmap-5.c: New test.
      	* c-c++-common/gomp/defaultmap-6.c: New test.
      	* gfortran.dg/gomp/defaultmap-10.f90: New test.
      	* gfortran.dg/gomp/defaultmap-9.f90: New test.
      0698c9fd
    • Jakub Jelinek's avatar
      doc: Remove obsolete sentence about _Float* not being supported in C++ [PR106652] · 145da6a8
      Jakub Jelinek authored
      As mentioned in the PR, these types are supported in C++ since GCC 13,
      so we shouldn't confuse users.
      
      2023-08-22  Jakub Jelinek  <jakub@redhat.com>
      
      	PR c++/106652
      	* doc/extend.texi (_Float<n>): Drop obsolete sentence that the
      	types aren't supported in C++.
      145da6a8
    • Juzhe-Zhong's avatar
      VECT: Add LEN_FOLD_EXTRACT_LAST pattern · f4658e02
      Juzhe-Zhong authored
      Hi, Richard and Richi.
      
      This is the last autovec pattern I want to add for RVV (length loop control).
      
      This patch is supposed to handled this following case:
      
      int __attribute__ ((noinline, noclone))
      condition_reduction (int *a, int min_v, int n)
      {
        int last = 66; /* High start value.  */
      
        for (int i = 0; i < n; i++)
          if (a[i] < min_v)
            last = i;
      
        return last;
      }
      
      ARM SVE IR:
      
        ...
        mask__7.11_39 = vect__4.10_37 < vect_cst__38;
        _40 = loop_mask_36 & mask__7.11_39;
        last_5 = .FOLD_EXTRACT_LAST (last_15, _40, vect_vec_iv_.7_32);
        ...
      
      RVV IR, we want to see:
       ...
       loop_len = SELECT_VL
       mask__7.11_39 = vect__4.10_37 < vect_cst__38;
       last_5 = .LEN_FOLD_EXTRACT_LAST (last_15, _40, vect_vec_iv_.7_32, loop_len, bias);
       ...
      
      gcc/ChangeLog:
      
      	* doc/md.texi: Add LEN_FOLD_EXTRACT_LAST pattern.
      	* internal-fn.cc (fold_len_extract_direct): Ditto.
      	(expand_fold_len_extract_optab_fn): Ditto.
      	(direct_fold_len_extract_optab_supported_p): Ditto.
      	* internal-fn.def (LEN_FOLD_EXTRACT_LAST): Ditto.
      	* optabs.def (OPTAB_D): Ditto.
      f4658e02
    • Richard Biener's avatar
      Simplify intereaved store vectorization processing · 2c27600f
      Richard Biener authored
      When doing interleaving we perform code generation when visiting the
      last store of a chain.  We keep track of this via DR_GROUP_STORE_COUNT,
      the following localizes this to the caller of vectorizable_store,
      also avoing redundant non-processing of the other stores.
      
      	* tree-vect-stmts.cc (vectorizable_store): Do not bump
      	DR_GROUP_STORE_COUNT here.  Remove early out.
      	(vect_transform_stmt): Only call vectorizable_store on
      	the last element of an interleaving chain.
      2c27600f
    • Filip Kastl's avatar
      MAINTAINERS: Update my email address · 9e5b47b4
      Filip Kastl authored
      
      Signed-off-by: default avatarFilip Kastl <fkastl@suse.cz>
      
      ChangeLog:
      
      	* MAINTAINERS: Update my email address.
      9e5b47b4
Loading