Skip to content
Snippets Groups Projects
  1. Nov 01, 2022
    • Alexander Monakov's avatar
      i386: correct integer division modeling in znver.md · 5cee5f94
      Alexander Monakov authored
      In znver.md, division instructions have descriptions like
      
      (define_insn_reservation "znver1_idiv_DI" 41
                              (and (eq_attr "cpu" "znver1,znver2")
                                   (and (eq_attr "type" "idiv")
                                        (and (eq_attr "mode" "DI")
                                             (eq_attr "memory" "none"))))
                              "znver1-double,znver1-ieu2*41")
      
      which says that DImode idiv has latency 41 (which is correct) and that
      it occupies 2nd integer execution unit for 41 consecutive cycles, but
      that is not correct:
      
      1) the division instruction is partially pipelined, and has throughput
         1/14, not 1/41;
      
      2) for the most part it occupies a separate division unit, not the
         general arithmetic unit.
      
      Evidently, interaction of such 41-cycle paths with the rest of
      reservations causes a combinatorial explosion in the automaton.
      
      Fix this by modeling the integer division unit properly, and correcting
      reservations to use the measured reciprocal throughput of those
      instructions (available from uops.info). A similar correction for
      floating-point divisions is left for a followup patch.
      
      Top 5 znver table sizes, before:
      
      68692 r znver1_ieu_check
      68692 r znver1_ieu_transitions
      99792 r znver1_ieu_min_issue_delay
      428108 r znver1_fp_min_issue_delay
      856216 r znver1_fp_transitions
      
      After:
      
      1454 r znver1_ieu_translate
      1454 r znver1_translate
      2304 r znver1_ieu_transitions
      428108 r znver1_fp_min_issue_delay
      856216 r znver1_fp_transitions
      
      gcc/ChangeLog:
      
      	PR target/87832
      	* config/i386/znver.md (znver1_idiv): New automaton.
      	(znver1-idiv): New unit.
      	(znver1_idiv_DI): Correct unit and cycles in the reservation.
      	(znver1_idiv_SI): Ditto.
      	(znver1_idiv_HI): Ditto.
      	(znver1_idiv_QI): Ditto.
      	(znver1_idiv_mem_DI): Ditto.
      	(znver1_idiv_mem_SI): Ditto.
      	(znver1_idiv_mem_HI): Ditto.
      	(znver1_idiv_mem_QI): Ditto.
      	(znver3_idiv_DI): Ditto.
      	(znver3_idiv_SI): Ditto.
      	(znver3_idiv_HI): Ditto.
      	(znver3_idiv_QI): Ditto.
      	(znver3_idiv_mem_DI): Ditto.
      	(znver3_idiv_mem_SI): Ditto.
      	(znver3_idiv_mem_HI): Ditto.
      	(znver3_idiv_mem_QI): Ditto.
      5cee5f94
    • Nathan Sidwell's avatar
      c++: Reorganize per-scope lambda discriminators · 0122faae
      Nathan Sidwell authored
      We currently use a per-extra-scope counter to discriminate multiple
      lambdas in a particular such scope.  This is not ABI compliant.  This
      patch merely refactors the existing code to make it easier to drop in
      a conformant mangling -- there's no functional change here.  I rename
      the LAMBDA_EXPR_DISCIMINATOR to LAMBDA_EXPR_SCOPE_ONLY_DISCRIMINATOR,
      foreshadowing that there'll be a new discriminator.  To provide ABI
      warnings we'll need to calculate both, and that requires some
      repacking of the lambda_expr's fields.  Finally, although we end up
      calling the discriminator setter and the scope recorder (nearly)
      always consecutively, it's clearer to handle it as two separate
      operations.  That also allows us to remove the instantiation
      special-case for a null extra-scope.
      
      	gcc/cp/
      	* cp-tree.h (LAMBDA_EXPR_DISCRIMINATOR): Rename to ...
      	(LAMBDA_EXPR_SCOPE_ONLY_DISCRIMINATOR): ... here.
      	(struct tree_lambda_expr): Make default_capture_mode &
      	discriminator_scope bitfields.
      	(record_null_lambda_scope) Delete.
      	(record_lambda_scope_discriminator): Declare.
      	* lambda.cc (struct lambda_discriminator): New struct.
      	(lambda_scope, lambda_scope_stack): Adjust types.
      	(lambda_count): Delete.
      	(struct tree_int): Delete.
      	(start_lambda_scope, finish_lambda_scope): Adjust.
      	(record_lambda_scope): Only record the scope.
      	(record_lambda_scope_discriminator): New.
      	* mangle.cc (write_closure_type_name): Adjust.
      	* module.cc (trees_out::core_vals): Likewise,
      	(trees_in::core_vals): Likewise.
      	* parser.cc (cp_parser_lambda_expression): Call
      	record_lambda_scope_discriminator.
      	* pt.cc (tsubst_lambda_expr): Adjust record_lambda_scope caling.  Call
      	record_lambda_scope_discriminator. Commonize control flow on tsubsting
      	the operator function.
      	libcc1/
      	* libcp1plugin.cc (plugin_start_closure): Adjust.
      	gcc/testsuite/
      	* g++.dg/abi/lambda-sig1-17.C: New.
      	* g++.dg/abi/lambda-sig1.h: New.
      	* g++.dg/cpp1y/lambda-mangle-1.C: Extracted to ...
      	* g++.dg/cpp1y/lambda-mangle-1.h: ... here.
      	* g++.dg/cpp1y/lambda-mangle-1-11.C: New
      	* g++.dg/cpp1y/lambda-mangle-1-17.C
      0122faae
    • liuhongt's avatar
      Fix incorrect digit constraint · 4acc4c2b
      liuhongt authored
      Matching constraints are used in these circumstances. More precisely,
      the two operands that match must include one input-only operand and
      one output-only operand. Moreover, the digit must be a smaller number
      than the number of the operand that uses it in the constraint.
      
      In pr107057, the 2 operands in the pattern are both input operands.
      
      gcc/ChangeLog:
      
      	PR target/107057
      	* config/i386/sse.md (*vec_interleave_highv2df): Remove
      	constraint 1.
      	(*vec_interleave_lowv2df): Ditto.
      	(vec_concatv2df): Ditto.
      	(*avx512f_unpcklpd512<mask_name>): Ditto and renamed to ..
      	(avx512f_unpcklpd512<mask_name>): .. this.
      	(avx512f_movddup512<mask_name>): Change to define_insn.
      	(avx_movddup256<mask_name>): Ditto.
      	(*avx_unpcklpd256<mask_name>): Remove constraint 1 and renamed
      	to ..
      	(avx_unpcklpd256<mask_name>): .. this.
      	* config/i386/i386.cc (ix86_vec_interleave_v2df_operator_ok):
      	Disallow MEM_P (op1) && MEM_P (op2).
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.target/i386/pr107057.c: New test.
      4acc4c2b
    • liuhongt's avatar
      Enable more optimization for 32-bit/64-bit shrd/shld with imm shift count. · 5c5ef2f9
      liuhongt authored
      This patch doens't handle variable count since it require 5 insns to
      be combined to get wanted pattern, but current pass_combine only
      supports at most 4.
      This patch doesn't handle 16-bit shrd/shld either.
      
      gcc/ChangeLog:
      
      	PR target/55583
      	* config/i386/i386.md (*x86_64_shld_1): Rename to ..
      	(x86_64_shld_1): .. this.
      	(*x86_shld_1): Rename to ..
      	(x86_shld_1): .. this.
      	(*x86_64_shrd_1): Rename to ..
      	(x86_64_shrd_1): .. this.
      	(*x86_shrd_1): Rename to ..
      	(x86_shrd_1): .. this.
      	(*x86_64_shld_shrd_1_nozext): New pre_reload splitter.
      	(*x86_shld_shrd_1_nozext): Ditto.
      	(*x86_64_shrd_shld_1_nozext): Ditto.
      	(*x86_shrd_shld_1_nozext): Ditto.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.target/i386/pr55583.c: New test.
      5c5ef2f9
    • Jason Merrill's avatar
      c++: pass std attributes to make_call_declarator · af6d747d
      Jason Merrill authored
      It seems preferable to pass these to the function rather than set them
      separately after the call.
      
      gcc/cp/ChangeLog:
      
      	* parser.cc (make_call_declarator): Add std_attrs parm.
      	(cp_parser_lambda_declarator_opt): Pass it.
      	(cp_parser_direct_declarator): Pass it.
      af6d747d
    • Jason Merrill's avatar
      c++: set TREE_NOTHROW after genericize · 43c40f11
      Jason Merrill authored
      genericize might introduce function calls (and does on the contracts
      branch), so it's safer to set this flag later.
      
      gcc/cp/ChangeLog:
      
      	* decl.cc (finish_function): Set TREE_NOTHROW later in the function.
      43c40f11
    • Jason Merrill's avatar
      c++: formatting tweaks · 6a1f27f4
      Jason Merrill authored
      gcc/cp/ChangeLog:
      
      	* decl.cc (duplicate_decls): Reformat loop.
      	* parser.cc (cp_parser_member_declaration): Add newline.
      	* semantics.cc: Remove newline.
      6a1f27f4
    • Cui,Lili's avatar
      Add attribute hot judgement for INLINE_HINT_known_hot hint. · 1b9a5cc9
      Cui,Lili authored
      We set up INLINE_HINT_known_hot hint only when we have profile feedback,
      now add function attribute judgement for it, when both caller and callee
      have __attribute__((hot)), we will also set up INLINE_HINT_known_hot hint
      for it.
      
      With this patch applied,
      ADL Multi-copy:    538.imagic_r  16.7%
      ICX Multi-copy:    538.imagic_r  15.2%
      CLX Multi-copy:    538.imagic_r  12.7%
      Znver3 Multi-copy: 538.imagic_r  10.6%
      Arm Multi-copy:    538.imagic_r  13.4%
      
      gcc/ChangeLog
      
      	* ipa-inline-analysis.cc (do_estimate_edge_time): Add function attribute
      	judgement for INLINE_HINT_known_hot hint.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.dg/ipa/inlinehint-6.c: New test.
      1b9a5cc9
    • GCC Administrator's avatar
      Daily bump. · 9a8b868d
      GCC Administrator authored
      9a8b868d
  2. Oct 31, 2022
    • Xiongchuan Tan's avatar
      RISC-V: Libitm add RISC-V support. · a3b58f28
      Xiongchuan Tan authored
      
      Reviewed-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
      Acked-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
      
      libitm/ChangeLog:
      
      	* configure.tgt: Add riscv support.
      	* config/riscv/asm.h: New file.
      	* config/riscv/sjlj.S: New file.
      	* config/riscv/target.h: New file.
      a3b58f28
    • Jakub Jelinek's avatar
      libstdc++-v3: <complex> support for extended floating point types · db55f1dd
      Jakub Jelinek authored
      The following patch adds <complex> support for extended floating point
      types.
      C++23 removes the float/double/long double specializations from the spec
      and instead adds explicit(bool) specifier on the converting constructor.
      The patch uses that for converting constructor of the base template as well
      as the float/double/long double specializations's converting constructors
      (e.g. so that it handles convertion construction also from complex of extended
      floating point types).  Copy ctor was already defaulted as the spec now
      requires.
      The patch also adds partial specialization for the _Float{16,32,64,128}
      and __gnu_cxx::__bfloat16_t types because the base template doesn't use
      __complex__ but a pair of floating point values.
      The g++.dg/cpp23/ testcase verifies explicit(bool) works correctly.
      
      2022-10-31  Jakub Jelinek  <jakub@redhat.com>
      
      gcc/testsuite/
      	* g++.dg/cpp23/ext-floating12.C: New test.
      libstdc++-v3/
      	* include/std/complex (complex::complex converting ctor): For C++23
      	use explicit specifier with constant expression.  Explicitly cast
      	both parts to _Tp.
      	(__complex_abs, __complex_arg, __complex_cos, __complex_cosh,
      	__complex_exp, __complex_log, __complex_sin, __complex_sinh,
      	__complex_sqrt, __complex_tan, __complex_tanh, __complex_pow): Add
      	__complex__ _Float{16,32,64,128} and __complex__ decltype(0.0bf16)
      	overloads.
      	(complex<float>::complex converting ctor,
      	complex<double>::complex converting ctor,
      	complex<long double>::complex converting ctor): For C++23 implement
      	as template with explicit specifier with constant expression
      	and explicit casts.
      	(__complex_type): New template.
      	(complex): New partial specialization for types with extended floating
      	point types.
      	(__complex_acos, __complex_asin, __complex_atan, __complex_acosh,
      	__complex_asinh, __complex_atanh): Add __complex__ _Float{16,32,64,128}
      	and __complex__ decltype(0.0bf16) overloads.
      	(__complex_proj): Likewise.  Add template for complex of extended
      	floating point types.
      	* include/bits/cpp_type_traits.h (__is_floating): Specialize for
      	_Float{16,32,64,128} and __gnu_cxx::__bfloat16_t.
      	* testsuite/26_numerics/complex/ext_c++23.cc: New test.
      db55f1dd
    • Guillermo E. Martinez's avatar
      btf: Add support to BTF_KIND_ENUM64 type · 8422861b
      Guillermo E. Martinez authored
      BTF supports 64-bits enumerators with following encoding:
      
        struct btf_type:
          name_off: 0 or offset to a valid C identifier
          info.kind_flag: 0 for unsigned, 1 for signed
          info.kind: BTF_KIND_ENUM64
          info.vlen: number of enum values
          size: 1/2/4/8
      
      The btf_type is followed by info.vlen number of:
      
          struct btf_enum64
          {
            uint32_t name_off;   /* Offset in string section of enumerator name.  */
            uint32_t val_lo32;   /* lower 32-bit value for a 64-bit value Enumerator */
            uint32_t val_hi32;   /* high 32-bit value for a 64-bit value Enumerator */
          };
      
      So, a new btf_enum64 structure was added to represent BTF_KIND_ENUM64
      and a new field dtd_enum_unsigned in ctf_dtdef structure to distinguish
      when CTF enum is a signed or unsigned type, later that information is
      used to encode the BTF enum type.
      
      gcc/ChangeLog:
      
      	* btfout.cc (btf_calc_num_vbytes): Compute enumeration size depending of
      	enumerator type btf_enum{,64}.
      	(btf_asm_type): Update btf_kflag according to enumeration type sign
      	using dtd_enum_unsigned field for both:  BTF_KIND_ENUM{,64}.
      	(btf_asm_enum_const): New argument to represent the size of
      	the BTF enum type, writing the enumerator constant value for
      	32 bits, if it's 64 bits then explicitly writes lower 32-bits
      	value and higher 32-bits value.
      	(output_asm_btf_enum_list): Add enumeration size argument.
      	* ctfc.cc (ctf_add_enum): New argument to represent CTF enum
      	basic information.
      	(ctf_add_generic): Use of ei_{name. size, unsigned} to build the
      	dtd structure containing enumeration information.
      	(ctf_add_enumerator): Update comment mention support for BTF
      	enumeration in 64-bits.
      	* dwarf2ctf.cc (gen_ctf_enumeration_type): Extract signedness
      	for enumeration type and use it in ctf_add_enum.
      	* ctfc.h (ctf_dmdef): Update dmd_value to HOST_WIDE_INT to allow
      	use 32/64 bits enumerators.
      	information.
      	(ctf_dtdef): New field to describe enum signedness.
      
      include/
      	* btf.h (btf_enum64): Add new definition and new symbolic
      	constant to BTF_KIND_ENUM64 and BTF_KF_ENUM_{UN,}SIGNED.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.dg/debug/btf/btf-enum-1.c: Update testcase, with correct
      	info.kflags encoding.
      	* gcc.dg/debug/btf/btf-enum64-1.c: New testcase.
      8422861b
    • Jakub Jelinek's avatar
      libstdc++: Small extended float support tweaks · cbf56503
      Jakub Jelinek authored
      The following patch
      1) enables the std::float128_t overloads for x86 with glibc 2.26+
      2) makes std::nextafter(std::float16_t, std::float16_t) and
         std::nextafter(std::bfloat16_t, std::bfloat16_t) constexpr
      3) adds (small) testsuite coverage for that
      
      2022-10-21  Jakub Jelinek  <jakub@redhat.com>
      
      	* config/os/gnu-linux/os_defines.h (_GLIBCXX_HAVE_FLOAT128_MATH):
      	Uncomment.
      	* include/c_global/cmath (nextafter(_Float16, _Float16)): Make it constexpr.
      	If std::__is_constant_evaluated() call __builtin_nextafterf16.
      	(nextafter(__gnu_cxx::__bfloat16_t, __gnu_cxx::__bfloat16_t)): Similarly
      	but call __builtin_nextafterf16b.
      	* testsuite/26_numerics/headers/cmath/nextafter_c++23.cc (test): Add
      	static assertions to test constexpr nextafter.
      cbf56503
    • Ju-Zhe Zhong's avatar
      RISC-V: Change constexpr back to CONSTEXPR · 1b07d374
      Ju-Zhe Zhong authored
      According to https://github.com/gcc-mirror/gcc/commit/f95d3d5de72a1c43e8d529bad3ef59afc3214705.
      Since GCC 4.8.6 doesn't support constexpr, we should change it back to CONSTEXPR.
      gcc/ChangeLog:
      
      	* config/riscv/riscv-vector-builtins-bases.cc: Change constexpr back to CONSTEXPR.
      	* config/riscv/riscv-vector-builtins-shapes.cc (SHAPE): Ditto.
      	* config/riscv/riscv-vector-builtins.cc (struct registered_function_hasher): Ditto.
      	* config/riscv/riscv-vector-builtins.h (struct rvv_arg_type_info): Ditto.
      1b07d374
    • Andrew Stubbs's avatar
      amdgcn: add fmin/fmax patterns · 10aa0356
      Andrew Stubbs authored
      Add fmin/fmax for scalar, vector, and reductions.  The smin/smax patterns are
      already using the IEEE compliant hardware instructions anyway, so we can just
      expand to use those insns.
      
      gcc/ChangeLog:
      
      	* config/gcn/gcn-valu.md (fminmaxop): New iterator.
      	(<fexpander><mode>3): New define_expand.
      	(<fexpander><mode>3<exec>): Likewise.
      	(reduc_<fexpander>_scal_<mode>): Likewise.
      	* config/gcn/gcn.md (fexpander): New attribute.
      10aa0356
    • Andrew Stubbs's avatar
      amdgcn: multi-size vector reductions · f539029c
      Andrew Stubbs authored
      Add support for vector reductions for any vector width by switching iterators
      and generalising the code slightly.  There's no one-instruction way to move an
      item from lane 31 to lane 0 (63, 15, 7, 3, and 1 are all fine though), and
      vec_extract is probably fewer cycles anyway, so now we always reduce to an
      SGPR.
      
      gcc/ChangeLog:
      
      	* config/gcn/gcn-valu.md (V64_SI): Delete iterator.
      	(V64_DI): Likewise.
      	(V64_1REG): Likewise.
      	(V64_INT_1REG): Likewise.
      	(V64_2REG): Likewise.
      	(V64_ALL): Likewise.
      	(V64_FP): Likewise.
      	(reduc_<reduc_op>_scal_<mode>): Use V_ALL. Use gen_vec_extract.
      	(fold_left_plus_<mode>): Use V_FP.
      	(*<reduc_op>_dpp_shr_<mode>): Use V_1REG.
      	(*<reduc_op>_dpp_shr_<mode>): Use V_DI.
      	(*plus_carry_dpp_shr_<mode>): Use V_INT_1REG.
      	(*plus_carry_in_dpp_shr_<mode>): Use V_SI.
      	(*plus_carry_dpp_shr_<mode>): Use V_DI.
      	(mov_from_lane63_<mode>): Delete.
      	(mov_from_lane63_<mode>): Delete.
      	* config/gcn/gcn.cc (gcn_expand_reduc_scalar): Support partial vectors.
      	* config/gcn/gcn.md (unspec): Remove UNSPEC_MOV_FROM_LANE63.
      f539029c
    • Andrew Stubbs's avatar
      amdgcn: Silence unused parameter warning · 12a10856
      Andrew Stubbs authored
      gcc/ChangeLog:
      
      	* config/gcn/gcn.cc (gcn_simd_clone_compute_vecsize_and_simdlen):
      	Set base_type as ARG_UNUSED.
      12a10856
    • Ramana Radhakrishnan's avatar
      Update email address · 7e06cfc1
      Ramana Radhakrishnan authored
      /
      	* MAINTAINERS: Update email address.
      7e06cfc1
    • Lulu Cheng's avatar
      Libvtv: Add loongarch support. · 27b9e115
      Lulu Cheng authored
      
      The loongarch64 specification permits page sizes of 4KiB, 16KiB and 64KiB,
      but only 16KiB pages are supported for now.
      
      Co-Authored-By: default avatarqijingwen <qijingwen@loongson.cn>
      
      include/ChangeLog:
      
      	* vtv-change-permission.h (defined): Determines whether the macro
      	__loongarch_lp64 is defined
      	(VTV_PAGE_SIZE): Set VTV_PAGE_SIZE to 16KiB for loongarch64.
      
      libvtv/ChangeLog:
      
      	* configure.tgt: Add loongarch support.
      27b9e115
    • Jakub Jelinek's avatar
      builtins: Add various complex builtins for _Float{16,32,64,128,32x,64x,128x} · 259a1155
      Jakub Jelinek authored
      The following patch adds some complex builtins which have libm
      implementation in glibc 2.26 and later on various arches.
      It is needed for libstdc++ _Float128 support when long double is not
      IEEE quad.
      
      2022-10-31  Jakub Jelinek  <jakub@redhat.com>
      
      	* builtin-types.def (BT_COMPLEX_FLOAT16, BT_COMPLEX_FLOAT32,
      	BT_COMPLEX_FLOAT64, BT_COMPLEX_FLOAT128, BT_COMPLEX_FLOAT32X,
      	BT_COMPLEX_FLOAT64X, BT_COMPLEX_FLOAT128X,
      	BT_FN_COMPLEX_FLOAT16_COMPLEX_FLOAT16,
      	BT_FN_COMPLEX_FLOAT32_COMPLEX_FLOAT32,
      	BT_FN_COMPLEX_FLOAT64_COMPLEX_FLOAT64,
      	BT_FN_COMPLEX_FLOAT128_COMPLEX_FLOAT128,
      	BT_FN_COMPLEX_FLOAT32X_COMPLEX_FLOAT32X,
      	BT_FN_COMPLEX_FLOAT64X_COMPLEX_FLOAT64X,
      	BT_FN_COMPLEX_FLOAT128X_COMPLEX_FLOAT128X,
      	BT_FN_FLOAT16_COMPLEX_FLOAT16, BT_FN_FLOAT32_COMPLEX_FLOAT32,
      	BT_FN_FLOAT64_COMPLEX_FLOAT64, BT_FN_FLOAT128_COMPLEX_FLOAT128,
      	BT_FN_FLOAT32X_COMPLEX_FLOAT32X, BT_FN_FLOAT64X_COMPLEX_FLOAT64X,
      	BT_FN_FLOAT128X_COMPLEX_FLOAT128X,
      	BT_FN_COMPLEX_FLOAT16_COMPLEX_FLOAT16_COMPLEX_FLOAT16,
      	BT_FN_COMPLEX_FLOAT32_COMPLEX_FLOAT32_COMPLEX_FLOAT32,
      	BT_FN_COMPLEX_FLOAT64_COMPLEX_FLOAT64_COMPLEX_FLOAT64,
      	BT_FN_COMPLEX_FLOAT128_COMPLEX_FLOAT128_COMPLEX_FLOAT128,
      	BT_FN_COMPLEX_FLOAT32X_COMPLEX_FLOAT32X_COMPLEX_FLOAT32X,
      	BT_FN_COMPLEX_FLOAT64X_COMPLEX_FLOAT64X_COMPLEX_FLOAT64X,
      	BT_FN_COMPLEX_FLOAT128X_COMPLEX_FLOAT128X_COMPLEX_FLOAT128X): New.
      	* builtins.def (CABS_TYPE, CACOSH_TYPE, CARG_TYPE, CASINH_TYPE,
      	CPOW_TYPE, CPROJ_TYPE): Define and undefine later.
      	(BUILT_IN_CABS, BUILT_IN_CACOSH, BUILT_IN_CACOS, BUILT_IN_CARG,
      	BUILT_IN_CASINH, BUILT_IN_CASIN, BUILT_IN_CATANH, BUILT_IN_CATAN,
      	BUILT_IN_CCOSH, BUILT_IN_CCOS, BUILT_IN_CEXP, BUILT_IN_CLOG,
      	BUILT_IN_CPOW, BUILT_IN_CPROJ, BUILT_IN_CSINH, BUILT_IN_CSIN,
      	BUILT_IN_CSQRT, BUILT_IN_CTANH, BUILT_IN_CTAN): Add
      	DEF_EXT_LIB_FLOATN_NX_BUILTINS.
      	* fold-const-call.cc (fold_const_call_sc, fold_const_call_cc,
      	fold_const_call_ccc): Add various CASE_CFN_*_FN: cases when
      	CASE_CFN_* is present.
      	* gimple-ssa-backprop.cc (backprop::process_builtin_call_use):
      	Likewise.
      	* builtins.cc (expand_builtin, fold_builtin_1): Likewise.
      	* fold-const.cc (negate_mathfn_p, tree_expr_finite_p,
      	tree_expr_maybe_signaling_nan_p, tree_expr_maybe_nan_p,
      	tree_expr_maybe_real_minus_zero_p, tree_call_nonnegative_warnv_p):
      	Likewise.
      259a1155
    • Jakub Jelinek's avatar
      builtins: Add __builtin_nextafterf16b builtin · 29490c2a
      Jakub Jelinek authored
      The following patch adds another needed builtin.
      The earlier patch adds among other things __builtin_nextafterf16
      builtin which we need in order to constexpr evaluate
      std::nextafter(_Float16) overload (patch for that has been posted already).
      While there is inline implementation of the overload, it isn't constant
      evaluation friendly, and the builtin doesn't need libm implementation
      because it will be used only during constant expression evaluation.
      We need the same thing also for std::nextafter(__gnu_cxx::__bfloat16_t)
      though and this patch does that.
      
      2022-10-31  Jakub Jelinek  <jakub@redhat.com>
      
      	* builtin-types.def (BT_FN_BFLOAT16_BFLOAT16_BFLOAT16): New.
      	* builtins.def (BUILT_IN_NEXTAFTERF16B): New builtin.
      	* fold-const-call.cc (fold_const_call_sss): Handle
      	CFN_BUILT_IN_NEXTAFTERF16B.
      29490c2a
    • Jakub Jelinek's avatar
      builtins: Add various __builtin_*f{16,32,64,128,32x,64x,128x} builtins · 7f940822
      Jakub Jelinek authored
      When working on libstdc++ extended float support in <cmath>, I found that
      we need various builtins for the _Float{16,32,64,128,32x,64x,128x} types.
      Glibc 2.26 and later provides the underlying libm routines (except for
      _Float16 and _Float128x for the time being) and in libstdc++ I think we
      need at least the _Float128 builtins on x86_64, i?86, powerpc64le and ia64
      (when long double is IEEE quad, we can handle it by using __builtin_*l
      instead), because without the builtins the overloads couldn't be constexpr
      (say when it would declare the *f128 extern "C" routines itself and call
      them).
      
      The testcase covers just types of those builtins and their constant
      folding, so doesn't need actual libm support.
      
      2022-10-31  Jakub Jelinek  <jakub@redhat.com>
      
      	* builtin-types.def (BT_FLOAT16_PTR, BT_FLOAT32_PTR, BT_FLOAT64_PTR,
      	BT_FLOAT128_PTR, BT_FLOAT32X_PTR, BT_FLOAT64X_PTR, BT_FLOAT128X_PTR):
      	New DEF_PRIMITIVE_TYPE.
      	(BT_FN_INT_FLOAT16, BT_FN_INT_FLOAT32, BT_FN_INT_FLOAT64,
      	BT_FN_INT_FLOAT128, BT_FN_INT_FLOAT32X, BT_FN_INT_FLOAT64X,
      	BT_FN_INT_FLOAT128X, BT_FN_LONG_FLOAT16, BT_FN_LONG_FLOAT32,
      	BT_FN_LONG_FLOAT64, BT_FN_LONG_FLOAT128, BT_FN_LONG_FLOAT32X,
      	BT_FN_LONG_FLOAT64X, BT_FN_LONG_FLOAT128X, BT_FN_LONGLONG_FLOAT16,
      	BT_FN_LONGLONG_FLOAT32, BT_FN_LONGLONG_FLOAT64,
      	BT_FN_LONGLONG_FLOAT128, BT_FN_LONGLONG_FLOAT32X,
      	BT_FN_LONGLONG_FLOAT64X, BT_FN_LONGLONG_FLOAT128X): New
      	DEF_FUNCTION_TYPE_1.
      	(BT_FN_FLOAT16_FLOAT16_FLOAT16PTR, BT_FN_FLOAT32_FLOAT32_FLOAT32PTR,
      	BT_FN_FLOAT64_FLOAT64_FLOAT64PTR, BT_FN_FLOAT128_FLOAT128_FLOAT128PTR,
      	BT_FN_FLOAT32X_FLOAT32X_FLOAT32XPTR,
      	BT_FN_FLOAT64X_FLOAT64X_FLOAT64XPTR,
      	BT_FN_FLOAT128X_FLOAT128X_FLOAT128XPTR, BT_FN_FLOAT16_FLOAT16_INT,
      	BT_FN_FLOAT32_FLOAT32_INT, BT_FN_FLOAT64_FLOAT64_INT,
      	BT_FN_FLOAT128_FLOAT128_INT, BT_FN_FLOAT32X_FLOAT32X_INT,
      	BT_FN_FLOAT64X_FLOAT64X_INT, BT_FN_FLOAT128X_FLOAT128X_INT,
      	BT_FN_FLOAT16_FLOAT16_INTPTR, BT_FN_FLOAT32_FLOAT32_INTPTR,
      	BT_FN_FLOAT64_FLOAT64_INTPTR, BT_FN_FLOAT128_FLOAT128_INTPTR,
      	BT_FN_FLOAT32X_FLOAT32X_INTPTR, BT_FN_FLOAT64X_FLOAT64X_INTPTR,
      	BT_FN_FLOAT128X_FLOAT128X_INTPTR, BT_FN_FLOAT16_FLOAT16_LONG,
      	BT_FN_FLOAT32_FLOAT32_LONG, BT_FN_FLOAT64_FLOAT64_LONG,
      	BT_FN_FLOAT128_FLOAT128_LONG, BT_FN_FLOAT32X_FLOAT32X_LONG,
      	BT_FN_FLOAT64X_FLOAT64X_LONG, BT_FN_FLOAT128X_FLOAT128X_LONG): New
      	DEF_FUNCTION_TYPE_2.
      	(BT_FN_FLOAT16_FLOAT16_FLOAT16_INTPTR,
      	BT_FN_FLOAT32_FLOAT32_FLOAT32_INTPTR,
      	BT_FN_FLOAT64_FLOAT64_FLOAT64_INTPTR,
      	BT_FN_FLOAT128_FLOAT128_FLOAT128_INTPTR,
      	BT_FN_FLOAT32X_FLOAT32X_FLOAT32X_INTPTR,
      	BT_FN_FLOAT64X_FLOAT64X_FLOAT64X_INTPTR,
      	BT_FN_FLOAT128X_FLOAT128X_FLOAT128X_INTPTR): New DEF_FUNCTION_TYPE_3.
      	* builtins.def (ACOSH_TYPE, ATAN2_TYPE, ATANH_TYPE, COSH_TYPE,
      	FDIM_TYPE, HUGE_VAL_TYPE, HYPOT_TYPE, ILOGB_TYPE, LDEXP_TYPE,
      	LGAMMA_TYPE, LLRINT_TYPE, LOG10_TYPE, LRINT_TYPE, MODF_TYPE,
      	NEXTAFTER_TYPE, REMQUO_TYPE, SCALBLN_TYPE, SCALBN_TYPE, SINH_TYPE):
      	Define and undefine later.
      	(FMIN_TYPE, SQRT_TYPE): Undefine at a later line.
      	(INF_TYPE): Define at a later line.
      	(BUILT_IN_ACOSH, BUILT_IN_ACOS, BUILT_IN_ASINH, BUILT_IN_ASIN,
      	BUILT_IN_ATAN2, BUILT_IN_ATANH, BUILT_IN_ATAN, BUILT_IN_CBRT,
      	BUILT_IN_COSH, BUILT_IN_COS, BUILT_IN_ERFC, BUILT_IN_ERF,
      	BUILT_IN_EXP2, BUILT_IN_EXP, BUILT_IN_EXPM1, BUILT_IN_FDIM,
      	BUILT_IN_FMOD, BUILT_IN_FREXP, BUILT_IN_HYPOT, BUILT_IN_ILOGB,
      	BUILT_IN_LDEXP, BUILT_IN_LGAMMA, BUILT_IN_LLRINT, BUILT_IN_LLROUND,
      	BUILT_IN_LOG10, BUILT_IN_LOG1P, BUILT_IN_LOG2, BUILT_IN_LOGB,
      	BUILT_IN_LOG, BUILT_IN_LRINT, BUILT_IN_LROUND, BUILT_IN_MODF,
      	BUILT_IN_NEXTAFTER, BUILT_IN_POW, BUILT_IN_REMAINDER, BUILT_IN_REMQUO,
      	BUILT_IN_SCALBLN, BUILT_IN_SCALBN, BUILT_IN_SINH, BUILT_IN_SIN,
      	BUILT_IN_TANH, BUILT_IN_TAN, BUILT_IN_TGAMMA): Add
      	DEF_EXT_LIB_FLOATN_NX_BUILTINS.
      	(BUILT_IN_HUGE_VAL): Use HUGE_VAL_TYPE instead of INF_TYPE in
      	DEF_GCC_FLOATN_NX_BUILTINS.
      	* fold-const-call.cc (fold_const_call_ss): Add various CASE_CFN_*_FN:
      	cases when CASE_CFN_* is present.
      	(fold_const_call_sss): Likewise.
      	* builtins.cc (mathfn_built_in_2): Use CASE_MATHFN_FLOATN instead of
      	CASE_MATHFN for various builtins in SEQ_OF_CASE_MATHFN macro.
      	(builtin_with_linkage_p): Add CASE_FLT_FN_FLOATN_NX for various
      	builtins next to CASE_FLT_FN.
      	* fold-const.cc (tree_call_nonnegative_warnv_p): Add CASE_CFN_*_FN:
      	next to CASE_CFN_*: for various builtins.
      	* tree-call-cdce.cc (can_test_argument_range): Add
      	CASE_FLT_FN_FLOATN_NX next to CASE_FLT_FN for various builtins.
      	(edom_only_function): Likewise.
      
      	* gcc.dg/torture/floatn-builtin.h: Add tests for newly added builtins.
      7f940822
    • konglin1's avatar
      Support Intel AVX-NE-CONVERT · 58685b93
      konglin1 authored
      gcc/ChangeLog:
      
      	* common/config/i386/i386-common.cc
      	(OPTION_MASK_ISA2_AVXNECONVERT_SET,
      	OPTION_MASK_ISA2_AVXNECONVERT_UNSET): New.
      	(ix86_handle_option): Handle -mavxneconvert, unset
      	avxneconvert when avx2 is disabled.
      	* common/config/i386/i386-cpuinfo.h (processor_types): Add
      	FEATURE_AVXNECONVERT.
      	* common/config/i386/i386-isas.h: Add ISA_NAME_TABLE_ENTRY for
      	avxneconvert.
      	* common/config/i386/cpuinfo.h (get_available_features):
      	Detect avxneconvert.
      	* config.gcc: Add avxneconvertintrin.h
      	* config/i386/avxneconvertintrin.h: New.
      	* config/i386/avx512bf16vlintrin.h (_mm256_cvtneps_pbh):
      	Unified builtin with avxneconvert.
      	(_mm_cvtneps_pbh): Ditto.
      	* config/i386/cpuid.h (bit_AVXNECONVERT): New.
      	* config/i386/i386-builtin-types.def: Add
      	DEF_POINTER_TYPE (PCV8HF, V8HF, CONST),
      	DEF_POINTER_TYPE (PCV8BF, V8BF, CONST),
      	DEF_POINTER_TYPE (PCV16HF, V16HF, CONST),
      	DEF_POINTER_TYPE (PCV16BF, V16BF, CONST),
      	DEF_FUNCTION_TYPE (V4SF, PCBFLOAT16),
      	DEF_FUNCTION_TYPE (V4SF, PCFLOAT16),
      	DEF_FUNCTION_TYPE (V8SF, PCBFLOAT16),
      	DEF_FUNCTION_TYPE (V8SF, PCFLOAT16),
      	DEF_FUNCTION_TYPE (V4SF, PCV8BF),
      	DEF_FUNCTION_TYPE (V4SF, PCV8HF),
      	DEF_FUNCTION_TYPE (V8SF, PCV16HF),
      	DEF_FUNCTION_TYPE (V8SF, PCV16BF),
      	* config/i386/i386-builtin.def: Add new builtins.
      	* config/i386/i386-c.cc (ix86_target_macros_internal): Define
      	__AVXNECONVERT__.
      	* config/i386/i386-expand.cc (ix86_expand_special_args_builtin):
      	Handle V4SF_FTYPE_PCBFLOAT16,V8SF_FTYPE_PCBFLOAT16, V4SF_FTYPE_PCFLOAT16,
      	V8SF_FTYPE_PCFLOAT16,V4SF_FTYPE_PCV8BF,
      	V4SF_FTYPE_PCV8HF,V8SF_FTYPE_PCV16BF,V8SF_FTYPE_PCV16HF.
      	* config/i386/i386-isa.def : Add DEF_PTA(AVXNECONVERT) New.
      	* config/i386/i386-options.cc (isa2_opts): Add -mavxneconvert.
      	(ix86_valid_target_attribute_inner_p): Handle avxneconvert.
      	* config/i386/i386.md: Add attr avx512bf16vl and avxneconvert.
      	* config/i386/i386.opt: Add option -mavxneconvert.
      	* config/i386/immintrin.h: Inculde avxneconvertintrin.h.
      	* config/i386/sse.md (vbcstnebf162ps_<mode>): New define_insn.
      	(vbcstnesh2ps_<mode>): Ditto.
      	(vcvtnee<bf16_ph>2ps_<mode>):Ditto.
      	(vcvtneo<bf16_ph>2ps_<mode>):Ditto.
      	(vcvtneps2bf16_v4sf): Ditto.
      	(*vcvtneps2bf16_v4sf): Ditto.
      	(vcvtneps2bf16_v8sf): Ditto.
      	* doc/invoke.texi: Document -mavxneconvert.
      	* doc/extend.texi: Document avxneconvert.
      	* doc/sourcebuild.texi: Document target avxneconvert.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.target/i386/avx-check.h: Add avxneconvert check.
      	* gcc.target/i386/funcspec-56.inc: Add new target attribute.
      	* gcc.target/i386/sse-12.c: Add -mavxneconvert.
      	* gcc.target/i386/sse-13.c: Ditto.
      	* gcc.target/i386/sse-14.c: Ditto.
      	* gcc.target/i386/sse-22.c: Ditto.
      	* gcc.target/i386/sse-23.c: Ditto.
      	* g++.dg/other/i386-2.C: Ditto.
      	* g++.dg/other/i386-3.C: Ditto.
      	* lib/target-supports.exp:add check_effective_target_avxneconvert.
      	* gcc.target/i386/avx-ne-convert-1.c: New test.
      	* gcc.target/i386/avx-ne-convert-vbcstnebf162ps-2.c: Ditto.
      	* gcc.target/i386/avx-ne-convert-vbcstnesh2ps-2.c: Ditto.
      	* gcc.target/i386/avx-ne-convert-vcvtneebf162ps-2.c: Ditto.
      	* gcc.target/i386/avx-ne-convert-vcvtneeph2ps-2.c: Ditto.
      	* gcc.target/i386/avx-ne-convert-vcvtneobf162ps-2.c: Ditto.
      	* gcc.target/i386/avx-ne-convert-vcvtneoph2ps-2.c: Ditto.
      	* gcc.target/i386/avx-ne-convert-vcvtneps2bf16-2.c: Ditto.
      	* gcc.target/i386/avx512bf16vl-vcvtneps2bf16-1.c: Rename..
      	* gcc.target/i386/avx512bf16vl-vcvtneps2bf16-1a.c: To this.
      	* gcc.target/i386/avx512bf16vl-vcvtneps2bf16-1b.c: New test.
      58685b93
    • konglin1's avatar
      i386:: using __bf16 for AVX512BF16 intrinsics · 87235f1e
      konglin1 authored
      gcc/ChangeLog:
      
      	* config/i386/avx512bf16intrin.h (__attribute__): Change short to bf16.
      	(_mm_cvtsbh_ss): Ditto.
      	(_mm512_cvtne2ps_pbh): Ditto.
      	(_mm512_mask_cvtne2ps_pbh): Ditto.
      	(_mm512_maskz_cvtne2ps_pbh): Ditto.
      	* config/i386/avx512bf16vlintrin.h (__attribute__): Ditto.
      	(_mm256_cvtne2ps_pbh): Ditto.
      	(_mm256_mask_cvtne2ps_pbh): Ditto.
      	(_mm256_maskz_cvtne2ps_pbh): Ditto.
      	(_mm_cvtne2ps_pbh): Ditto.
      	(_mm_mask_cvtne2ps_pbh): Ditto.
      	(_mm_maskz_cvtne2ps_pbh): Ditto.
      	(_mm_cvtness_sbh): Ditto.
      	* config/i386/i386-builtin-types.def (V8BF): Add new
      	DEF_VECTOR_TYPE for BFmode.
      	(V16BF): Ditto.
      	(V32BF): Ditto.
      	* config/i386/i386-builtin.def (BDESC): Fixed builtins.
      	* config/i386/i386-expand.cc (ix86_expand_args_builtin): Changed
      	avx512bf16 ix86_builtin_func_type included HI to BF.
      	* config/i386/immintrin.h: Add SSE2 depend for avx512bf16.
      	* config/i386/sse.md (TARGET_AVX512VL): Changed HI vector to BF
      	vector.
      	(avx512f_cvtneps2bf16_v4sf): New define_expand.
      	(*avx512f_cvtneps2bf16_v4sf): New define_insn.
      	(avx512f_cvtneps2bf16_v4sf_maskz):Ditto.
      	(avx512f_cvtneps2bf16_v4sf_mask): Ditto.
      	(avx512f_cvtneps2bf16_v4sf_mask_1): Ditto.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.target/i386/avx512bf16-cvtsbh2ss-1.c: Add fpmath option.
      	* gcc.target/i386/avx512bf16-vdpbf16ps-2.c: Fixed
      	scan-assembler.
      	* gcc.target/i386/avx512bf16vl-cvtness2sbh-1.c: Add x/y suffix
      	for vcvtneps2bf16.
      	* gcc.target/i386/avx512bf16vl-vcvtneps2bf16-1.c: Ditto.
      87235f1e
    • liuhongt's avatar
      Enable V4BFmode and V2BFmode. · 6913cad2
      liuhongt authored
      Enable V4BFmode and V2BFmode with the same ABI as V4HFmode and
      V2HFmode. No real operation is supported for them except for movement.
      This should solve PR target/107261.
      
      Also I notice there's redundancy in VALID_AVX512FP16_REG_MODE, and
      remove V2BFmode remove it.
      
      gcc/ChangeLog:
      
      	PR target/107261
      	* config/i386/i386-modes.def (VECTOR_MODE): Support V2BFmode.
      	* config/i386/i386.cc (classify_argument): Handle V4BFmode and
      	V2BFmode.
      	(ix86_convert_const_vector_to_integer): Ditto.
      	* config/i386/i386.h (VALID_AVX512FP16_REG_MODE): Remove
      	V2BFmode.
      	(VALID_SSE2_REG_MODE): Add V4BFmode and V2BFmode.
      	(VALID_MMX_REG_MODE): Add V4BFmode.
      	* config/i386/i386.md (mode): Add V4BF and V2BF.
      	(MODE_SIZE): Ditto.
      	* config/i386/mmx.md (MMXMODE) Add V4BF.
      	(V_32): Add V2BF.
      	(V_16_32_64): Add V4BF and V2BF.
      	(mmxinsnmode): Add V4BF and V2BF.
      	(*mov<mode>_internal): Hanlde V4BFmode and V2BFmode.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.target/i386/pr107261.c: New test.
      6913cad2
    • GCC Administrator's avatar
      Daily bump. · da5e8844
      GCC Administrator authored
      da5e8844
  3. Oct 30, 2022
  4. Oct 29, 2022
    • Eric Botcazou's avatar
      Repair --disable-sjlj-exceptions · 7f067400
      Eric Botcazou authored
      It was broken by:
      
      	2022-08-31  Martin Liska  <mliska@suse.cz>
      
      	config.build: Remove deprecated ports.
      	config.gcc: Likewise.
      	config.host: Likewise.
      	configure.ac: Likewise.
      	configure: Regenerate.
      	config/pa/pa-hpux10.h: Removed.
      	config/pa/pa-hpux10.opt: Removed.
      	config/pa/t-dce-thr: Removed.
      
      gcc/
      	* configure.ac (sjlj-exceptions): Restore dropped line.
      	* configure: Regenerate.
      7f067400
    • Eric Botcazou's avatar
      Restore RTL alias analysis for hard frame pointer · 96ba0c36
      Eric Botcazou authored
      The change:
      
      	2021-07-28  Bin Cheng  <bin.cheng@linux.alibaba.com>
      
      	alias.c (init_alias_analysis): Don't skip prologue/epilogue.
      
      broke the alias analysis for the hard frame pointer (when it is used as a
      frame pointer, i.e. when the frame pointer is not eliminated) described in
      the large comment at the top of the file, because static_reg_base_value is
      set for it and, consequently, new_reg_base_value too.
      
      When the instruction saving the stack pointer into the hard frame pointer in
      the prologue is processed, it is viewed as a second set of the hard frame
      pointer and to a different value by record_set, which then proceeds to reset
      new_reg_base_value to 0 and the game is over.
      
      gcc/
      	* alias.cc (init_alias_analysis): Do not record sets to the hard
      	frame pointer if the frame pointer has not been eliminated.
      96ba0c36
    • Iain Buclaw's avatar
      d: Merge upstream dmd, druntime e4f8919591, phobos 3ad507b51. · 7e7ebe3e
      Iain Buclaw authored
      D front-end changes:
      
          - Import dmd v2.101.0-beta.1.
          - Add predefined version `D_Optimized' when compiling with `-O'.
          - Shortened method syntax (DIP1043) is now enabled by default.
          - Array literals assigned to `scope' array variables are now
            allocated on the stack.
          - Implement `@system' variables (DIP1035), available behind the
            preview feature flag `-fpreview=systemvariables'.
      
      D runtime changes:
      
          - Import druntime v2.101.0-beta.1.
      
      Phobos changes:
      
          - Import phobos v2.101.0-beta.1.
          - Added `std.typecons.SafeRefCounted', that can be used in `@safe'
            code with `-fpreview=dip1000'.
      
      gcc/d/ChangeLog:
      
      	* d-attribs.cc (apply_user_attributes): Update for new front-end
      	interface.
      	* d-builtins.cc (d_init_versions): Predefine `D_Optimized' with
      	compiling with optimizations enabled.
      	* d-lang.cc (d_handle_option): Update for new front-end interface.
      	Handle new option `-fpreview=systemvariables'.
      	* dmd/MERGE: Merge upstream dmd e4f8919591.
      	* dmd/VERSION: Bump version to v2.101.0-beta.1.
      	* expr.cc (ExprVisitor::visit (AssignExp *)): Treat construction of
      	static arrays from a call expression as a simple assignment.
      	(ExprVisitor::visit (ArrayLiteralExp *)): Handle array literals with
      	`scope' storage.
      	* gdc.texi: Update documentation of `-fpreview=' options.
      	* lang.opt (fpreview=shortenedmethods): Remove.
      	(fpreview=systemvariables):  New option.
      
      libphobos/ChangeLog:
      
      	* libdruntime/MERGE: Merge upstream druntime e4f8919591.
      	* src/MERGE: Merge upstream phobos 3ad507b51.
      
      gcc/testsuite/ChangeLog:
      
      	* gdc.dg/simd19630.d: Move tests with errors to ...
      	* gdc.dg/simd19630b.d: ... here.  New test.
      	* gdc.dg/simd19630c.d: New test.
      	* gdc.dg/simd_ctfe.d: Removed.
      	* gdc.dg/simd18867.d: New test.
      	* gdc.dg/simd19788.d: New test.
      	* gdc.dg/simd21469.d: New test.
      	* gdc.dg/simd21672.d: New test.
      	* gdc.dg/simd23077.d: New test.
      	* gdc.dg/simd23084.d: New test.
      	* gdc.dg/simd23085.d: New test.
      	* gdc.dg/torture/simd19632.d: New test.
      	* gdc.dg/torture/simd20041.d: New test.
      	* gdc.dg/torture/simd21673.d: New test.
      	* gdc.dg/torture/simd21676.d: New test.
      	* gdc.dg/torture/simd22438.d: New test.
      	* gdc.dg/torture/simd23009.d: New test.
      	* gdc.dg/torture/simd23077.d: New test.
      	* gdc.dg/torture/simd8.d: New test.
      	* gdc.dg/torture/simd9.d: New test.
      	* gdc.dg/torture/simd_prefetch.d: New test.
      7e7ebe3e
    • Thomas Schwinge's avatar
      Better separate 'LTO' vs. 'LTODump' in 'gcc/lto/lang.opt' · cfd85418
      Thomas Schwinge authored
      Minor clean-up after Subversion r270897 (Git
      commit 66d62d9f) "Add lto-dump tool".
      
      No change in generated files.
      
      	gcc/lto/
      	* lang.opt: Better separate 'LTO' vs. 'LTODump'.
      cfd85418
    • Iain Buclaw's avatar
      d: Make TARGET_D_MINFO_SECTION hooks in elfos.h the language default. · eaa59f08
      Iain Buclaw authored
      Removes the last of all TARGET_D_* macro definitions in common target
      headers.  Now everything is either defined in the D language front-end,
      or D-specific target headers.
      
      gcc/ChangeLog:
      
      	* config/darwin-d.cc (TARGET_D_MINFO_START_NAME): Rename to ...
      	(TARGET_D_MINFO_SECTION_START): ...this.
      	(TARGET_D_MINFO_END_NAME): Rename to ...
      	(TARGET_D_MINFO_SECTION_END): ... this.
      	* config/elfos.h (TARGET_D_MINFO_SECTION): Remove.
      	(TARGET_D_MINFO_START_NAME): Remove.
      	(TARGET_D_MINFO_END_NAME): Remove.
      	* config/i386/cygwin-d.cc (TARGET_D_MINFO_SECTION): Remove.
      	(TARGET_D_MINFO_START_NAME): Remove.
      	(TARGET_D_MINFO_END_NAME): Remove.
      	* config/i386/winnt-d.cc (TARGET_D_MINFO_SECTION): Remove.
      	(TARGET_D_MINFO_START_NAME): Remove.
      	(TARGET_D_MINFO_END_NAME): Remove.
      	* doc/tm.texi: Regenerate.
      	* doc/tm.texi.in (TARGET_D_MINFO_START_NAME): Rename to ...
      	(TARGET_D_MINFO_SECTION_START): ...this.
      	(TARGET_D_MINFO_END_NAME): Rename to ...
      	(TARGET_D_MINFO_SECTION_END): ...this.
      
      gcc/d/ChangeLog:
      
      	* d-target.def (d_minfo_section): Expand documentation of hook.
      	Default initialize to "minfo".
      	(d_minfo_start_name): Rename to ...
      	(d_minfo_section_start): ... this.  Default initialize to
      	"__start_minfo".
      	(d_minfo_end_name): Rename to ...
      	(d_minfo_section_end): ... this. Default initialize to "__stop_minfo".
      	* modules.cc (register_moduleinfo): Use new targetdm hook names.
      eaa59f08
    • Iain Buclaw's avatar
      d: Remove D-specific version definitions from target headers · ca652f86
      Iain Buclaw authored
      This splits up the targetdm sources so that each file only handles one
      target platform.
      
      Having all logic kept in the headers means that they could become out of
      sync when a new target is added (loongarch*-*-linux*) or accidentally
      broken if some headers in tm_file are changed about.
      
      gcc/ChangeLog:
      
      	* config.gcc: Split out glibc-d.o into linux-d.o, kfreebsd-d.o,
      	kopensolaris-d.o, and gnu-d.o.  Split out cygwin-d.o from winnt-d.o.
      	* config/arm/linux-eabi.h (EXTRA_TARGET_D_OS_VERSIONS): Remove.
      	* config/gnu.h (GNU_USER_TARGET_D_OS_VERSIONS): Remove.
      	* config/i386/cygwin.h (EXTRA_TARGET_D_OS_VERSIONS): Remove.
      	* config/i386/linux-common.h (EXTRA_TARGET_D_OS_VERSIONS): Remove.
      	* config/i386/mingw32.h (EXTRA_TARGET_D_OS_VERSIONS): Remove.
      	* config/i386/t-cygming: Add cygwin-d.o.
      	* config/i386/winnt-d.cc (winnt_d_os_builtins): Only add
      	MinGW-specific version condition.
      	* config/kfreebsd-gnu.h (GNU_USER_TARGET_D_OS_VERSIONS): Remove.
      	* config/kopensolaris-gnu.h (GNU_USER_TARGET_D_OS_VERSIONS): Remove.
      	* config/linux-android.h (ANDROID_TARGET_D_OS_VERSIONS): Remove.
      	* config/linux.h (GNU_USER_TARGET_D_OS_VERSIONS): Remove.
      	* config/mips/linux-common.h (EXTRA_TARGET_D_OS_VERSIONS): Remove.
      	* config/t-glibc: Remove glibc-d.o, add gnu-d.o, kfreebsd-d.o,
      	kopensolaris-d.o.
      	* config/t-linux: Add linux-d.o.
      	* config/glibc-d.cc: Remove file.
      	* config/gnu-d.cc: New file.
      	* config/i386/cygwin-d.cc: New file.
      	* config/kfreebsd-d.cc: New file.
      	* config/kopensolaris-d.cc: New file.
      	* config/linux-d.cc: New file.
      ca652f86
    • Jeff Law's avatar
      Fix signed vs unsigned issue in H8 port · 724d3f92
      Jeff Law authored
      gcc/
      	* config/h8300/h8300.cc (pre_incdec_with_reg): Make reg argument
      	an unsigned int
      	* config/h8300/h8300-protos.h (pre_incdec_with_reg): Adjust prototype.
      724d3f92
    • GCC Administrator's avatar
      Daily bump. · 3055829a
      GCC Administrator authored
      3055829a
  5. Oct 28, 2022
    • Jonathan Wakely's avatar
      libstdc++: Fix dangling reference in filesystem::path::filename() · 49237fe6
      Jonathan Wakely authored
      The new -Wdangling-reference warning noticed this.
      
      libstdc++-v3/ChangeLog:
      
      	* include/bits/fs_path.h (path::filename()): Fix dangling
      	reference.
      49237fe6
    • Arsen Arsenović's avatar
      libstdc++: Make placeholders inline when inline variables are available · b80f25a3
      Arsen Arsenović authored
      This slightly lowers the dependency of generated code on libstdc++.so.
      
      libstdc++-v3/ChangeLog:
      
      	* include/std/functional: Make placeholders inline, if possible.
      b80f25a3
    • Arsen Arsenović's avatar
      libstdc++: Don't use gstdint.h anymore · 655271e4
      Arsen Arsenović authored
      libstdc++-v3/ChangeLog:
      
      	* configure.ac: Stop generating gstdint.h.
      	* src/c++11/compatibility-atomic-c++0x.cc: Stop using gstdint.h.
      	* Makefile.in: Regenerate.
      	* aclocal.m4: Regenerate.
      	* config.h.in: Regenerate.
      	* configure: Regenerate.
      	* doc/Makefile.in: Regenerate.
      	* include/Makefile.in: Regenerate.
      	* libsupc++/Makefile.in: Regenerate.
      	* po/Makefile.in: Regenerate.
      	* python/Makefile.in: Regenerate.
      	* src/Makefile.in: Regenerate.
      	* src/c++11/Makefile.in: Regenerate.
      	* src/c++17/Makefile.in: Regenerate.
      	* src/c++20/Makefile.in: Regenerate.
      	* src/c++98/Makefile.in: Regenerate.
      	* src/filesystem/Makefile.in: Regenerate.
      	* src/libbacktrace/Makefile.in: Regenerate.
      	* testsuite/Makefile.in: Regenerate.
      655271e4
    • Marek Polacek's avatar
      c++: -Wdangling-reference and system headers · e583c86f
      Marek Polacek authored
      I got this testcase:
      
        auto f() -> std::optional<std::string>;
        for (char c : f().value()) { }
      
      which has a dangling reference: std::optional<T>::value returns
      a reference to the contained value, but here it's the f() temporary.
      We warn, which is great, but only with -Wsystem-headers, because
      the function comes from a system header and warning_enabled_at used
      in do_warn_dangling_reference checks diagnostic_report_warnings_p,
      which in this case returned false so we didn't warn.
      
      Fixed as below.  I could also override dc_warn_system_headers so that
      the warning is enabled in system headers always.  With that, I found one
      issue in libstdc++:
      
      libstdc++-v3/include/bits/fs_path.h:1265:15: warning: possibly dangling reference to a temporary [-Wdangling-reference]
       1265 |         auto& __last = *--end();
            |               ^~~~~~
      
      which looks like a true positive as well.
      
      gcc/cp/ChangeLog:
      
      	* call.cc (maybe_warn_dangling_reference): Enable the warning in
      	system headers if the decl isn't in a system header.
      
      gcc/testsuite/ChangeLog:
      
      	* g++.dg/warn/Wdangling-reference4.C: New test.
      e583c86f
    • Jason Merrill's avatar
      c++: apply friend attributes sooner · 38a628f5
      Jason Merrill authored
      Comparing attributes between declarations of a friend function has been
      complicated by pushdecl happening before decl_attributes.  I assumed there
      was some complicated reason we weren't calling decl_attributes here, but it
      doesn't break anything.
      
      gcc/cp/ChangeLog:
      
      	* decl.cc (grokdeclarator): Call decl_attributes before do_friend.
      38a628f5
Loading