Skip to content
Snippets Groups Projects
  1. Jul 26, 2023
    • Uros Bizjak's avatar
      testsuite: Fix gfortran.dg/ieee/comparisons_3.F90 testsuite failures · c194a413
      Uros Bizjak authored
      The testcase should use dg-additional-options istead of dg-options to
      not overwrite default compile flags that include path for finding
      the IEEE modules.
      
      gcc/testsuite/ChangeLog:
      
      	* gfortran.dg/ieee/comparisons_3.F90: Use dg-additional-options
      	instead of dg-options.
      c194a413
    • Richard Biener's avatar
      tree-optimization/106081 - elide redundant permute · 5d09fb68
      Richard Biener authored
      The following patch makes sure to elide a redundant permute that
      can be merged with existing splats represented as load permutations
      as we now do for non-grouped SLP loads.  This is the last bit
      missing to fix this PR where the main fix was already done by
      r14-2117-gdd86a5a69cbda4
      
      	PR tree-optimization/106081
      	* tree-vect-slp.cc (vect_optimize_slp_pass::start_choosing_layouts):
      	Assign layout -1 to splats.
      
      	* gcc.dg/vect/pr106081.c: New testcase.
      5d09fb68
    • Siddhesh Poyarekar's avatar
      testsuite/110763: Ensure zero return from test · 386df7ce
      Siddhesh Poyarekar authored
      
      The test deliberately reads beyond bounds to exersize ubsan and the
      return value may be anything, based on previous allocations.  The OFF
      test caters for it by ANDing the return with 0, do the same for the DYN
      test.
      
      gcc/testsuite/ChangeLog:
      
      	PR testsuite/110763
      	* gcc.dg/ubsan/object-size-dyn.c (dyn): New parameter RET.
      	(main): Use it.
      
      Signed-off-by: default avatarSiddhesh Poyarekar <siddhesh@gotplt.org>
      386df7ce
    • Aldy Hernandez's avatar
      [range-ops] Remove special case for handling bitmasks in casts. · 8605bd93
      Aldy Hernandez authored
      Now that we can generically handle bitmasks for unary operators,
      there's no need to special case them.
      
      gcc/ChangeLog:
      
      	* range-op-mixed.h (class operator_cast): Add update_bitmask.
      	* range-op.cc (operator_cast::update_bitmask): New.
      	(operator_cast::fold_range): Call update_bitmask.
      8605bd93
    • Li Xu's avatar
      RISC-V: Fix vector tuple intrinsic · adbac207
      Li Xu authored
      Consider this following case:
      void test_vsoxseg3ei32_v_i32mf2x3(int32_t *base, vuint32mf2_t bindex, vint32mf2x3_t v_tuple, size_t vl) {
        return __riscv_vsoxseg3ei32_v_i32mf2x3(base, bindex, v_tuple, vl);
      }
      
      Compiler failed with:
      test.c:19:1: internal compiler error: in vl_vtype_info, at config/riscv/riscv-vsetvl.cc:1679
         19 | }
            | ^
      0x1439ec2 riscv_vector::vl_vtype_info::vl_vtype_info(riscv_vector::avl_info, unsigned char, riscv_vector::vlmul_type, unsigned char, bool, bool)
              ../.././riscv-gcc/gcc/config/riscv/riscv-vsetvl.cc:1679
      0x143f788 get_vl_vtype_info
              ../.././riscv-gcc/gcc/config/riscv/riscv-vsetvl.cc:807
      0x143f788 riscv_vector::vector_insn_info::parse_insn(rtl_ssa::insn_info*)
              ../.././riscv-gcc/gcc/config/riscv/riscv-vsetvl.cc:1843
      0x1440371 riscv_vector::vector_infos_manager::vector_infos_manager()
              ../.././riscv-gcc/gcc/config/riscv/riscv-vsetvl.cc:2350
      0x14407ee pass_vsetvl::init()
              ../.././riscv-gcc/gcc/config/riscv/riscv-vsetvl.cc:4581
      0x14471cf pass_vsetvl::execute(function*)
              ../.././riscv-gcc/gcc/config/riscv/riscv-vsetvl.cc:4716
      
      gcc/ChangeLog:
      
      	* config/riscv/riscv-vector-builtins.def (vfloat16mf4x2_t): Change
      	scalar type to float16, eliminate warning.
      	(vfloat16mf4x3_t): Ditto.
      	(vfloat16mf4x4_t): Ditto.
      	(vfloat16mf4x5_t): Ditto.
      	(vfloat16mf4x6_t): Ditto.
      	(vfloat16mf4x7_t): Ditto.
      	(vfloat16mf4x8_t): Ditto.
      	(vfloat16mf2x2_t): Ditto.
      	(vfloat16mf2x3_t): Ditto.
      	(vfloat16mf2x4_t): Ditto.
      	(vfloat16mf2x5_t): Ditto.
      	(vfloat16mf2x6_t): Ditto.
      	(vfloat16mf2x7_t): Ditto.
      	(vfloat16mf2x8_t): Ditto.
      	(vfloat16m1x2_t): Ditto.
      	(vfloat16m1x3_t): Ditto.
      	(vfloat16m1x4_t): Ditto.
      	(vfloat16m1x5_t): Ditto.
      	(vfloat16m1x6_t): Ditto.
      	(vfloat16m1x7_t): Ditto.
      	(vfloat16m1x8_t): Ditto.
      	(vfloat16m2x2_t): Ditto.
      	(vfloat16m2x3_t): Ditto.
      	(vfloat16m2x4_t): Ditto.
      	(vfloat16m4x2_t): Ditto.
      	* config/riscv/vector-iterators.md: add RVVM4x2DF in iterator V4T.
      	* config/riscv/vector.md: add tuple mode in attr sew.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.target/riscv/rvv/base/tuple-intrinsic.c: New test.
      adbac207
    • Uros Bizjak's avatar
      i386: Clear upper half of XMM register for V2SFmode operations [PR110762] · ade30fad
      Uros Bizjak authored
      Clear the upper half of a V4SFmode operand register in front of all
      potentially trapping instructions. The testcase:
      
      --cut here--
      typedef float v2sf __attribute__((vector_size(8)));
      typedef float v4sf __attribute__((vector_size(16)));
      
      v2sf test(v4sf x, v4sf y)
      {
        v2sf x2, y2;
      
        x2 = __builtin_shufflevector (x, x, 0, 1);
        y2 = __builtin_shufflevector (y, y, 0, 1);
      
        return x2 + y2;
      }
      --cut here--
      
      now compiles to:
      
              movq    %xmm1, %xmm1    # 9     [c=4 l=4]  *vec_concatv4sf_0
              movq    %xmm0, %xmm0    # 10    [c=4 l=4]  *vec_concatv4sf_0
              addps   %xmm1, %xmm0    # 11    [c=12 l=3]  *addv4sf3/0
      
      This approach addresses issues with exceptions, as well as issues with
      denormal/invalid values. An obvious exception to the rule is a division,
      where the value != 0.0 should be loaded into the upper half of the
      denominator to avoid division by zero exception.
      
      The patch effectively tightens the solution from PR95046 by clearing upper
      halves of all operand registers before every potentially trapping instruction.
      The testcase:
      
      --cut here--
      typedef float __attribute__((vector_size(8))) v2sf;
      
      v2sf test (v2sf a, v2sf b, v2sf c)
      {
        return a * b - c;
      }
      --cut here--
      
      compiles to:
      
              movq    %xmm1, %xmm1    # 8     [c=4 l=4]  *vec_concatv4sf_0
              movq    %xmm0, %xmm0    # 9     [c=4 l=4]  *vec_concatv4sf_0
              movq    %xmm2, %xmm2    # 12    [c=4 l=4]  *vec_concatv4sf_0
              mulps   %xmm1, %xmm0    # 10    [c=16 l=3]  *mulv4sf3/0
              movq    %xmm0, %xmm0    # 13    [c=4 l=4]  *vec_concatv4sf_0
              subps   %xmm2, %xmm0    # 14    [c=12 l=3]  *subv4sf3/0
      
      The implementation emits V4SFmode operation, so we can remove all "emulated"
      SSE2 V2SFmode trapping instructions and remove "emulated" SSE2 V2SFmode
      alternatives from 3dNOW! insn patterns.
      
      	PR target/110762
      
      gcc/ChangeLog:
      
      	* config/i386/i386.md (plusminusmult): New code iterator.
      	* config/i386/mmx.md (mmxdoublevecmode): New mode attribute.
      	(movq_<mode>_to_sse): New expander.
      	(<plusminusmult:insn>v2sf3): Macroize expander from addv2sf3,
      	subv2sf3 and mulv2sf3 using plusminusmult code iterator.  Rewrite
      	as a wrapper around V4SFmode operation.
      	(mmx_addv2sf3): Change operand 1 and operand 2 predicates to
      	nonimmediate_operand.
      	(*mmx_addv2sf3): Remove SSE alternatives.  Change operand 1 and
      	operand 2 predicates to nonimmediate_operand.
      	(mmx_subv2sf3): Change operand 2 predicate to nonimmediate_operand.
      	(mmx_subrv2sf3): Change operand 1 predicate to nonimmediate_operand.
      	(*mmx_subv2sf3): Remove SSE alternatives.  Change operand 1 and
      	operand 2 predicates to nonimmediate_operand.
      	(mmx_mulv2sf3): Change operand 1 and operand 2 predicates to
      	nonimmediate_operand.
      	(*mmx_mulv2sf3): Remove SSE alternatives.  Change operand 1 and
      	operand 2 predicates to nonimmediate_operand.
      	(divv2sf3): Rewrite as a wrapper around V4SFmode operation.
      	(<smaxmin:code>v2sf3): Ditto.
      	(mmx_<smaxmin:code>v2sf3): Change operand 1 and operand 2
      	predicates to nonimmediate_operand.
      	(*mmx_<smaxmin:code>v2sf3): Remove SSE alternatives.  Change
      	operand 1 and operand 2 predicates to nonimmediate_operand.
      	(mmx_ieee_<ieee_maxmin>v2sf3): Ditto.
      	(sqrtv2sf2): Rewrite as a wrapper around V4SFmode operation.
      	(*mmx_haddv2sf3_low): Ditto.
      	(*mmx_hsubv2sf3_low): Ditto.
      	(vec_addsubv2sf3): Ditto.
      	(*mmx_maskcmpv2sf3_comm): Remove.
      	(*mmx_maskcmpv2sf3): Remove.
      	(vec_cmpv2sfv2si): Rewrite as a wrapper around V4SFmode operation.
      	(vcond<V2FI:mode>v2sf): Ditto.
      	(fmav2sf4): Ditto.
      	(fmsv2sf4): Ditto.
      	(fnmav2sf4): Ditto.
      	(fnmsv2sf4): Ditto.
      	(fix_truncv2sfv2si2): Ditto.
      	(fixuns_truncv2sfv2si2): Ditto.
      	(mmx_fix_truncv2sfv2si2): Remove SSE alternatives.
      	Change operand 1 predicate to nonimmediate_operand.
      	(floatv2siv2sf2): Rewrite as a wrapper around V4SFmode operation.
      	(floatunsv2siv2sf2): Ditto.
      	(mmx_floatv2siv2sf2): Remove SSE alternatives.
      	Change operand 1 predicate to nonimmediate_operand.
      	(nearbyintv2sf2): Rewrite as a wrapper around V4SFmode operation.
      	(rintv2sf2): Ditto.
      	(lrintv2sfv2si2): Ditto.
      	(ceilv2sf2): Ditto.
      	(lceilv2sfv2si2): Ditto.
      	(floorv2sf2): Ditto.
      	(lfloorv2sfv2si2): Ditto.
      	(btruncv2sf2): Ditto.
      	(roundv2sf2): Ditto.
      	(lroundv2sfv2si2): Ditto.
      	(*mmx_roundv2sf2): Remove.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.target/i386/pr110762.c: New test.
      ade30fad
    • Jose E. Marchesi's avatar
      bpf: fix generation of neg and neg32 BPF instructions · 590a8287
      Jose E. Marchesi authored
      This patch fixes GCC to generate correct neg and neg32 instructions,
      which do not take a source register operand.  A couple of new tests
      are added.
      
      Tested in bpf-unknown-none.
      
      gcc/ChangeLog
      
      2023-07-26  Jose E. Marchesi  <jose.marchesi@oracle.com>
      
      	* config/bpf/bpf.md: Fix neg{SI,DI}2 insn.
      
      gcc/testsuite/ChangeLog
      
      2023-07-26  Jose E. Marchesi  <jose.marchesi@oracle.com>
      
      	* gcc.target/bpf/neg-1.c: New test.
      	* gcc.target/bpf/neg-pseudoc-1.c: Likewise.
      590a8287
    • Tobias Burnus's avatar
      libgomp.texi: Add status item, @ref and document omp_in_explicit_task · 819f3d36
      Tobias Burnus authored
      libgomp/ChangeLog:
      
      	* libgomp.texi (OpenMP 5.2 features): Add 'all' for 'defaultmap' as 'N'.
      	(Tasking Routines): Document omp_in_explicit_task.
      	(Implementation-defined ICV Initialization): Use @ref not @code.
      819f3d36
    • Richard Biener's avatar
      tree-optimization/110799 - fix bug in code hoisting · 565e0e80
      Richard Biener authored
      Code hoisting part of GIMPLE PRE failed to adjust the TBAA behavior
      of common loads in the case the alias set of the ref was the same
      but the base alias set was not.  It also failed to adjust the
      base behavior, assuming it would match.  The following plugs this
      hole.
      
      	PR tree-optimization/110799
      	* tree-ssa-pre.cc (compute_avail): More thoroughly match
      	up TBAA behavior of redundant loads.
      
      	* gcc.dg/torture/pr110799.c: New testcase.
      565e0e80
    • Jakub Jelinek's avatar
      range-op-float: Fix up -frounding-math frange_arithmetic +- handling [PR110755] · 21da32d9
      Jakub Jelinek authored
      IEEE754 says that x + (-x) and x - x result in +0 in all rounding modes
      but rounding towards negative infinity, in which case the result is -0
      for all finite x.  x + x and x - (-x) if it is zero retain sign of x.
      Now, range_arithmetic implements the normal rounds to even rounding,
      and as the addition or subtraction in those cases is exact, we don't do any
      further rounding etc. and e.g. on the testcase below distilled from glibc
      compute a range [+0, +INF], which is fine for -fno-rounding-math or
      if we'd have a guarantee that those statements aren't executed with rounding
      towards negative infinity.
      
      I believe it is only +- which has this problematic behavior and I think
      it is best to deal with it in frange_arithmetic; if we know -frounding-math
      is on, it is x + (-x) or x - x and we are asked to round to negative
      infinity (i.e. want low bound rather than high bound), change +0 result to
      -0.
      
      2023-07-26  Jakub Jelinek  <jakub@redhat.com>
      
      	PR tree-optimization/110755
      	* range-op-float.cc (frange_arithmetic): Change +0 result to -0
      	for PLUS_EXPR or MINUS_EXPR if -frounding-math, inf is negative and
      	it is exact op1 + (-op1) or op1 - op1.
      
      	* gcc.dg/pr110755.c: New test.
      21da32d9
    • Kewen Lin's avatar
      rs6000: Correct vsx operands output for xxeval [PR110741] · 96a83923
      Kewen Lin authored
      PR110741 exposes one issue that we didn't use the correct
      character for vsx operands in output operand substitution,
      consequently it can map to the wrong registers which hold
      some unexpected values.
      
      	PR target/110741
      
      gcc/ChangeLog:
      
      	* config/rs6000/vsx.md (define_insn xxeval): Correct vsx
      	operands output with "x".
      
      gcc/testsuite/ChangeLog:
      
      	* g++.target/powerpc/pr110741.C: New test.
      96a83923
    • Aldy Hernandez's avatar
      [range-ops] Handle bitmasks for ABSU_EXPR. · 39f117d6
      Aldy Hernandez authored
      gcc/ChangeLog:
      
      	* range-op.cc (class operator_absu): Add update_bitmask.
      	(operator_absu::update_bitmask): New.
      39f117d6
    • Aldy Hernandez's avatar
      [range-ops] Handle bitmasks for ABS_EXPR. · 5346a2fc
      Aldy Hernandez authored
      gcc/ChangeLog:
      
      	* range-op-mixed.h (class operator_abs): Add update_bitmask.
      	* range-op.cc (operator_abs::update_bitmask): New.
      5346a2fc
    • Aldy Hernandez's avatar
      [range-ops] Handle bitmasks for BIT_NOT_EXPR. · 4a188dee
      Aldy Hernandez authored
      gcc/ChangeLog:
      
      	* range-op-mixed.h (class operator_bitwise_not): Add update_bitmask.
      	* range-op.cc (operator_bitwise_not::update_bitmask): New.
      4a188dee
    • Aldy Hernandez's avatar
      [range-ops] Handle bitmasks for unary operators. · 5cac2394
      Aldy Hernandez authored
      It looks like we missed out on bitmasks for unary operators because we
      were using bit_value_binop exclusively.  This patch hands off to
      bit_value_unop when appropriate, thus allowing us to handle ABS and
      BIT_NOT_EXPR, and others.  Follow-up patches will add the tweaks for the
      range-ops entries themselves.
      
      gcc/ChangeLog:
      
      	* range-op.cc (update_known_bitmask): Handle unary operators.
      5cac2394
    • Aldy Hernandez's avatar
      Initialize value in bit_value_unop. · 7a48d8d2
      Aldy Hernandez authored
      bit_value_binop initializes VAL regardless of the final mask.  It even
      has a comment to that effect:
      
        /* Ensure that VAL is initialized (to any value).  */
      
      However, bit_value_unop, which in theory shares the same API, does not.
      This causes range-ops to choke on uninitialized VALs for some inputs to
      ABS.
      
      Instead of fixing the callers, it's cleaner to make bit_value_unop and
      bit_value_binop consistent.
      
      gcc/ChangeLog:
      
      	* tree-ssa-ccp.cc (bit_value_unop): Initialize val when appropriate.
      7a48d8d2
    • Jin Ma's avatar
      RISC-V: Fixbug for fsflags instruction error using immediate. · ad0dde0a
      Jin Ma authored
      The pattern mistakenly believes that fsflags can use immediate numbers,
      but in fact it does not support it. Immediate numbers should use fsflagsi.
      
      For example:
      __builtin_riscv_fsflags(4);
      
      The following error occurred.
      /tmp/ccoWdWqT.s: Assembler messages:
      /tmp/ccoWdWqT.s:14: Error: illegal operands `fsflags 4'
      
      gcc/ChangeLog:
      
      	* config/riscv/riscv.md: Likewise.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.target/riscv/fsflags.c: New test.
      ad0dde0a
    • Jan Hubicka's avatar
      Fix profile_count::to_sreal_scale · 645c67f8
      Jan Hubicka authored
      gcc/ChangeLog:
      
      	* profile-count.cc (profile_count::to_sreal_scale): Value is not know
      	if we divide by zero.
      645c67f8
    • Nathaniel Shead's avatar
      c++: Track lifetimes in constant evaluation [PR70331,PR96630,PR98675] · 9fdbd7d6
      Nathaniel Shead authored
      
      This adds rudimentary lifetime tracking in C++ constexpr contexts,
      allowing the compiler to report errors with using values after their
      backing has gone out of scope. We don't yet handle other ways of
      accessing values outside their lifetime (e.g. following explicit
      destructor calls).
      
      	PR c++/96630
      	PR c++/98675
      	PR c++/70331
      
      gcc/cp/ChangeLog:
      
      	* constexpr.cc (constexpr_global_ctx::is_outside_lifetime): New
      	function.
      	(constexpr_global_ctx::get_value): Don't return expired values.
      	(constexpr_global_ctx::get_value_ptr): Likewise.
      	(constexpr_global_ctx::remove_value): Mark value outside
      	lifetime.
      	(outside_lifetime_error): New function.
      	(cxx_eval_call_expression): No longer track save_exprs.
      	(cxx_eval_loop_expr): Likewise.
      	(cxx_eval_constant_expression): Add checks for outside lifetime
      	values. Remove local variables at end of bind exprs, and
      	temporaries after cleanup points.
      
      gcc/testsuite/ChangeLog:
      
      	* g++.dg/cpp1y/constexpr-lifetime1.C: New test.
      	* g++.dg/cpp1y/constexpr-lifetime2.C: New test.
      	* g++.dg/cpp1y/constexpr-lifetime3.C: New test.
      	* g++.dg/cpp1y/constexpr-lifetime4.C: New test.
      	* g++.dg/cpp1y/constexpr-lifetime5.C: New test.
      	* g++.dg/cpp1y/constexpr-lifetime6.C: New test.
      
      Signed-off-by: default avatarNathaniel Shead <nathanieloshead@gmail.com>
      9fdbd7d6
    • Nathaniel Shead's avatar
      c++: Prevent dangling pointers from becoming nullptr in constexpr [PR110619] · b8266af7
      Nathaniel Shead authored
      
      Currently, when typeck discovers that a return statement will refer to a
      local variable it rewrites to return a null pointer. This causes the
      error messages for using the return value in a constant expression to be
      unhelpful, especially for reference return values, and is also a visible
      change to otherwise valid code (as in the linked PR).
      
      The transformation is nonetheless important, however, both as a safety
      guard against attackers being able to gain a handle to other data on the
      stack, and to prevent duplicate warnings from later null-dereference
      warning passes.
      
      As such, this patch just delays the transformation until cp_genericize,
      after constexpr function definitions have been generated.
      
      	PR c++/110619
      
      gcc/cp/ChangeLog:
      
      	* cp-gimplify.cc (cp_genericize_r): Transform RETURN_EXPRs to
      	not return dangling pointers.
      	* cp-tree.h (RETURN_EXPR_LOCAL_ADDR_P): New flag.
      	(check_return_expr): Add a new parameter.
      	* semantics.cc (finish_return_stmt): Set flag on RETURN_EXPR
      	when referring to dangling pointer.
      	* typeck.cc (check_return_expr): Disable transformation of
      	dangling pointers, instead pass this information to caller.
      
      gcc/testsuite/ChangeLog:
      
      	* g++.dg/cpp1y/constexpr-110619.C: New test.
      
      Signed-off-by: default avatarNathaniel Shead <nathanieloshead@gmail.com>
      b8266af7
    • Nathaniel Shead's avatar
      c++: Improve location information in constant evaluation · 5ebe5bcf
      Nathaniel Shead authored
      
      This patch updates 'input_location' during constant evaluation to ensure
      that errors in subexpressions that lack location information still
      provide accurate diagnostics.
      
      By itself this change causes some small regressions in diagnostic
      quality for circumstances where errors used 'input_location' but the
      location of the parent subexpression doesn't make sense, so this patch
      also includes a small diagnostic improvement to fix the most egregious
      case.
      
      gcc/cp/ChangeLog:
      
      	* constexpr.cc (modifying_const_object_error): Find the source
      	location of the const object's declaration.
      	(cxx_eval_constant_expression): Update input_location to the
      	location of the currently evaluated expression, if possible.
      
      libstdc++-v3/ChangeLog:
      
      	* testsuite/25_algorithms/equal/constexpr_neg.cc: Update diagnostic
      	locations.
      	* testsuite/26_numerics/gcd/105844.cc: Likewise.
      	* testsuite/26_numerics/lcm/105844.cc: Likewise.
      
      gcc/testsuite/ChangeLog:
      
      	* g++.dg/cpp0x/constexpr-48089.C: Update diagnostic locations.
      	* g++.dg/cpp0x/constexpr-70323.C: Likewise.
      	* g++.dg/cpp0x/constexpr-70323a.C: Likewise.
      	* g++.dg/cpp0x/constexpr-delete2.C: Likewise.
      	* g++.dg/cpp0x/constexpr-diag3.C: Likewise.
      	* g++.dg/cpp0x/constexpr-ice20.C: Likewise.
      	* g++.dg/cpp0x/constexpr-mutable3.C: Likewise.
      	* g++.dg/cpp0x/constexpr-recursion.C: Likewise.
      	* g++.dg/cpp0x/overflow1.C: Likewise.
      	* g++.dg/cpp1y/constexpr-89285.C: Likewise.
      	* g++.dg/cpp1y/constexpr-89481.C: Likewise.
      	* g++.dg/cpp1y/constexpr-tracking-const14.C: Likewise.
      	* g++.dg/cpp1y/constexpr-tracking-const16.C: Likewise.
      	* g++.dg/cpp1y/constexpr-tracking-const18.C: Likewise.
      	* g++.dg/cpp1y/constexpr-tracking-const19.C: Likewise.
      	* g++.dg/cpp1y/constexpr-tracking-const21.C: Likewise.
      	* g++.dg/cpp1y/constexpr-tracking-const22.C: Likewise.
      	* g++.dg/cpp1y/constexpr-tracking-const3.C: Likewise.
      	* g++.dg/cpp1y/constexpr-tracking-const4.C: Likewise.
      	* g++.dg/cpp1y/constexpr-tracking-const7.C: Likewise.
      	* g++.dg/cpp1y/constexpr-union5.C: Likewise.
      	* g++.dg/cpp1y/pr68180.C: Likewise.
      	* g++.dg/cpp1z/constexpr-lambda6.C: Likewise.
      	* g++.dg/cpp1z/constexpr-lambda8.C: Likewise.
      	* g++.dg/cpp2a/bit-cast11.C: Likewise.
      	* g++.dg/cpp2a/bit-cast12.C: Likewise.
      	* g++.dg/cpp2a/bit-cast14.C: Likewise.
      	* g++.dg/cpp2a/constexpr-98122.C: Likewise.
      	* g++.dg/cpp2a/constexpr-dynamic17.C: Likewise.
      	* g++.dg/cpp2a/constexpr-init1.C: Likewise.
      	* g++.dg/cpp2a/constexpr-new12.C: Likewise.
      	* g++.dg/cpp2a/constexpr-new3.C: Likewise.
      	* g++.dg/cpp2a/constinit10.C: Likewise.
      	* g++.dg/cpp2a/is-corresponding-member4.C: Likewise.
      	* g++.dg/ext/constexpr-vla2.C: Likewise.
      	* g++.dg/ext/constexpr-vla3.C: Likewise.
      	* g++.dg/ubsan/pr63956.C: Likewise.
      
      Signed-off-by: default avatarNathaniel Shead <nathanieloshead@gmail.com>
      5ebe5bcf
    • Jason Merrill's avatar
      testsuite: run C++11 tests in C++11 mode · 2ace6cd6
      Jason Merrill authored
      A recent change missed updating constexpr-mutable3.C because it wasn't run
      in C++11 mode even though it checks the behavior for { target c++11_only }.
      
      gcc/testsuite/ChangeLog:
      
      	* lib/g++-dg.exp (g++-dg-runtest): Check for c++11_only.
      2ace6cd6
    • GCC Administrator's avatar
      Daily bump. · af37e394
      GCC Administrator authored
      af37e394
  2. Jul 25, 2023
    • David Faust's avatar
      bpf: don't print () in bpf_print_operand_address · 8d36a0f5
      David Faust authored
      Unfortunately, the pseudo-C dialect syntax used for some of the v3
      atomic instructions clashes with unconditionally printing the
      surrounding parentheses in bpf_print_operand_address.
      
      Instead, place the parentheses in the output templates where needed.
      
      gcc/
      
      	* config/bpf/bpf.cc (bpf_print_operand_address): Don't print
      	enclosing parentheses for pseudo-C dialect.
      	* config/bpf/bpf.md (zero_exdendhidi2): Add parentheses around
      	operands of pseudo-C dialect output templates where needed.
      	(zero_extendqidi2): Likewise.
      	(zero_extendsidi2): Likewise.
      	(*mov<MM:mode>): Likewise.
      8d36a0f5
    • Andrew Pinski's avatar
      Fix 110803: use of plain char instead of signed char · 67357270
      Andrew Pinski authored
      So the problem here is that plain char can either be signed
      or unsigned depending on the target (powerpc and aarch64 are
      unsigned while most other targets are signed). So the testcase
      gcc.c-torture/execute/pr109986.c was assuming plain char was signed
      char which is wrong so it is better to just change the `char` to be
      `signed char`.
      Note gcc.c-torture/execute/pr109986.c includes gcc.dg/tree-ssa/pr109986.c
      where the plain char was being used.
      
      Committed as obvious after a quick test to make sure gcc.c-torture/execute/pr109986.c
      now passes and gcc.dg/tree-ssa/pr109986.c still passes.
      
      gcc/testsuite/ChangeLog:
      
      	PR testsuite/110803
      	* gcc.dg/tree-ssa/pr109986.c: Change plain char to be
      	`signed char`.
      67357270
    • Joseph Myers's avatar
      Update gcc uk.po · 099d40ba
      Joseph Myers authored
      	* uk.po: Update.
      099d40ba
    • Marek Polacek's avatar
      c++: clear tf_partial et al in instantiate_template [PR108960] · 39004608
      Marek Polacek authored
      In <https://gcc.gnu.org/pipermail/gcc-patches/2023-February/612929.html>
      we concluded that we might clear all flags except tf_warning_or_error
      when performing instantiate_template.
      
      	PR c++/108960
      
      gcc/cp/ChangeLog:
      
      	* pt.cc (lookup_and_finish_template_variable): Don't clear tf_partial
      	here.
      	(instantiate_template): Reset all complain flags except
      	tf_warning_or_error.
      39004608
    • Thomas Schwinge's avatar
      List myself as "nvptx port" maintainer · 28e3d361
      Thomas Schwinge authored
      	* MAINTAINERS: List myself as "nvptx port" maintainer.
      28e3d361
    • Aldy Hernandez's avatar
      Make some functions in CCP static. · a8649d53
      Aldy Hernandez authored
      gcc/ChangeLog:
      
      	* tree-ssa-ccp.cc (value_mask_to_min_max): Make static.
      	(bit_value_mult_const): Same.
      	(get_individual_bits): Same.
      a8649d53
    • Marek Polacek's avatar
      c++: fix ICE with constexpr ARRAY_REF [PR110382] · 6e424feb
      Marek Polacek authored
      This code in cxx_eval_array_reference has been hard to get right.
      In r12-2304 I added some code; in r13-5693 I removed some of it.
      
      Here the problematic line is "S s = arr[0];" which causes a crash
      on the assert in verify_ctor_sanity:
      
        gcc_assert (!ctx->object || !DECL_P (ctx->object)
                    || ctx->global->get_value (ctx->object) == ctx->ctor);
      
      ctx->object is the VAR_DECL 's', which is correct here.  The second
      line points to the problem: we replaced ctx->ctor in
      cxx_eval_array_reference:
      
        new_ctx.ctor = build_constructor (elem_type, NULL); // #1
      
      which I think we shouldn't have; the CONSTRUCTOR we created in
      cxx_eval_constant_expression/DECL_EXPR
      
        new_ctx.ctor = build_constructor (TREE_TYPE (r), NULL);
      
      had the right type.
      
      We still need #1 though.  E.g., in constexpr-96241.C, we never
      set ctx.ctor/object before calling cxx_eval_array_reference, so
      we have to build a CONSTRUCTOR there.  And in constexpr-101371-2.C
      we have a ctx.ctor, but it has the wrong type, so we need a new one.
      
      We can fix the problem by always clearing the object, and, as an
      optimization, only create/free a new ctor when actually needed.
      
      	PR c++/110382
      
      gcc/cp/ChangeLog:
      
      	* constexpr.cc (cxx_eval_array_reference): Create a new constructor
      	only when we don't already have a matching one.  Clear the object
      	when the type is non-scalar.
      
      gcc/testsuite/ChangeLog:
      
      	* g++.dg/cpp1y/constexpr-110382.C: New test.
      6e424feb
    • Tobias Burnus's avatar
      OpenMP/Fortran: Reject declarations between target + teams · 09dda270
      Tobias Burnus authored
      While commit r14-2754-g2e31fe431b08b0302e1fa8a1c18ee51adafd41df
      detected executable statements, declarations do not show up as
      executable statements.  Hence, we now check whether the first
      statement after TARGET is TEAMS - such that we can detect data
      statements like type or variable declarations.  Fortran semantics
      ensures that only executable directives/statemens can come after
      '!$omp end teams' such that those can be detected with the
      previous check.
      
      Note that statements returning ST_NONE such as 'omp nothing' or
      'omp error at(compilation)' will still slip through.
      
      	PR fortran/110725
      	PR middle-end/71065
      
      gcc/fortran/ChangeLog:
      
      	* gfortran.h (gfc_omp_clauses): Add target_first_st_is_teams.
      	* parse.cc (parse_omp_structured_block): Set it if the first
      	statement in the structured block of a TARGET is TEAMS or
      	a combined/composite starting with TEAMS.
      	* openmp.cc (resolve_omp_target): Also show an error for
      	contains_teams_construct without target_first_st_is_teams.
      
      gcc/testsuite/ChangeLog:
      
      	* gfortran.dg/gomp/teams-6.f90: New test.
      09dda270
    • Marc Poulhiès's avatar
      Adjust one Ada test · d8dc61bb
      Marc Poulhiès authored
      Recent change modified how the loops are created, with the first
      iteration being extracted out of the loops in the 2 test cases.
      Adjust the text to match from the unroll dump.
      
      gcc/testsuite/ChangeLog:
      
      	* gnat.dg/unroll3.adb: Adjust.
      d8dc61bb
    • Tobias Burnus's avatar
      gfortran.dg/gomp/pr99226.f90: Add missing dg-error · 50656980
      Tobias Burnus authored
      Follow up to r14-2754-g2e31fe431b08b0302e1fa8a1c18ee51adafd41df
      which added a check that a target region with teams does not
      have anything anything else strictly nested in the target.
      
      When changing the dg-error for this PR, somehow the addition of a
      dg-error in a second line was lost (the message uses (1) and (2) as
      location, showing two lines, both need a dg-error with the same message).
      
      gcc/testsuite/ChangeLog:
      
      	* gfortran.dg/gomp/pr99226.f90: Update dg-error.
      50656980
    • Haochen Gui's avatar
      rs6000: Implemented f[min/max]_optab by xs[min/max]dp · 54ce3cbd
      Haochen Gui authored
      gcc/
      	PR target/103605
      	* config/rs6000/rs6000-builtin.cc (rs6000_gimple_fold_builtin): Gimple
      	fold RS6000_BIF_XSMINDP and RS6000_BIF_XSMAXDP when fast-math is set.
      	* config/rs6000/rs6000.md (FMINMAX): New int iterator.
      	(minmax_op): New int attribute.
      	(UNSPEC_FMAX, UNSPEC_FMIN): New unspecs.
      	(f<minmax_op><mode>3): New pattern by UNSPEC_FMAX and UNSPEC_FMIN.
      	* config/rs6000/rs6000-builtins.def (__builtin_vsx_xsmaxdp): Set
      	pattern to fmaxdf3.
      	(__builtin_vsx_xsmindp): Set pattern to fmindf3.
      
      gcc/testsuite/
      	PR target/103605
      	* gcc.target/powerpc/pr103605.h: New.
      	* gcc.target/powerpc/pr103605-1.c: New.
      	* gcc.target/powerpc/pr103605-2.c: New.
      54ce3cbd
    • Gaius Mulley's avatar
      PR modula2/110174 Bugfixes to M2GenGCC.mod:CodeInline preventing an ICE · c4637cbe
      Gaius Mulley authored
      
      This patch calls skip_const_decl before chaining parameter values and
      ensures that all strings passed to build_stmt (..., ASM_EXPR, ...) are
      nul terminated.  It also improves the accuracy of locations in
      function calls and asm statements.
      
      gcc/m2/
      
      	PR modula2/110174
      	* gm2-compiler/M2GCCDeclare.def (PromoteToCString): New procedure
      	function.
      	* gm2-compiler/M2GCCDeclare.mod (PromoteToCString): New procedure
      	function.
      	* gm2-compiler/M2GenGCC.mod (BuildTreeFromInterface): Call
      	skip_const_decl before chaining the parameter value.
      	Use PromoteToCString to ensure the string is nul terminated.
      	(CodeInline): Remove all parameters and replace with quad.
      	Use GetQuadOtok to get operand token numbers.
      	Remove call to DeclareConstant and replace it with PromoteToCString.
      	* gm2-compiler/M2Quads.def (BuildInline): Rename into ...
      	(BuildAsm): ... this.
      	* gm2-compiler/M2Quads.mod: (BuildInline): Rename into ...
      	(BuildAsm): ... this.
      	(BuildAsmElement): Add debugging.
      	* gm2-compiler/P1Build.bnf: Remove import of BuildInline.
      	* gm2-compiler/P2Build.bnf: Remove import of BuildInline.
      	* gm2-compiler/P3Build.bnf: Remove import of BuildInline and
      	import BuildAsm.
      	* gm2-compiler/PHBuild.bnf: Remove import of BuildInline.
      	* gm2-libs-iso/SysClock.mod (foo): Remove.
      	* gm2-libs/FIO.mod (BufferedRead): Rename parameter a to dest.
      	Rename variable t to src.
      	* m2pp.cc (pf): Correct block comment.
      	(pe): Correct block comment.
      	(m2pp_asm_expr): New function.
      	(m2pp_statement): Call m2pp_asm_expr.
      
      gcc/testsuite/
      
      	PR modula2/110174
      	* gm2/pim/pass/program2.mod: Remove import of BuildInline.
      	* gm2/extensions/asm/fail/extensions-asm-fail.exp: New test.
      	* gm2/extensions/asm/fail/stressreturn.mod: New test.
      	* gm2/extensions/asm/pass/extensions-asm-pass.exp: New test.
      	* gm2/extensions/asm/pass/fooasm.mod: New test.
      
      Signed-off-by: default avatarGaius Mulley <gaiusmod2@gmail.com>
      c4637cbe
    • GCC Administrator's avatar
      Daily bump. · 87d4356c
      GCC Administrator authored
      87d4356c
  3. Jul 24, 2023
    • Deev Patel's avatar
      libstdc++: Add missing constexpr specifiers in <format> · 96482ffe
      Deev Patel authored
      A couple of virtual functions in the libstdc++ format header are marked
      constexpr in the base class, but not in the derived class. This was
      causing build failures when trying to compile latest gcc libstdc++ with
      clang 16 using c++20. Adding the constexpr specifier resolves the issue.
      
      libstdc++-v3/ChangeLog:
      
      	* include/std/format (_Formatting_scanner::_M_on_chars): Add
      	missing constexpr specifier.
      	(_Formatting_scanner::_M_format_arg): Likewise.
      96482ffe
    • Tobias Burnus's avatar
      OpenMP/Fortran: Reject not strictly nested target -> teams [PR110725, PR71065] · 2e31fe43
      Tobias Burnus authored
      OpenMP requires: "If a teams region is nested inside a target region, the
      corresponding target construct must not contain any statements, declarations
      or directives outside of the corresponding teams construct."
      
      This commit checks now for this restriction.
      
      	PR fortran/110725
      	PR middle-end/71065
      
      gcc/fortran/ChangeLog:
      
      	* gfortran.h (gfc_omp_clauses): Add contains_teams_construct.
      	* openmp.cc (resolve_omp_target): New; check for teams nesting.
      	(gfc_resolve_omp_directive): Call it.
      	* parse.cc (decode_omp_directive): Set contains_teams_construct
      	on enclosing ST_OMP_TARGET.
      
      gcc/testsuite/ChangeLog:
      
      	* gfortran.dg/gomp/pr99226.f90: Update dg-error.
      	* gfortran.dg/gomp/teams-5.f90: New test.
      2e31fe43
    • Jonathan Wakely's avatar
      libstdc++; Do not use strtold for hppa-hpux [PR110653] · 31c3b67d
      Jonathan Wakely authored
      When I switched std::stold to depend on HAVE_STRTOLD that enabled it for
      hppa-hpux which defines HAVE_BROKEN_STRTOLD. Add a check for that macro
      so that we don't use strtold, and fall through to the check for double
      and long double having the same representation. That should mean we
      define a conforming std::stold in terms of std::stod, instead of trying
      to use the broken strtold.
      
      Also fix a logic error in the fallback definition of std::stod, which
      should not treat zero as a subnormal number.
      
      libstdc++-v3/ChangeLog:
      
      	PR libstdc++/110653
      	* include/bits/basic_string.h [!HAVE_STOF] (stof): Do not
      	throw an exception for zero result.
      	[HAVE_BROKEN_STRTOLD] (stold): Do not use strtold.
      31c3b67d
    • David Faust's avatar
      bpf: add pseudo-c asm dialect for "nop" · be16bb88
      David Faust authored
      The define_insn "nop" was missing a template for the pseudo-c dialect,
      so the normal syntax was unconditionally emitted.
      
      gcc/
      
      	* config/bpf/bpf.md (nop): Add pseudo-c asm dialect template.
      be16bb88
Loading