Skip to content
Snippets Groups Projects
  1. Mar 23, 2023
    • Songhe Zhu's avatar
      RISC-V: Fix loss of function to script 'multilib-generator' · 37dd1f14
      Songhe Zhu authored
      
      The arch 'rv32imac' will not be created when excuting
      './multilib-generator rv32imc-ilp32--a'
      
      The output is:
      MULTILIB_OPTIONS = march=rv32imc mabi=ilp32
      MULTILIB_DIRNAMES = rv32imc ilp32
      MULTILIB_REQUIRED = march=rv32imc/mabi=ilp32
      MULTILIB_REUSE =
      
      Analysis : The alts:['rv32imc', 'rv32imac'] will change
      to ['rv32imac', 'rv32imc'] through function:unique(alts) processing,
      This is the wrong alts should not be changed.
      This patch fix it.
      
      gcc/ChangLog:
      	* config/riscv/multilib-generator: Adjusting the loop of 'alt' in 'alts'.
      
      Signed-off-by: default avatarSonghe Zhu <zhusonghe@eswincomputing.com>
      37dd1f14
    • Jason Merrill's avatar
      c++: local class in nested generic lambda [PR109241] · 4872e46e
      Jason Merrill authored
      In this testcase, the tree walk to look for bare parameter packs was
      confused by finding a type with no TREE_BINFO.  But it should be fine that
      it's unset; we already checked for unexpanded packs at parse time.
      
      I also tried doing the partial instantiation of the local class, which is
      probably the long-term direction we want to go, but for stage 4 let's go
      with this safer change.
      
      	PR c++/109241
      
      gcc/cp/ChangeLog:
      
      	* pt.cc (find_parameter_packs_r): Handle null TREE_BINFO.
      
      gcc/testsuite/ChangeLog:
      
      	* g++.dg/cpp1y/lambda-generic-local-class2.C: New test.
      4872e46e
    • Ju-Zhe Zhong's avatar
      RISC-V: Fix LRA issue for LMUL < 1 vector spillings [PR109244] · cd0c433e
      Ju-Zhe Zhong authored
      In order to decrease the memory traffic, we don't use whole register
      load/store for the LMUL less than 1 and mask mode, so those case will
      require one extra general purpose register for setting up VL register,
      but it's not allowed during LRA process, so we defined few special move patterns
      used for LRA, which will defer the expansion after LRA.
      
      gcc/ChangeLog:
      
      	PR target/109244
      	* config/riscv/riscv-protos.h (emit_vlmax_vsetvl): Define as global.
      	(emit_vlmax_op): Ditto.
      	* config/riscv/riscv-v.cc (get_sew): New function.
      	(emit_vlmax_vsetvl): Adapt function.
      	(emit_pred_op): Ditto.
      	(emit_vlmax_op): Ditto.
      	(emit_nonvlmax_op): Ditto.
      	(legitimize_move): Fix LRA ICE.
      	(gen_no_side_effects_vsetvl_rtx): Adapt function.
      	* config/riscv/vector.md (@mov<V_FRACT:mode><P:mode>_lra): New pattern.
      	(@mov<VB:mode><P:mode>_lra): Ditto.
      	(*mov<V_FRACT:mode><P:mode>_lra): Ditto.
      	(*mov<VB:mode><P:mode>_lra): Ditto.
      
      gcc/testsuite/ChangeLog:
      
      	PR target/109244
      	* g++.target/riscv/rvv/base/pr109244.C: New test.
      	* gcc.target/riscv/rvv/base/binop_vv_constraint-4.c: Adapt testcase.
      	* gcc.target/riscv/rvv/base/binop_vv_constraint-6.c: Ditto.
      	* gcc.target/riscv/rvv/base/binop_vx_constraint-127.c: Ditto.
      	* gcc.target/riscv/rvv/base/spill-1.c: Ditto.
      	* gcc.target/riscv/rvv/base/spill-2.c: Ditto.
      	* gcc.target/riscv/rvv/base/spill-3.c: Ditto.
      	* gcc.target/riscv/rvv/base/spill-5.c: Ditto.
      	* gcc.target/riscv/rvv/base/spill-7.c: Ditto.
      	* g++.target/riscv/rvv/base/bug-18.C: New test.
      	* gcc.target/riscv/rvv/base/merge_constraint-3.c: New test.
      	* gcc.target/riscv/rvv/base/merge_constraint-4.c: New test.
      cd0c433e
    • Ju-Zhe Zhong's avatar
      RISC-V: Implement __riscv_vlenb PR109228 · 116a8678
      Ju-Zhe Zhong authored
      __riscv_vlenb is defined in RVV intrinsic spec 0.11 and used in some project
      like google/highway.
      
      gcc/ChangeLog:
      
      	PR target/109228
      	* config/riscv/riscv-vector-builtins-bases.cc (class vlenb): Add
      	__riscv_vlenb support.
      	(BASE): Ditto.
      	* config/riscv/riscv-vector-builtins-bases.h: Ditto.
      	* config/riscv/riscv-vector-builtins-functions.def (vlenb): Ditto.
      	* config/riscv/riscv-vector-builtins-shapes.cc (struct vlenb_def): Ditto.
      	(SHAPE): Ditto.
      	* config/riscv/riscv-vector-builtins-shapes.h: Ditto.
      	* config/riscv/riscv-vector-builtins.cc: Ditto.
      
      gcc/testsuite/ChangeLog:
      
      	PR target/109228
      	* gcc.target/riscv/rvv/base/vlenb-1.c: New test.
      116a8678
    • Ju-Zhe Zhong's avatar
      RISC-V: Fix wrong vsetvli fusion for vmv.s.x · a481eed8
      Ju-Zhe Zhong authored
      
      gcc/ChangeLog:
      
      	* config/riscv/riscv-vsetvl.cc (reg_available_p): Fix bugs.
      	(pass_vsetvl::compute_local_backward_infos): Fix bugs.
      	(pass_vsetvl::need_vsetvl): Fix bugs.
      	(pass_vsetvl::backward_demand_fusion): Fix bugs.
      	(pass_vsetvl::demand_fusion): Fix bugs.
      	(eliminate_insn): Fix bugs.
      	(insert_vsetvl): Ditto.
      	(pass_vsetvl::emit_local_forward_vsetvls): Ditto.
      	* config/riscv/riscv-vsetvl.h (enum vsetvl_type): Ditto.
      	* config/riscv/vector.md: Ditto.
      
      gcc/testsuite/ChangeLog:
      
      	* g++.target/riscv/rvv/base/bug-10.C: New test.
      	* g++.target/riscv/rvv/base/bug-11.C: New test.
      	* g++.target/riscv/rvv/base/bug-12.C: New test.
      	* g++.target/riscv/rvv/base/bug-13.C: New test.
      	* g++.target/riscv/rvv/base/bug-14.C: New test.
      	* g++.target/riscv/rvv/base/bug-15.C: New test.
      	* g++.target/riscv/rvv/base/bug-16.C: New test.
      	* g++.target/riscv/rvv/base/bug-17.C: New test.
      	* g++.target/riscv/rvv/base/bug-2.C: New test.
      	* g++.target/riscv/rvv/base/bug-3.C: New test.
      	* g++.target/riscv/rvv/base/bug-4.C: New test.
      	* g++.target/riscv/rvv/base/bug-5.C: New test.
      	* g++.target/riscv/rvv/base/bug-6.C: New test.
      	* g++.target/riscv/rvv/base/bug-7.C: New test.
      	* g++.target/riscv/rvv/base/bug-8.C: New test.
      	* g++.target/riscv/rvv/base/bug-9.C: New test.
      
      Signed-off-by: default avatarJu-Zhe Zhong <juzhe.zhong@rivai.ai>
      Co-authored-by: default avatarkito-cheng <kito.cheng@sifive.com>
      a481eed8
    • Ju-Zhe Zhong's avatar
      RISC-V: Fix wrong RTL pattern for ternary instructions. · 0e271517
      Ju-Zhe Zhong authored
      
      We've wrong RTL pattern cause unexpected optimizaion result.
      
      Give a example is vnmsub.vx pattern, the operation of vnmsub.vx
      list below:
      
        vnmsub.vx vd, rs1, vs2, vm    # vd[i] = -(x[rs1] * vd[i]) + vs2[i]
      
      But our RTL pattern write as (x[rs1] * vd[i]) - vs2[i], and the GCC try to
      simplify when x[rs1] is constant 1, and then become a vd[i] - vs[i]
      instruction.
      
      We also revise all ternary instructions to make sure the RTL has right
      semantic:
      
      And it's the mapping list between instruction and RTL pattern:
      
      interger:
      vnmsac.vv vd, vs1, vs2, vm    # vd[i] = -(vs1[i] * vs2[i]) + vd[i]  (minus op3 (mult op1 op2))
      vnmsac.vx vd, rs1, vs2, vm    # vd[i] = -(x[rs1] * vs2[i]) + vd[i]   (minus op3 (mult op1 op2))
      
      floating-point:
      vfmacc.vv vd, vs1, vs2, vm    # vd[i] = +(vs1[i] * vs2[i]) + vd[i] (plus (mult (op1 op2)) op3)
      vfmacc.vf vd, rs1, vs2, vm    # vd[i] = +(f[rs1] * vs2[i]) + vd[i] (plus (mult (op1 op2)) op3)
      
      vfnmacc.vv vd, vs1, vs2, vm   # vd[i] = -(vs1[i] * vs2[i]) - vd[i] (minus (neg (mult (op1 op2))) op3))
      vfnmacc.vf vd, rs1, vs2, vm   # vd[i] = -(f[rs1] * vs2[i]) - vd[i] (minus (neg (mult (op1 op2)) op3))
      vfmsac.vv vd, vs1, vs2, vm    # vd[i] = +(vs1[i] * vs2[i]) - vd[i] (minus (mult (op1 op2)) op3)
      vfmsac.vf vd, rs1, vs2, vm    # vd[i] = +(f[rs1] * vs2[i]) - vd[i] (minus (mult (op1 op2)) op3)
      
      vfnmsac.vv vd, vs1, vs2, vm   # vd[i] = -(vs1[i] * vs2[i]) + vd[i] (plus (neg:(mult (op1 op2))) op3)
      vfnmsac.vf vd, rs1, vs2, vm   # vd[i] = -(f[rs1] * vs2[i]) + vd[i] (plus (neg:(mult (op1 op2))) op3)
      
      gcc/ChangeLog:
      
      	* config/riscv/riscv-vector-builtins-bases.cc: Fix ternary bug.
      	* config/riscv/vector-iterators.md (nmsac): Ditto.
      	(nmsub): Ditto.
      	(msac): Ditto.
      	(msub): Ditto.
      	(nmadd): Ditto.
      	(nmacc): Ditto.
      	* config/riscv/vector.md (@pred_mul_<optab><mode>): Ditto.
      	(@pred_mul_plus<mode>): Ditto.
      	(*pred_madd<mode>): Ditto.
      	(*pred_macc<mode>): Ditto.
      	(*pred_mul_plus<mode>): Ditto.
      	(@pred_mul_plus<mode>_scalar): Ditto.
      	(*pred_madd<mode>_scalar): Ditto.
      	(*pred_macc<mode>_scalar): Ditto.
      	(*pred_mul_plus<mode>_scalar): Ditto.
      	(*pred_madd<mode>_extended_scalar): Ditto.
      	(*pred_macc<mode>_extended_scalar): Ditto.
      	(*pred_mul_plus<mode>_extended_scalar): Ditto.
      	(@pred_minus_mul<mode>): Ditto.
      	(*pred_<madd_nmsub><mode>): Ditto.
      	(*pred_nmsub<mode>): Ditto.
      	(*pred_<macc_nmsac><mode>): Ditto.
      	(*pred_nmsac<mode>): Ditto.
      	(*pred_mul_<optab><mode>): Ditto.
      	(*pred_minus_mul<mode>): Ditto.
      	(@pred_mul_<optab><mode>_scalar): Ditto.
      	(@pred_minus_mul<mode>_scalar): Ditto.
      	(*pred_<madd_nmsub><mode>_scalar): Ditto.
      	(*pred_nmsub<mode>_scalar): Ditto.
      	(*pred_<macc_nmsac><mode>_scalar): Ditto.
      	(*pred_nmsac<mode>_scalar): Ditto.
      	(*pred_mul_<optab><mode>_scalar): Ditto.
      	(*pred_minus_mul<mode>_scalar): Ditto.
      	(*pred_<madd_nmsub><mode>_extended_scalar): Ditto.
      	(*pred_nmsub<mode>_extended_scalar): Ditto.
      	(*pred_<macc_nmsac><mode>_extended_scalar): Ditto.
      	(*pred_nmsac<mode>_extended_scalar): Ditto.
      	(*pred_mul_<optab><mode>_extended_scalar): Ditto.
      	(*pred_minus_mul<mode>_extended_scalar): Ditto.
      	(*pred_<madd_msub><mode>): Ditto.
      	(*pred_<macc_msac><mode>): Ditto.
      	(*pred_<madd_msub><mode>_scalar): Ditto.
      	(*pred_<macc_msac><mode>_scalar): Ditto.
      	(@pred_neg_mul_<optab><mode>): Ditto.
      	(@pred_mul_neg_<optab><mode>): Ditto.
      	(*pred_<nmadd_msub><mode>): Ditto.
      	(*pred_<nmsub_nmadd><mode>): Ditto.
      	(*pred_<nmacc_msac><mode>): Ditto.
      	(*pred_<nmsac_nmacc><mode>): Ditto.
      	(*pred_neg_mul_<optab><mode>): Ditto.
      	(*pred_mul_neg_<optab><mode>): Ditto.
      	(@pred_neg_mul_<optab><mode>_scalar): Ditto.
      	(@pred_mul_neg_<optab><mode>_scalar): Ditto.
      	(*pred_<nmadd_msub><mode>_scalar): Ditto.
      	(*pred_<nmsub_nmadd><mode>_scalar): Ditto.
      	(*pred_<nmacc_msac><mode>_scalar): Ditto.
      	(*pred_<nmsac_nmacc><mode>_scalar): Ditto.
      	(*pred_neg_mul_<optab><mode>_scalar): Ditto.
      	(*pred_mul_neg_<optab><mode>_scalar): Ditto.
      	(@pred_widen_neg_mul_<optab><mode>): Ditto.
      	(@pred_widen_mul_neg_<optab><mode>): Ditto.
      	(@pred_widen_neg_mul_<optab><mode>_scalar): Ditto.
      	(@pred_widen_mul_neg_<optab><mode>_scalar): Ditto.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.target/riscv/rvv/base/bug-3.c: New test.
      	* gcc.target/riscv/rvv/base/bug-4.c: New test.
      	* gcc.target/riscv/rvv/base/bug-5.c: New test.
      
      Signed-off-by: default avatarJu-Zhe Zhong <juzhe.zhong@rivai.ai>
      Co-authored-by: default avatarkito-cheng <kito.cheng@sifive.com>
      0e271517
    • Kito Cheng's avatar
      RISC-V: Add riscv_vector target check · ba31f9a3
      Kito Cheng authored
      Add target check funciton to ensure vector extension can be used.
      
      gcc/testsuite/ChangeLog:
      
      	* lib/target-supports.exp (check_effective_target_riscv_vector):
      	New.
      ba31f9a3
    • liuhongt's avatar
      Remove TARGET_GEN_MEMSET_SCRATCH_RTX since it's not used anymore. · 77127363
      liuhongt authored
      The target hook is only used by i386, and the current definition is
      same as default gen_reg_rtx.
      
      gcc/ChangeLog:
      
      	* builtins.cc (builtin_memset_read_str): Replace
      	targetm.gen_memset_scratch_rtx with gen_reg_rtx.
      	(builtin_memset_gen_str): Ditto.
      	* config/i386/i386-expand.cc
      	(ix86_convert_const_wide_int_to_broadcast): Replace
      	ix86_gen_scratch_sse_rtx with gen_reg_rtx.
      	(ix86_expand_vector_move): Ditto.
      	* config/i386/i386-protos.h (ix86_gen_scratch_sse_rtx):
      	Removed.
      	* config/i386/i386.cc (ix86_gen_scratch_sse_rtx): Removed.
      	(TARGET_GEN_MEMSET_SCRATCH_RTX): Removed.
      	* doc/tm.texi: Remove TARGET_GEN_MEMSET_SCRATCH_RTX.
      	* doc/tm.texi.in: Ditto.
      	* target.def: Ditto.
      77127363
    • GCC Administrator's avatar
      Daily bump. · 50bd9c41
      GCC Administrator authored
      50bd9c41
  2. Mar 22, 2023
    • Jonathan Wakely's avatar
      libstdc++: Fix assigning nullptr to std::atomic<shared_ptr<T>> (LWG 3893) · a495b738
      Jonathan Wakely authored
      LWG voted this to Tentatively Ready recently.
      
      libstdc++-v3/ChangeLog:
      
      	* include/bits/shared_ptr_atomic.h (atomic::operator=(nullptr_t)):
      	Add overload, as per LWG 3893.
      	* testsuite/20_util/shared_ptr/atomic/atomic_shared_ptr.cc:
      	Check assignment from nullptr.
      a495b738
    • David Malcolm's avatar
      testsuite: always use UTF-8 in scan-sarif-file[-not] [PR105959] · 6b274094
      David Malcolm authored
      
      c-c++-common/diagnostic-format-sarif-file-4.c is a test case for
      quoting non-ASCII source code in a SARIF diagnostic log.
      
      The SARIF standard mandates that .sarif files are UTF-8 encoded.
      
      PR testsuite/105959 notes that the test case fails when the system
      encoding is not UTF-8, such as when the "make" invocation is prefixed
      with LC_ALL=C, whereas it works with in a UTF-8-locale.
      
      The root cause is that dg-scan opens the file for reading using the
      "system" encoding; I believe it is falling back to treating all files as
      effectively ISO 8859-1 in a non-UTF-8 locale.
      
      This patch fixes things by adding a mechanism to dg-scan to allow
      callers to (optionally) specify an encoding to use when reading the
      file, and updating scan-sarif-file (and the -not variant) to always
      use UTF-8 when calling dg-scan, fixing the test case with LC_ALL=C.
      
      gcc/testsuite/ChangeLog:
      	PR testsuite/105959
      	* gcc.dg-selftests/dg-final.exp
      	(dg_final_directive_check_num_args): Update expected maximum
      	number of args for the various directives using dg-scan.
      	* lib/scanasm.exp (append_encoding_arg): New procedure.
      	(dg-scan): Add optional 3rd argument: the encoding to use when
      	reading from the file.
      	* lib/scansarif.exp (scan-sarif-file): Treat the file as UTF-8
      	encoded when reading it.
      	(scan-sarif-file-not): Likewise.
      
      Signed-off-by: default avatarDavid Malcolm <dmalcolm@redhat.com>
      6b274094
    • Ian Lance Taylor's avatar
    • Jason Merrill's avatar
      c++: array bound partial ordering [PR108390] · 5a1717fb
      Jason Merrill authored
      fold_convert doesn't work with a dependent argument, and problematically
      differed from the corresponding fold+build_nop further down in the
      function.  So change it to match.
      
      	PR c++/108390
      
      gcc/cp/ChangeLog:
      
      	* pt.cc (unify): Use fold of build_nop instead of fold_convert.
      
      gcc/testsuite/ChangeLog:
      
      	* g++.dg/template/partial-order3.C: New test.
      5a1717fb
    • Harald Anlauf's avatar
      Fortran: improve checking of FINAL subroutine arguments [PR104572] · 3e791f45
      Harald Anlauf authored
      
      gcc/fortran/ChangeLog:
      
      	PR fortran/104572
      	* resolve.cc (gfc_resolve_finalizers): Argument of a FINAL subroutine
      	cannot be an alternate return.
      
      gcc/testsuite/ChangeLog:
      
      	PR fortran/104572
      	* gfortran.dg/pr104572.f90: New test.
      
      Co-authored-by: default avatarSteven G. Kargl <kargl@gcc.gnu.org>
      3e791f45
    • Jonathan Wakely's avatar
      libstdc++: Remove std::formatter<const charT[N], charT> specialization · f2e70da6
      Jonathan Wakely authored
      This was approved in Issaquah as LWG 3833.
      
      libstdc++-v3/ChangeLog:
      
      	* include/std/format (formatter<const charT[N], charT>): Do not
      	define partial speclialization, as per LWG 3833.
      	* testsuite/std/format/formatter/requirements.cc: Check it.
      f2e70da6
    • Jonathan Wakely's avatar
      libstdc++: Define __cpp_lib_constexpr_algorithms in <utility> (LWG 3792) · 924d9904
      Jonathan Wakely authored
      We actually defined this macro in <utility> at one point, but I removed
      it in r10-7901-g2025db692e9ed1.
      
      libstdc++-v3/ChangeLog:
      
      	* include/std/utility (__cpp_lib_constexpr_algorithms): Define,
      	as per LWG 3792.
      	* testsuite/20_util/exchange/constexpr.cc: Check for it.
      924d9904
    • Jonathan Wakely's avatar
      libstdc++: Add missing __cpp_lib_format macro to <version> · 02e86035
      Jonathan Wakely authored
      libstdc++-v3/ChangeLog:
      
      	* include/std/version (__cpp_lib_format): Define.
      	* testsuite/std/format/functions/format.cc: Check it.
      02e86035
    • Jonathan Wakely's avatar
      libstdc++: Use rvalues in std::string::resize_and_overwrite (LWG 3645) · ba4f5530
      Jonathan Wakely authored
      Previously the C++23 draft required that the callback arguments were
      lvalues, which was overvable by the callback. LWG 3645 removes that
      overspecification, so we can pass rvalues and the user can't modify
      our local variables. I've used auto(p) to produce rvalues, which is only
      supported since Clang 15, but I think that's OK for a C++23 feature.
      
      While making this change I noticed that we weren't correctly enforcing
      the requirement that the callback returns an integer-like type. Add
      better assertions for the type and value.
      
      libstdc++-v3/ChangeLog:
      
      	* include/bits/basic_string.tcc (basic_string::resize_and_overwrite):
      	Pass rvalues to the callback, as now allowed by LWG 3645.
      	Enforce preconditions on the return value.
      	* testsuite/21_strings/basic_string/capacity/char/resize_and_overwrite.cc:
      	Adjust.
      ba4f5530
    • Jonathan Wakely's avatar
      libstdc++: Add comment to <format> (LWG 3720) · 7d4f4ce6
      Jonathan Wakely authored
      libstdc++-v3/ChangeLog:
      
      	* include/std/format: Add a comment noting that the resolution
      	of LWG 3720 has been applied..
      7d4f4ce6
    • Jonathan Wakely's avatar
      libstdc++: Add allocator-extended constructors to std::match_results (LWG 2195) · 9ae11081
      Jonathan Wakely authored
      This was approved in Issaquah last month.
      
      libstdc++-v3/ChangeLog:
      
      	* include/bits/regex.h (match_results): Add allocator-extended
      	copy and move constructors, as per LWG 2195.
      	* testsuite/28_regex/match_results/ctors/char/alloc.cc: New test.
      9ae11081
    • Jonathan Wakely's avatar
      libstdc++: Make std::istream_iterator copy ctor constexpr (LWG 3600) · ad0b9cf1
      Jonathan Wakely authored
      As explained in LWG 3600, we never implemented a C++0x change that made
      the copy constructor of std::istream_iterator defined as defaulted. That
      would be an ABI break, so the resolution of LWG 3600 is to not require
      it to be trivial, but just constexpr and conditionally noexcept. This
      applies that resolution.
      
      libstdc++-v3/ChangeLog:
      
      	* include/bits/stream_iterator.h (istream_iterator): Add
      	constexpr to copy constructor, as per LWG 3600.
      	* testsuite/24_iterators/istream_iterator/cons/constexpr.cc:
      	Check copy construction.
      ad0b9cf1
    • Vladimir N. Makarov's avatar
      LRA: Do not repeat inheritance and live range splitting in case of asm error · 81d762cb
      Vladimir N. Makarov authored
      LRA was trying to do live range splitting again and again as there were
      no enough regs for asm.  This patch solves the problem.
      
              PR target/109137
      
      gcc/ChangeLog:
      
      	* lra.cc (lra): Do not repeat inheritance and live range splitting
      	when asm error is found.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.target/i386/pr109137.c: New.
      81d762cb
    • Gaius Mulley's avatar
      modula2: Add cwd to include path. Include m2cor before m2pim. · aae0d89e
      Gaius Mulley authored
      
      The driver should default to include the current working directory in the
      module search path.  This patch adds . to the search path provided
      -fm2-pathname has not been specified.  The patch also reorders the pim
      libraries so that the m2cor directory is searched before m2pim.
      Coroutine support is visible by default for both -fpim and -fiso
      (from their respective SYSTEM modules).
      
      gcc/m2/ChangeLog:
      
      	PR modula2/109248
      	* Make-lang.in (m2/pge-boot/%.o): Add CFLAGS and CXXFLAGS for C
      	and C++ compiles.
      	* gm2spec.cc (add_m2_I_path): Indentation.
      	(lang_specific_driver): New variable seen_pathname.
      	Detect -fm2-pathname.  If not seen then push_back_Ipath (".").
      	Change non iso library path to "m2cor,m2log,m2pim,m2iso".
      
      Signed-off-by: default avatarGaius Mulley <gaiusmod2@gmail.com>
      aae0d89e
    • Jason Merrill's avatar
      c++: attribute on dtor in template [PR108795] · 426cab4e
      Jason Merrill authored
      Since r7-2549 we were throwing away the explicit C:: when we found that ~C
      has an attribute that we treat as making its type dependent.
      
      	PR c++/108795
      
      gcc/cp/ChangeLog:
      
      	* semantics.cc (finish_id_expression_1): Check scope before
      	returning id_expression.
      
      gcc/testsuite/ChangeLog:
      
      	* g++.dg/ext/attr-tsafe1.C: New test.
      426cab4e
    • Alex Coplan's avatar
      c++: Avoid duplicate diagnostic calling unavailable function [PR109177] · d3a6f174
      Alex Coplan authored
      As the PR shows, we currently emit duplicate diagnostics for calls to
      functions marked with __attribute__((unavailable)). This patch fixes
      that.
      
      gcc/cp/ChangeLog:
      
      	PR c++/109177
      	* call.cc (build_over_call): Use make_temp_override to suppress
      	both unavailable and deprecated warnings when calling
      	build_addr_func.
      
      gcc/testsuite/ChangeLog:
      
      	PR c++/109177
      	* g++.dg/ext/pr109177.C: New test.
      d3a6f174
    • David Malcolm's avatar
      analyzer: fix false +ves from -Wanalyzer-deref-before-check due to inlining [PR109239] · 0c652ebb
      David Malcolm authored
      
      The patch has this effect on my integration tests of -fanalyzer:
      
        Comparison:
          GOOD: 129        (17.70% -> 17.92%)
           BAD: 600 -> 591 (-9)
      
      which is purely due to improvements to -Wanalyzer-deref-before-check
      on the Linux kernel:
      
        -Wanalyzer-deref-before-check:
          GOOD: 1        (4.55% -> 7.69%)
           BAD: 21 -> 12 (-9)
           Known false positives: 16 -> 10 (-6)
             linux-5.10.162: 7 -> 1 (-6)
           Suspected false positives: 3 -> 0 (-3)
             linux-5.10.162: 3 -> 0 (-3)
      
      gcc/analyzer/ChangeLog:
      	PR analyzer/109239
      	* program-point.cc: Include "analyzer/inlining-iterator.h".
      	(program_point::effectively_intraprocedural_p): New function.
      	* program-point.h (program_point::effectively_intraprocedural_p):
      	New decl.
      	* sm-malloc.cc (deref_before_check::emit): Use it when rejecting
      	interprocedural cases, so that we reject interprocedural cases
      	that have become intraprocedural due to inlining.
      
      gcc/testsuite/ChangeLog:
      	PR analyzer/109239
      	* gcc.dg/analyzer/deref-before-check-pr109239-linux-bus.c: New test.
      
      Signed-off-by: default avatarDavid Malcolm <dmalcolm@redhat.com>
      0c652ebb
    • Andrew Jenner's avatar
      amdgcn: Add instruction patterns for complex number operations. · 1bde3ace
      Andrew Jenner authored
      gcc/ChangeLog:
      
      	* config/gcn/gcn-protos.h (gcn_expand_dpp_swap_pairs_insn)
      	(gcn_expand_dpp_distribute_even_insn)
      	(gcn_expand_dpp_distribute_odd_insn): Declare.
      	* config/gcn/gcn-valu.md (@dpp_swap_pairs<mode>)
      	(@dpp_distribute_even<mode>, @dpp_distribute_odd<mode>)
      	(cmul<conj_op><mode>3, cml<addsub_as><mode>4, vec_addsub<mode>3)
      	(cadd<rot><mode>3, vec_fmaddsub<mode>4, vec_fmsubadd<mode>4)
      	(fms<mode>4<exec>, fms<mode>4_negop2<exec>, fms<mode>4)
      	(fms<mode>4_negop2): New patterns.
      	* config/gcn/gcn.cc (gcn_expand_dpp_swap_pairs_insn)
      	(gcn_expand_dpp_distribute_even_insn)
      	(gcn_expand_dpp_distribute_odd_insn): New functions.
      	* config/gcn/gcn.md: Add entries to unspec enum.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.target/gcn/complex.c: New test.
      1bde3ace
    • Tobias Burnus's avatar
      MAINTAINERS: Add myself as OpenMP and libgomp maintainer · eb800d4f
      Tobias Burnus authored
      ChangeLog:
      	* MAINTAINERS: Add myself as OpenMP and libgomp maintainer.
      eb800d4f
    • Aldy Hernandez's avatar
      frange: Implement nan_state class [PR109008] · 81295d44
      Aldy Hernandez authored
      This patch implements a nan_state class, that allows us to query or
      pass around the NANness of an frange.  We can store +NAN, -NAN, +-NAN,
      or not-a-NAN with it.
      
      I tried to touch as little as possible, leaving other cleanups to the
      next release.  For example, we should replace the m_*_nan fields in
      frange with nan_state, and provide relevant accessors to nan_state
      (isnan, etc).
      
      	PR tree-optimization/109008
      
      gcc/ChangeLog:
      
      	* value-range.cc (frange::set): Add nan_state argument.
      	* value-range.h (class nan_state): New.
      	(frange::get_nan_state): New.
      81295d44
    • Martin Liska's avatar
      configure: regenerate · 5e812e8c
      Martin Liska authored
      gcc/ChangeLog:
      
      	* configure: Regenerate.
      5e812e8c
    • Gaius Mulley's avatar
      PR modula2/107630 Remove M2LINK and remove some cross linking · 573dbd51
      Gaius Mulley authored
      
      Remove M2LINK.def.  Pass the user forced module initialization string as
      a parameter to M2RTS.ConstructModules.  This patch allows
      -fm2-whole-program to link successfully using dynamic libraries.
      
      gcc/m2/ChangeLog:
      
      	PR modula2/107630
      	* Make-lang.in (m2/stage2/cc1gm2$(exeext)): Remove
      	m2/gm2-libs-boot/M2LINK.o.
      	(m2/stage1/cc1gm2$(exeext)): Ditto.
      	(GM2-LIBS-BOOT-DEFS): Remove M2LINK.def.
      	(GM2-LIBS-DEFS): Ditto.
      	(m2/mc-boot/$(SRC_PREFIX)%.o): Replace CXX_FLAGS with CXXFLAGS.
      	(m2/mc-boot-ch/$(SRC_PREFIX)%.o): Ditto.
      	(m2/mc-boot/main.o): Ditto.
      	(mcflex.o): Add $(CFLAGS).
      	(m2/gm2-libs-boot/M2LINK.o): Remove rule.
      	* gm2-compiler/M2GCCDeclare.def (DeclareM2linkGlobals): Remove.
      	* gm2-compiler/M2GCCDeclare.mod: (M2LinkEntry): Remove.
      	(M2LinkIndex): Remove.
      	(DoVariableDeclaration): Remove initial and call to
      	AddEntryM2Link.
      	(AddEntryM2Link): Remove.
      	(GetEntryM2Link): Remove.
      	(DeclareM2linkGlobals): Remove.
      	(DetectM2LinkInitial): Remove.
      	(InitM2LinkModule): Remove.
      	* gm2-compiler/M2GenGCC.mod (CodeFinallyEnd): Remove call to
      	DeclareM2linkGlobals.
      	* gm2-compiler/M2Quads.mod (BuildM2InitFunction): Add extra
      	parameter containing runtime module override to ConstructModules.
      	* gm2-compiler/M2Scaffold.mod: Update comment describing
      	ConstructModules.
      	* gm2-gcc/m2decl.cc (m2decl_DeclareM2linkForcedModuleInitOrder):
      	Remove.
      	* gm2-libs-iso/M2RTS.def (ConstructModules): Add overrideliborder
      	parameter.
      	* gm2-libs-iso/M2RTS.mod: Add overrideliborder parameter.
      	* gm2-libs/M2Dependent.def (ConstructModules): Add overrideliborder
      	parameter.
      	* gm2-libs/M2Dependent.mod (ConstructModules): Add overrideliborder
      	parameter.
      	* gm2-libs/M2RTS.def (ConstructModules): Add overrideliborder parameter.
      	* gm2-libs/M2RTS.mod (ConstructModules): Add overrideliborder
      	parameter.
      	* gm2-libs/M2LINK.def: Removed.
      
      libgm2/ChangeLog:
      
      	* libm2pim/Makefile.am (M2DEFS): Remove M2LINK.def.
      	* libm2pim/Makefile.in: Rebuild.
      
      Signed-off-by: default avatarGaius Mulley <gaiusmod2@gmail.com>
      573dbd51
    • GCC Administrator's avatar
      Daily bump. · 03178527
      GCC Administrator authored
      03178527
  3. Mar 21, 2023
    • Joseph Myers's avatar
      stor-layout: Set TYPE_TYPELESS_STORAGE consistently for type variants · b3321313
      Joseph Myers authored
      I've observed an LTO wrong-code bug with a large testcase in GCC 12,
      that results from TYPE_TYPELESS_STORAGE not being set consistently on
      type variants.
      
      Specifically, in the LTO stage of compilation, there is an aggregate
      type passed to get_alias_set, whose TYPE_MAIN_VARIANT does not have
      TYPE_TYPELESS_STORAGE set.  However, the TYPE_CANONICAL of that main
      variant *does* have have TYPE_TYPELESS_STORAGE set; note that the use
      of TYPE_CANONICAL in get_alias_set comes after the check of
      TYPE_TYPELESS_STORAGE.  The effect is that when (one-argument)
      record_component_aliases is called, the recursive call to
      get_alias_set gives alias set 0, and the aggregate type ends up not
      being considered to alias its members, with wrong-code consequences.
      
      I haven't managed to produce a self-contained executable testcase to
      demonstrate this, but it clearly seems appropriate for
      TYPE_TYPELESS_STORAGE to be consistent on type variants, so this patch
      makes it so, which appears to be sufficient to resolve the bug.  I've
      attached a reduced test to
      <https://gcc.gnu.org/pipermail/gcc-patches/2023-March/614278.html>
      that does at least demonstrate main-variant versions of a type (SB in
      this test) being written out to LTO IR both with and without
      TYPE_TYPELESS_STORAGE, although not the subsequent consequences of a
      type without TYPE_TYPELESS_STORAGE with a TYPE_CANONICAL (as
      constructed after LTO type merging) with TYPE_TYPELESS_STORAGE and
      following wrong-code.
      
      Bootstrapped with no regressions for x86_64-pc-linux-gnu.
      
      	* stor-layout.cc (finalize_type_size): Copy TYPE_TYPELESS_STORAGE
      	to variants.
      b3321313
    • Matthias Kretz's avatar
      libstdc++: Use more precise __RECIPROCAL_MATH__ macro · fac64bf4
      Matthias Kretz authored
      
      Signed-off-by: default avatarMatthias Kretz <m.kretz@gsi.de>
      
      libstdc++-v3/ChangeLog:
      
      	* include/experimental/bits/simd_x86.h
      	(_SimdImplX86::_S_divides): Replace test for __GCC_IEC_559 == 0
      	with __RECIPROCAL_MATH__.
      fac64bf4
    • Matthias Kretz's avatar
      libstdc++: Skip integer division optimization for Clang · 403e48ef
      Matthias Kretz authored
      
      Clang ICEs on _SimdImplX86::_S_divides. The function is only working
      around a missed optimization and not necessary for correctness.
      Therefore, don't use it for Clang.
      
      Signed-off-by: default avatarMatthias Kretz <m.kretz@gsi.de>
      
      libstdc++-v3/ChangeLog:
      
      	* include/experimental/bits/simd_detail.h: Don't define
      	_GLIBCXX_SIMD_WORKAROUND_PR90993 for Clang.
      	* include/experimental/bits/simd_x86.h (_S_divides): Remove
      	check for __clang__.
      403e48ef
    • Harald Anlauf's avatar
      Fortran: reject MODULE PROCEDURE outside generic module interface [PR99036] · dd282b16
      Harald Anlauf authored
      gcc/fortran/ChangeLog:
      
      	PR fortran/99036
      	* decl.cc (gfc_match_modproc): Reject MODULE PROCEDURE if not in a
      	generic module interface.
      
      gcc/testsuite/ChangeLog:
      
      	PR fortran/99036
      	* gfortran.dg/pr99036.f90: New test.
      dd282b16
    • Matthias Kretz's avatar
      libstdc++: Fix simd compilation with Clang · 8ff3ca2d
      Matthias Kretz authored
      
      Clang fails to compile some constant expressions involving simd.
      Therefore, just disable this non-conforming extension for clang.
      
      Fix AVX512 blend implementation for Clang. It was converting the bitmask
      to bool before, which is obviously wrong. Instead use a Clang builtin to
      convert the bitmask to vector-mask before using a vector blend ?:. A
      similar change is required for the masked unary implementation, because
      the GCC builtins do not exist on Clang.
      
      Signed-off-by: default avatarMatthias Kretz <m.kretz@gsi.de>
      
      libstdc++-v3/ChangeLog:
      
      	* include/experimental/bits/simd_detail.h: Don't declare the
      	simd API as constexpr with Clang.
      	* include/experimental/bits/simd_x86.h (__movm): New.
      	(_S_blend_avx512): Resolve FIXME. Implement blend using __movm
      	and ?:.
      	(_SimdImplX86::_S_masked_unary): Clang does not implement the
      	same builtins. Implement the function using __movm, ?:, and -
      	operators on vector_size types instead.
      8ff3ca2d
    • Jason Merrill's avatar
      c++: DMI in template with virtual base [PR106890] · 041a164e
      Jason Merrill authored
      When parsing a default member init we just build a CONVERT_EXPR for
      converting to a virtual base, and then expand that into the more complex
      form when we actually use the DMI in a constructor.  But that wasn't working
      for the template case where we are considering the conversion at the point
      that the constructor needs the DMI instantiation, so it seemed like we were
      in a constructor already.  And then when the other constructor tries to
      reuse the instantiation, it sees uses of the first constructor's parameters,
      and dies.  So ensure that we get the CONVERT_EXPR in this case, too.
      
      	PR c++/106890
      
      gcc/cp/ChangeLog:
      
      	* init.cc (maybe_instantiate_nsdmi_init): Don't leave
      	current_function_decl set to a constructor.
      
      gcc/testsuite/ChangeLog:
      
      	* g++.dg/cpp0x/nsdmi-template25.C: New test.
      041a164e
    • Andrew MacLeod's avatar
      Terminate GORI calculations if a relation is not relevant. · 0963cb5f
      Andrew MacLeod authored
      We currently allow VARYING lhs GORI calculations to continue if there is
      a relation present in the hope it will eventually better refine a result.
      This adds a check that the relation is relevant to the outgoing range
      calculation first.  If it is not relevant, stop calculating.
      
      	PR tree-optimization/109192
      	* gimple-range-gori.cc (gori_compute::compute_operand_range):
      	Terminate gori calculations if a relation is not relevant.
      	* value-relation.h (value_relation::set_relation): Allow
      	equality between op1 and op2 if they are the same.
      0963cb5f
    • Richard Biener's avatar
      tree-optimization/109219 - avoid looking at STMT_SLP_TYPE · 26adc870
      Richard Biener authored
      The following avoids looking at STMT_SLP_TYPE apart from the only
      place needing it - transform and analysis of non-SLP loop stmts.
      In particular it doesn't have a reliable meaning on SLP representatives
      which are also passed as stmt_vinfo to vectorizable_* routines.  The
      proper way to check in those is to look for the slp_node argument
      instead.
      
      	PR tree-optimization/109219
      	* tree-vect-loop.cc (vectorizable_reduction): Check
      	slp_node, not STMT_SLP_TYPE.
      	* tree-vect-stmts.cc (vectorizable_condition): Likewise.
      	* tree-vect-slp.cc (vect_slp_analyze_node_operations_1):
      	Remove assertion on STMT_SLP_TYPE.
      
      	* gcc.dg/torture/pr109219.c: New testcase.
      26adc870
Loading